gnade-1.6.2.orig/0000755000175000017500000000000011040716276013401 5ustar lbrentalbrentagnade-1.6.2.orig/AUTHORS0000644000175000017500000000077510176727314014466 0ustar lbrentalbrentaThese are the authors and copyright holders of the GNADE software (in alphabetical order of their lastname): Denis Chalon Dimitry Anisimkov François Fabien Juergen Pfeifer Julio Cano Michael Erdmann Stephen Leake Sune Falck Ching Bon Lam gnade-1.6.2.orig/COPYING0000644000175000017500000003542707262711146014451 0ustar lbrentalbrenta GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS gnade-1.6.2.orig/MANIFEST0000644000175000017500000003066710544005112014532 0ustar lbrentalbrenta./COPYING ./README ./MANIFEST ./VERSION ./AUTHORS ./TODO ./configure ./Makefile ./make.conf.in ./gnade.gpp ./version.ads ./bin/gnade-vars.sh.in ./bin/Makefile ./etc/Makefile ./etc/config.site ./etc/profile.d/Makefile ./etc/profile.d/gnade.sh.in ./etc/profile.d/gnade.csh.in ./etc/profile.d/gnade.bash.in ./ide/README ./ide/gps/gpsaddons.sh ./ide/gps/gesql.xml ./ide/gps/sql.xml ./dbi/postgres/Makefile ./dbi/postgres/Makefile.postgres ./dbi/postgres/postgres.gpr ./dbi/postgres/gnu-db-postgresql.adb ./dbi/postgres/gnu-db-postgresql.ads ./dbi/postgres/README ./dbi/mysql/Makefile ./dbi/mysql/Makefile.mysql ./dbi/mysql/mysql.gpr ./dbi/mysql/gnu-db-mysql.ads ./dbi/mysql/gnu-db-mysql.adb ./dbi/mysql/Changes ./dbi/sqlite/Makefile ./dbi/sqlite/Makefile.sqlite ./dbi/sqlite/sqlite.gpr ./dbi/sqlite/README ./dbi/sqlite/gnu-db-sqlite.adb ./dbi/sqlite/gnu-db-sqlite.ads ./dbi/sqlite3/gnu-db-sqlite3.adb ./dbi/sqlite3/gnu-db-sqlite3.ads ./dbi/sqlite3/Makefile ./dbi/sqlite3/Makefile.sqlite ./dbi/sqlite3/README ./dbi/sqlite3/sqlite.gpr ./dbi/Makefile ./dbi/odbc/Makefile ./dbi/odbc/Makefile.odbc ./dbi/odbc/odbc.gpr ./dbi/odbc/gnu-db-sqlcli-dispatch.adb ./dbi/odbc/gnu-db-sqlcli-dispatch-a_array.adb ./dbi/odbc/gnu-db-sqlcli-dispatch-a_array.ads ./dbi/odbc/gnu-db-sqlcli-dispatch-a_bitmap.adb ./dbi/odbc/gnu-db-sqlcli-dispatch-a_bitmap.ads ./dbi/odbc/gnu-db-sqlcli-dispatch-a_boolean.adb ./dbi/odbc/gnu-db-sqlcli-dispatch-a_boolean.ads ./dbi/odbc/gnu-db-sqlcli-dispatch-a_boolean_string.adb ./dbi/odbc/gnu-db-sqlcli-dispatch-a_boolean_string.ads ./dbi/odbc/gnu-db-sqlcli-dispatch-a_context.adb ./dbi/odbc/gnu-db-sqlcli-dispatch-a_context.ads ./dbi/odbc/gnu-db-sqlcli-dispatch-a_enumerated.adb ./dbi/odbc/gnu-db-sqlcli-dispatch-a_enumerated.ads ./dbi/odbc/gnu-db-sqlcli-dispatch-a_integer.adb ./dbi/odbc/gnu-db-sqlcli-dispatch-a_integer.ads ./dbi/odbc/gnu-db-sqlcli-dispatch-a_pointer.adb ./dbi/odbc/gnu-db-sqlcli-dispatch-a_pointer.ads ./dbi/odbc/gnu-db-sqlcli-dispatch-a_string.adb ./dbi/odbc/gnu-db-sqlcli-dispatch-a_string.ads ./dbi/odbc/gnu-db-sqlcli-dispatch-a_unsigned.adb ./dbi/odbc/gnu-db-sqlcli-dispatch-a_unsigned.ads ./dbi/odbc/gnu-db-sqlcli-dispatch-a_wide_string.adb ./dbi/odbc/gnu-db-sqlcli-dispatch-a_wide_string.ads ./dbi/odbc/gnu-db-sqlcli-dispatch-debug.adb ./dbi/odbc/gnu-db-sqlcli-dispatch-debug.ads ./dbi/odbc/gnu-db-sqlcli-connection_attribute.gpb ./dbi/odbc/gnu-db-sqlcli-statement_attribute.ads ./dbi/odbc/gnu-db-sqlcli-generic_attr-boolean_attribute.adb ./dbi/odbc/gnu-db-sqlcli-info-debug.ads ./dbi/odbc/gnu-db-sqlcli-generic_attr-pointer_attribute.adb ./dbi/odbc/gnu-db-sqlcli-generic_attr-boolean_attribute.ads ./dbi/odbc/gnu-db-sqlcli-environment_attribute-debug.ads ./dbi/odbc/gnu-db-sqlcli-environment_attribute-debug.adb ./dbi/odbc/gnu-db-sqlcli-info.ads ./dbi/odbc/gnu-db-sqlcli-generic_attr-boolean_string_attribute.adb ./dbi/odbc/gnu-db-sqlcli-generic_attr-context_attribute.ads ./dbi/odbc/gnu-db-sqlcli-connection_attribute-debug.adb ./dbi/odbc/gnu-db-sqlcli-diag.gpb ./dbi/odbc/gnu-db-sqlcli-generic_attr-array_attribute.ads ./dbi/odbc/gnu-db-sqlcli-generic_attr-array_attribute.adb ./dbi/odbc/gnu-db-sqlcli-generic_attr-integer_attribute.adb ./dbi/odbc/gnu-db-sqlcli-generic_attr-context_attribute.adb ./dbi/odbc/gnu-db-sqlcli-statement_attribute-debug.ads ./dbi/odbc/gnu-db-sqlcli-generic_attr-string_attribute.adb ./dbi/odbc/gnu-db-sqlcli-statement_attribute.gpb ./dbi/odbc/gnu-db-sqlcli-generic_attr-bitmap_attribute.gpb ./dbi/odbc/gnu-db-sqlcli-generic_attr-enumerated_attribute.ads ./dbi/odbc/gnu-db-sqlcli-generic_attr-unsigned_attribute.adb ./dbi/odbc/gnu-db-sqlcli-generic_attr-unsigned_attribute.ads ./dbi/odbc/gnu-db-sqlcli-generic_attr-wide_string_attribute.adb ./dbi/odbc/gnu-db-sqlcli-generic_attr-wide_string_attribute.ads ./dbi/odbc/gnu-db-sqlcli-bind.adb ./dbi/odbc/gnu-db-sqlcli-generic_attr-integer_attribute.ads ./dbi/odbc/gnu-db-sqlcli-dispatch.ads ./dbi/odbc/gnu-db-sqlcli-generic_attr.ads ./dbi/odbc/gnu-db-sqlcli-generic_attr-enumerated_attribute.adb ./dbi/odbc/gnu-db-sqlcli-connection_attribute-debug.ads ./dbi/odbc/gnu-db-sqlcli-generic_attr-boolean_string_attribute.ads ./dbi/odbc/gnu-db-sqlcli-generic_attr-string_attribute.ads ./dbi/odbc/gnu-db-sqlcli-statement_attribute-debug.adb ./dbi/odbc/gnu-db-sqlcli-environment_attribute.ads ./dbi/odbc/gnu-db-sqlcli-raise_sql_error.adb ./dbi/odbc/gnu-db-sqlcli-info.gpb ./dbi/odbc/gnu-db-sqlcli-generic_attr-bitmap_attribute.ads ./dbi/odbc/gnu-db-sqlcli-bind.ads ./dbi/odbc/gnu-db-sqlcli-generic_attr-pointer_attribute.ads ./dbi/odbc/gnu-db-sqlcli.gpb ./dbi/odbc/gnu-db-sqlcli-desc.ads ./dbi/odbc/gnu-db-sqlcli-diag.ads ./dbi/odbc/gnu-db-sqlcli-info-debug.adb ./dbi/odbc/gnu-db-sqlcli-environment_attribute.gpb ./dbi/odbc/gnu-db-sqlcli-desc.gpb ./dbi/odbc/gnu-db-sqlcli.ads ./dbi/odbc/gnu-db-sqlcli-connection_attribute.ads ./dbi/adbc/MANIFEST ./dbi/adbc/Makefile ./dbi/adbc/README ./dbi/adbc/client.adb ./dbi/adbc/gnu-db-adbc.ads ./dbi/adbc/gnu-db-adbc-connection.adb ./dbi/adbc/gnu-db-adbc-connection.ads ./dbi/adbc/gnu-db-adbc-driver-mysql.adb ./dbi/adbc/gnu-db-adbc-driver-mysql.ads ./dbi/adbc/gnu-db-adbc-driver-pgsql.adb ./dbi/adbc/gnu-db-adbc-driver-pgsql.ads ./dbi/adbc/gnu-db-adbc-driver.ads ./dbi/adbc/gnu-db-adbc-hostvariable-types.adb ./dbi/adbc/gnu-db-adbc-hostvariable-types.ads ./dbi/adbc/gnu-db-adbc-hostvariable.adb ./dbi/adbc/gnu-db-adbc-hostvariable.ads ./dbi/adbc/gnu-db-adbc-resultset.adb ./dbi/adbc/gnu-db-adbc-resultset.ads ./dbi/adbc/gnu-db-adbc-row.adb ./dbi/adbc/gnu-db-adbc-row.ads ./dbi/adbc/gnu-db-adbc-statement.adb ./dbi/adbc/gnu-db-adbc-statement.ads ./dbi/adbc/gnu-db-adbc.ads ./dbi/adbc/gnu-db-adbc-sql_helper.adb ./dbi/adbc/gnu-db-adbc-sql_helper.ads ./dbi/adbc/libadbc.adb ./dbi/oci/MANIFEST ./dbi/oci/Makefile ./dbi/oci/Makefile.oci ./dbi/oci/oci.gpr ./dbi/oci/oci-envcreate80.adb ./dbi/oci/oci-envcreate80.ads ./dbi/oci/oci-environments.adb ./dbi/oci/oci-environments.ads ./dbi/oci/oci-lib.ads ./dbi/oci/oci-reference_finalization.adb ./dbi/oci/oci-reference_finalization.ads ./dbi/oci/oci-thick-binds.adb ./dbi/oci/oci-thick-binds.ads ./dbi/oci/oci-thick-connections.adb ./dbi/oci/oci-thick-connections.ads ./dbi/oci/oci-thick-date.adb ./dbi/oci/oci-thick-date.ads ./dbi/oci/oci-thick-debug_allocation.adb ./dbi/oci/oci-thick-debug_allocation.ads ./dbi/oci/oci-thick-gen_ocinumber.adb ./dbi/oci/oci-thick-gen_ocinumber.ads ./dbi/oci/oci-thick-integer_var.ads ./dbi/oci/oci-thick-lobs.adb ./dbi/oci/oci-thick-lobs.ads ./dbi/oci/oci-thick-long_float_var.ads ./dbi/oci/oci-thick-notifications.adb ./dbi/oci/oci-thick-notifications.ads ./dbi/oci/oci-thick-number_functions.adb ./dbi/oci/oci-thick-number_functions.ads ./dbi/oci/oci-thick-ocidate_var.ads ./dbi/oci/oci-thick-ocihandle_var.ads ./dbi/oci/oci-thick-ocinumber_var.ads ./dbi/oci/oci-thick-parameters.adb ./dbi/oci/oci-thick-parameters.ads ./dbi/oci/oci-thick-servers.adb ./dbi/oci/oci-thick-servers.ads ./dbi/oci/oci-thick-statements.adb ./dbi/oci/oci-thick-statements.ads ./dbi/oci/oci-thick-string_bounded.adb ./dbi/oci/oci-thick-string_bounded.ads ./dbi/oci/oci-thick-string_var.adb ./dbi/oci/oci-thick-string_var.ads ./dbi/oci/oci-thick-strings.adb ./dbi/oci/oci-thick-strings.ads ./dbi/oci/oci-thick-var.ads ./dbi/oci/oci-thick-variable.adb ./dbi/oci/oci-thick-variable.ads ./dbi/oci/oci-thick.adb ./dbi/oci/oci-thick.ads ./dbi/oci/oci-thread.adb ./dbi/oci/oci-thread.ads ./dbi/oci/oci.ads ./esql/esql_support.gpr ./esql/esql.gpr ./esql/gnu-db-esql_support.adb ./esql/gnu-db-esql_support.ads ./esql/gnu-db-esql_iso92_types.ads ./esql/gnu-db-esql_support-odbc.ads ./esql/gnu-db-esql_support-odbc.adb ./esql/scanner.ads ./esql/driver.adb ./esql/Makefile ./esql/Makefile.esql ./esql/esql_parser.adb ./esql/esql_parser.ads ./esql/esql_variables.adb ./esql/esql_variables.ads ./esql/scanner.adb ./esql/sql_standard.ads ./esql/driver.ads ./esql/options.ads ./esql/Changes ./esql/gesql.gpb ./esql/README ./samples/postgres/Makefile ./samples/postgres/Makefile.postgresql ./samples/postgres/demo.gpb ./samples/postgres/postgresql.gpr ./samples/Makefile ./samples/sqlite/README ./samples/sqlite/demo.adb ./samples/sqlite/Makefile ./samples/sqlite/Makefile.sqlite ./samples/sqlite/sqlite.gpr ./samples/esql/README ./samples/esql/Makefile ./samples/esql/Makefile.esql ./samples/esql/esql.gpr ./samples/esql/simple_pkg.gpq ./samples/esql/simple_pkg.ads ./samples/esql/simple.gpq ./samples/esql/dynamic.gpq ./samples/esql/dynamic_connect.adb ./samples/esql/dynamic_connect.ads ./samples/esql/simplepkg.adb ./samples/esql/nobel.ads ./samples/esql/nobel_co.adb ./samples/esql/nobel.gpq ./samples/esql/attachment.gpq ./samples/esql/insert.gpq ./samples/mysql/Makefile ./samples/mysql/Makefile.mysql ./samples/mysql/mysql.gpr ./samples/mysql/dbinstall.sql ./samples/mysql/testdb.gpb ./samples/sample_db/Makefile ./samples/sample_db/Makefile.mysql ./samples/sample_db/Makefile.postgres ./samples/sample_db/Makefile.oracle ./samples/sample_db/Makefile.UNKNOWN ./samples/sample_db/README.postgres ./samples/sample_db/README.mysql ./samples/sample_db/README.oracle ./samples/sample_db/README.UNKNOWN ./samples/sample_db/create_user.mysql.sql ./samples/sample_db/gnade.mysql.sql ./samples/sample_db/gnade.postgres.sql ./samples/sample_db/odbc.ini.sample.in ./samples/sample_db/remove_user.mysql.sql ./samples/sample_db/Makefile.mimer ./samples/sample_db/README.mimer ./samples/sample_db/create_user.mimer.sql ./samples/sample_db/create_user.mimer.sql.in ./samples/sample_db/gnade.mimer.sql ./samples/sample_db/gnade_remove.mimer.sql ./samples/sample_db/mimersql.sh ./samples/odbc/Makefile ./samples/odbc/Makefile.odbc ./samples/odbc/odbc.gpr ./samples/odbc/demo.gpb ./samples/adbc/Makefile ./samples/adbc/client.adb ./samples/oci/Makefile ./samples/oci/Makefile.samples ./samples/oci/samples.gpr ./samples/oci/demo.adb ./samples/oci/mklib80.bat ./samples/oci/mklib8i.bat ./samples/oci/readme.txt ./samples/standalone/Makefile ./samples/standalone/Makefile.nobel ./samples/standalone/README ./samples/standalone/nobel.gpr ./samples/standalone/nobel.ads ./samples/standalone/nobel.gpq ./samples/standalone/nobel_co.adb ./samples/README ./doc/build/Makefile ./doc/build/odbc.sgml ./doc/build/esql.sgml ./doc/build/gnade.sgml ./doc/build/faq.sgml ./doc/build/porting.sgml ./doc/build/bindings.sgml ./doc/build/gfdl.sgml ./doc/build/gpl.sgml ./doc/build/gnudb.sgml ./doc/build/tools.sgml ./doc/build/gnade.words ./doc/build/gps_index.xml ./doc/build/gps.sgml ./doc/build/ado.sgml ./doc/build/oci.sgml ./contrib/README ./contrib/Makefile ./contrib/packages ./contrib/wisconsin/wisconsin.adb.old ./contrib/wisconsin/wisconsin.adq ./contrib/wisconsin/main.adb ./contrib/wisconsin/Makefile ./contrib/wisconsin/wisconsin.ads ./contrib/wisconsin/wisconsin.sql ./contrib/wisconsin/README ./contrib/simple/Makefile ./contrib/simple/simple.gpq ./support/README ./support/Makefile ./support/support.gpr ./support/gnu-db-support-list-strings.adb ./support/gnu-db-support-list-strings.ads ./support/gnu-db-support-list.adb ./support/gnu-db-support-list.ads ./support/gnu-db-support-tables.adb ./support/gnu-db-support-tables.ads ./support/gnu-db-support.ads ./support/gnu-db.ads ./support/gnu.ads ./autoconf/Makefile ./autoconf/README ./autoconf/configure.in ./autoconf/config.guess ./autoconf/config.sub ./autoconf/install-sh ./win32/GNUmakefile ./win32/README ./win32/gensql.wsf ./win32/mssql.qry.in ./win32/gnade.iss ./win32/support/all_modules.awk ./win32/support/make_all.cmd ./pkg-config/gnade.pc.in ./pkg-config/Makefile ./tools/README ./tools/Makefile ./tools/tools.gpr ./tools/lsodbc.adb ./tools/odbc.adb ./tools/odbc.ads ./tools/sql.adb ./tools/tools.gps ./tools/import.ads ./tools/import.adb ./tools/imp.adb ./tools/exp.adb ./tools/util.ads ./tools/util.adb ./tools/files.adb ./tools/files.ads ./cfg/cfg.adb ./cfg/cfg.ads ./cfg/cfgget.adb ./cfg/cfg.gpr ./cfg/cfgset.adb ./cfg/gnade.cfg ./cfg/Makefile ./cfg/Makefile.cfg ./cfg/prep.adb ./cfg/README ./cfg/string_builder.adb ./cfg/string_builder.ads ./cfg/tables.adb ./cfg/tables.ads ./cfg/scripts-gnu/Makefile ./cfg/scripts-gnu/docbuild.sh.in ./cfg/scripts-gnu/gnadeinst.sh.in ./cfg/scripts-gnu/srcinst.sh.in ./cfg/scripts-gnu/staticlib.sh.in ./cfg/scripts-gnu/gnade-config.in ./cfg/scripts-gnu/sharedlib.sh.in ./cfg/scripts-gnu/srcuinst.sh.in ./cfg/scripts-cygwin/Makefile ./cfg/scripts-cygwin/docbuild.sh.in ./cfg/scripts-cygwin/gnadeinst.sh.in ./cfg/scripts-cygwin/srcinst.sh.in ./cfg/scripts-cygwin/staticlib.sh.in ./cfg/scripts-cygwin/gnade-config.in ./cfg/scripts-cygwin/sharedlib.sh.in ./cfg/scripts-cygwin/srcuinst.sh.in ./cfg/scripts-win32/Makefile ./cfg/scripts-win32/srcinst.bat.in ./cfg/scripts-win32/staticlib.bat.in ./cfg/scripts-win32/sharedlib.bat.in ./cfg/scripts-win32/srcuinst.bat.in gnade-1.6.2.orig/Makefile0000644000175000017500000002776410537576263015073 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/Makefile,v $ ## Description : The top level makefile of GNADE -- ## Author : Michael Erdmann -- ## Created On : 03-Jan-2001 -- ## Last Modified By: $Author: merdmann $ -- ## Last Modified On: $Date: 2006/12/12 19:02:11 $ -- ## Status : $State: Exp $ -- ## -- ## Copyright (C) 2000-2006 Michael Erdmann -- ## -- ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## This makefile recursively visits subdirectories for the various GNADE ## components and performs the make steps there. ## ## All objects exported by this project are compiled in the source tree ## and copied into the following export directories: ## ## -bin - All executables ## -lib - All libraries ## -include - All includes as for example *.ali, *.ads and *.adb ## files. ## -doc - All documentation ## -export - All package exported by the project. The setup installer ## for windows and the rpm files will be stored here. ## -libexec - All tools which are called only from within GNADE ## shared - All objects to be installed by the end used localy. ## ## The Makefile provides the following target: ## ## make all - makes the whole GNADE project including the samples ## if configured. ## make clean - Removes all compilation product from the GNADE file ## tree but leaves the compilation results intact ## make distclean - Removes all compilation results from the file tree and ## the common directories -bin/-include/... ## make dist - Create a distribution based on the information as it ## is stored in the VERSION file. ## ## make createuser- Creates a data base user. This traget has been specified ## here, because for some data bases it has to be executed ## using a different user id. ## ## make createdb - Create the used database ## ## The behaviour of the Makefiles depends on the parameter COMPLETE. If it is ## set to any value, the makefiles called from the makefile are compiling ## only locally in the working directory and a make install needs to be issued ## manually to copy the compilation results into the export directories. ## ## If a make clean is done in one of the called makefiles, the compliation ## results are deleted from the export directories. ## ## The sub makefiles have to process the following targets: ## ## all build - To Build the targets of the subproject ## clean - Clean locally all compilation results including the results ## in the export directories. If the Variable EXPORT is set ## do not delete the results in the export files. ## install - Copy the local compilation results into the export directories ## ## ## ## ## Note: ## The sample database is only generated on systems, where the ## one of the supported databases is available. ## ## Restrictions ## ============ ## None ## ## References ## ========== ## None ## .PHONY: clean reatedb createuser directories dist-Linux dist-binaries \ dist-win32 dist distclean documentation install manual publish \ remove-directories removedb removeuser shared-all shared-clean sinclude make.conf ifeq ($(GNADETARGET),) ROOT=$(prefix) else ROOT=$(GNADETARGET) endif DISTNAME=gnade-src-$(VERSION) ## ## This line dfines the logging method ## LOGFILE=build.log ifneq ($(LOGFILE),) logging=>>$(LOGFILE) else logging= endif ## ## list of directories which are created by the makefile to export build ## results. ## exportdirs=$(libdir) \ $(includedir) \ $(bindir) \ $(docdir) \ $(SHARED) \ $(DBPATH) \ $(libexec) \ $(gnadeetcdir) \ $(exportdir) ## ############################################################################ ## ## Compile the GNADE sources ## ## ############################################################################ ## all clean :: ifeq ($(BUILDENV),) @echo "*** ERROR: run the configure script before trying to build GNADE" exit 1 endif $(MAKE) core-$@ $(logging) $(MAKE) odbc-$@ $(logging) $(MAKE) native-$@ $(logging) $(MAKE) samples-$@ $(logging) clean :: -$(RM) $(LOGFILE) ## ## core components needed in any configuration ## core-all core-clean: $(MAKE) -C./cfg $(subst core-,,$@) Target=$(libexec) EXPORT=T $(MAKE) -C./etc $(subst core-,,$@) EXPORT=T $(MAKE) -C./support EXPORT=T $(subst core-,,$@) $(MAKE) -C./bin EXPORT=T $(subst core-,,$@) ## ## All odbc related and dependant parts of GNADE ## odbc-all odbc-clean :: ifneq ($(OPTODBC),) $(MAKE) -C./dbi BINDINGS=odbc EXPORT=T $(subst odbc-,,$@) $(MAKE) -C./esql EXPORT=T $(subst odbc-,,$@) $(MAKE) -C./tools EXPORT=T $(subst odbc-,,$@) $(MAKE) -C./samples SAMPLES="esql odbc" $(subst odbc-,,$@) else @echo "ODBC Bindings not build" endif ## ## All native database bindings except for odbc ## native-all native-clean :: ifneq ($(NATIVE_BINDINGS),) $(MAKE) -C./dbi BINDINGS="$(NATIVE_BINDINGS)" EXPORT=T $(subst native-,,$@) else @echo "Native bindings are not build" endif ## ## The samples ## samples-all samples-clean : $(MAKE) -C./samples SAMPLES="$(NATIVE_SAMPLES)" $(subst samples-,,$@) ## ## Generate the configured basic project file for gnade ## $(TARGET)gnade.gpr: gnade.gpp $(PREP) -s DMLINKEROPT="$(DMLINKEROPT)" \ NALINKEROPT="$(APP_LINK_FLAGS_NATIVE)" \ ROOT=$(ROOT) \ BUILDARCH=$(BUILDARCH) \ gnade.gpp $(TARGET)gnade.gpr all:: $(MAKE) gnade.gpr ## ## Generate commonly resources ## shared-all: $(CP) $(subst /,$(PATHSEP),./ide/gps/*.xml) $(subst /,$(PATHSEP), $(SHARED)) $(CP) $(subst /,$(PATHSEP),./doc/build/*.xml) $(subst /,$(PATHSEP), $(SHARED)) $(MAKE) GNADETARGET=/usr/local/gnade TARGET=$(SHARED)/ \ APP_LINK_FLAGS_NATIVE="-L$(SITE_LIBDIR) $(GNADE_LIBS)" \ $(SHARED)/gnade.gpr shared-clean: ## ## create/delete the export directories ## directories: -$(MKDIR) $(subst /,$(PATHSEP),$(exportdirs)) 2> configure.log remove-directories: -$(RMDIR) $(subst /,$(PATHSEP),$(exportdirs)) 2>configure.log ## ## Create the documentation ## documentation : $(DOCUMENT_PARTS) manual: echo $(DOCUMENT_PARTS) $(MAKE) -C doc/build documentation ## ############################################################################ ## ## create a distribution package different operating system. ## ## ############################################################################ ## dist :: all $(MAKE) dist-binaries $(MAKE) documentation $(MAKE) package package :: $(MAKE) package-$(BUILDENV) $(MAKE) package-clean-$(BUILDENV) # copy the binries into the lib dist-binaries: strip $(libexec)/prep$(bin) strip $(wildcard $(bindir)/*$(bin)) ## Build all packages which could be build by a GNU development environment package-gnu: dist-tree $(foreach i,$(PACKAGE_TYPES),package-$i) dist-tree: clean rm -rf $(DISTNAME) mkdir -p $(DISTNAME) mkdir -p $(DISTNAME)/doc mkdir -p $(DISTNAME)/doc/releasenotes tar cvf $(DISTNAME)/files.tar --files-from=MANIFEST ( cd $(DISTNAME) && tar xvf files.tar && rm files.tar ) cp -a ./doc/releasenotes/note_$(VERSION).html $(DISTNAME)/doc/releasenotes cp -a $(docdir)/* $(DISTNAME)/doc package-gzip: tar cvfz $(DISTNAME).tar.gz $(DISTNAME) mv $(DISTNAME).tar.gz $(exportdir) rm -rf $(DISTNAME) package-zip: zip -r $(exportdir)/$(DISTNAME).zip $(DISTNAME) package-rpm: @echo "*** Execute the makefile in ./rpm as superuser ****" package-clean-gnu: $(RM) $(DISTNAME) ## Build a windows/dos distribution package-win32: clean cmd /c "C:\Programme\Inno Setup 4\iscc" win32\gnade.iss >var/build.log $(CP) $(subst /,$(PATHSEP),Output/setup.exe $(exportdir)/setup-gnade-$(VERSION).exe) $(RMDIR) Output package-clean-win32: ## ############################################################################ ## ## Create the test database ## ############################################################################ ## createdb createuser removeuser removedb: $(MAKE) -C./samples/sample_db DATABASE=$(DATABASE) $@ ## ############################################################################ ## ## install the sofware in the system ## ############################################################################ ## install :: shared-all ./bin/gnadeinst.sh --force ## ############################################################################ ## ## CLEANUP SECTION ## ## ############################################################################ ## ## ## clean up the distribution ## distclean :: clean clean-standalone $(MAKE) remove-directories $(RM) gnade.gpr $(RM) make.conf $(RM) gnade-*.*.tar.gz $(RM) gnade-*.*.zip $(RM) config.* *~ .configure configure.log ## ## Cleanup some subdirs but no all! ## clean :: ifeq ($(BUILDENV),gnu) $(MAKE) -C./autoconf $@ $(MAKE) -C./pkg-config $@ $(MAKE) -C./cfg $@ $(MAKE) -C./bin $@ endif ## ## Perfom a local clean up ## clean :: $(MAKE) -C./cfg clean $(RM) *~*~ *~ ## ## clean out the standalone example. This example does not know anything ## about the operating system. ## clean-standalone: $(RM) $(subst /,$(PATHSEP),samples/standalone/*.ali) $(RM) $(subst /,$(PATHSEP),samples/standalone/*.o) $(RM) $(subst /,$(PATHSEP),samples/standalone/*~*~) $(RM) $(subst /,$(PATHSEP),samples/standalone/*~) ## ## publish towards sourceforge ## publish: -ncftpput upload.sourceforge.net /incoming $(exportdir)/$(DISTNAME).zip -ncftpput upload.sourceforge.net /incoming $(exportdir)/$(DISTNAME).tar.gz gnade-1.6.2.orig/README0000644000175000017500000002622710537576263014304 0ustar lbrentalbrenta GNat Ada Database Environment (GNADE) ==================================== Revision : $Revision: 1.31 $ Contents ======== 1. Introduction 2. License/Authors 3. Supported Platforms 4. Linux/Unix installation of the tar packages 4.1 Installation of the GNADE environment 4.2 Verification of the functionality 4.3 Global installation of GNADE 4.4 Test of the tar package installation 5. Linux/Unix installation of the RPM packges 6. Windows Installation 7. Documentation 8. GNADE and GPS 9. Additional Make Options 10. Contact 1. Introduction =============== The GNADE projects provides tools and support packages in order to allow easy access to different data base systems using Ada 95 (specially the GNU Ada 95 compiler). The integration of SQL into Ada 95 is supported by an embedded SQL translator which generates code working on top of the GNADE ODBC bindings. The GNADE ODBC bindings are a thin Ada 95 binding to ODBC. The projects provides additionaly native bindings to PostgreSQL and MySQL. Additionally the project provides an experimental interface called Ada Database Connectivity. Since this interface is highly unstable no application code should be developed for this interface. The project is available in tar and rpm format. The tar package contains the development environment which has to build and installed on the target system. The contents of your package is described in the release notes located under doc/releasenotes. 2. License/Authors ================== Generally speaking GNADE is an open source project. For details please refer to the ./COPYING and ./AUTHORS files in this directory. 3. Supported Platforms ====================== This software is known to operate on: - Linux SuSe and Redhat distribution - Windows NT, 2000, XP - Solaris for more information please refere to the release note of this release. 4. Linux/Unix/Cygwin Installation of the tar package ==================================================== The installation of the tar package is done in three steps: Step 1 - Installation of the development environment. Building all libraries and executables of the GNADE environment. Step 2 - Verification of the functionality Step 3 - Installation of the GNADE products globally. 4.1 Installation of the GNADE environment ========================================= After obtaining and unpacking the distribution into a directory, perform the following step to create the GNADE environment: cd ./gnade ./configure Options := [-debug] [-assert] [--sampledb=] Currently the dbvendor values postgres, mysql and mimer (for MimerSQL) are supported. Native bindings are available for mysql, postgres. All testprograms do require a small sample database. In order to use the database you have to create a user for your data base. Because this step has often to be done using a different user id and it is only done once you have to perform the following steps manualy: [ su db-adminstrator ] gmake createuser [ exit ] After installing the data base user you may run the global makefile by simply entering: gmake This will produce the libraries for the ODBC binding, the esql translator and a sample data base which is used by the examples under ./samples. In order to use the samples under ./samples you need to install the test database. gmake createdb This will install the tables and data of the test database in the database GNADE. Unter ./var you will find some sample ODBC init files which should work. For details please refer to the documentation ODBC manager product you are using. 4.2 Verification of the functionality ===================================== Make process of the GNADE environment includes the installation of a sample data base. The directory ./samples/smaple_db contains the installation procedure and the odbc.ini sample file. The ./samples directory contains several samples which may be used to verify the correct operation of the GNADE environment. If all examples do work proceed with step 3. 4.3 Global installation of GNADE ================================ In order to install the GNADE environment globally on your system execute as root the following command: gmake install This will install the GNADE libraries and the esql translator in your system. /usr/local/lib/ada - All library components /usr/bin - Executable to esql. You may change these paths by modifying n the file etc/config.site the lines shown below: ## all binaries (/usr/bin) site_bindir="/usr/bin" ## all libraies (/usr/lib) site_libdir="/usr/lib" ## all compilation units (/usr/lib/ada/..) site_adadir="/usr/lib/ada" in the file ./make.conf.in before starting step 1. 4.4 Test of the tar package installation ======================================== The esql translator may be tested by changing into the directory ./samples/esql. The files with the extension adq do contain Ada with embedded SQL code. The Makefile builds the following executables: ./test_db - A test file which shows some of the GNADE esql features. ./nobel_co - Reporting system for the nobel company 5. Installation of the RPM packages =================================== There are two package for each version. gnade--.src.rpm gnade--..rpm To install the GNADE package execute the following command as root: rpm -ivh gnade--..rpm If you like to have the source code install the first package in the same way. In order to test your installation copy the contents of /usr/share/doc/package/gnade/standalone into a directory and compile the ada code. If the makefile completes sucessfully the installation is ready. PLEASE BE AWARE, THAT THE RPM PACKAGE DOES NOT CHECK YOU CONFIGURATION. THIS MEANS ODBC HAS TO BE INSTALLED PROPERLY. 6. Windows DOS / Cygwin Installation ==================================== GNADE provides two basic build environments on the windows platform: DOS - This is basically a batch driven build process which requires only the GNAT and ther GNAT-Win installation. The installer for windows provides an environment for DOS. GNU - This requires the installation of cygwin. The build works verry similar to linux. There are two ways of obtaining the GNADE release. Either by downloading the setup.exe or by retrieving it from the CVS. ** NOTE ** The Windows distribution of GNAT is in two parts; the standard GNAT tools in gnat-3.15p-nt.exe and the extra Windows tools and libraries in gnatwin-3.15p.exe. Both must be installed. 6.1 Setup.exe ============== The setup installer for windows is intended for the end user which developes applications on top of GNADE and contains ready to use precomplied binaries and libraries campareable to the rpm packages for linux. The setup includes the sources of the GNADE release as well, but only of the software contained in the release. Normaly there is no need to install the sources. If you like to develop components for GNADE please use the CVS. In order to use the following changes to the environment have to be done manually: PATH=%GNADE_BASEPATH%\bin:$PATH 6.2 GNADE CVS ============== The CVS provides the current sources which need to be compiled before they are usable for application development. 6.3 Compiling GNADE using DOS ============================= In case that you have downloaded the code from the CVS at sourceforge then perform the following steps to compile the release: 1. Edit make.conf.win32 to meet you system 2. cd \gnade configure make This should create directories win32-bin, win32-lib and win32-include with the GNADE libraries and packet specifications. In order to build an installer you need to have Inno-Setup installed. In order to build a setup.exe: make clean make dist 6.4 Building GNADE using Cygwin =============================== If you have cygwin installed, basically the same procedures as for Linux/Unix do apply, which means: cd \gnade configure make The only major difference is that you do not need to build an installer to install the software on your system. In order to install GNADE run: make install This installes all GNADE libraries, Ada Specs. etc. under /usr/local/gnade. In order to make GNADE available, add to the PATH the path of GNADE: PATH=$PATH:/usr/local/gnade/bin NOTE: The Windows distribution of GNAT is in two parts; the standard GNAT tools in gnat-3.15p-nt.exe and the extra Windows tools and libraries in gnatwin-3.15p.exe. Both must be installed. 7. Documentation ================ Documentation is available in pdf and html format. It is located in the directory ./doc/html or ./doc. In particular, see the release notes in doc/releasenotes. The docbook sources of the documentation are locoated under ./doc/build. If docbook is installed then you may build the documentation by the command: gmake documentation For windows the documenation is not yet part of the release since i got no docbook working on the XP platform yet. 8. GNADE and GPS ================ GNADE is mainly based upon project files which can also be used by GPS (The GNAT Programing System www.act-europe.com). Each subdirectory contains normaly one equally named project file. If you are programming within the GNADE source tree do not try to change the contents of the project file by means of the "Edit Project property" menu, because GPS will change the contents of the project file in such a ways that the it is not possible any more to compile the GNADE software. Two makefiles are included in each directory: Makefile Makefile. The Makefile. is used by the GPS system. For some reason GPS sometimes calls directly gnatmake and under other circumstances the Makefile.. GNADE provides a root project file which might be included to build a project file for your application. If you wnat to do this, then add to the project path the path of the GNADE project file as shown below: for Cygwin: ADA_PROJECT_PATH=...$ADA_PROJECT_PATH:$GNADE_BASEPATH/shared for Dos: ADA_PROJECT_PATH=%ADA_PROJECT_PATH%;%GNADE_BASEPATH% 9. Additional Make Options ========================== 10. Contact ========== If you find an error or you need support, please use the facilities at: http://sourceforge.net/projects/gnade PLEASE FEEL FREE TO CONTRIBUTE TO THE PROJECT BY TESTING AGAINST LEGACY CODE. PLEASE PROVIDE ME THE RESULTS OF YOUR TESTS THAT I AM ABLE TO ADOPT THE ESQL TRANSLATOR TO YOUR REQUIREMENTS. All official distributions will be stored here as well. In case you port the software to a different platform, please keep me informed either by sending me a mail Michael.Erdmann@snafu.de or use the bug reporting facilities at: http://sourceforeg.net/projects/gnade A mailing list for GNADE related discussion has been established. In order do subscribe to the list goto: http://sourceforge.net/projects/gnade gnade-1.6.2.orig/TODO0000644000175000017500000000011507603533031014062 0ustar lbrentalbrentaFor things to do please check the website: http://gnade.sourceforge.net/ gnade-1.6.2.orig/VERSION0000644000175000017500000000005710544005112014437 0ustar lbrentalbrentaGNADE_MAJOR=1 GNADE_MINOR=6 GNADE_PATCHLEVEL=0 gnade-1.6.2.orig/configure0000755000175000017500000001500610544257460015315 0ustar lbrentalbrenta#!/bin/sh ## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/configure,v $ -- ## Description : shell script to configure the build environment. -- ## Author : Michael Erdmann -- ## Created On : 03-Jan-2001 -- ## Last Modified By: $Author: merdmann $ ## Last Modified On: $Date: 2006/12/26 17:43:12 $ ## Revision : $Revision: 1.48 $ ## Status : $State: Exp $ ## ## Copyright (C) 2000-2004 -- ## -- ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## . ./VERSION VERS=$GNADE_MAJOR.$GNADE_MINOR.$GNADE_PATCHLEVEL echo echo "GNAT Data Base Developement Environment (GNADE) $VERS" echo "(C) Copyright 2000-2004; the GNADE Team (see --show-authors)" echo ## check for cygwin buildenv=gnu basedir=`pwd` ; if test -e /usr/bin/cygpath.exe ; then basedir=`cygpath -m $basedir` buildenv=cygwin fi export basedir config_opt="" sampledb="" build_samples_opt="--with-sample=samples" odbc_opt="--with-odbc=y" dboperator=$USER; root="/usr/local/gnade" for i in $* ; do case "$1" in -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac case $1 in -D|--enable-debug) config_opt="$config_opt --enable-debug";; -S|--enable-assert) config_opt="$config_opt --enable-assert";; -a|--show-authors) cat AUTHORS exit 0 ;; --help|-h) echo "configure [ option(s) ] [ native(s) ]" echo echo "option(s):" echo " --help this message" echo " --enable-debug compile with debugging code" echo " --enable-assert compile with assert option" echo " --show-authors display the authors of the GNADE team" echo " --nosamples do not include the samples in the build" echo " --dbadmin= Set the database administrator to a different name as the login" echo " --sampledb= define the sample db. If not given no sample" echo " database will be generated. Possible values are:" echo " mysql " echo " postgres " echo " mimer " echo " --all configure all known native libraries" echo " --no-odbc odbc/esql is not build or installed" echo " --unicode force the usage of unicode" echo " --root= define the target installation root (/usr/local/gnade)." echo echo "native(s)" echo " This optional parameter may contain one or more RDBMS products" echo " for which native bindings may be build." echo echo " postgres - PostgreSQL [http://www.postgresql.org/]" echo " mysql - MySQL [http://www.mysql.com/]" echo " oracle - Oracle [http://www.oracle.com/]" echo " sqlite - SQLLite [http://www.sqlite.org/]" echo exit 0 ;; --nosamples) build_samples_opt="" ;; --no-odbc) odbc_opt="" ;; --sampledb=*) case $optarg in postgres|mysql|mimer) sampledb=$optarg ;; *) echo "ERROR: No sample database available for $optarg." echo exit 1 ;; esac ;; --dbadmin=*) dboperator=$optarg ;; --root=*) root=$optarg ;; --unicode) config_opt="$config_opt --with-unicode=y" ;; --all) for i in postgres mysql oracle sqlite ; do config_opt="$config_opt --with-$i" done ;; *) ## check the native bindings case $1 in postgres|mysql|oracle|oci|adbc|sqlite) if test "$1" = "oci" ; then config_opt="$config_opt --with-oracle" else config_opt="$config_opt --with-$1" fi ;; odbc) ;; *) echo "ERROR: No native bindings available for $1; see --help switch." echo exit 1 ;; esac ;; esac shift done config_opt="$config_opt $build_samples_opt" ( cd autoconf && make && ./configure --with-root=$root \ --with-install-dir=$basedir/autoconf \ --prefix=$basedir --with-dboperator=$dboperator \ --with-sampledb=$sampledb $config_opt $odbc_opt ) if test $? -ne 0 then echo echo "** CONFIGURE ABORTED **" echo exit $? fi make -s directories make -s -C./cfg ADAMAKE="gnatmake -q" make -s -C./cfg/scripts-$buildenv install rm -rf gnade.gpr make -s gnade.gpr chmod +x ./bin/*.sh echo echo " ** CONFIGURE COMPLETE ** " echo gnade-1.6.2.orig/configure.bat0000755000175000017500000000077710056424537016072 0ustar lbrentalbrentaecho off rem $Id: configure.bat,v 1.14 2004/05/30 18:35:11 merdmann Exp $ echo GNADE Windows Build Configurator; Version 1.5 echo Copyright (C) 2004 The GNADE Team (see AUTHORS) http://gnade.sourceforge.net/ make -s -C./cfg ADAMAKE="gnatmake -q" BUILDENV=win32 libexec=. cfg\prep -s ROOT=%CD% make.conf.win32 make.conf make -s -C./cfg/scripts-win32 install if exist gnade.gpr del gnade.gpr make -s remove-directories make -s directories make -s PREP=cfg\prep gnade.gpr make -s -C./cfg clean echo Finished. gnade-1.6.2.orig/gnade.adp0000644000175000017500000000020407747071013015143 0ustar lbrentalbrentasrc_dir=dbi/odbc src_dir=dbi/mysql src_dir=esql src_dir=samples/esql src_dir=samples/mysql src_dir=support obj_dir=adaodbc gnade-1.6.2.orig/gnade.gpp0000644000175000017500000000246310030367733015172 0ustar lbrentalbrenta-- -- $Id: gnade.gpp,v 1.12 2004/03/24 20:30:19 merdmann Exp $ -- project Gnade is for Languages use ("Ada", "Gesql"); type ARCH_Type is ( "@BUILDARCH@" ); ARCH : ARCH_Type := external( "ARCH", "@BUILDARCH@" ); ROOT := "@ROOT@" ; -- driver manager parameters DMLINKEROPT := "@DMLINKEROPT@"; -- native libs NALINKEROPT := "@NALINKEROPT@"; IncludeOpt := "-I" & ROOT & "/" & ARCH &"-include" ; LibOpt := "-L" & ROOT & "/" & ARCH & "-lib" ; Target := ROOT & "/" & ARCH & "-bin"; package Naming is for Specification_Suffix ("gesql") use ".gpq"; for Specification_Suffix ("sql") use ".sql"; end Naming; for Source_Dirs use ("."); for Object_Dir use "."; package Builder is for Default_Switches ("Ada") use ("-s", "-m", "-g", "-gnatQ" ); end Builder; package Compiler is for Default_Switches ("Ada") use ("-g" ); end Compiler; package Binder is for Default_Switches ("Ada") use ("-static"); end Binder; package Linker is for Default_Switches ("Ada") use ("-g"); end Linker; package Ide is for Vcs_Kind use "CVS"; for Compiler_Command ("sql") use Target & "/" & "sql"; -- for Gnatlist use "na"; end Ide; end Gnade; gnade-1.6.2.orig/gnade.gpr0000644000175000017500000000367310670336444015205 0ustar lbrentalbrenta-- -- $Id: gnade.gpr,v 1.7 2007/09/07 21:05:40 persan Exp $ -- Project Gnade is type Build_Type is ("Release", "Debug"); Build : Build_Type := External ("Build", "Debug"); for Languages use ("Ada"); for Source_Dirs use (); for Object_Dir use "lib-obj/" & Build; for Exec_Dir use "."; package Builder is for Default_Switches ("ada") use ("-s", "-k", "-j" & External ("NUMBER_OF_PROCESSORS", "1")); case Build is when "Release" => for Default_Switches ("ada") use Builder'Default_Switches ("ada") & ("-O3"); when "Debug" => for Default_Switches ("ada") use Builder'Default_Switches ("ada") & ("-g"); end case; end Builder; package Compiler is for Default_Switches ("ada") use ("-gnat05", "-gnatn", "-gnatf", "-gnatwa", "-gnatwL", "-gnaty3abefhiklM1640prtn"); case Build is when "Release" => for Default_Switches ("ada") use Compiler'Default_Switches ("ada") & ("-O3"); when "Debug" => for Default_Switches ("ada") use Compiler'Default_Switches ("ada") & ("-O0", "-g"); end case; end Compiler; package Binder is for Default_Switches ("ada") use ("-static", "-E"); end Binder; package Linker is case Build is when "Release" => null; when "Debug" => for Default_Switches ("ada") use ("-g"); end case; end Linker; package Naming is for Specification_Suffix ("gesql") use ".gpq"; for Specification_Suffix ("sql") use ".sql"; end Naming; package Ide is for Vcs_Kind use "CVS"; end Ide; end Gnade; gnade-1.6.2.orig/make.conf.in0000644000175000017500000001701510056167321015573 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/make.conf.in,v $ ## Description : Common includefile for all the makefiles. ## Author : Michael Erdmann ## Created On : 22-March-2001 ## Last Modified By: $Author: merdmann $ ## Last Modified On: $Date: 2004/05/29 20:13:05 $ ## Status : $State: Exp $ ## ## Copyright (C) 2000-2004 Michael Erdmann -- ## -- ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## include @prefix@/VERSION # # Define the local work directories for the GNADE build environment # prefix=@prefix@ BUILDARCH=@build_os@-@build_cpu@ libdir=$(prefix)/$(BUILDARCH)-lib bindir=$(prefix)/$(BUILDARCH)-bin includedir=$(prefix)/$(BUILDARCH)-include docdir=$(prefix)/$(BUILDARCH)-doc vardir=@datadir@ libexec=$(prefix)/$(BUILDARCH)-libexec exportdir=$(prefix)/$(BUILDARCH)-export gnadeetcdir=$(prefix)/$(BUILDARCH)-etc BUILDOS=@build_os@ BUILDENV=@buildenv@ bin=@bin@ ADAINCLUDE=$(includedir) ADALIB=$(libdir) SHARED=$(prefix)/shared ARCH=@build_cpu@ # Site Installation directories. These directories are used to store # files system wide. These values are used by the system wide installation # script as well. SITE_BINDIR=@site_bindir@ SITE_ADADIR=@site_adadir@ SITE_LIBDIR=@site_libdir@ SITE_SHARED=@site_shared@ #-----------------------------------------------------------------------------# # VERSIONS # #-----------------------------------------------------------------------------# VERSION=$(GNADE_MAJOR).$(GNADE_MINOR).$(GNADE_PATCHLEVEL) MAJOR=$(GNADE_MAJOR) MINOR=$(GNADE_MINOR) #-----------------------------------------------------------------------------# # DEFINE SUPPORT PROGRAM NAMES # #-----------------------------------------------------------------------------# # This copy command is used to copy compilation products into libe dirs. CP=cp -@cp_options@ RM=rm -rf DATE=date PATHSEP=/ RMDIR=rm -rf MKDIR=mkdir # Install program INSTALL=@INSTALL@ # GNAT compiler ADA=@adacomp@ # GNATMAKE ADAMAKE=@adamake@ # GNATPREP ADAPREP=@adaprep@ # Mulitpurpose PREP PREP=$(libexec)/prep #-----------------------------------------------------------------------------# # COMPILE AND LINKER FLAGS # #-----------------------------------------------------------------------------# #LD_RPATH_OPTION=@ld_rpath_option@ GNADE_LIBS=@gnadelibs@ #ADAFLAGS=-a @debugopt@ -I$(ADAINCLUDE) -aO$(ADALIB) -gnatf -gnatwl ADAFLAGS=@debugopt@ -I$(ADAINCLUDE) -aO$(ADALIB) -gnatf -gnatwl -fno-common CFLAGS=-funwind-tables -fno-common $(ADAFLAGS) APP_BIND_FLAGS=-bargs -E APP_LINK_FLAGS_NOLIB=-L$(ADALIB) $(LD_RPATH_OPTION) $(GNADE_LIBS) APP_LINK_FLAGS=$(APP_LINK_FLAGS_NOLIB) @odbc_dmlib@ APP_LINK_FLAGS_NATIVE= -L$(ADALIB) @native_libs@ UNICODE=@odbc_unicode_support@ # the driver manager libraries DMLINKEROPT=@odbc_dmlib@ GNADEPREPFLAGS=@gnade_prep_flags@ #-----------------------------------------------------------------------------# # GNADE TOOLS # #-----------------------------------------------------------------------------# esql=gesql tooldir=$(prefix)/bin ESQL=$(bindir)/$(esql) MKSHARED=$(tooldir)/sharedlib.sh MKSTATIC=$(tooldir)/staticlib.sh ADAINSTALL=$(tooldir)/srcinst.sh ADAUINSTALL=$(tooldir)/srcuinst.sh #-----------------------------------------------------------------------------# # MISC. ITEMS # #-----------------------------------------------------------------------------# BUILD_DISTRIBUTION=@build_distribution@ LIBADDR2LINES=@libaddr2lines@ DOCBUILDER=@prefix@/bin/docbuild.sh MYSQL_VERSION=@mysql_version@ PACKAGE_TYPES=@package_types@ #-----------------------------------------------------------------------------# # TEST DATABASE # #-----------------------------------------------------------------------------# # Define the names used to access the data base via ODBC DATABASE=@dbcs_vendor@ SAMPLEDB=gnade DBSOURCE=@odbc_source@ DBUSER=@dbuser@ DBPASSWD=@dbpasswd@ DBOPERATOR=@dboperator@ DBPATH=@localstatedir@ DOCUMENT_PARTS=@documents@ #-----------------------------------------------------------------------------# # CONFIGURED DATA BASE SPECIFICS TOOLS # #-----------------------------------------------------------------------------# # Define the sql access program SQLA=@sql@ NATIVE_BINDINGS=@native@ NATIVE_SAMPLES=$(NATIVE_BINDINGS) OPTPKGCONFIG=@pkgconfig@ OPTODBC=@opt_odbc@ ifneq ($(OPTODBC),) BINDINGS=odbc $(NATIVE_BINDINGS) else BINDINGS=$(NATIVE_BINDINGS) endif #-----------------------------------------------------------------------------# # C O M M O N R U L E S # #-----------------------------------------------------------------------------# PREPFLAGS= .SUFFIXES: .gpb .adb .gpq .gpb.adb: $(ADAPREP) $(GNADEPREPFLAGS) $(PREPFLAGS) $*.gpb $*.adb .gpq.adb: $(ESQL) $(ESQLFLAGS) $*.gpq gnade-1.6.2.orig/make.conf.win320000644000175000017500000001654210663650411016134 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/make.conf.win32,v $ ## Description : Common includefile for all the makefiles. ## Author : Michael Erdmann ## Created On : 22-March-2001 ## Last Modified By: $Author: persan $ ## Last Modified On: $Date: 2007/08/24 21:43:37 $ ## Status : $State: Exp $ ## ## Copyright (C) 2000-2004 Michael Erdmann -- ## -- ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## prefix=$(subst \\,/,@ROOT@) include $(prefix)/VERSION # # Define the local work directories for the GNADE build environment # BUILDENV=win32 BUILDARCH=win32 libdir=$(prefix)/$(BUILDARCH)-lib bindir=$(prefix)/$(BUILDARCH)-bin includedir=$(prefix)/$(BUILDARCH)-include docdir=$(prefix)/$(BUILDARCH)-doc vardir=$(prefix)/share exportdir=$(prefix)/$(BUILDARCH)-export ADAINCLUDE=$(includedir) ADALIB=$(libdir) SHARED=$(prefix)/shared libexec=$(prefix)/$(BUILDARCH)-libexec BUILDOS=win32 BUILDENV=win32 #-----------------------------------------------------------------------------# # VERSIONS # #-----------------------------------------------------------------------------# VERSION=$(GNADE_MAJOR).$(GNADE_MINOR).$(GNADE_PATCHLEVEL) MAJOR=$(GNADE_MAJOR) MINOR=$(GNADE_MINOR) #-----------------------------------------------------------------------------# # DEFINE SUPPORT PROGRAM NAMES # #-----------------------------------------------------------------------------# # This copy command is used to copy compilation products into libe dirs. DATE=cmd.exe /c date/T PATHSEP=\\ bin=.exe CP=cmd.exe /c copy RM=cmd.exe /q /c del /q /f RMDIR=cmd.exe /c rmdir /s /q MKDIR=cmd.exe /c md # Install program INSTALL=$(bindir)/install.bat # GNAT compiler names ADA=gcc ADAMAKE=gnatmake ADAPREP=gnatprep -DDEBUG=True -DUNICODE=False PREP=$(libexec)/prep GNATCLEAN=gnatclean #-----------------------------------------------------------------------------# # COMPILE AND LINKER FLAGS # #-----------------------------------------------------------------------------# # the driver manager libraries DMLIB=odbc32 DMLOC=/gnat/lib/win32 DMLINKEROPT=-L$(DMLOC) -l$(DMLIB) GNADE_LIBS=-L$(libdir) -lgnadeesql -lgnadeodbc -lgnadeaux #ADAFLAGS=-a -O2 -gnatn -I$(ADAINCLUDE) -aO$(ADALIB) -gnatf -gnatwl ADAFLAGS=-O2 -gnatn -I$(ADAINCLUDE) -aO$(ADALIB) -gnatf -gnatwl -fno-common CFLAGS=-funwind-tables -fno-common $(ADAFLAGS) APP_BIND_FLAGS=-bargs -E APP_LINK_FLAGS_NOLIB=-L$(ADALIB) $(LD_RPATH_OPTION) $(GNADE_LIBS) APP_LINK_FLAGS=$(GNADE_LIBS) $(DMLIB) APP_LINK_FLAGS_NATIVE= -L$(ADALIB) -L/usr/lib/mysql -L/usr/lib/unixODBC -lgnadepostgresql -lpq -lgnadesqlite -lsqlite -lgnademysql -lmysqlclient UNICODE=False #-----------------------------------------------------------------------------# # GNADE TOOLS # #-----------------------------------------------------------------------------# esql=gesql tooldir=$(prefix)/bin ESQL=$(bindir)/$(esql) MKSHARED=$(tooldir)/sharedlib.bat MKSTATIC=$(tooldir)/staticlib.bat ADAINSTALL=$(tooldir)/srcinst.bat ADAUINSTALL=$(tooldir)/srcuinst.bat #-----------------------------------------------------------------------------# # MISC. ITEMS # #-----------------------------------------------------------------------------# BUILD_DISTRIBUTION=win32 DOCBUILDER=NA ## there is not way of building the docs MYSQL_VERSION=MYSQL4 PACKAGE_TYPES=zip #-----------------------------------------------------------------------------# # TEST DATABASE # #-----------------------------------------------------------------------------# # Define the names used to access the data base via ODBC DATABASE=mimer SAMPLEDB=gnade DBSOURCE=gnade DBUSER=gnade DBPASSWD=gnade DBOPERATOR=gnade DBPATH=${prefix}/var #-----------------------------------------------------------------------------# # CONFIGURED DATA BASE SPECIFICS TOOLS # #-----------------------------------------------------------------------------# # Define the sql access program SQLA=$(DBPRODUCT)/sqlb OPTODBC="y" # # Put in here all native bindings you want to build. # NATIVE_BINDINGS=mysql sqlite postgres oci # adopt this line to your configuration # e.g. NATIVE_SAMPLES="mysql sqlite postgres oci" NATIVE_SAMPLES= # PKGCONFIG is never build for Windows! OPTPKGCONFIG="" ifneq ($(OPTODBC),) BINDINGS=odbc $(NATIVE_BINDINGS) else BINDINGS=$(NATIVE_BINDINGS) endif #-----------------------------------------------------------------------------# # C O M M O N R U L E S # #-----------------------------------------------------------------------------# PREPFLAGS= .SUFFIXES: .gpb .adb .gpq .gpb.adb: $(ADAPREP) $(PREPFLAGS) $*.gpb $*.adb .gpq.adb: $(ESQL) $(ESQLFLAGS) $*.gpq gnade-1.6.2.orig/version.ads0000644000175000017500000000010310021674206015543 0ustar lbrentalbrentapackage Version is Minor : constant Natural := 1; end Version; gnade-1.6.2.orig/autoconf/0000755000175000017500000000000011040716276015217 5ustar lbrentalbrentagnade-1.6.2.orig/autoconf/Makefile0000644000175000017500000000643010041352036016650 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/autoconf/Makefile,v $ ## Description : Makefile to generate the config script ## Author : Michael Erdmann ## Created On : 03-Jan-2001 ## Last Modified By: $Author: stephen_leake $ ## Last Modified On: $Date: 2004/04/21 01:53:34 $ ## Status : $State: Exp $ ## -- ## Copyright (C) 2000-2001, 2004 ## ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## This makefile rebuild all configure script used to configure the ## GNADE package. ## ## Restrictions ## ============ ## None ## ## References ## ========== ## None ## all: configure configure: configure.in autoconf rm -rf config.cache config.log config.status clean distclean : rm -rf config.cache config.log config.status make.conf *~ configure rm -rf autom4te.cache # end of file gnade-1.6.2.orig/autoconf/README0000644000175000017500000000032207263673232016102 0ustar lbrentalbrentaThis is the working directory for the autconf utility. The makefile is invoked by the ../configure script - configure.in - Parameter file fuer autoconf - ../make.conf.in - Include file für all make file gnade-1.6.2.orig/autoconf/config.guess0000755000175000017500000011315007530234421017534 0ustar lbrentalbrenta#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. timestamp='2001-09-04' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Written by Per Bothner . # Please send patches to . # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi dummy=dummy-$$ trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int dummy(){}" > $dummy.c ; for c in cc gcc c89 ; do ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; if test $? = 0 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; rm -f $dummy.c $dummy.o $dummy.rel ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # Netbsd (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # Determine the machine/vendor (is the vendor relevant). case "${UNAME_MACHINE}" in amiga) machine=m68k-unknown ;; arm32) machine=arm-unknown ;; atari*) machine=m68k-atari ;; sun3*) machine=m68k-sun ;; mac68k) machine=m68k-apple ;; macppc) machine=powerpc-apple ;; hp3[0-9][05]) machine=m68k-hp ;; ibmrt|romp-ibm) machine=romp-ibm ;; *) machine=${UNAME_MACHINE}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE}" in i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit 0 ;; alpha:OSF1:*:*) if test $UNAME_RELEASE = "V4.0"; then UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` fi # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. cat <$dummy.s .data \$Lformat: .byte 37,100,45,37,120,10,0 # "%d-%x\n" .text .globl main .align 4 .ent main main: .frame \$30,16,\$26,0 ldgp \$29,0(\$27) .prologue 1 .long 0x47e03d80 # implver \$0 lda \$2,-1 .long 0x47e20c21 # amask \$2,\$1 lda \$16,\$Lformat mov \$0,\$17 not \$1,\$18 jsr \$26,printf ldgp \$29,0(\$26) mov 0,\$16 jsr \$26,exit .end main EOF eval $set_cc_for_build $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null if test "$?" = 0 ; then case `./$dummy` in 0-0) UNAME_MACHINE="alpha" ;; 1-0) UNAME_MACHINE="alphaev5" ;; 1-1) UNAME_MACHINE="alphaev56" ;; 1-101) UNAME_MACHINE="alphapca56" ;; 2-303) UNAME_MACHINE="alphaev6" ;; 2-307) UNAME_MACHINE="alphaev67" ;; 2-1307) UNAME_MACHINE="alphaev68" ;; esac fi rm -f $dummy.s $dummy echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit 0 ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit 0 ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit 0 ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit 0;; amiga:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit 0 ;; arc64:OpenBSD:*:*) echo mips64el-unknown-openbsd${UNAME_RELEASE} exit 0 ;; arc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; hkmips:OpenBSD:*:*) echo mips-unknown-openbsd${UNAME_RELEASE} exit 0 ;; pmax:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sgi:OpenBSD:*:*) echo mips-unknown-openbsd${UNAME_RELEASE} exit 0 ;; wgrisc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:OS/390:*:*) echo i370-ibm-openedition exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit 0;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit 0 ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit 0 ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit 0 ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit 0 ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit 0 ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit 0 ;; sparc*:NetBSD:*) echo `uname -p`-unknown-netbsd${UNAME_RELEASE} exit 0 ;; atari*:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit 0 ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit 0 ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit 0 ;; sun3*:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mac68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme88k:OpenBSD:*:*) echo m88k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit 0 ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit 0 ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit 0 ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit 0 ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD $dummy.c -o $dummy \ && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ && rm -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit 0 ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit 0 ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit 0 ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit 0 ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit 0 ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit 0 ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit 0 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit 0 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit 0 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit 0 ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit 0 ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit 0 ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy echo rs6000-ibm-aix3.2.5 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit 0 ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:*:*) echo rs6000-ibm-aix exit 0 ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit 0 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit 0 ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit 0 ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit 0 ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit 0 ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit 0 ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) case "${HPUX_REV}" in 11.[0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; esac ;; esac fi ;; esac if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy` if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi rm -f $dummy.c $dummy fi ;; esac echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit 0 ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy echo unknown-hitachi-hiuxwe2 exit 0 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit 0 ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit 0 ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit 0 ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit 0 ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit 0 ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit 0 ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit 0 ;; hppa*:OpenBSD:*:*) echo hppa-unknown-openbsd exit 0 ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit 0 ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit 0 ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit 0 ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit 0 ;; CRAY*X-MP:*:*:*) echo xmp-cray-unicos exit 0 ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*T3D:*:*:*) echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY-2:*:*:*) echo cray2-cray-unicos exit 0 ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; *:OpenBSD:*:*) echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit 0 ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit 0 ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit 0 ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i386-pc-interix exit 0 ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit 0 ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit 0 ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; *:GNU:*:*) echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit 0 ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux exit 0 ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; mips:Linux:*:*) case `sed -n '/^byte/s/^.*: \(.*\) endian/\1/p' < /proc/cpuinfo` in big) echo mips-unknown-linux-gnu && exit 0 ;; little) echo mipsel-unknown-linux-gnu && exit 0 ;; esac ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit 0 ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit 0 ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit 0 ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit 0 ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit 0 ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit 0 ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit 0 ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. ld_supported_targets=`cd /; ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit 0 ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit 0 ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit 0 ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build cat >$dummy.c < #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 printf ("%s-pc-linux-gnu\n", argv[1]); # else printf ("%s-pc-linux-gnulibc1\n", argv[1]); # endif # else printf ("%s-pc-linux-gnulibc1\n", argv[1]); # endif #else printf ("%s-pc-linux-gnuaout\n", argv[1]); #endif return 0; } EOF $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit 0 ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit 0 ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit 0 ;; i*86:*:5:[78]*) case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit 0 ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit 0 ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit 0 ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit 0 ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit 0 ;; paragon:*:*:*) echo i860-intel-osf1 exit 0 ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit 0 ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit 0 ;; M68*:*:R3V[567]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4.3${OS_REL} && exit 0 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4 && exit 0 ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit 0 ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit 0 ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit 0 ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit 0 ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit 0 ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit 0 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit 0 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit 0 ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit 0 ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit 0 ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit 0 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit 0 ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit 0 ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit 0 ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit 0 ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit 0 ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit 0 ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Darwin:*:*) echo `uname -p`-apple-darwin${UNAME_RELEASE} exit 0 ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) if test "${UNAME_MACHINE}" = "x86pc"; then UNAME_MACHINE=pc fi echo `uname -p`-${UNAME_MACHINE}-nto-qnx exit 0 ;; *:QNX:*:4*) echo i386-pc-qnx exit 0 ;; NSR-[KW]:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit 0 ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit 0 ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit 0 ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit 0 ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit 0 ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit 0 ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit 0 ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit 0 ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit 0 ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit 0 ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit 0 ;; *:ITS:*:*) echo pdp10-unknown-its exit 0 ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit 0 ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit 0 ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; c34*) echo c34-convex-bsd exit 0 ;; c38*) echo c38-convex-bsd exit 0 ;; c4*) echo c4-convex-bsd exit 0 ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: gnade-1.6.2.orig/autoconf/config.sub0000755000175000017500000006710007530234421017202 0ustar lbrentalbrenta#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. timestamp='2001-09-07' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit 0;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ | c4x | clipper \ | d10v | d30v | dsp16xx \ | fr30 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | m32r | m68000 | m68k | m88k | mcore \ | mips16 | mips64 | mips64el | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el | mips64vr4300 \ | mips64vr4300el | mips64vr5000 | mips64vr5000el \ | mipsbe | mipseb | mipsel | mipsle | mipstx39 | mipstx39el \ | mipsisa32 \ | mn10200 | mn10300 \ | ns16k | ns32k \ | openrisc \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | s390 | s390x \ | sh | sh[34] | sh[34]eb | shbe | shle \ | sparc | sparc64 | sparclet | sparclite | sparcv9 | sparcv9b \ | stormy16 | strongarm \ | tahoe | thumb | tic80 | tron \ | v850 \ | we32k \ | x86 | xscale \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alphapca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armv*-* \ | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c54x-* \ | clipper-* | cray2-* | cydra-* \ | d10v-* | d30v-* \ | elxsi-* \ | f30[01]-* | f700-* | fr30-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | m32r-* \ | m68000-* | m680[01234]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | mcore-* \ | mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \ | mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipseb-* \ | mipsle-* | mipsel-* | mipstx39-* | mipstx39el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | s390-* | s390x-* \ | sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* \ | sparc-* | sparc64-* | sparc86x-* | sparclite-* \ | sparcv9-* | sparcv9b-* | stormy16-* | strongarm-* | sv1-* \ | t3e-* | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \ | v850-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xmp-* | xps100-* | xscale-* \ | ymp-* \ | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | ymp) basic_machine=ymp-cray os=-unicos ;; cray2) basic_machine=cray2-cray os=-unicos ;; [cjt]90) basic_machine=${basic_machine}-cray os=-unicos ;; crds | unos) basic_machine=m68k-crds ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mipsel*-linux*) basic_machine=mipsel-unknown os=-linux-gnu ;; mips*-linux*) basic_machine=mips-unknown os=-linux-gnu ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; mmix*) basic_machine=mmix-knuth os=-mmixware ;; monitor) basic_machine=m68k-rom68k os=-coff ;; msdos) basic_machine=i386-pc os=-msdos ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pentium | p5 | k5 | k6 | nexgen) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon) basic_machine=i686-pc ;; pentiumii | pentium2) basic_machine=i686-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sparclite-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=t3e-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; tower | tower-32) basic_machine=m68k-ncr ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; windows32) basic_machine=i386-pc os=-windows32-msvcrt ;; xmp) basic_machine=xmp-cray os=-unicos ;; xps | xps100) basic_machine=xps100-honeywell ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; mips) if [ x$os = x-linux-gnu ]; then basic_machine=mips-unknown else basic_machine=mips-mips fi ;; romp) basic_machine=romp-ibm ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh3 | sh4 | sh3eb | sh4eb) basic_machine=sh-unknown ;; sparc | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; c4x*) basic_machine=c4x-none os=-coff ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto*) os=-nto-qnx ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-ibm) os=-aix ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -ptx*) vendor=sequent ;; -vxsim* | -vxworks*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: gnade-1.6.2.orig/autoconf/configure.in0000644000175000017500000006673110537576263017557 0ustar lbrentalbrenta#!/bin/sh ## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/autoconf/configure.in,v $ ## Description : Configuration script for GNADE -- ## Author : Michael Erdmann -- ## Created On : 22-03-2001 -- ## Last Modified By: $Author: merdmann $ -- ## Last Modified On: $Date: 2006/12/12 19:02:11 $ -- ## Status : $State: Exp $ -- ## -- ## Copyright (C) 2000-2004 Michael Erdmann -- ## -- ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## Functional Description -- ## ====================== -- ## This script is intended for all GNU tool based development environments -- ## as for examples: -- ## Linux -- ## Cygwin -- ## Solaris -- ## -- ## ---------------------------------------------------------------------------- ## AC_INIT(../configure) . ../VERSION ## ---------------------------------------------------------------------- ## Configure the location of the directory where install-sh is located. ## ---------------------------------------------------------------------- AC_ARG_WITH(install-dir, [ --with-install-dir= Set the location of the install-sh script], install_dir=$withval, install_dir=$prefix) # define the installation of GNADE AC_ARG_WITH(root, [ --with-root= define the gnade installation target], [gnadehome=$withval] ) AC_ARG_WITH(pkg-config, [ --with-pkg-config= Set the path where to find the pkg-config specs], site_pkgconfig_path=$withval ) # check for the odbc interface to be included opt_odbc="" AC_ARG_WITH(odbc, [ --with-odbc= Include the odbc binding = y], [opt_odbc=$withval] ) # check for unicode to be used AC_ARG_WITH(unicode, [ --with-unicode= force unicode to be used], [odbc_unicode_support=$withval] ) odbc_unicode_support="" if test "$odbc_unicode_support" = "y" ; then odbc_unicode_support="True"; fi if test "$odbc_unicode_support" = "n" ; then odbc_unicode_support="False"; fi # set the location of the sample directory AC_ARG_WITH(sample, [ --with-sample= Set the location of the sample directory], [sampledir=$withval],[sampledir=""] ) AC_CONFIG_AUX_DIR( ../autoconf $install_dir ) AC_PROG_INSTALL AC_CANONICAL_SYSTEM # ---------------------------------------------------------------------- # AC_CHECK_ADAPKG( PKGNAME, pathname [,action [, skip ]] ) # # This macros attampts to locate ada package on a linux system # by seaching in the sub directories ./ and ./include specified # in: # # 1) ada_site_path from the site configuration # 2) site_libdir/ada # # As a side effect this macro returns in # ----------------------------------------------------------------------- AC_DEFUN([AC_CHECK_ADAPKG], [ ac_var=$prefix/.tmp rm -rf $ac_var ; mkdir $ac_var AC_MSG_CHECKING([for Ada package $1]) ac_ada_path="" echo "with $1; procedure test is begin null; end test; " > $ac_var/test.adb for ac_dir in "./" $site_ada_path $site_libdir/ada/$1 ; do ( cd $ac_var && $adamake -c -I$ac_dir -I$ac_dir/include test.adb ) 2>/dev/null >/dev/null if test "$?" = "0" ; then ac_ada_path=$ac_dir break fi done rm -rf $ac_var if test "x$ac_ada_path" = "x"; then if test "x$4" = "x" ; then AC_ERROR([package not found]) else AC_MSG_RESULT([missing but ignored]) $2="" ; export $2 fi else AC_MSG_RESULT([found ($ac_ada_path)]) $2=$ac_ada_path ; export $2 $3 fi ]) # AC_CHECK_DYNLIB AC_DEFUN([AC_CHECK_DYNLIB], [ for i in so dylib ; do if test -e $2.$i ; then ac_dbcs=$2.$i $3 break fi done; ]) ## ## Define Version string of the version to be configured ## version=$GNADE_MAJOR.$GNADE_MINOR.$GNADE_PATCHLEVEL AC_SUBST(version) ## ## Options ## case $build_os in darwin) ## -gnatn does not work on os/x debugopt="-O2" ;; *) debugopt="-O2 -gnatn" ;; esac ## ## default flags to be applied on any gnatprep run ## AC_SUBST(gnade_prep_flags) gnade_prep_flags="" AC_ARG_ENABLE(debug,[Enable debugging],[debugopt="-g -gnato"]) if test "x$debugopt" = "x" ; then gnade_prep_flags="$gnade_prep_flags -DDEBUG=True" else gnade_prep_flags="$gnade_prep_flags -DDEBUG=False" fi AC_ARG_ENABLE(assert,[Enable assertation], [debugopt="$debugopt -gnata"]) AC_SUBST(debugopt) ## ## fetch the site specific locations of the database products ## for i in $site_db_libs; do LDFLAGS="-L$i $LDFLAGS" done export LDFLAGS; ############################################################################### ## C H E C K THE P L A T F O R M E N V I R O N M E N T ## ## ## ## 1) Guess the place where to install GNADE ## ## 2) Check if pkg-config is used. ## ## 3) Figure out the distribution ## ## 4) check for the addr2line workaround ## ## ## ############################################################################### ## define the home directory of the gnade installment. This is not automatically ## where the sources are installed! if test "x$gnadehome" = "x" ; then if test "x$site_gnadehome" = "x" ; then gnadehome=/usr/local/gnade else gnadehome=$site_gnadehome fi fi ## the place where the gnade binaries are stored if test "x$site_bindir" = "x" ; then site_bindir="$gnadehome/bin" fi if test "x$site_etcdir" = "x" ; then site_etcdir="$gnadehome/etc" fi ## the place of the libraries if test "x$site_libdir" = "x" ; then site_libdir="$gnadehome/lib" fi ## the place of the included units (adb, ads, ali files) if test "x$site_adadir" = "x"; then site_adadir="$gnadehome/include" fi ## the location of the documentation if test "x$site_docdir" = "x"; then site_docdir="$gnadehome/doc" fi AC_SUBST(site_bindir) AC_SUBST(site_libdir) AC_SUBST(site_adadir) AC_SUBST(site_docdir) AC_SUBST(site_etcdir) site_shared="$gnadehome/shared" AC_SUBST(site_shared) ## Try to locate pkgconfig and place wehre the module specs ## have to be put. pkgconfig="" AC_CHECK_PROG(pkgconfig, pkg-config, pkg-config, "") AC_SUBST(pkgconfig) if test "x$pkgconfig" != "x" ; then AC_MSG_CHECKING([for pkgconfig path]) site_pkgconfig_path="" for i in $site_libdir/pkgconfig $prefix/lib/pkgconfig $libdir/pkgconfig ; do if test -d $i ; then site_pkgconfig_path=$i break fi done; if test "x$site_pkgconfig_path" = "x"; then site_pkgconfig_path="/usr/local/lib/pkgconfig" fi if test "x$site_pkgconfig_path" = "x"; then site_pkgconfig_path=$PKG_CONFIG_PATH fi if test "x$site_pkgconfig_path" = "x"; then AC_MSG_RESULT([not found]) else AC_MSG_RESULT( $site_pkgconfig_path ) fi fi AC_SUBST(site_pkgconfig_path) ## Figure out the Linux distribution we are running on AC_SUBST(build_distribution) case $build_os in linux*) AC_CHECK_FILE( "/etc/redhat-release", build_distribution=redhat, [ AC_CHECK_FILE( /etc/SuSE-release, build_distribution=suse, build_distribtuin=unknown) ] ) ;; *) build_distribution=unknown ;; esac ## ## Define several parameters depending on the operating system ## we are running on. ## bin="" AC_SUBST(bin) buildenv=gnu AC_SUBST(buildenv) darwin_dynlink="" AC_SUBST(darwin_dynlink) AC_SUBST(cp_options) AC_SUBST(ld_rpath_option) ld_rpath_option="-Wl,-rpath,\$(libdir)" case $build_os in solaris*) cp_options=pf buildenv=solaris ;; freebsd4*) cp_options=pf buildenv=gnu ;; linux-gnu) cp_options=pdf buildenv=gnu ;; ## OS-X for MAC. This is a workaround only for OS/X shared libs darwin*) cp_options=pf ld_rpath_option="" buildenv=gnu ;; ## cygwin is hosted on a dos platform cygwin*) cp_options=pf bin=.exe buildenv=gnu ;; *) cp_options=pf buildenv=gnu ;; esac ## Check if the addr2lines function is available. If not, no symbolic ## trace back may be used in the application code. This is a workaround ## for some Linux systems (e.g. SuSe 8.1, Solaris). AC_SUBST(libaddr2line) libaddr2lines="n" AC_CHECK_LIB( addr2line, convert_addresses,[libaddr2lines="y"]) ## ## ## AC_SUBST(sampledir) ############################################################################### ## ## ## C H E C K F O R A D D I T I O N A L T O O L S ## ## ## ############################################################################### ## DOCBOOK DOCBOOK="" SGML_BASE="" documents="" used_spellchecker="" AC_CHECK_PROGS(DOCBOOK,[openjade jade],no) if test "$DOCBOOK" != "no" ; then documents="manual" AC_MSG_CHECKING([for SGML base directory]) for i in /usr/lib /usr/share ; do if test -d $i/sgml ; then SGML_BASE="$i/sgml" break fi done if test "x$SGML_BASE" = "x" ; then AC_MSG_RESULT([not found]) else AC_MSG_RESULT([found $SGML_BASE]) fi else documents="" fi AC_SUBST(SGML_BASE) AC_SUBST(DOOKBOOK) AC_SUBST(documents) ## PACKAGING TOOLS AC_CHECK_PROGS(zip,[zip]) AC_CHECK_PROGS(gzip,[gzip]) AC_CHECK_PROGS(rpm,[rpm]) package_types="$zip $gzip $rpm" AC_SUBST(package_types) ############################################################################### ## P R E P A R E T H E A D A C O M P I L E R ## ## ## ## Even there is only one GNAT there are different productions available for ## ## different platforms. This sections tries to guess the different configs. ## ## ## ############################################################################### AC_SUBST(gnatpath) if test "x$site_gnat_path" = "x" ; then site_gnat_path=/usr/gnat/bin fi gnatpath=""; AC_MSG_CHECKING([for correct gnat path ..] ) echo "procedure test is begin null; end test; " > test.adb for i in $site_gnat_path /usr/gnat/bin /usr/local/bin /usr/bin ; do for gcc in gnatgcc adagcc gcc ; do if test -x $i/$gcc ; then rm -rf test.ali test.o $i/$gcc -c test.adb 2> /dev/null if test -e test.ali ; then gnatpath=$i break fi fi done if test "x$gnatpath" != "x" ; then adacomp=$gcc; break; fi done; rm -rf test.adb CC=$adacomp export CC adacomp=$gnatpath/$adacomp AC_MSG_RESULT([ $gnatpath ]) PATH=$gnatpath:$PATH; export PATH ## check for tools AC_CHECK_PROGS(adacomp, gnatgcc adagcc gcc, gcc) AC_CHECK_PROG(adamake, gnatmake, gnatmake, no ) AC_CHECK_PROG(adaprep, gnatprep, gnatprep, no) for i in $adacomp $adamake $adaprep do if test "$i" = "no" ; then AC_MSG_ERROR([GNAT Ada 95 compiler is missing]) fi done ############################################################################### ## P R E P A R E O D B C D R I V E R M A N A G E R ## ## ## ## check the ODBC Driver Manager. We are checking for iodbc and open odbc ## ## the driver has to be selected which support unicode. ## ## If open ODBC is installed it will overule iodbc ## ## ## ############################################################################### ## add the site specific places to the ld path and the odbc_dmlib odbc_dmlib="" AC_SUBST(odbc_dmlib) AC_MSG_CHECKING([for ODBC driver managerproducts]) if test "x$opt_odbc" = "x" ; then odbc_dm_prodict="none" AC_MSG_RESULT([ skiped, no odbc included] ) else odbc_dm_products="myodbc3 odbc iodbc odbc32" if test "x$site_odbc_dmlibs" != "x" ; then for i in $site_odbc_dmlibs ; do for dm in $odbc_dm_products ; do if test -e $i/lib$dm.a ; then LDFLAGS="$LDFLAGS -L$i" odbc_dmlib="$odbc_dmlib -L$i" fi done done fi AC_MSG_RESULT([ $odbc_dmlib $LDFLAGS ]) export LDFLAGS ## locate the driver manager for the odbc interface odbc_dm="" case $build_os in cygwin*) odbc_dm=odbc32 if test "x$odbc_unicode_support" = "x" ; then odbc_unicode_support="True" fi ;; *) for i in myodbc3 odbc iodbc odbc32 ; do AC_CHECK_LIB( $i, SQLAllocHandle, odbc_dm=$i) if test "x$odbc_dm" != "x" ; then break; fi done ;; esac if test "x$site_odbc_dmlibs" != "x" -a "x$darwin_dynlink" != "x" ; then AC_MSG_CHECKING([for OS-X sharedlib.sh fix - dynmic driver manager libs]) for i in $site_odbc_dmlibs ; do if test -e $i/lib$odbc_dm.dylib ; then darwin_dynlink="$darwin_dynlink $i/lib$odbc_dm.dylib" break fi done; AC_MSG_RESULT([ $darwin_dynlink ]) fi AC_MSG_CHECKING([for correct odbc driver manager libs]) if test "x$odbc_dm" = "x" ; then AC_ERROR([odbc driver manager libs not set]) else odbc_dmlib="$odbc_dmlib -l$odbc_dm" AC_MSG_RESULT([seems to be correctly set]) fi ## check for unicode support. if it is not forced, then try to evaluate it. AC_SUBST(odbc_unicode_support) if test "x$odbc_unicode_support" = "x" ; then AC_SEARCH_LIBS( SQLPrepareW, $odbc_dmlib, [odbc_unicode_support="True"], [odbc_unicode_support="False"]) fi gnade_prep_flags="$gnade_prep_flags -DUNICODE=\"$odbc_unicode_support\"" fi ## end of odbc driver manager products ############################################################################### ## P R E P A R E E X P O R T E D O D B C L I B R A R I E S ## ############################################################################### tools="" if test "$opt_odbc" = "y" ; then gnadelibs="-lgnadeesql -lgnadeodbc -lgnadeaux" tools="tools" else gnadelibs="-lgnadeaux" fi AC_SUBST(gnadelibs) AC_SUBST(opt_odbc) ############################################################################### ## C H E C K F O R O T H E R P R O D U C T S ## ############################################################################### ## CHECK FOR GTK ADA gtk_path="" ## AC_CHECK_ADAPKG([Gtk], [gtk_path], [GNADE_LIBS="$GNADE_libs -lgtk"]) AC_CHECK_PROG(gtkadaconfig, gtkada-config, gtkada-config, no) ## ## check if the ada container package is available. This package is ## used by sqlite3. ## ada_container_pkg="" AC_CHECK_ADAPKG([Ada.Containers],[ada_container_pkg],[echo], ignore ) ############################################################################### ## P R E P A R E S A M P L E D A T A B A S E ## ## Handle the implemenation od the sample database. In order to ## ## install a data base we check: ## ## 1) check for the ODBC driver libraries of each vendor ## ## 2) Build an sample odbcinst.ini file ## ## 3) check the requiered tools to inject data ## ## ## ############################################################################### AC_SUBST(dbcs_vendor) AC_SUBST(odbc_driver) AC_SUBST(odbc_driver_path) AC_SUBST(dbpasswd) AC_SUBST(dboperator) AC_SUBST(dbuser) AC_ARG_WITH(dboperator, [--with-dboperator= Set the user id of the database operator], [dboperator=$withval], [dboperator=$USER] ) dbuser=gnade dbcs_vendor=UNKNOWN odbc_driver=UNKNOWN dbpasswd="" sampledb="" ## ## Try to gues the location of the odbc drivers for all ## supported data base products. As a result an odbcinst.ini will ## be written into the local state directory. ## odbcinst="$prefix/var/odbcinst.ini" libplaces="/usr/lib /usr/local/lib $site_db_libs" if test ! -d $prefix/var ; then mkdir $prefix/var fi rm -rf $odbcinst echo "" > $odbcinst for i in PostgreSQL MimerSQL MySQL ; do AC_MSG_CHECKING([ODBC drivers of $i]); odbc_driver_path="" odbc_description="" odbc_setup="" case $i in PostgreSQL) for p in $libplaces /usr/local/pgsql ; do for l in psqlodbc.so libodbcpsql.so ; do if test -e $p/$l ; then odbc_driver_path=$p/$l odbc_setup=$p/libodbcpsqlS.so odbc_description="ODBC for PostgreSQL" break fi done if test "x$odbc_driver_path" != "x" ; then break; fi done ;; MimerSQL) if test -e /usr/lib/libmimer.so ; then odbc_description="ODBC for MimerSQL" odbc_driver_path="/usr/lib/libmimer.so" fi ;; MySQL) for p in $libplaces ; do if test -e $p/libmyodbc.so ; then odbc_description="ODBC for MySQL" odbc_driver_path="$p/libmyodbc.so" break fi ## handle os/x if test -e $p/libmyodbc.dylib ; then odbc_description="ODBC for MySQL" odbc_driver_path="$p/libmyodbc.dylib" break fi done ;; esac if test "x$odbc_driver_path" = "x" ; then AC_MSG_RESULT([not found]); else AC_MSG_RESULT([found, configuration prepared]); echo "[[$i]]" >>/tmp/gnade.tmp echo "Description = $odbc_description" >>/tmp/gnade.tmp echo "Driver = $odbc_driver_path" >>/tmp/gnade.tmp if test "x$odbc_setup" != "x" ; then >>/tmp/gnade.tmp echo "Setup = $odbc_setup" >>/tmp/gnade.tmp fi >>/tmp/gnade.tmp echo "Fileusage = 1 " >>/tmp/gnade.tmp echo >>/tmp/gnade.tmp fi; done; if test -e /tmp/gnade.tmp ; then mv /tmp/gnade.tmp $odbcinst fi ## ## For the defined database vendor try to gues some of the important ## informations we need for the test data base. ## ## 1.) define the vendor string in the odbc.ini and the odbcinst.ini ## 2.) try to locate the odbc driver in the file system ## AC_SUBST(odbc_source) AC_ARG_WITH(odbc-source, [ --with-odbc-source= Set the source name of the data base], [odbc_source=$withval], [odbc_source="gnade"] ) AC_ARG_WITH(sampledb, [ set the sample database], [ sampledb=$withval ] ) AC_ARG_WITH(tooldir, [ --with-tooldir= Set the tooldirectory relative to prefix], [tooldir=$prefix/$withval], [tooldir=$site_tooldir] ) AC_MSG_CHECKING([database tools for example database]); AC_SUBST(sql) AC_SUBST(dbtoolpath) sql="" dbtoolpath="" case $sampledb in postgres) dbcs_vendor="postgres" odbc_driver="PostgreSQL" dbpasswd=gnade native="postgres" for p in $libplaces /usr/local/pgsql /usr ; do if test -e $p/bin/psql ; then dbtoolpath=$p/bin sql=psql break fi done ;; mysql) dbcs_vendor="mysql" odbc_driver="MySQL" native="mysql" for p in $libplaces $PATH /usr/local/bin ; do if test -e $p/mysql ; then dbtoolpath=$p; sql="mysql" break; fi done; ;; mimer) dbcs_vendor="mimer" odbc_driver="MimerSQL" dbpasswd="gnade" native="" for p in $libplaces /opt/Mimer* ; do if test -e $p/bin/bsql ; then dbtoolpath=$p/bin; sql="bsql" break; fi done ;; oracle) dbcs_vendor="oracle $dbcs_vendor" odbc_driver=OracleSQL dbpasswd=gnade native="oci" sql=sqlplus dbtoolpath="" ;; *) dbcs_vendor=UNKNOWN odbc_driver=UNKNOWN sql=UNKNOWN ;; esac if test "x$sql" == "x" ; then AC_ERROR([not found]) else AC_MSG_RESULT([found in $dbtoolpath]) fi ## ## Check the prerequisites for the requested native bindings and ## setup the libaries pathes for the native libraries ## native_libs="" AC_SUBST(native_libs) if test "x$site_db_libs" != "x" ; then for i in $site_db_libs ; do if test -d $i ; then LDFLAGS="$LDFLAGS -L$i" native_libs="$native_libs -L$i" fi done; fi export LDFLAGS libname="" ## ## Check the installation of the native bindings ## AC_ARG_WITH(adbc, [ Build ADBC ], [ native="adbc $native" native_libs="$native_libs -lgnadeadbc" ] ) AC_ARG_WITH(postgres, [ Assume Postgres dbcs ], [ AC_SEARCH_LIBS( PQexec, pq, [ native="postgres $native" native_libs="$native_libs -lgnadepostgresql -lpq"], [AC_MSG_ERROR(The development kit for PostgreSQL has not been found)]) ] ) AC_ARG_WITH(sqlite, [ Include SQLite ], [ AC_SEARCH_LIBS( sqlite_open, sqlite, [ native="sqlite $native" native_libs="$native_libs -lgnadesqlite -lsqlite" if test "x$ada_container_pkg" != "x" ; then AC_MSG_RESULT([sqlite3 bindings included]) native="sqlite3 $native" else AC_MSG_RESULT([No sqlite3 bindings included]) fi ], [AC_MSG_ERROR([The development kit for SQLite has not been found])]) ] ) mysql_version="" AC_SUBST(mysql_version) AC_ARG_WITH(mysql, [Include Native bindings for MySQL], [ AC_SEARCH_LIBS( mysql_real_connect, mysqlclient, [mysql_version="MYSQL4"], [AC_SEARCH_LIBS( mysql_connect, mysqlclient, [ mysql_version="MYSQL3" ], [AC_MSG_ERROR(The development kit for mysql has not been found)]) ] ) AC_MSG_CHECKING([MySQL version]) AC_MSG_RESULT([$mysql_version]) if test "x$mysql_version" != "x" ; then native="mysql $native" native_libs="$native_libs -lgnademysql -lmysqlclient" ## if test "x$darwin_dynlink" != "x" ; then AC_MSG_CHECKING([for OS-X sharedlib.sh fix - dynmic driver manager libs]) for i in $site_db_libs ; do if test -e $i/libmysqlclient.dylib ; then darwin_dynlink="$darwin_dynlink $i/libmysqlclient.dylib" break fi done AC_MSG_RESULT($darwin_dynlink) fi fi ] ) AC_ARG_WITH(mimer, [ Assume Mimer SQL dbcs], [ AC_MSG_ERROR([No native bindings available for MimerSQL])] ) AC_ARG_WITH(oracle, [ Assume Oracle 8i data base ], [ echo echo "**************************************************************" echo "**** W A R N I N G ****" echo "**************************************************************" echo echo " 1) Please ensure manually that you have installed Oracle 8i" echo echo " 2) To install the data base $odbc_source using the file:" echo echo " ./samples/sample_db/gnade.oracle.sql" echo echo "**************************************************************" echo native="$native oci" ] ) AC_SUBST(native) ##AC_SUBST(tools) ## ## Build the library arguments for pkgconfig ## pkgconfig_libs="$odbc_dmlibs $native_libs" AC_SUBST(pkgconfig_libs) ## SAMPLEDB="GNADE" DBUSER=$dbuser DBPASSWD=$dbpasswd AC_SUBST(SAMPLEDB) AC_SUBST(DBUSER) AC_SUBST(DBPASSWD) ## ## Generate files ## AC_OUTPUT( [ ../make.conf ../samples/sample_db/odbc.ini.sample ../samples/sample_db/create_user.mimer.sql ../etc/profile.d/gnade.sh ../etc/profile.d/gnade.csh ../etc/profile.d/gnade.bash ../pkg-config/gnade.pc ../bin/gnade-vars.sh ]) cp ../samples/sample_db/odbc.ini.sample $prefix/var/odbc.ini # # Output a nice message if the first time called # if test -f ../.configure ; then cat < -- ## Created On : 03-Jan-2001 -- ## Last Modified By: $Author: merdmann $ -- ## Last Modified On: $Date: 2005/02/27 19:27:25 $ -- ## Status : $State: Exp $ -- ## -- ## Copyright (C) 2000-2004 -- ## -- ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## include ../make.conf all:: chmod +x *.sh clean :: $(RM) *~ *~*~ distclean :: clean $(RM) *.sh *.bat gnade-1.6.2.orig/bin/gnade-vars.sh.in0000755000175000017500000001005110043005005017120 0ustar lbrentalbrenta#!/bin/sh ## @configure_input@ ## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/bin/gnade-vars.sh.in,v $ ## Description : Online installation procedure ## Author : Michael Erdmann ## Created On : 9-April-2002 ## Last Modified By: $Author: merdmann $ ## Last Modified On: $Date: 2004/04/25 18:57:09 $ ## Status : $State: Exp $ ## ## Copyright (C) 2000-2002 -- ## -- ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- . @prefix@/VERSION ## ## Installation target directories ## libs=@site_libdir@ bindir=@site_bindir@ build_os=@build_os@ ## ## Ada compiler ## adacc=@adacomp@ adamake=@adamake@ ## ## Internal used definitions ## instbin="@INSTALL@" version=$GNADE_MAJOR.$GNADE_MINOR.$GNADE_PATCHLEVEL adalibs=@site_adadir@ bindir=@site_bindir@ etcdir=@site_etcdir@ docdir=@site_docdir@ toolsdir=@site_toolsdir@ adashared=@site_shared@ pkgconfig=@pkgconfig@ site_pkgconfig_path=@$site_pkgconfig_path@ ## ## Source directory in the GNADE build environment from where all ## objects, units and binaries are taken from. ## gnadelib=@prefix@/@build_os@-@build_cpu@-lib gnadebin=@prefix@/@build_os@-@build_cpu@-bin gnadedoc=@prefix@/@build_os@-@build_cpu@-doc gnadeinclude=@prefix@/@build_os@-@build_cpu@-include gnadeshared=@prefix@/shared gnadetools=@prefix@/bin gnadeetcdir=@prefix@/@build_os@-@build_cpu@-etc varpath=@prefix@/var debugopt="@debugopt@" ## ## list the natice producs to be build and ## and installed. gnadenatives="@native@" ## Make sure, that the gnat gcc is always found first PATH=@gnatpath@:$PATH ; export PATH ## ## Document processing ## jade=@DOCBOOK@ sgml_base=@SGML_BASE@ gnade-1.6.2.orig/cfg/0000755000175000017500000000000011040716276014140 5ustar lbrentalbrentagnade-1.6.2.orig/cfg/Makefile0000644000175000017500000001014010050436207015565 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/cfg/Makefile,v $ ## Description : Makefile to compile the configure tool -- ## Author : Michael Erdmann -- ## Created On : 9.4.2002 -- ## Last Modified By: $Author: merdmann $ -- ## Last Modified On: $Date: 2004/05/12 15:02:31 $ -- ## Version : $Revision: 1.7 $ ## Status : $State: Exp $ ## -- ## Copyright (C) 2004 Michael Erdmann -- ## -- ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## This package is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## Contact -- ## ======= -- ## Error reports shall be handled via http://gnade.sourceforge.net -- ## Features and ideas via: gnade-develop@lists.sourceforge.net -- ## -- ## Author contact: -- ## purl:/net/michael.erdmann -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## This makefile build the example code for the GNU ADO Interface. ## ## Restrictions ## ============ ## None ## ## References ## ========== ## None ## ## ## .PHONY: scripts build sinclude ../make.conf # binaries=$(foreach f,prep cfgset cfgget, $f$(bin)) ## ## ## all build :: $(binaries) $(binaries) :: prep.adb cfgset.adb cfgget.adb $(ADAMAKE) -XTarget=$(libexec) -Pcfg.gpr clean :: $(RM) b~* *~ *~*~ *.bak $(RM) $(binaries) *.ali *.o distclean :: clean gnade-1.6.2.orig/cfg/Makefile.cfg0000644000175000017500000001000010027646521016324 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## Ada Database Connectivity (ADBC) - Makefile -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/cfg/Makefile.cfg,v $ ## Description : Makefile for the shell code -- ## Author : Michael Erdmann -- ## Created On : 9.4.2002 -- ## Last Modified By: $Author: merdmann $ -- ## Last Modified On: $Date: 2004/03/22 20:32:17 $ -- ## Version : $Revision: 1.1 $ ## Status : $State: Exp $ ## -- ## Copyright (C) 2000-2002 -- ## -- ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## This package is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## Contact -- ## ======= -- ## Error reports shall be handled via http://gnade.sourceforge.net -- ## Features and ideas via: gnade-develop@lists.sourceforge.net -- ## -- ## Author contact: -- ## purl:/net/michael.erdmann -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## This makefile build the example code for the GNU ADO Interface. ## ## Restrictions ## ============ ## None ## ## References ## ========== ## None ## ## ## build : $(MAKE) -C./ $@ ARCH=linux-gnu-i686 gnade-1.6.2.orig/cfg/README0000644000175000017500000000030210043005006014773 0ustar lbrentalbrentaThis directory contains a facility to configure GNADE. The reason why this exisits, is because in longer terms GNADE will be made more indepenant from GNAT and the underlying operating system. gnade-1.6.2.orig/cfg/cfg.adb0000644000175000017500000001351210537477634015365 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/cfg/cfg.adb,v $ -- Description : Storing & Retrieving configuration data -- -- Author : Michael Erdmann -- -- Created On : 22-Mar-2004 -- -- Last Modified By: $Author: merdmann $ -- -- Last Modified On: $Date: 2006/12/12 10:08:28 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2004 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- -- -- Restrictions -- -- ============ -- -- R.1 - The handling of the tree nodes is currently not task save -- -- -- -- References -- -- ========== -- -- None -- -- -- ------------------------------------------------------------------------------- with Ada.Text_IO; use Ada.Text_IO; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Strings; use Ada.Strings; with Ada.Strings.Fixed; use Ada.Strings.Fixed; with Tables; package body CFG is Version : constant String := "$Id: cfg.adb,v 1.6 2006/12/12 10:08:28 merdmann Exp $"; package PT is new Tables( Unbounded_String ); use PT; Names : Tree_Node_Access := Create_Tree; --------- -- Get -- --------- function Get( S : in String ) return String is Result : Unbounded_String ; begin Fetch( Names, S, Result ); return To_String( Result ); exception when Entry_Not_Found => return ""; end Get ; --------- -- Add -- --------- procedure Add( S : in String ) is Start : Natural := Index( S, "="); function Convert( S : in String ) return String is T : String( 1..2*S'Length ); K : Natural := T'First; begin for I in S'Range loop T(K) := S(I); K := K + 1; if S(I) = '\' then T(K) := S(I); K := K + 1; end if; end loop; return T(1..K-1); end Convert; begin PT.Insert( Names, Trim( S(S'First..Start-1), Both ), To_Unbounded_String(Convert(Trim( S(Start+1.. S'Last), Both ))) ); end Add; -------------- -- Load_CFG -- -------------- procedure Load_CFG( Name : in String ) is F : File_Type; Line : String( 1..4000 ); Length : Natural := 0; begin Open( File => F, Name => Name , Mode => In_File ); while not End_of_File(F) loop Get_Line( F, Line, Length ); if Length > 0 then declare Value : String := Trim( Line(1..Length ), Both ); begin if Value(1) /= '#' and Value(1) /= '.' then Add( Value ); end if; exception when PT.ALREADY_STORED => if not Opt_Silent then Put_Line("Definition '" & value & "' ignored" ); end if; end ; end if; end loop; Close(F); end Load_CFG; procedure Save_CFG is F : File_Type; begin null; end Save_CFG; end CFG; gnade-1.6.2.orig/cfg/cfg.ads0000644000175000017500000000724510043005007015361 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/cfg/cfg.ads,v $ -- Description : Storing & Retrieving configuration data -- -- Author : Michael Erdmann -- -- Created On : 22-Mar-2004 -- -- Last Modified By: $Author: merdmann $ -- -- Last Modified On: $Date: 2004/04/25 18:57:11 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2004 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- -- -- Restrictions -- -- ============ -- -- R.1 - The handling of the tree nodes is currently not task save -- -- -- -- References -- -- ========== -- -- None -- -- -- ------------------------------------------------------------------------------- package CFG is procedure Add( S : in String ); function Get( S : in String ) return String; procedure Load_CFG( Name : in String ) ; procedure Save_CFG; Opt_Silent : Boolean := False; end CFG; gnade-1.6.2.orig/cfg/cfg.gpr0000644000175000017500000000131310050436207015400 0ustar lbrentalbrenta-- -- $Id: cfg.gpr,v 1.2 2004/05/12 15:02:31 merdmann Exp $ -- project CFG is Target := external( "Target", "." ); for Languages use ("Ada", "Project File" ); for Source_Dirs use ("."); for Object_Dir use "."; for Main use ("prep.adb", "cfgget.adb", "cfgset.adb" ); for Exec_Dir use Target ; package Linker is for Default_Switches ("ada") use ("-g") ; end Linker; package Binder is for Default_Switches ("ada") use ("-static" ); end Binder; package Compiler is for Default_Switches ("ada") use ("-g" ); end Compiler; package Builder is for Default_Switches ("ada") use ("-g", "-gnatQ" ); end Builder; end CFG; gnade-1.6.2.orig/cfg/cfgget.adb0000644000175000017500000000734610030110677016050 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/cfg/cfgget.adb,v $ -- Description : GNADE Preprocessor and configuration tool -- Author : Michael Erdmann -- Created On : 22-Mar-2004 -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2004/03/23 19:36:31 $ -- Status : $State: Exp $ -- -- Copyright (C) 2004 Michael Erdmann -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- -- -- Restrictions -- -- ============ -- -- -- -- References -- -- ========== -- -- None -- -- -- ------------------------------------------------------------------------------- with Ada.Strings; use Ada.Strings; with Ada.Command_Line; use Ada.Command_Line; with Ada.Text_IO; use Ada.Text_IO; with CFG; use CFG; with String_Builder; use String_Builder; procedure CFGGet is Version : constant String := "$Id: cfgget.adb,v 1.2 2004/03/23 19:36:31 merdmann Exp $"; SB : String_Builder.Object; Argc : Natural := 1; Opt_Quote : Boolean := False; begin Load_CFG( "" ); while Argc in 1..Argument_Count loop if Argument(Argc) = "-f" then Opt_Quote := True; else Put_Line( CFG.Get( Argument(Argc) ) ); end if; Argc := Argc + 1; end loop; Finalize( SB ); end CFGGet; gnade-1.6.2.orig/cfg/cfgset.adb0000644000175000017500000000720110030110677016052 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/cfg/cfgset.adb,v $ -- Description : GNADE Preprocessor and configuration tool -- Author : Michael Erdmann -- Created On : 22-Mar-2004 -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2004/03/23 19:36:31 $ -- Status : $State: Exp $ -- -- Copyright (C) 2004 Michael Erdmann -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- -- -- Restrictions -- -- ============ -- -- -- -- References -- -- ========== -- -- None -- -- -- ------------------------------------------------------------------------------- with Ada.Strings; use Ada.Strings; with Ada.Command_Line; use Ada.Command_Line; with CFG; use CFG; with String_Builder; use String_Builder; procedure CFGSet is Version : constant String := "$Id: cfgset.adb,v 1.2 2004/03/23 19:36:31 merdmann Exp $"; SB : String_Builder.Object; Argc : Natural := 1; begin Load_CFG(""); Insert( SB, Argument( Argc ) ); Argc := Argc + 1; while Argc in 3..Argument_Count loop Insert( SB, ' ' ); Insert( SB, Argument( Argc ) ); end loop; Save_CFG; Finalize( SB ); end CFGSet; gnade-1.6.2.orig/cfg/gnade.cfg0000644000175000017500000000012110027646521015670 0ustar lbrentalbrentaX=1234 566 78889 Y=rrrrr Hallo=ddddddd cfsdf sfsdf sfs var=Das ist eine Variable gnade-1.6.2.orig/cfg/prep.adb0000644000175000017500000001650410047400463015556 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/cfg/prep.adb,v $ -- Description : GNADE Preprocessor and configuration tool -- Author : Michael Erdmann -- Created On : 22-Mar-2004 -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2004/05/09 10:00:19 $ -- Status : $State: Exp $ -- -- Copyright (C) 2004 Michael Erdmann -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- -- -- Restrictions -- -- ============ -- -- -- -- References -- -- ========== -- -- None -- -- -- ------------------------------------------------------------------------------- with Ada.Text_IO; use Ada.Text_IO; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Strings; use Ada.Strings; with Ada.Strings.Fixed; use Ada.Strings.Fixed; with Ada.Command_Line; use Ada.Command_Line; with String_Builder; use String_Builder; with CFG; use CFG; with Tables; procedure Prep is Version : constant String := "$Id: prep.adb,v 1.5 2004/05/09 10:00:19 merdmann Exp $"; SB : String_Builder.Object; Argc : Natural := 1; In_File_Name : Unbounded_String := Null_Unbounded_String ; Out_File_Name : Unbounded_String := Null_Unbounded_String ; CFG_DB_Path : Unbounded_String := Null_Unbounded_String ; CR_Shown : Boolean := False; Opt_Silent : Boolean := False; ---------- -- Help -- ----------- procedure Help is begin Put_Line("usage:" ); Put_Line(" prep [options] in-file out-file" ); Put_Line("" ); Put_Line("options:"); Put_Line(" '=' Define a substitution value"); Put_Line(" -f Load definitions from a given file"); Put_Line(""); end Help; --------------- -- Copyrigth -- --------------- procedure Copyrigth is begin If not CR_Shown and not Opt_Silent then Put_Line("GNADE Preprocessor Version 1.0" ); Put_Line("Copyright (C) 2004 Michael Erdmann " ); end if; CR_Shown := True; end Copyrigth; ------------------ -- Process_Line -- ------------------ function Process_Line( S : in String ) return String is Attrib : String( 1..256 ) := (others =>' '); Length : Natural := 0; begin Clear( SB ); for i in S'Range loop if S(i) = '@' then if Length = 0 then Length := Attrib'First; else Insert( SB, CFG.Get( Attrib( 1..Length-1 ) ) ); Length := 0; end if; else if Length > 0 then Attrib(Length) := S(i); Length := Length + 1; else Insert( SB, S(i) ); end if; end if; end loop; return To_String( SB ); end Process_Line; ------------- -- Process -- ------------- procedure Process_File( Input : in String; Output : in String ) is -- process a single file Line : String( 1..1024 ); Length : Natural := 0; Inp : File_Type ; Outp : File_Type ; LineNo : Natural := 0; begin Open( File => Inp, Name => Input, Mode => In_File ); Create( File => Outp, Name => Output, Mode => Out_File ); while not End_Of_File( Inp ) loop begin Get_Line( Inp, Line, Length ); LineNO := LineNo + 1; Put_Line( Outp, Process_Line( Line(1..Length ) ) ); end ; end loop ; Close(inp); Close(Outp); exception when Others => Put_Line("Error while processing line" & Natural'Image(LineNo) & " of " & Input ); end Process_File; begin if Argument_Count < 1 then Help; return; end if; while Argc in 1..Argument_Count loop if Argument(Argc) = "-f" then Argc := Argc + 1; Load_CFG( Argument( Argc ) ); Argc := Argc + 1; elsif Argument(Argc) = "-s" then Opt_Silent := True; CFG.Opt_Silent := Opt_Silent; Argc := Argc + 1; elsif Index( Argument(Argc), "=" ) > 0 then CFG.Add( Argument( Argc ) ); Argc := Argc + 1; else if In_File_Name = Null_Unbounded_String then In_File_name := To_Unbounded_String( Argument( Argc ) ); elsif Out_File_Name = Null_Unbounded_String then Out_File_name := To_Unbounded_String( Argument( Argc ) ); end if; Argc := Argc + 1; if Out_File_Name /= Null_Unbounded_String and In_File_Name /= null_Unbounded_String then Copyrigth; Process_File( To_String( In_File_Name ), To_String( Out_File_Name ) ); end if; end if; end loop; Finalize( SB ); end Prep; gnade-1.6.2.orig/cfg/string_builder.adb0000644000175000017500000001427010027646521017627 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/cfg/string_builder.adb,v $ -- Description : Simple string builder package -- -- Author : Michael Erdmann -- -- Created On : 16-Mar-2002 -- -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2004/03/22 20:32:17 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2000-2002 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- -- -- Functional Description -- -- ====================== -- -- -- -- -- -- Restrictions -- -- ============ -- -- -- -- References -- -- ========== -- -- None -- -- -- ------------------------------------------------------------------------------- with Unchecked_Deallocation ; package body String_Builder is Version : constant String := "$Id: string_builder.adb,v 1.1 2004/03/22 20:32:17 merdmann Exp $"; type String_Access is access String; ---------------------- -- Object_Data_Type -- ---------------------- type Object_Data_Type is record Length : Natural := 0; Buffer : String_Access := null; end record; procedure Free is new Unchecked_Deallocation( String, String_Access ); procedure Free is new Unchecked_Deallocation( Object_Data_Type, Object_Data_Access ); ---------------- -- Initialize -- ---------------- function Initialize return Object_Data_Access is Result : Object_Data_Access := new Object_Data_Type ; begin return Result; end Initialize; -------------- -- Finalize -- -------------- procedure Finalize( This : in out Object ) is begin if This.Data.Buffer /= null then Free( This.Data.Buffer ); end if; Free( This.Data ); end Finalize; --------------- -- To_String -- ---------------- function To_String( This : in Object ) return String is -- convert the contents of the string buffer into a string Data : Object_Data_Access renames This.Data ; begin return Data.Buffer( 1..Data.Length ); end To_String; ----------- -- Clear -- ----------- procedure Clear( This : in out Object) is Data : Object_Data_Access renames This.Data ; begin Data.Length := 0; end Clear ; ------------ -- Insert -- ------------ procedure Insert( This : in out Object; Char : in Character ) is -- Insert a character into the string buffer. -- R.1 - If the buffer does not exist create a buffer with 1000 chars -- R.2 - If the buffer get to low to store the character extend the -- buffer. Data : Object_Data_Access renames This.Data ; begin if Data.Buffer = null then Data.Buffer := new String( 1..2000 ); Data.Length := 0; end if; if not ( Data.Length+1 > Data.Buffer'Length ) then declare Tmp : String_Access := new String( 1..(Data.Length + 1000) ); begin Tmp( 1..Data.Length ) := Data.Buffer( 1..Data.Length ); Free( Data.Buffer ); Data.Buffer := Tmp ; end ; Data.Length := Data.Length + 1; Data.Buffer( Data.Length ) := Char ; end if; end Insert; ------------ -- Insert -- ------------ procedure Insert( This : in out Object; Str : in String ) is begin for i in Str'Range loop Insert( This, Str(i) ); end loop; end Insert; end String_Builder; gnade-1.6.2.orig/cfg/string_builder.ads0000644000175000017500000001326510027646521017653 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/cfg/string_builder.ads,v $ -- Description : Simple string builder package -- -- Author : Michael Erdmann -- -- Created On : 22-Mar-2004 -- -- Last Modified By: $Author: merdmann $ -- -- Last Modified On: $Date: 2004/03/22 20:32:17 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2004 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- -- -- -- -- Restrictions -- -- ============ -- -- -- -- References -- -- ========== -- -- None -- -- -- ------------------------------------------------------------------------------- package String_Builder is type Object is private; --------------------------------------------------------------------------- -- Description: -- Convert buffer to string -- Preconditions: -- None -- Postconditions: -- None -- Exceptions: -- None -- Notes: -- None --------------------------------------------------------------------------- function To_String( This : in Object ) return String; --------------------------------------------------------------------------- -- Description: -- -- Preconditions: -- None -- Postconditions: -- None -- Exceptions: -- None -- Notes: -- None --------------------------------------------------------------------------- procedure Clear( This : in out Object); --------------------------------------------------------------------------- -- Description: -- Convert buffer to string -- Preconditions: -- None -- Postconditions: -- None -- Exceptions: -- None -- Notes: -- None --------------------------------------------------------------------------- procedure Insert( This : in out Object; Char : in Character ); --------------------------------------------------------------------------- -- Description: -- Convert buffer to string -- Preconditions: -- None -- Postconditions: -- None -- Exceptions: -- None -- Notes: -- None --------------------------------------------------------------------------- procedure Insert( This : in out Object; Str : in String ); --------------------------------------------------------------------------- -- Description: -- Convert buffer to string -- Preconditions: -- None -- Postconditions: -- None -- Exceptions: -- None -- Notes: -- None --------------------------------------------------------------------------- procedure Finalize( This : in out Object ); private type Object_Data_Type; type Object_Data_Access is access Object_Data_Type; function Initialize return Object_Data_Access; type Object is record Data : Object_Data_Access := Initialize; end record; end String_Builder; gnade-1.6.2.orig/cfg/tables.adb0000644000175000017500000002174410030110677016061 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/cfg/tables.adb,v $ -- Description : Symbol Table Manager for the ESQL translator -- Author : Michael Erdmann -- Created On : 06-Jan-2001 -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2004/03/23 19:36:31 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000-2003 Michael Erdmann -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- -- -- Restrictions -- -- ============ -- -- R.1 - The handling of the tree nodes is currently not task save -- -- -- -- References -- -- ========== -- -- None -- -- -- ------------------------------------------------------------------------------- package body Tables is Version : constant String := "$Id: tables.adb,v 1.2 2004/03/23 19:36:31 merdmann Exp $"; pragma Unreferenced (Version); --- ==================================================================== --- --- L O C A L S U P P O R T D A T A --- --- ==================================================================== --- subtype Index_Type is Character; -- this is the index type. It included all possbible characaters of the -- of the ASCII symbol set. Null_Leaf : constant Leaf_Access := null; type Leaf_Array is array( Index_Type ) of Leaf_Access; -- This is the list of pointers per index and leaf. For each index value a -- pointer is stored which points to another leaf. type Leaf_Type is record Valid_Information : Boolean := False; Value : Index_Type ; Next : Leaf_Array := (others=>Null_Leaf); Information : Symbol_Information_Type; end record; --- ==================================================================== --- --- S U P P O R T P R O C E D U R E S --- --- ==================================================================== --- -------------- -- New_Leaf -- -------------- function New_Leaf( T : Tree_Node_Access ) return Leaf_Access is pragma Unreferenced (T); Result : Leaf_Access := new Leaf_Type; begin Result.Valid_Information := False; Result.Next := (others=>null); return Result; end New_Leaf; ------------ -- Locate -- ------------ function Locate( T : in Tree_Node_Access; Name : in String; Expand_Tree : in Boolean := False ) return Leaf_Access is -- -- Locate a name in the index tree by walking trough till the -- end of the string. At the end of this process, the variable -- current points either to a leaf which carries information or -- or returns null. The user has to verify that the found leaf -- is not an enpty leaf. -- Is the nd_tree option not set, the search is stoped as soon -- as no next leaf pointer is defined. If the option is set an -- empty tree leaf is inserted. This feature is need to insert -- a tree element. -- Current : Leaf_Access := T.Root; Tmp : Leaf_Access; C : Index_Type; begin for I in Name'Range loop C := Name(I); Tmp := Current.Next(C); if Tmp = null then if not Expand_Tree then Current := null; exit; end if; Tmp := New_Leaf(T); Tmp.Value := C; Current.Next(C) := Tmp; end if; Current := Tmp; end loop; return Current; end Locate; ------------ -- Locate -- ------------ procedure Keys( T : in Tree_Node_Access; Keys : in out Key_Array; Nbr_Keys : out Natural ) is begin Nbr_Keys := 0; end Keys; --- ==================================================================== --- --- P U B L I C M E T H O D S --- --- ==================================================================== --- ----------------- -- Create_Tree -- ----------------- function Create_Tree return Tree_Node_Access is -- Create Tree. Result : Tree_Node_Access := new Tree_Node; begin Result.Root := New_Leaf(Result); return Result; end Create_Tree; ------------ -- Insert -- ------------ procedure Insert( T : in out Tree_Node_Access; Name : in String; Info : Symbol_Information_Type ) is -- -- Insert the name into the index tree by walking trough till the -- end of the string. At the end of this process, the variable -- current points either to a leaf which carries information or -- not. Current : Leaf_Access; begin Current := Locate( T, Name, Expand_Tree => True ); if not Current.Valid_Information then Current.Valid_Information := True; Current.Information := Info; else raise Already_Stored; end if; end Insert; ----------- -- Fetch -- ----------- procedure Fetch( T : in out Tree_Node_Access ; Name : in String; Info : out Symbol_Information_Type ) is -- Fetch the symbol table entry for a given name Current : constant Leaf_Access := Locate( T, Name ); begin if Current = null then raise Entry_Not_Found; end if; if not Current.Valid_Information then raise Entry_Not_Found; else Info := Current.Information; end if; end Fetch; ------------ -- Update -- ------------ procedure Update( T : in out Tree_Node_Access ; Name : in String; Info : in Symbol_Information_Type ) is -- Modify a given entry by simply overwritin the data if -- it is already stored, Current : Leaf_Access := Locate( T, Name ); begin if Current = null then raise Entry_Not_Found; end if; if Current.Valid_Information then Current.Information := Info; else raise Entry_Not_Found; end if; end Update; ------------ -- Delete -- ------------ procedure Delete( T : in out Tree_Node_Access ; Name : in String ) is -- Delete by marking the information as invalid Current : Leaf_Access := Locate( T, Name ); begin if Current /= null then Current.Valid_Information := False; end if; end Delete; end Tables; gnade-1.6.2.orig/cfg/tables.ads0000644000175000017500000001445210027646521016110 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/cfg/tables.ads,v $ -- Description : Symbol Tables -- Author : Michael Erdmann -- Created On : 29-Oct-2000 -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2004/03/22 20:32:17 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000-2004 Michael Erdmann -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- -- -- Restrictions -- -- ============ -- -- R.1 - The handling of the tree nodes is currently not task save -- -- -- -- References -- -- ========== -- -- None -- -- -- ------------------------------------------------------------------------------- with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; generic type Symbol_Information_Type is private; package Tables is type Tree_Node is private; type Tree_Node_Access is access Tree_Node; Usage_Error : exception; Already_Stored : exception; Entry_Not_Found : exception; type Key_Array is array( Natural Range <> ) of Unbounded_String; --------------------------------------------------------------------------- -- Description: -- This function creates an instance of the index tree -- Preconditions: -- None -- Postconditions: -- The tree node instance is intialized -- Exceptions: -- None -- Notes: -- None --------------------------------------------------------------------------- function Create_Tree return Tree_Node_Access; --------------------------------------------------------------------------- -- Description: -- The information is stored in the symbol table under the -- given Name. -- -- Preconditions: -- P1 - The Tree_Node pointer has to be created by means -- of Create_Tree. -- P2 - The Name is not already stored in the tree -- Postconditions: -- C1 - The Name and the information are stored in the table. -- Exceptions: -- Usage_Error : Pre.cond. P1 violated -- Already_Stored : Pre.cond. P2 vialoated -- -- Notes: -- --------------------------------------------------------------------------- procedure Insert( T : in out Tree_Node_Access; Name : in String; Info : Symbol_Information_Type ); --------------------------------------------------------------------------- -- Description: -- -- Preconditions: -- -- Postconditions: -- -- Exceptions: -- -- Notes: -- None --------------------------------------------------------------------------- procedure Fetch( T : in out Tree_Node_Access ; Name : in String; Info : out Symbol_Information_Type ); --------------------------------------------------------------------------- -- Description: -- -- Preconditions: -- -- Postconditions: -- -- Exceptions: -- -- Notes: -- None --------------------------------------------------------------------------- procedure Update( T : in out Tree_Node_Access; Name : in String; Info : in Symbol_Information_Type ); --------------------------------------------------------------------------- -- Description: -- -- Preconditions: -- -- Postconditions: -- -- Exceptions: -- -- Notes: -- None --------------------------------------------------------------------------- procedure Delete( T : in out Tree_Node_Access; Name : in String ); -- ===================================================================== -- private type Leaf_Type; type Leaf_Access is access Leaf_Type; type Tree_Node is record Root : Leaf_Access := null; -- root element of the index tree end record; -- this is the tree node, which contains all the data which -- is used to maintain and operate on the index tree. end Tables; gnade-1.6.2.orig/cfg/test.gpp0000644000175000017500000000016410030110677015617 0ustar lbrentalbrentaHallo @das ist ein e Variable@ und dass auch @var@ faddf djdadadas @daten@ @Hallo@ dasda d dasdg dasd adsad adad gnade-1.6.2.orig/cfg/scripts-cygwin/0000755000175000017500000000000011040716254017121 5ustar lbrentalbrentagnade-1.6.2.orig/cfg/scripts-cygwin/Makefile0000644000175000017500000001057710054200131020555 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/cfg/scripts-cygwin/Makefile,v $ ## Description : Makefile for the shell code -- ## Author : Michael Erdmann -- ## Created On : 9.4.2002 -- ## Last Modified By: $Author: merdmann $ -- ## Last Modified On: $Date: 2004/05/23 19:49:45 $ -- ## Version : $Revision: 1.5 $ ## Status : $State: Exp $ ## -- ## Copyright (C) 2000-2004 -- ## -- ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## This package is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## Contact -- ## ======= -- ## Error reports shall be handled via http://gnade.sourceforge.net -- ## Features and ideas via: gnade-develop@lists.sourceforge.net -- ## -- ## Author contact: -- ## purl:/net/michael.erdmann -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## This makefile build the example code for the GNU ADO Interface. ## ## Restrictions ## ============ ## None ## ## References ## ========== ## None ## ## ## .PHONY: gnade-config clean distclean all install sinclude ../../make.conf scripts=$(wildcard *.in) targets=$(subst .in,,$(scripts)) ## ## install the scripts ## all install: gnade-config for i in $(targets) ; do \ $(PREP) -s prefix=$(prefix) $$i.in $$i ; \ install --mode=0555 $$i $(tooldir) ; \ done install --mode=0555 gnade-config $(tooldir) gnade-config: gnade-config.in $(PREP) -s prefix=$(prefix) gnade-config.in gnade-config ## ## ## clean:: $(RM) b~* *~ *~*~ *.bak ## ## ## distclean:: clean $(RM) $(targets) $(foreach i, $(targets), $(tooldir)/$(i) ) gnade-1.6.2.orig/cfg/scripts-cygwin/docbuild.sh.in0000644000175000017500000001150510054200131021633 0ustar lbrentalbrenta#!/bin/sh ## ---------------------------------------------------------------------------- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/cfg/scripts-cygwin/docbuild.sh.in,v $ ## Description : build a docbook document on a redhat/suse system -- ## Author : Michael Erdmann ## Created On : 27-Dec-2002 ## Last Modified By: $Author: merdmann $ ## Last Modified On: $Date: 2004/05/23 19:49:45 $ ## Status : $State: Exp $ ## ## Copyright (C) 2000-2002 Michael Erdmann -- ## -- ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## ---------------------------------------------------------------------------- . @prefix@/bin/gnade-vars.sh CATALOG="CATALOG.docbook_4 CATALOG.jade_dsl CATALOG.docbk30" if [ -e /etc/redhat-release ] ; then styles=/usr/lib/sgml/stylesheets else styles=/usr/share/sgml/docbook/dsssl-stylesheets/ fi DSLhtml=$styles/html/docbook.dsl DSLprint=$styles/print/docbook.dsl JADE_OPT="-D /usr/share/sgml -w all " for c in $CATALOG ; do JADE_OPT="$JADE_OPT -c $c" done target="" format="pdf" log="/dev/null" ## ## Scan the arguments of the doc builder ## for i in $* ;do case "$1" in -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac case $1 in --target=*) target=$optarg ;; --tex|--pdf|--ps|--html) format=$1 ;; --log=*) log=$optarg ;; -help|--help|-h) echo "docbuild.sh option(s) file(s)]" echo echo "options:" echo " --tex Create an tex result file" echo " --help this message" echo " --target the resultfile(s)" echo echo "The following formats may be given, provided, that in the " echo "previous run, the tex file has been generated. Please note " echo "that only one format is possbile per command invokation." echo echo " --pdf Adobe PDF format" echo " --ps Postscript format" echo " --html HTML format" echo exit 0 ;; *) files="$files $1" ;; esac shift; done if [ "x$target" != "x" ] ; then JADE_OPT="$JADE_OPT -o $target" fi if [ "x$log" != "x" ] ; then JADE_OPT="$JADE_OPT -f $log" fi date >> $log for f in $files; do case $format in --tex ) $jade $JADE_OPT -t tex -d $DSLprint $f ;; --pdf ) pdfjadetex $f.tex >> $log if [ "x$target" != "x" ]; then mv $f.pdf $target fi ;; --ps ) jadetex $f.tex >> $log jadetex $f.tex >> $log jadetex $f.tex >> $log echo "$target" if [ "x$target" = "x" ]; then target="$f.ps" fi dvips -o $target $f.dvi >> $log ;; --html ) $jade $JADE_OPT -t sgml -d $DSLhtml $f.sgml ;; --rtf) $jade $JADE_OPT -t rtf -d $DSLhtml $f.sgml ;; esac done ; gnade-1.6.2.orig/cfg/scripts-cygwin/gnade-config.in0000644000175000017500000000734410054200131021764 0ustar lbrentalbrenta#!/bin/sh ## @configure_input@ ## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/cfg/scripts-cygwin/gnade-config.in,v $ ## Description : Compile/Link Configuration Script ## Author : Michael Erdmann ## Created On : 9-April-2002 ## Last Modified By: $Author: merdmann $ ## Last Modified On: $Date: 2004/05/23 19:49:45 $ ## Status : $State: Exp $ ## ## Copyright (C) 2000-2003 Michael Erdmann -- ## -- ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Installation target directories ## libs=/usr/local/gnade/lib include=/usr/local/gnade/include ## ## Internal used definitions ## gnade_cflags="" gnade_libs="" usage() { cat <&2 fi while test $# -gt 0; do case "$1" in -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac case $1 in --version) echo "GNADE @version@" ;; --cflags) echo_cflags=yes ;; --libs) echo_libs=yes ;; *) usage 1 1>&2 ;; esac shift done if test "$echo_cflags" = "yes"; then echo -I$include -A$include fi if test "$echo_libs" = "yes"; then echo -largs -L$libs -lgnadeesql -lgnadeodbc -lgnadeaux @odbc_dmlib@ fi gnade-1.6.2.orig/cfg/scripts-cygwin/gnadeinst.sh.in0000644000175000017500000002050210054200131022017 0ustar lbrentalbrenta#!/bin/sh ## @configure_input@ ## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/cfg/scripts-cygwin/gnadeinst.sh.in,v $ ## Description : Online installation procedure ## Author : Michael Erdmann ## Created On : 9-April-2002 -- ## Last Modified By: $Author: merdmann $ -- ## Last Modified On: $Date: 2004/05/23 19:49:45 $ -- ## Status : $State: Exp $ -- ## -- ## Copyright (C) 2000-2004 -- ## -- ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- . @prefix@/bin/gnade-vars.sh ## ## Internall used definitions ## opt_force="n" root="" ## ## ## RC="0"; ## ## Install a shared library ## sharedlib() { l=$1.so.$GNADE_MAJOR rm -f $libs/$l.$GNADE_MINOR $libs/$l if test -e $gnadelib/$l.$GNADE_MINOR; then echo -n " $l ..." $instbin -p -m 0555 $gnadelib/$l.$GNADE_MINOR $libs if test "$?" = "0"; then ( cd $libs; ln -s $l.$GNADE_MINOR $l ) echo " done." else echo "** failed **"; RC="1" fi; else echo " $l not installed (not available)." fi } ## ## Install a static library ## staticlib() { if test -e $gnadelib/$1.a; then echo -n " $1.a ..." $instbin -p -m 0444 $gnadelib/$1.a $libs if test "$?" != "0"; then echo "** failed **" RC="1" else echo " done." fi fi } ## ## install a binary ## binary() { echo -n " $1 ..." $instbin -p -m 0555 $1 $bindir if test "$?" != "0"; then echo "** failed **" RC="1" fi echo } ## ## Scan the argument list for usable commands ## scanargs() { for i in $* ; do case "$1" in -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac case $i in -f|--force) opt_force="y" ;; *) ;; esac shift done } ## ## Install an optional component ## opt_install() { if test -e $1 ; then $instbin -p -m 0444 $1 $2 else echo "Component $1 not installed." fi } ## ## ## echo echo "GNADE $version, System wide installation procedure." echo "Copyright (C) 2002-2004, M.Erdmann http://gnade.sourceforge.net/" echo scanargs $* uid=`id -u` case $build_os in cygwin*) ;; *) if test "$uid" != "0" ; then echo "ERROR:" echo "Sorry, but you are logged in as user `id -u -n`. You need to " echo "login as system administrator to complete the installation" echo "properly." echo exit 255 fi ;; esac ## ## If the force option is not set, the user is asked for confirmation ## echo "This procedure will install the GNADE software on your system" echo "globaly available in the directories:" echo " $adalibs " echo " $libs" echo " $bindir" echo if test $opt_force = "n" then echo -n "Do you want to continue y/n?" read a case $a in n|N|no|No|NO) echo "Installation aborted, nothing changed" exit 0 ;; *) echo ;; esac; fi host=`hostname` echo "Installing GNADE $version on $host" ## ## Install the directories and the gnat units ## if test -z "$libs"; then echo echo "ERROR: There is a configuration error. The destination directory" echo " of the gnade libraries have not been defined. Please check " echo " the contents of etc/config.site." echo exit $RC fi; echo -n "Installing GNADE units ..." $instbin -d $adalibs $instbin -p -m 0444 $gnadeinclude/*.ad[bs] $adalibs ##$instbin -p -m 0444 $gnadelib/*.o $adalibs $instbin -p -m 0444 $gnadeinclude/*.ali $adalibs echo " done." echo #### echo -n "Installing GNADE shared files ..." $instbin -d $adashared for i in $gnadeshared/* ; do if test -e $i ; then $instbin -p -m 0444 $i $adashared fi done echo " done." echo #### #### echo "Installing GNADE tools in $bindir" $instbin -d $bindir for i in $gnadebin/* ; do binary $i done echo "Installing gnade-config into $bindir" $instbin -p -m 0555 $gnadetools/gnade-config $bindir ## ## Install a static library ## echo echo "Installing GNADE core libraries in $libs" $instbin -d $libs staticlib libgnadeodbc staticlib libgnadeadbc staticlib libgnadeaux staticlib libgnadeesql staticlib libgnadesqlite sharedlib libgnadeodbc sharedlib libgnadeaux sharedlib libgnadeesql sharedlib libgnadeadbc sharedlib libgnadesqlite ## ## Install the dynamic libraries ## echo echo "Installing native bindings in $libs" for i in $gnadenatives ; do case $i in mysql) sharedlib libgnademysql staticlib libgnademysql ;; oracle|oci) sharedlib libgnadeoci staticlib libgnadeoci ;; postgres) sharedlib libgnadepostgresql staticlib libgnadepostgresql ;; *) ;; esac done ## ## Install the documentation ## echo -n "Installing documentation into $docdir ..." $instbin -d $docdir for i in $gnadedoc/html/* ; do if test -e $i ; then $instbin -p -m 0444 $i $docdir fi done echo " done." opt_install $gnadedoc/gnade.ps $docdir opt_install $gnadedoc/gnade.pdf $docdir opt_install $gnadedoc/gps_index.xml $docdir echo ## ## Installation of the shared resources ## if test -s $gnadeshared ; then echo -n "Installing shared resources into $adashared ..." $instbin -d $adashared $instbin -p -m 0444 $gnadeshared/* $adashared echo " done." echo fi echo -n "Installing environment init scripts into $etcdir/profile.d" $instbin -d $etcdir/profile.d $instbin -p -m 0555 $gnadeetcdir/profile.d/gnade.* $etcdir/profile.d echo " done." echo ## ## Install the pkg configuration ## if test -n "$pkgconfig" ; then $instbin -p -m 0444 pkg-config/gnade.pc $site_pkgconfig_path $pkgconfig gnade fi ## ## ## echo if test "$RC" = "0" ; then echo "Successfully completed." else echo "ERROR: Installation failed, the installation is incomplete." fi echo exit $RC gnade-1.6.2.orig/cfg/scripts-cygwin/sharedlib.sh.in0000644000175000017500000000630710054200131022007 0ustar lbrentalbrenta#!/bin/sh ## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/cfg/scripts-cygwin/sharedlib.sh.in,v $ ## Description : build and install shared libs in the system -- ## Author : Michael Erdmann -- ## Created On : 9-April-2002 -- ## Last Modified By: $Author: merdmann $ -- ## Last Modified On: $Date: 2004/05/23 19:49:45 $ -- ## Status : $State: Exp $ -- ## -- ## Copyright (C) 2000-2004 -- ## -- ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- echo "** Shared lib not supported for cygwin **" gnade-1.6.2.orig/cfg/scripts-cygwin/srcinst.sh.in0000644000175000017500000000014710054200131021533 0ustar lbrentalbrenta#!/bin/sh target=$1 shift for i in $* ; do echo "Copying $i" install --mode=0444 $i $target done gnade-1.6.2.orig/cfg/scripts-cygwin/srcuinst.sh.in0000644000175000017500000000021710056641622021736 0ustar lbrentalbrenta#!/bin/sh target=$1 shift for i in $* ; do if test -e $target/$i ; then chmod 0777 $target/$i rm $target/$i fi done exit $? gnade-1.6.2.orig/cfg/scripts-cygwin/staticlib.sh.in0000644000175000017500000000004710054200131022023 0ustar lbrentalbrenta#!/bin/sh ar cr $1/$2 *.o ranlib $1/$2 gnade-1.6.2.orig/cfg/scripts-gnu/0000755000175000017500000000000011040716276016416 5ustar lbrentalbrentagnade-1.6.2.orig/cfg/scripts-gnu/Makefile0000644000175000017500000001052410210417435020051 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/cfg/scripts-gnu/Makefile,v $ ## Description : Makefile for the shell code -- ## Author : Michael Erdmann -- ## Created On : 9.4.2002 -- ## Last Modified By: $Author: merdmann $ -- ## Last Modified On: $Date: 2005/02/27 19:27:25 $ -- ## Version : $Revision: 1.8 $ ## Status : $State: Exp $ ## -- ## Copyright (C) 2000-2004 -- ## -- ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## This package is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## Contact -- ## ======= -- ## Error reports shall be handled via http://gnade.sourceforge.net -- ## Features and ideas via: gnade-develop@lists.sourceforge.net -- ## -- ## Author contact: -- ## purl:/net/michael.erdmann -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## This makefile build the example code for the GNU ADO Interface. ## ## Restrictions ## ============ ## None ## ## References ## ========== ## None ## ## ## .PHONY: gnade-config clean distclean all install sinclude ../../make.conf scripts=$(wildcard *.in) targets=$(subst .in,,$(scripts)) ## ## install the scripts ## all install: $(targets) $(targets): $(scripts) $(PREP) -s -f ../../make.conf $@.in $(tooldir)/$@ ## for i in $(targets) ; do \ ## $(PREP) -s -f ../../make.conf $$i.in $$i ; \ ## $(INSTALL) --mode=0555 $$i $(tooldir)/$$i ; \ ## done ## ## ## clean:: $(RM) b~* *~ *~*~ *.bak ## ## ## distclean:: clean $(RM) $(targets) $(foreach i, $(targets), $(tooldir)/$(i) ) gnade-1.6.2.orig/cfg/scripts-gnu/docbuild.sh.in0000644000175000017500000001150210040546312021132 0ustar lbrentalbrenta#!/bin/sh ## ---------------------------------------------------------------------------- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/cfg/scripts-gnu/docbuild.sh.in,v $ ## Description : build a docbook document on a redhat/suse system -- ## Author : Michael Erdmann ## Created On : 27-Dec-2002 ## Last Modified By: $Author: merdmann $ ## Last Modified On: $Date: 2004/04/18 18:45:30 $ ## Status : $State: Exp $ ## ## Copyright (C) 2000-2002 Michael Erdmann -- ## -- ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## ---------------------------------------------------------------------------- . @prefix@/bin/gnade-vars.sh CATALOG="CATALOG.docbook_4 CATALOG.jade_dsl CATALOG.docbk30" if [ -e /etc/redhat-release ] ; then styles=/usr/lib/sgml/stylesheets else styles=/usr/share/sgml/docbook/dsssl-stylesheets/ fi DSLhtml=$styles/html/docbook.dsl DSLprint=$styles/print/docbook.dsl JADE_OPT="-D /usr/share/sgml -w all " for c in $CATALOG ; do JADE_OPT="$JADE_OPT -c $c" done target="" format="pdf" log="/dev/null" ## ## Scan the arguments of the doc builder ## for i in $* ;do case "$1" in -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac case $1 in --target=*) target=$optarg ;; --tex|--pdf|--ps|--html) format=$1 ;; --log=*) log=$optarg ;; -help|--help|-h) echo "docbuild.sh option(s) file(s)]" echo echo "options:" echo " --tex Create an tex result file" echo " --help this message" echo " --target the resultfile(s)" echo echo "The following formats may be given, provided, that in the " echo "previous run, the tex file has been generated. Please note " echo "that only one format is possbile per command invokation." echo echo " --pdf Adobe PDF format" echo " --ps Postscript format" echo " --html HTML format" echo exit 0 ;; *) files="$files $1" ;; esac shift; done if [ "x$target" != "x" ] ; then JADE_OPT="$JADE_OPT -o $target" fi if [ "x$log" != "x" ] ; then JADE_OPT="$JADE_OPT -f $log" fi date >> $log for f in $files; do case $format in --tex ) $jade $JADE_OPT -t tex -d $DSLprint $f ;; --pdf ) pdfjadetex $f.tex >> $log if [ "x$target" != "x" ]; then mv $f.pdf $target fi ;; --ps ) jadetex $f.tex >> $log jadetex $f.tex >> $log jadetex $f.tex >> $log echo "$target" if [ "x$target" = "x" ]; then target="$f.ps" fi dvips -o $target $f.dvi >> $log ;; --html ) $jade $JADE_OPT -t sgml -d $DSLhtml $f.sgml ;; --rtf) $jade $JADE_OPT -t rtf -d $DSLhtml $f.sgml ;; esac done ; gnade-1.6.2.orig/cfg/scripts-gnu/gnade-config.in0000644000175000017500000000730010210417435021260 0ustar lbrentalbrenta#!/bin/sh ## @configure_input@ ## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/cfg/scripts-gnu/gnade-config.in,v $ ## Description : Compile/Link Configuration Script ## Author : Michael Erdmann ## Created On : 9-April-2002 ## Last Modified By: $Author: merdmann $ ## Last Modified On: $Date: 2005/02/27 19:27:25 $ ## Status : $State: Exp $ ## ## Copyright (C) 2000-2003 Michael Erdmann -- ## -- ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Installation target directories ## libs=/usr/local/gnade/lib include=/usr/local/gnade/include ## ## Internal used definitions ## gnade_cflags="" gnade_libs="" usage() { cat <&2 fi while test $# -gt 0; do case "$1" in -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac case $1 in --version) echo "GNADE @version@" ;; --cflags) echo_cflags=yes ;; --libs) echo_libs=yes ;; *) usage 1 1>&2 ;; esac shift done if test "$echo_cflags" = "yes"; then echo -I$include -A$include fi if test "$echo_libs" = "yes"; then echo -largs -L$libs @GNADE_LIBS@ fi gnade-1.6.2.orig/cfg/scripts-gnu/gnadeinst.sh.in0000644000175000017500000002223010544005112021316 0ustar lbrentalbrenta#!/bin/sh ## @configure_input@ ## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/cfg/scripts-gnu/gnadeinst.sh.in,v $ ## Description : Online installation procedure ## Author : Michael Erdmann ## Created On : 9-April-2002 -- ## Last Modified By: $Author: merdmann $ -- ## Last Modified On: $Date: 2006/12/25 17:28:42 $ -- ## Status : $State: Exp $ -- ## -- ## Copyright (C) 2000-2004 -- ## -- ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- . @prefix@/bin/gnade-vars.sh ## ## Internally used definitions ## opt_force="n" root="" ## ## ## RC="0"; ## ## Install a shared library ## sharedlib() { l=$1.so.$GNADE_MAJOR rm -f $libs/$l.$GNADE_MINOR $libs/$l if test -e $gnadelib/$l.$GNADE_MINOR; then echo -n " $l ..." $instbin -p -m 0555 $gnadelib/$l.$GNADE_MINOR $libs if test "$?" = "0"; then ( cd $libs; ln -s $l.$GNADE_MINOR $l ) echo " done." else echo "** failed **"; RC="1" fi; else echo " $l not installed (not available)." fi } ## ## Install a static library ## staticlib() { if test -e $gnadelib/$1.a; then echo -n " $1.a ..." $instbin -p -m 0444 $gnadelib/$1.a $libs if test "$?" != "0"; then echo "** failed **" RC="1" else echo " done." fi fi } ## ## install a binary ## binary() { echo -n " $1 ..." $instbin -p -m 0555 $1 $bindir if test "$?" != "0"; then echo "** failed **" RC="1" fi echo } ## ## Scan the argument list for usable commands ## scanargs() { for i in $* ; do case "$1" in -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac case $i in -f|--force) opt_force="y" ;; *) ;; esac shift done } ## ## Install an optional component ## opt_install() { if test -e $1 ; then $instbin -p -m 0444 $1 $2 else echo "Component $1 not installed." fi } ## ## Check the path name by going up in the tree until the path is valid ## and check if it is allowed to rwx into this directory. ## checkdir() { path=$1 while test ! -d $path ; do path=`dirname $path` done; test -w $path && test -r $path && test -x $path } ############################################################################## ## M A I N E N T R Y P O I N T ## ############################################################################## echo echo "GNADE $version, System wide installation procedure." echo "Copyright (C) 2002-2004, M.Erdmann http://gnade.sourceforge.net/" echo scanargs $* uid=`id -u` case $build_os in cygwin*) ;; *) echo "Checking access rights for installation directories:" non_writable="" for d in @prefix@ $adalibs $libs $bindir ; do echo -n " $d .." if checkdir $d ; then echo ".. okay" uid=0 else echo "non writable" non_writable="$non_writable $d"; fi; done; echo if test "x$non_writable" != "x" ; then echo "The directoryies" echo " $non_writable" echo echo "are not writable for `id -u -n`. Either use the system adminstration account" echo "or correct this!" echo exit 255 fi ;; esac ## ## If the force option is not set, the user is asked for confirmation ## echo "This procedure will install the GNADE software on your system" echo "globaly available in the directories:" echo " $adalibs " echo " $libs" echo " $bindir" echo if test $opt_force = "n" then echo -n "Do you want to continue y/n?" read a case $a in n|N|no|No|NO) echo "Installation aborted, nothing changed" exit 0 ;; *) echo ;; esac; fi host=`hostname` echo "Installing GNADE $version on $host" ## ## Install the directories and the gnat units ## if test -z "$libs"; then echo echo "ERROR: There is a configuration error. The destination directory" echo " of the gnade libraries have not been defined. Please check " echo " the contents of etc/config.site." echo exit $RC fi; echo -n "Installing GNADE units ..." $instbin -d $adalibs $instbin -p -m 0444 $gnadeinclude/*.ad[bs] $adalibs ##$instbin -p -m 0444 $gnadelib/*.o $adalibs $instbin -p -m 0444 $gnadeinclude/*.ali $adalibs echo " done." echo #### echo -n "Installing GNADE shared files ..." $instbin -d $adashared for i in $gnadeshared/* ; do if test -e $i ; then $instbin -p -m 0444 $i $adashared fi done echo " done." echo #### #### echo "Installing GNADE tools in $bindir" $instbin -d $bindir for i in $gnadebin/* ; do binary $i done echo "Installing gnade-config into $bindir" $instbin -p -m 0555 $gnadetools/gnade-config $bindir ## ## Install a static library ## echo echo "Installing GNADE core libraries in $libs" $instbin -d $libs staticlib libgnadeodbc staticlib libgnadeadbc staticlib libgnadeaux staticlib libgnadeesql staticlib libgnadesqlite sharedlib libgnadeodbc sharedlib libgnadeaux sharedlib libgnadeesql sharedlib libgnadeadbc sharedlib libgnadesqlite ## ## Install the dynamic libraries ## echo echo "Installing native bindings in $libs" for i in $gnadenatives ; do case $i in mysql) sharedlib libgnademysql staticlib libgnademysql ;; oracle|oci) sharedlib libgnadeoci staticlib libgnadeoci ;; postgres) sharedlib libgnadepostgresql staticlib libgnadepostgresql ;; *) ;; esac done ## ## Install the documentation ## echo -n "Installing documentation into $docdir ..." $instbin -d $docdir for i in $gnadedoc/html/* ; do if test -e $i ; then $instbin -p -m 0444 $i $docdir fi done echo " done." opt_install $gnadedoc/gnade.ps $docdir opt_install $gnadedoc/gnade.pdf $docdir opt_install $gnadedoc/gps_index.xml $docdir echo ## ## Installation of the shared resources ## if test -s $gnadeshared ; then echo -n "Installing shared resources into $adashared ..." $instbin -d $adashared $instbin -p -m 0444 $gnadeshared/* $adashared echo " done." echo fi echo -n "Installing environment init scripts into $etcdir/profile.d" $instbin -d $etcdir/profile.d $instbin -p -m 0555 $gnadeetcdir/profile.d/gnade.* $etcdir/profile.d echo " done." echo ## ## Install the pkg configuration ## if test -n "$pkgconfig" ; then $instbin -p -m 0444 pkg-config/gnade.pc $site_pkgconfig_path $pkgconfig gnade fi ## ## ## echo if test "$RC" = "0" ; then echo "Successfully completed." else echo "ERROR: Installation failed, the installation is incomplete." fi echo exit $RC gnade-1.6.2.orig/cfg/scripts-gnu/sharedlib.sh.in0000644000175000017500000001043710056565220021316 0ustar lbrentalbrenta#!/bin/sh ## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/cfg/scripts-gnu/sharedlib.sh.in,v $ ## Description : build and install shared libs in the system -- ## Author : Michael Erdmann -- ## Created On : 9-April-2002 -- ## Last Modified By: $Author: merdmann $ -- ## Last Modified On: $Date: 2004/05/31 08:19:28 $ -- ## Status : $State: Exp $ -- ## -- ## Copyright (C) 2000-2004 -- ## -- ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- opt_clean="n" srcdir="" libname="" libdir="" MAJOR="" MINOR="" ## ## ## usage() { cat < Description: Creates a shred library with all object which are stored in the $libdir directory. EOF exit $1 } ## ## Create a shared library and ## makeshared() { target=$libdir/$1.$MAJOR case `uname` in Darwin* | darwin ) ( cd $libdir; libtool -dynamic $srcdir/*.o -o $target -L/usr/lib/ada -lgnat /usr/lib/libiodbc.dylib /Library/MySQL/lib/mysql/libmysqlclient.dylib -noall_load -lsystem -lgcc ) ;; *) ( cd $libdir; gcc -shared -o $target $srcdir/*.o ) ;; esac ( cd $libdir && ln -sf $target $target.$MINOR ) ( cd $libdir && chmod 0555 $target $target.$MINOR ) } ## ########################################## ## ## Main Entry ## ## ########################################## ## if test $# -eq 0; then usage 1 1>&2 exit 1; fi ## ## Scan the arguments ## srcdir=`pwd` libdir=$1 shift MINOR=$1 shift MAJOR=$1 shift makeshared $1 ## exit $? ## ################## ## ## # E X I T # ## ## ################## ## gnade-1.6.2.orig/cfg/scripts-gnu/srcinst.sh.in0000644000175000017500000000040610056565220021041 0ustar lbrentalbrenta#!/bin/sh # $Id: srcinst.sh.in,v 1.2 2004/05/31 08:19:28 merdmann Exp $ target=$1 shift for i in $* ; do if test -e $i ; then echo "Copying $i" install --mode=0444 $i $target else echo "$i not exisiting" exit 1 fi done exit $? gnade-1.6.2.orig/cfg/scripts-gnu/srcuinst.sh.in0000644000175000017500000000572610056565220021240 0ustar lbrentalbrenta#!/bin/sh ## ---------------------------------------------------------------------------- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/cfg/scripts-gnu/srcuinst.sh.in,v $ ## Description : uninstall surce code from the include directory -- ## Author : Michael Erdmann -- ## Created On : 9-April-2002 -- ## Last Modified By: $Author: merdmann $ -- ## Last Modified On: $Date: 2004/05/31 08:19:28 $ -- ## Status : $State: Exp $ -- ## -- ## Copyright (C) 2000-2004 -- ## -- ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## ---------------------------------------------------------------------------- target=$1 shift for i in $* ; do if test -e $target/$i ; then chmod 0777 $target/$i rm $target/$i fi done exit $? gnade-1.6.2.orig/cfg/scripts-gnu/staticlib.sh.in0000644000175000017500000000006010056565220021326 0ustar lbrentalbrenta#!/bin/sh ar cr $1/$2 *.o ranlib $1/$2 exit $? gnade-1.6.2.orig/cfg/scripts-win32/0000755000175000017500000000000011040716254016563 5ustar lbrentalbrentagnade-1.6.2.orig/cfg/scripts-win32/Makefile0000644000175000017500000001043110056400105020211 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/cfg/scripts-win32/Makefile,v $ ## Description : Build the windoes 32 specific scripts -- ## Author : Michael Erdmann -- ## Created On : 9.4.2002 -- ## Last Modified By: $Author: merdmann $ -- ## Last Modified On: $Date: 2004/05/30 15:39:49 $ -- ## Version : $Revision: 1.4 $ ## Status : $State: Exp $ ## -- ## Copyright (C) 2000-2004 -- ## -- ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## This package is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## Contact -- ## ======= -- ## Error reports shall be handled via http://gnade.sourceforge.net -- ## Features and ideas via: gnade-develop@lists.sourceforge.net -- ## -- ## Author contact: -- ## purl:/net/michael.erdmann -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## This makefile build the example code for the GNU ADO Interface. ## ## Restrictions ## ============ ## None ## ## References ## ========== ## None ## ## ## .PHONY: sinclude ../../make.conf scripts=$(wildcard *.in) targets=$(subst .in,,$(scripts)) ## translate root ifneq ($(PATHSEP),/) root=$(subst /,\,$(prefix)) else root=$(prefix) endif ## ## install the scripts ## all install: echo $(root) for %%i in ( $(targets) ) do ..\\prep -s ROOT=$(root) %%i.in $(tooldir)\%%i ## ## local clean ## clean:: $(RM) b~* *~ *~*~ *.bak $(targets) ## ## global clean ## distclean:: clean $(RM) $(foreach i, $(targets), $(tooldir)/$(i) ) gnade-1.6.2.orig/cfg/scripts-win32/sharedlib.bat.in0000644000175000017500000000013210040261572021606 0ustar lbrentalbrentaecho off rem %1 - Path to the libriries rem %2 - Major rem %3 - Minor rem %4 - Lists gnade-1.6.2.orig/cfg/scripts-win32/srcinst.bat.in0000644000175000017500000000014710040261572021344 0ustar lbrentalbrentaecho off for %%i in ( %* ) do replace/a/R %%i @ROOT@\win32-include attrib +r @ROOT@\win32-include\* gnade-1.6.2.orig/cfg/scripts-win32/srcuinst.bat.in0000644000175000017500000000004410056410456021531 0ustar lbrentalbrentafor %%i in ( %* ) do del /Q %1\%%i gnade-1.6.2.orig/cfg/scripts-win32/staticlib.bat.in0000644000175000017500000000005110040261572021627 0ustar lbrentalbrentaecho off ar cr %1/%2 *.o ranlib %1/%2 gnade-1.6.2.orig/contrib/0000755000175000017500000000000011040716254015035 5ustar lbrentalbrentagnade-1.6.2.orig/contrib/Makefile0000644000175000017500000000622707500666113016510 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/contrib/Makefile,v $ ## Description : Top level makefile for all contrib code ## Author : Michael Erdmann ## Created On : 03-Jan-2001 ## Last Modified By: $Author: merdmann $ ## Last Modified On: $Date: 2002/06/09 14:55:07 $ ## Status : $State: Exp $ ## ## Copyright (C) 2000-2001 ## ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## ## This makefile visits all subdirectories of contributed code, which is ## part of the standard installation. ## ## Restrictions ## ============ ## ## References ## ========== ## include ../make.conf # all clean distclean install :: for f in `cat packages` ; do (cd $$f && $(MAKE) $@) ; done clean:: rm -rf *~ distclean:: clean rm -rf *.gz *.zip gnade-1.6.2.orig/contrib/README0000644000175000017500000000100307342235570015716 0ustar lbrentalbrentaThis directory contains all contributions. Contribution code is code which is not sample code. test_n - Some test code provided by Sune Falk test_a wisconsin - Winsconsin benchmark gsql - A SQL plus like client. Requieres florist and gtkada. NOTE: The makefiles for the contrib code are build to work on the installed distribution only. I may be nessesary to adopt the makefiles to your installation. Normaly it should be suffcient to change the LIBINSTALL variable within the makefile. gnade-1.6.2.orig/contrib/packages0000644000175000017500000000000507500666113016535 0ustar lbrentalbrentagsql gnade-1.6.2.orig/contrib/bank/0000755000175000017500000000000011040716254015750 5ustar lbrentalbrentagnade-1.6.2.orig/contrib/bank/Makefile0000644000175000017500000001057207362362766017436 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/contrib/bank/Makefile,v $ ## Description : Makefile for the embedded SQL samples ## Author : Juergen Pfeifer ## Created On : 03-Jan-2001 ## Last Modified By: $Author: me $ ## Last Modified On: $Date: 2001/10/14 19:22:30 $ ## Status : $State: Exp $ ## ## Copyright (C) 2000-2001 ## ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## This makefile builds the sample programs for embedded SQL. ## ## Restrictions ## ============ ## None ## ## References ## ========== ## None ## sinclude ../conf.local sinclude ../../make.conf # ESQLFLAGS = -v -s -pedantic $(FLAGS) # use always the local esql translator ESQL=$(bindir)/$(esql) # all exported executable PROGRAMS=bank # ------------------------------------------------------------------------- # # C O M P I L E R R U L E S # # ------------------------------------------------------------------------- # .SUFFIXES: .adb .adq .adq_p # run the ebedded sql translator .adq.adb: $(ESQL) $(ESQLFLAGS) $*.adq # add the connection information dep. on the configured data base .adq_p.adq: $(ADAPREP) -DDBUSER=\"$(DBUSER)\" \ -DDBPASSWD=\"$(DBPASSWD)\" \ -DDBSOURCE=\"$(DBSOURCE)\" \ $*.adq_p $*.adq # ------------------------------------------------------------------------- # # E X E C U T A B L E S # # ------------------------------------------------------------------------- # all :: $(PROGRAMS) #bank.adq: bank.adq_p bank: bank.adb $(ADAMAKE) -o bank $(ADAFLAGS) bank.adb -cargs $(CFLAGS) \ $(APP_BIND_FLAGS) $(APP_LINK_FLAGS) -largs # ------------------------------------------------------------------------- # # C L E A N T H E D I R E C T O R Y # # ------------------------------------------------------------------------- # clean: rm -rf $(PROGRAMS) b~*.* *.o *~ *.ali core bank.adb distclean :: clean gnade-1.6.2.orig/contrib/bank/bank.adq0000644000175000017500000000617707362362766017406 0ustar lbrentalbrentawith Ada.Text_Io; use Ada.Text_Io; with Sql_Standard; use Sql_Standard; with Ada.Strings.Fixed; use Ada.Strings.Fixed; with Ada.Strings; use Ada.Strings; with Sql_Standard; use Sql_Standard; with Ada.Exceptions; use Ada.Exceptions; with Ada.Characters.Latin_1; use Ada.Characters; -- Bank account as an exemple of Embedded SQL in Ada -- including Queries and DML procedure Bank is package Io is new Ada.Text_Io.Integer_Io (Integer); use Io; -- declare host and program variables Exec Sql declare DB01 Database ; User : constant String := "SYSTEM"; Sql_Error : exception; procedure Print_Table is Exec Sql begin declare Section end-Exec Account_Name : Char (1..21); Amount : Sql_Standard.Real; Exec Sql end declare Section end-Exec begin Exec Sql at DB01 declare Bank_Curs Local Cursor for select * From Bank; Exec Sql AT DB01 Open Bank_Curs; Put ("Status :"); Put (integer(SQLCA.SQLCODE)); Put_line (" Select * from Bank"); New_line; Put_Line("Account Name | Amount "); Fetch_Loop: loop Exec Sql AT DB01 Fetch From Bank_Curs Into :Account_Name, :Amount; exit when SQLCODE in SQL_STANDARD.NOT_FOUND; Put(To_String (Account_Name) & " " ); Put(Integer(Amount)); New_line; end loop Fetch_Loop; Put("Rows fetched: "); Put(Sqlca.Affected_Rows, Width => 3); New_Line; Exec Sql AT DB01 Close Bank_Curs; end; begin Exec Sql Whenever Sqlerror raise Sql_Error; -- Logon as USER Exec Sql Connect "gnade" Identified By "gnade" By DB01 To "gnade"; -- Creation of the table BANK. begin Exec Sql at DB01 Drop table Bank; -- Catch the exception when Bank is unknown exception when Sql_Error => null; end; Put ("Status :"); Put (integer(SQLCA.SQLCODE)); Put_line (" Drop table Bank"); Exec Sql at DB01 Create table Bank (Account_Name Char(20), Amount Decimal (8,0)); Put ("Status :"); Put (integer(SQLCA.SQLCODE)); Put_line (" Create table Bank"); Exec Sql at DB01 Commit; Print_table; Exec Sql at DB01 insert into Bank values ('Barth', 100); Exec Sql at DB01 insert into Bank values ('Monty', 700); Exec Sql at DB01 insert into Bank values ('Bob', 500); Exec Sql at DB01 insert into Bank values ('Bill', 2000); Exec Sql at DB01 insert into Bank values ('Larry', 50); Print_table; Exec Sql at DB01 update Bank set Amount = 200 where Account_name = 'Bob'; Print_table; Exec Sql at DB01 delete from Bank where Amount > 250; Print_table; Exec Sql at DB01 commit; exception Exec Sql Whenever SqlError Continue; when Sql_Error => Put(Trim( Sqlca.Message, Right )); end; gnade-1.6.2.orig/contrib/cgi/0000755000175000017500000000000011040716254015577 5ustar lbrentalbrentagnade-1.6.2.orig/contrib/cgi/Makefile0000644000175000017500000001060207444734276017257 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/contrib/cgi/Makefile,v $ ## Description : Makefile for GNADE applications ## Author : Michael Erdmann ## Created On : 03-Jan-2001 ## Last Modified By: $Author: merdmann $ ## Last Modified On: $Date: 2002/03/16 21:27:26 $ ## Status : $State: Exp $ ## ## Copyright (C) 2000-2001 ## ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## This makefile builds the sample programs for embedded SQL. ## ## Restrictions ## ============ ## None ## ## References ## ========== ## None ## sinclude ../conf.local sinclude ../../make.conf # ESQLFLAGS = -v -s -pedantic $(FLAGS) # use always the local esql translator ESQL=$(bindir)/$(esql) # all exported executable PROGRAMS=bank # ------------------------------------------------------------------------- # # C O M P I L E R R U L E S # # ------------------------------------------------------------------------- # .SUFFIXES: .adb .adq .adq_p # run the ebedded sql translator .adq.adb: $(ESQL) $(ESQLFLAGS) $*.adq # add the connection information dep. on the configured data base .adq_p.adq: $(ADAPREP) -DDBUSER=\"$(DBUSER)\" \ -DDBPASSWD=\"$(DBPASSWD)\" \ -DDBSOURCE=\"$(DBSOURCE)\" \ $*.adq_p $*.adq # ------------------------------------------------------------------------- # # E X E C U T A B L E S # # ------------------------------------------------------------------------- # all :: $(PROGRAMS) #bank.adq: bank.adq_p bank: bank.adb $(ADAMAKE) -o bank $(ADAFLAGS) bank.adb -cargs $(CFLAGS) \ $(APP_BIND_FLAGS) $(APP_LINK_FLAGS) -largs # ------------------------------------------------------------------------- # # C L E A N T H E D I R E C T O R Y # # ------------------------------------------------------------------------- # clean: rm -rf $(PROGRAMS) b~*.* *.o *~ *.ali core bank.adb bb.out distclean :: clean gnade-1.6.2.orig/contrib/cgi/README0000644000175000017500000000073507444734276016505 0ustar lbrentalbrentaNotice of use : This program requires the AdaCGI binding from D. Wheeler that can be found at : http://www.dwheeler.com/adacgi. The execution of the program requires a Webserver such as Apache Steps to perform : - Translate this file of embedded SQL by : gesql bank.adq - Compile/bind/link - Put bank.exe into the ../cgi-bin directory of the Web server - Launch the Webserver - Call http://localhost/cgi-bin/bank from your browser gnade-1.6.2.orig/contrib/cgi/bank.adq0000644000175000017500000001751707445145345017227 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/cgi/bank.adq,v $ -- Description : Bank CGI demonstration -- -- Author : Francois Fabien -- -- Created : 15.3.2002 -- -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2002/03/17 16:57:09 $ -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2002 Francois Fabien -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Francois Fabien -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- -- -- This program requires the AdaCGI binding from D. Wheeler that can be -- -- found at : http://www.dwheeler.com/adacgi. -- -- The execution of the program requires a Webserver such as Apache -- -- Steps to perform : -- -- Translate this file of embedded SQL by : gesql bank.adq -- -- Compile/bind/link -- -- Put bank.exe into the ../cgi-bin directory of the Web server -- -- Ensure that all odbc config files are available there as well. -- -- Launch the Webserver -- -- Call http://localhost/cgi-bin/bank from your browser -- ------------------------------------------------------------------------------- with Ada.Text_Io; use Ada.Text_Io; with Sql_Standard; use Sql_Standard; with Ada.Strings.Fixed; use Ada.Strings.Fixed; with Ada.Strings; use Ada.Strings; with Sql_Standard; use Sql_Standard; with Ada.Exceptions; use Ada.Exceptions; with Ada.Characters.Latin_1; use Ada.Characters; with CGI; use CGI; -- Bank account as an exemple of Embedded SQL in Ada -- including Queries and DML procedure Bank is package Io is new Ada.Text_Io.Integer_Io (Integer); use Io; -- declare host and program variables Exec Sql declare DB01 Database ; User : constant String := "gnade"; Sql_Error : exception; procedure Print_Table is Exec Sql begin declare Section end-Exec Account_Name : Char (1..21); Amount : Sql_Standard.Real; Exec Sql end declare Section end-Exec begin Exec Sql at DB01 declare Bank_Curs LOCAL CURSOR for select * From Bank; Exec Sql AT DB01 Open Bank_Curs; New_line; Put ("

Query :=Select * from Bank | Status :"); Put (integer(SQLCA.SQLCODE)); Put_line ("

"); New_line; Put_Line (""); Put_Line (""); Put_Line (""); Put_Line (""); Put_Line (""); Fetch_Loop: loop declare Allfetched : exception; -- Turn on the automatic exception generation. Exec Sql Whenever not Found raise Allfetched; begin Exec Sql AT DB01 Fetch From Bank_Curs Into :Account_Name, :Amount; Put(""); Put("" ); Put(""); exception when Allfetched => Put_Line ("
Account NameAmount
" & To_String (Account_Name) & ""); Put(Integer(Amount)); Put_line("
"); Put("

Rows fetched: "); Put(Sqlca.Affected_Rows, Width => 3); Put_Line ("

"); New_Line; exit; end; end loop Fetch_Loop; Exec Sql AT DB01 Close Bank_Curs; end; begin Exec Sql Whenever Sqlerror raise Sql_Error; Put_CGI_Header; Put_HTML_Head("Demonstration of Ada 95 Binding to ODBC"); Put_HTML_Heading("GNADE Demonstration Program", 1); Put_Line("

This page demonstrates the use of Ada 95 binding to ODBC.

"); -- Logon as USER Exec Sql Connect User Identified By "gnade" By DB01 To "DEMO_DB"; Put_Line("

User " & User & " successfully connected to DEMO_DB

"); -- Creation of the table BANK. begin Exec Sql at DB01 Drop table Bank; -- Catch the exception when Bank is unknown exception when Sql_Error => null; end; Put ("

Query :=Drop table Bank | Status :"); Put (integer(SQLCA.SQLCODE)); Put_line ("

"); Exec Sql at DB01 Create table Bank (Account_Name Char(20), Amount Decimal (8,0)); Put ("

Query :=Create table Bank | Status :"); Put (integer(SQLCA.SQLCODE)); Put_line ("

"); Print_table; Exec Sql at DB01 insert into Bank values ('Barth', 100); Exec Sql at DB01 insert into Bank values ('Monty', 700); Exec Sql at DB01 insert into Bank values ('Bob', 500); Exec Sql at DB01 insert into Bank values ('Bill', 2000); Exec Sql at DB01 insert into Bank values ('Larry', 50); Print_table; Exec Sql at DB01 update Bank set Amount = 200 where Account_name = 'Bob'; Print_table; Exec Sql at DB01 delete from Bank where Amount > 250; Print_table; Exec Sql at DB01 commit; exception Exec Sql Whenever SqlError Continue; when Sql_Error => Put(Trim( Sqlca.Message, Right )); end; gnade-1.6.2.orig/contrib/gsql/0000755000175000017500000000000011040716276016007 5ustar lbrentalbrentagnade-1.6.2.orig/contrib/gsql/import_export.ads0000644000175000017500000000610107402511114021400 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/import_export.ads,v $ -- Description : Implement the import/export features -- Author : Michael Erdmann -- Created : 8.8.2001 -- Last Modified By: $Author: me $ -- Last Modified On: $Date: 2001/12/02 20:42:52 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- -- -- Functional Description -- -- ====================== -- -- This package implements the export of a table into an external ASCII -- -- file. Each colon is seperated by a seperator charcter -- -- -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- package Import_Export is procedure Export( Table : in String; Name : in String ); procedure Import( Table : in String; Name : in String ); end Import_Export; gnade-1.6.2.orig/contrib/gsql/COPYING0000644000175000017500000003542707354160662017062 0ustar lbrentalbrenta GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS gnade-1.6.2.orig/contrib/gsql/MANIFEST0000644000175000017500000000215007502045235017134 0ustar lbrentalbrentaCOPYING MANIFEST Makefile README release_note.html contents_handler.adb contents_handler.ads contents_manager-gui.adb contents_manager-gui.ads contents_manager.adb contents_manager.ads config.gps datasource_handler.adb datasource_handler.ads environment.adb environment.ads files.adb files.ads gsql.adb gsql_types.adb gsql_types.ads gui.adb gui.ads gui_about.adb gui_about.ads gui_addrow.adb gui_addrow.ads gui_checkbutton.adb gui_checkbutton.ads gui_common.adb gui_common.ads gui_dialog.adb gui_dialog.ads gui_editor.adb gui_editor.ads gui_files.adb gui_files.ads gui_license.adb gui_license.ads gui_logging.adb gui_logging.ads gui_menu.adb gui_menu.ads gui_preferences.adb gui_preferences.ads gui_result.adb gui_result.ads gui_rowdefinition.ads gui_table.adb gui_table.ads gui_tools.adb gui_tools.ads gui_window.gps gui_window.adb gui_worksheet.adb gui_worksheet.ads import_export.adb import_export.ads odbc.adb odbc.ads preferences.ads procedure_handler.adb procedure_handler.ads project_file.adb project_file.ads query_handler.adb query_handler.ads table_handler.adb table_handler.ads test.xpm text_block.adb text_block.ads gnade-1.6.2.orig/contrib/gsql/Makefile0000644000175000017500000001272007755664546017475 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNat Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/Makefile,v $ ## Description : Makefile for the GSQL IDE ## Author : Michael Erdmann ## Created On : 08-Aug-2001 ## Last Modified By: $Author: merdmann $ ## Last Modified On: $Date: 2003/11/16 12:11:18 $ ## Status : $State: Exp $ ## ## Copyright (C) 2000-2001 ## ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## This makefile builds the sample programs for the thin ODBC binding. ## ## Restrictions ## ============ ## ## References ## ========== ## sinclude ../conf.local sinclude ../../make.conf VERS=0.8 DISTNAME=gsql-source-$(VERS) all:: icons gsql ## ## Build the GSQL Application ## gsql: gsql.adb \ gsql_types.ads gsql_types.adb \ odbc.adb odbc.ads \ gui.adb gui.ads \ gui_window.adb gui_window.ads \ gui_files.adb gui_files.ads \ gui_result.adb gui_result.ads \ gui_editor.adb gui_editor.ads \ gui_preferences.adb gui_preferences.ads \ gui_logging.adb gui_logging.ads \ gui_menu.adb gui_menu.ads \ gui_tools.ads gui_tools.adb \ gui_dialog.adb gui_dialog.ads \ gui_license.adb gui_license.ads \ gui_about.adb gui_about.ads \ gui_common.adb gui_common.ads \ gui_table.adb gui_table.ads \ gui_worksheet.ads gui_worksheet.adb \ gui_addrow.ads gui_addrow.adb \ gui_rowdefinition.ads \ gui_checkbutton.ads gui_checkbutton.adb \ contents_handler.ads \ contents_manager-gui.ads contents_manager-gui.adb \ contents_manager.adb contents_manager.ads \ query_handler.ads query_handler.adb \ table_handler.ads table_handler.adb \ procedure_handler.ads procedure_handler.adb \ datasource_handler.ads datasource_handler.adb \ project_file.ads project_file.adb \ files.adb files.ads \ text_block.ads text_block.adb \ environment.adb environment.ads \ preferences.ads \ config.ads \ import_export.adb import_export.ads gnatmake -g $(ADAFLAGS) gsql -cargs $(CFLAGS) \ `gtkada-config --cflags` \ $(APP_BIND_FLAGS) $(APP_LINK_FLAGS) \ -L/usr/lib/ada/GtkAda-1.2/lib `gtkada-config --libs` \ -largs -lodbc cp gsql $(bindir) ## ## Provide the icons for installation ## icons: cp *.xpm $(SHARED) ## ## Insert the version number into the window gui ## gui_window.ads: gui_window.gps $(ADAPREP) -DVersion=\"$(VERS)\" gui_window.gps gui_window.ads ## ## Insert the configuration data from the GNADE environment ## config.ads: config.gps $(ADAPREP) -DShared_Path=\"$(SITE_SHARED)\" config.gps config.ads ## ## Clean the directory ## clean:: rm -f b~*.ad[bs] core a.out *.o *.ali *~ rm -f gsql rm -f gui_window.ads config.ads distclean:: clean ## ## create a distribution ## dist :: rm -rf ../$(DISTNAME) mkdir -p ../$(DISTNAME) cat MANIFEST | cpio -pdmu ../$(DISTNAME) ( cd .. ; tar cvzf $(DISTNAME).tar.gz $(DISTNAME) ) ( cd .. ; zip -r $(DISTNAME).zip $(DISTNAME) ) rm -rf ../$(DISTNAME) publish: ncftpput upload.sourceforge.net /incoming ../$(DISTNAME).zip ncftpput upload.sourceforge.net /incoming ../$(DISTNAME).tar.gz gnade-1.6.2.orig/contrib/gsql/README0000644000175000017500000000123207410605335016664 0ustar lbrentalbrentaIntroduction ============ This is the GNADE ODBC Explorer. It is intended as a starting point for an SQL developement environment, which means you may store queries in a repository and test them on a data base. The following features are already available: - Access of multiple data source - Execution of queries and displaying the result set. - Execution of the DML and DDL commands. Features to come: - Project organisation - Table definition support - Procedure defintion support - Entity Releationship editor For more information refere to the release notes: release_note.html Michael Erdmann Torellstrasse 2 10243 Berlin Michael.Erdmann@snafu.de gnade-1.6.2.orig/contrib/gsql/import_export.adb0000644000175000017500000001131007402511114021355 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/import_export.adb,v $ -- Description : Implement the import/export features -- Author : Michael Erdmann -- Created : 8.8.2001 -- Last Modified By: $Author: me $ -- Last Modified On: $Date: 2001/12/02 20:42:52 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- -- -- Functional Description -- -- ====================== -- -- This package implements the export of a table into an external ASCII -- -- file. Each colon is seperated by a seperator charcter -- -- -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Text_IO; use Ada.Text_IO; with Ada.Exceptions; use Ada.Exceptions; with GUI_Logging; use GUI_Logging; with ODBC; use ODBC; package body Import_Export is Version : constant String := "$Id: import_export.adb,v 1.1 2001/12/02 20:42:52 me Exp $"; Record_Length : Positive := 2000; ------------ -- Export -- ------------ procedure Export( Table : in String; Name : in String ) is -- export a table into a file File : File_Type; Last_Line : Natural := 0; Line : String( 1..Record_Length ); Length : Natural; begin GUI_Logging.Log("Exporting table " & Table & " to file " & Name ); Create( File, Out_File, Name ); Close( File ); exception when Error : others => GUI_Logging.Error( Exception_Name (Error) ); GUI_Logging.Error( Exception_Message (Error) ); GUI_Logging.Error( "Import aborted at line " & Natural'Image(Last_Line) ); end Export; ------------ -- Import -- ------------ procedure Import( Table : in String; Name : in String ) is File : File_Type; Last_Line : Natural := 0; Line : String( 1..Record_Length ); Length : Natural; begin GUI_Logging.Log("Importing table " & Table & " from file " & Name ); Open( File, In_File, Name ); while not End_Of_File( File ) loop Last_Line := Last_Line + 1; Get_Line( File, Line, Length ); end loop; Close( File ); exception when Error : others => GUI_Logging.Error( Exception_Name (Error) ); GUI_Logging.Error( Exception_Message (Error) ); GUI_Logging.Error( "Import aborted at line " & Natural'Image(Last_Line) ); end Import; end Import_Export; gnade-1.6.2.orig/contrib/gsql/config.gps0000644000175000017500000000522707500615102017765 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNat Ada Database Environment - GNADE -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/config.gps,v $ -- Description : handle the persistent environment variables -- Author : Michael Erdmann -- Created : 22.9.2001 -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2002/06/09 09:05:06 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- package Config is Shared_Path : constant String := $Shared_Path; end Config; gnade-1.6.2.orig/contrib/gsql/query_handler.ads0000644000175000017500000001005607355676443021363 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/query_handler.ads,v $ -- Description : Contents Handler for Queries -- Author : Michael Erdmann -- -- Created : 8.8.2001 -- -- Last Modified By: $Author: me $ -- Last Modified On: $Date: 2001/09/30 20:14:27 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Contents_Handler; use Contents_Handler; with Contents_Manager; use Contents_Manager; with Project_File; use Project_File; with GSQL_Types; use GSQL_Types; with GUI_Editor; use GUI_Editor; package Query_Handler is type Object is new Contents_Handler.Object with private; type Handle is access all Object; procedure Initialize; procedure Finalize; Query_Prefix : constant String; private type Object is new Contents_Handler.Object with record Constructor : Constructor_Access := null; Editor : GUI_Editor.Object; Id : Element_ID; Name : Unbounded_String := Null_Unbounded_String; end record; Query_Prefix : constant String := "query"; procedure Initialize( This : in out Object ); procedure Finalize( This : in out Object ); procedure Selected( This : in out Object ); procedure Value( This : in Object; Text : out Text_Buffer; Last : out Positive ); procedure Save( Item : in out Object; Value : in Text_Buffer; Name : in String := "" ); procedure Load( Item : in out Object; Value : out Text_Buffer; Last : out Natural ); procedure Open_Editor( This : in out Object ); procedure Close_Editor( This : in out Object ); procedure Execute( This : in out Object ); end Query_Handler; gnade-1.6.2.orig/contrib/gsql/contents_handler.adb0000644000175000017500000001130207353152146022010 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/contents_handler.adb,v $ -- Description : contents handler package -- -- Author : Michael Erdmann -- -- Created : 8.8.2001 -- -- Last Modified By: $Author: me $ -- Last Modified On: $Date: 2001/09/22 18:11:50 $ -- Status : $State: Exp $ -- -- -- Copyright (C) 2000 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- This package implements the so called contents handler. The contents -- -- handler package maintains the table of contents for the application. -- -- -- -- Restrictions -- -- ============ -- -- -- -- -- -- -- ------------------------------------------------------------------------------- with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; package body Contents_Handler is ---------------- -- Initialize -- ---------------- procedure Initialize( This : in out Object ) is begin This.Self := This'Unchecked_Access; end Initialize; -------------- -- Finalize -- -------------- procedure Finalize( This : in out Object ) is begin null; end Finalize; --------- -- Key -- --------- function Key( This : in Object'Class ) return String is begin return To_String( This.Key ); end Key; --------- -- Key -- --------- function Key( This : in Object'Class ) return Unbounded_String is begin return This.Key; end Key; --------- -- Key -- --------- procedure Key( This : in out Object'Class; Value : in String ) is begin Key( This, To_Unbounded_String( Value ) ); end Key; --------- -- Key -- --------- procedure Key( This : in out Object'Class; Value : in Unbounded_String ) is begin This.Key := Value; end Key; ---------- -- self -- ---------- function Self( This : in Object'Class ) return Handle is begin return This.Self; end Self; end Contents_Handler; gnade-1.6.2.orig/contrib/gsql/release_note.html0000644000175000017500000002761007755664546021374 0ustar lbrentalbrenta No title

GNADE SQL Client

Version 0.8

Editor M.Erdmann

5.8.2002

Contents

This release of the GNADE SQL Client is featuring:

  • The clients displays all available data sources
  • The client provides an persitent project file, which means query and table definitions may be saved for later use.
  • The client allows to execute queries.
  • The creation of tables is supported.

Supported Database

The GSQL progam has been tested in the software configurations shown below. More confiurations are expected to work with this implementation since it is based upon ODBC.

Component Description Version OS Distribution/Source of the release
Postgres PostgreSQL Database 7.0.3
Linux - Redhat 7.0
Linux - SuSe 7.0
Solaris 7
Windows NT/2000
www.postgresql.org
Mimer Mimer SQL RDBMS 8.2
Solaris 7/8
Linux
Windows NT
www.mimer.com

Copyright, License and Authors

The GNU Public License (GPL) applies with the following extension to all software components in this release

As a special exception, if other files instantiate generics from GNADE Ada units, or you link GNADE Ada units or libraries with other files to produce an executable, these units or libraries do not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.

The documentation has been put under the Free GNU Documentation License.

Even GSQL is assumed to be a part of the GNADE project, the author(s) and copyright holder(s) of the GSQL client are:

Michael Erdmann Michael.Erdmann@snafu.de

Contact

Bug Reports http://sourcefore.net/projects/gnade M.Erdmann
GNADE Discussions http://cert.uni-stuttgart.de/mailman/listinfo/gnade-dev

gnade-dev@cert.uni-stuttgart.de

Florian Weimer
Project Page http://gnade.sourceforge.net/

http://sourcefore.net/projects/gnade

M.Erdmann
Dev. Coordination Michael.Erdmann@snafu.de M.Erdmann

New Features

Feature Req, Short Description Version Comments

Restrictions

  • The application has to run in the same directory as it has been build beause it uses some *.xpm files which located there as well. In the next releases these resources will be a part of the application.
  • This version is a prerelease there for a lot of debugging outputs are generated and some of the GUI elements are not functioning currently.

Fixed Problems

Please report any found problem via the bug traking system refered at http://gnade.sourceforge.net/ by using the category GSQL.

Bug Ref. Fixed with

Version

Short Description Comments

Known Problems

Bug Ref. Short Description Comments

Installation

The GNADE code and the documentation is distributed in the following files:

File Contents
gsql-source-0.6.tar.g Complete GSQL source code as tar file compressed by GNU zip.
gsql-source-0.6.zip Complete GSQL source code distribution as ZIP file.

The installation of this software requires the following components:

Component Version Origin
gzip 1.2.4 GNU
unzip 5.42 Infozip
zip 2.2 Infozip
tar - GNU or native
gmake GNU make

In order to install this source package a GNADE source distirbution has to be installed and configured previously. After this has been done change into the directory contrib and perform the following steps:

  1. Copy the gsql-source package into thw contrib directory
  2. Depending on the file type you like to use execute one of the following commands:


    unzip gsql-source-0.6.zip


    or

    gunzip -c gsql-source-0.6.tar.gz | tar xvf -

  3. change into the directory ./gsql-source-0.6

  4. gmake clean

    gmake

Other components

In order to build this application the following components are required:

Component Version Source
GtkAda-1.2.12-1 1.2.12-1
GTK 1.2.8 www.gtk.org
Florist 3.13p-7

Contributions

Special regards to the following persons which have contributed to the project:


Document Version: $Date: 2003/11/16 12:11:18 $ $Revision: 1.4 $

gnade-1.6.2.orig/contrib/gsql/contents_handler.ads0000644000175000017500000001352607355676443022060 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/contents_handler.ads,v $ -- Description : contents handler package -- -- Author : Michael Erdmann -- -- Created : 8.8.2001 -- -- Last Modified By: $Author: me $ -- Last Modified On: $Date: 2001/09/30 20:14:27 $ -- Status : $State: Exp $ -- -- -- Copyright (C) 2000 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- This package implements the so called contents handler. The contents -- -- handler package maintains the table of contents for the application. -- -- -- -- Restrictions -- -- ============ -- -- -- -- -- -- -- ------------------------------------------------------------------------------- with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Project_File; use Project_File; with GSQL_Types; use GSQL_Types; package Contents_Handler is type Object is abstract tagged private; type Handle is access all Object'Class; -- set the key of a contents element procedure Key( This : in out Object'Class; Value : in String ); procedure Key( This : in out Object'Class; Value : in Unbounded_String ); function Key( This : in Object'Class ) return String; function Key( This : in Object'Class ) return Unbounded_String; function Self( This : in Object'Class ) return Handle; procedure Initialize( This : in out Object ); procedure Finalize( This : in out Object ); -- ********************************************************************* -- -- ** A B S T R A C T I N T E R F A C E TO BE IMPLEMENTED ** -- -- ********************************************************************* -- -- instance has been selected for processing procedure Selected( Item : in out Object ) is abstract; -- return the contents of the instances which is written into the -- given text buffer. procedure Value( Item : in Object; Text : out Text_Buffer; Last : out Positive ) is abstract; -- save to persitent storage, this is called upon finalization of -- the object. procedure Save( Item : in out Object; Value : in Text_Buffer; Name : in String := "" ) is abstract; -- load the object data from a persitant storage. This is called -- upon initialization of the object, which means the procedure -- has to implement the situation, that the instance does not exist -- yet as well. procedure Load( Item : in out Object; Value : out Text_Buffer; Last : out Natural ) is abstract; -- Edit a selected object procedure Open_Editor( Item : in out Object ) is abstract; -- the editor is closed procedure Close_Editor( Item : in out Object ) is abstract; -- the execute button has been pressed, execute the contents of -- the instances. procedure Execute( Item : in out Object ) is abstract; private type Object is abstract tagged record Key : Unbounded_String := Null_Unbounded_String; Self : Handle := null; end record; end Contents_Handler; gnade-1.6.2.orig/contrib/gsql/table_handler.adb0000644000175000017500000002315310670060161021240 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/table_handler.adb,v $ -- Description : Handle the tables of a project -- -- Author : Michael Erdmann -- -- Created : 8.8.2001 -- -- Last Modified By: $Author: persan $ -- Last Modified On: $Date: 2007/09/06 20:17:53 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Text_IO; use Ada.Text_IO; with Text_Block; use Text_Block; with Contents_Manager.GUI; use Contents_Manager.GUI; with Datasource_Handler; use Datasource_Handler; with Preferences; use Preferences; with GUI_Preferences; use GUI_Preferences; with GUI_Logging; use GUI_Logging; with GUI_Tools; use GUI_Tools; with GUI_Worksheet; use GUI_Worksheet; with Project_File; use Project_File; package body Table_Handler is -- ********************************************************************* -- -- ** L O C A L D A T A ** -- -- ********************************************************************* -- Table_Section : Element_ID := Null_Element_ID; -- ********************************************************************* -- -- ** P U B L I C P R O C E D U R E S ** -- -- ********************************************************************* -- ---------------- -- Initialize -- ---------------- procedure Initialize ( This : in out Object) is -- initialize the query (instance) begin Initialize (Contents_Handler.Object (This)); This.Id := GUI.Add_Element (Key (This), Table_Section, Self (This)); GUI_Worksheet.Initialize (This.Table_Editor); end Initialize; -------------- -- Finalize -- -------------- procedure Finalize ( This : in out Object) is Name : constant Unbounded_String := Key (This); begin if GUI_Worksheet.Is_Open (Name) then GUI_Worksheet.Remove_Sheet (Name); end if; Project_File.Remove (Table_Prefix, Key (This)); GUI.Delete_Element (This.Id); Finalize (Contents_Handler.Object (This)); end Finalize; ----------------- -- Instanciate -- ----------------- function Instanciate ( Key : in String) return Contents_Handler.Handle is pragma Unreferenced (Key); Result : constant Handle := new Object; begin return Contents_Handler.Handle (Result); end Instanciate; ---------------- -- Initialize -- ---------------- procedure Initialize is Item : constant Handle := new Object; begin Item.Constructor := Instanciate'Access; Table_Section := Add_Element (Title => "Tables", Content => Contents_Handler.Handle (Item)); Contents_Manager.Register (Table_Prefix, Instanciate'Access); Contents_Manager.Initialize (Table_Prefix, Table_Section); end Initialize; -------------- -- Finalize -- -------------- procedure Finalize is begin Contents_Manager.Finalize (Table_Prefix); end Finalize; ----------- -- Value -- ----------- procedure Value ( This : in Object; Text : out Text_Buffer; Last : out Positive) is begin GUI_Table.Get_Result (This.Table_Editor, Text, Last); end Value; ---------- -- Save -- ---------- procedure Save ( Item : in out Object; Value : in Text_Buffer; Name : in String := "") is pragma Unreferenced (Name); -- store the data of the GUI in the project file. -- R.1 If the object is already in the project file, then simply -- update the data -- R.2 if the object is not in the project file, assume, that the -- element with the specified name has to be created newly.assume element -- to be inserted newly. NewObj : Handle; pragma Unreferenced (NewObj); begin Item.Name := Value (1); if not Section_Exists (Table_Prefix, To_String (Item.Name)) then -- R.2 NewObj := Handle (Contents_Manager.Create ( Table_Prefix, To_String (Item.Name)) ); GUI_Worksheet.Remove_Sheet (Item.Table_Editor); end if; -- R.1, R.2 Project_File.Update (Table_Prefix, To_String (Item.Name), Value); end Save; ---------- -- Load -- ---------- procedure Load ( Item : in out Object; Value : out Text_Buffer; Last : out Natural) is -- R.0 - load the table from the project file. -- R.1 - If there is no such entry simply return the template -- text. Description : constant Text_Buffer := ( To_Unbounded_String ("Fill in your description"), To_Unbounded_String ("Author: " & Preference (Prf_Author)) ); begin Project_File.Get ( -- R.0 Table_Prefix, Key (Item), Value, Last ); exception when Section_Not_Found => -- R.1 Last := Value'First; Value (Last) := Item.Name; Last := Last + 1; Put_Text_Block (Value, Description, Last); end Load; -------------- -- Selected -- -------------- procedure Selected ( This : in out Object) is begin if This.Constructor /= null then GUI_Tools.Activate (Table_Prefix); else Open_Editor (This); end if; end Selected; ----------------- -- Open_Editor -- ----------------- procedure Open_Editor ( This : in out Object) is -- load the referenced instance into the query editor Name : Unbounded_String := Key (This); begin if not GUI_Worksheet.Is_Open (Name) then GUI_Worksheet.Add_Sheet ( This.Table_Editor, Self (This), Name); else GUI_Worksheet.Bring_In_Front (Name); end if; end Open_Editor; ------------------ -- Close_Editor -- ------------------ procedure Close_Editor ( This : in out Object) is Name : Unbounded_String := Key (This); begin GUI_Worksheet.Remove_Sheet (Name); end Close_Editor; ------------- -- Execute -- ------------- procedure Execute ( This : in out Object) is -- execute the current editor contents Name : constant String := To_String (Key (This)); Text : Text_Buffer (1 .. Max_Section_Length); Last : Positive := Text'First; begin if Datasource_Handler.Current_Database = Not_Attached then Error ("No data base connected"); return; end if; Log ("Droping Table " & Name); Datasource_Handler.Execute ("DROP TABLE " & Name); Load (This, Text, Last); Log ("Inserting Table " & Name); Put_Line (DML_Create_Table_Command (Text)); Datasource_Handler.Execute (DML_Create_Table_Command (Text)); end Execute; end Table_Handler; gnade-1.6.2.orig/contrib/gsql/contents_manager-gui.adb0000644000175000017500000002620307360040500022561 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/contents_manager-gui.adb,v $ -- Description : GUI for the data base client -- Author : Michael Erdmann -- Created : 8.8.2001 -- Last Modified By: $Author: me $ -- Last Modified On: $Date: 2001/10/07 11:49:20 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- Author: Michael Erdmann -- -- -- -- Functional description -- -- ====================== -- -- -- -- Author -- -- ====== -- -- -- -- Author: Michael Erdmann -- -- -- -- Restrictions -- -- ============ -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Text_Io; use Ada.Text_IO; with Ada.Exceptions; use Ada.Exceptions; with Ada.Strings; use Ada.Strings; with Ada.Strings.Fixed; use Ada.Strings.Fixed; -- GTK Support packages (gtkada package) with Glib; use Glib; with Gtk; use Gtk; with Gtk.List; use Gtk.List; with Gtk.Adjustment; use Gtk.Adjustment; with Gtk.Box; use Gtk.Box; with Gtk.Enums; use Gtk.Enums; with Gtk.Frame; use Gtk.Frame; with Gtk.Handlers; use Gtk.Handlers; with Gtk.Tree; use Gtk.Tree; with Gtk.Tree_Item; use Gtk.Tree_Item; with Gtk.Widget; use Gtk.Widget; with Unchecked_Conversion; with GUI_Logging; use GUI_Logging; package body Contents_Manager.GUI is Version : constant String := "$Id: contents_manager-gui.adb,v 1.6 2001/10/07 11:49:20 me Exp $"; --- *************************************************************************** -- --- *** L O C A L D A T A TYPES *** -- --- *************************************************************************** -- Component_Tree : Gtk_Tree; ----------------------------- -- Component Tree Elements -- ----------------------------- type Component_Tree_Item_Record; type Component_Tree_Item is access all Component_Tree_Item_Record; type Component_Tree_Item_Record is new Gtk_Tree_Item_Record with record Id : Element_Id := Null_Element_ID; Subtree : Gtk_Tree := null; Display_Name : Unbounded_String := Null_Unbounded_String; Parent : Element_Id := Null_Element_ID; end record; ------------------------------- -- Table of contents records -- ------------------------------- CT : array( Element_ID ) of Component_Tree_Item := (others=>null); --- *************************************************************************** -- --- *** H A N D L E THE C O M P O N E N T T R E E *** -- --- *************************************************************************** -- package Tree_Element_Cb is new Gtk.Handlers.User_Callback (Widget_Type => Gtk.Tree.Gtk_Tree_Record, User_Type => Integer); -------------------- -- Component Tree -- -------------------- package Tree_Cb is new Handlers.Callback (Gtk_Tree_Record); ---------------------- -- Support Packages -- ---------------------- function To_Tree is new Unchecked_Conversion (Gtk_Tree_Item, Gtk_Tree); function From_Tree is new Unchecked_Conversion (Gtk_Tree, Gtk_Tree_Item); ------------------------- -- CB_Component_Select -- ------------------------- procedure CB_Component_Select ( Tree : access Gtk_Tree_Record'Class; Item_P : access Gtk_Widget_Record'Class; Data : Integer) is -- handle all selects of components Item : Component_Tree_Item := Component_Tree_Item( Item_P ); begin Last_Selected := Item.Id; Selected( Item.Id ); exception when The_Error : others => Error("Exception " & Exception_Name( The_Error ) & " occured " ); Error(" " & Exception_Message( The_Error ) ); raise; end Cb_Component_Select; --------------------- -- Cb_Tree_Changed -- -------------------- procedure Cb_Tree_Changed ( Tree : access GTK_Tree_Record'Class) is use Widget_List; Selected_List : Widget_List.Glist; Nb_Selected : Guint; begin Selected_List := Get_Selection (Tree); Nb_Selected := Length (Selected_List); end Cb_Tree_Changed; ----------------------------- -- Show_table_Of_Contents -- ----------------------------- procedure Show_Table_Of_Contents( Hbox : in out Gtk_Box ) is --- Root_Element : Gtk_Tree_Item; Ts : Gtk_Tree; --- begin Gtk_New( Ts ); Set_USize( Ts, 200, 500 ); Gtk_New(Root_Element, "Root" ); Append( Ts, Root_Element ); Show(Ts); Gtk_New(Component_Tree); Set_Subtree(Root_Element, Component_Tree ); Show(Component_Tree); Pack_Start(Hbox, Child=>Ts, Expand=>False); -- install the major call backs Tree_Element_Cb.Connect( Component_Tree, "select_child", Tree_Element_Cb.To_Marshaller (CB_Component_Select'Access), 0); Tree_Cb.Object_Connect( Component_Tree, "selection_changed", Tree_Cb.To_Marshaller (Cb_Tree_Changed'Access), Slot_Object => Component_Tree); end Show_Table_Of_Contents; -- *************************************************************************** -- -- *** C O N T E N T S M A N A G E M E N T P R O C E D U R E S *** -- -- *************************************************************************** -- -------------------- -- Delete_Element -- -------------------- procedure Delete_Widget( Id : in Element_ID ) is -- delete an element from the compnent tree use Widget_List; Clear_List : Widget_List.Glist; begin Widget_List.Prepend( Clear_List, Gtk_Widget(CT(Id)) ); List_Reverse( Clear_List ); Remove_Items( CT(CT(Id).Parent).Subtree, Clear_List ); Free( Clear_List ); end Delete_Widget; ----------------- -- Add_Element -- ----------------- function Add_Element( Title : in String; Parent : in Element_ID := Null_Element_Id; Content : in Contents_Handler.Handle := null ) return Element_ID is -- -- Add a section to the table of contents. -- R.0 - The object does not yet exist then create a contents -- element in the contents manager. -- R.1 - if the parent does not yet have a subtree to insert -- the element create a subtree. -- R.2 - if the parent is null, then assume the root element as -- parent. -- Id : Element_ID := Contents_Manager.Get_Element_ID( Title, Parent ); begin if Id = Null_Element_ID then -- R.0 Id := Add_Contents_Element(To_Unbounded_String(Title), Content, Parent); end if; declare Item : Component_Tree_Item renames CT(Id); Subtree : Gtk_Tree; begin if Item /= null then return id; end if; Item := new Component_Tree_Item_Record; Item.Display_Name := To_Unbounded_String( Title ); Item.Id := Id; Item.Parent := Parent; if Parent /= Null_Element_ID then -- R.1 if CT(Parent).Subtree = null then Gtk_New(Subtree); CT(Parent).Subtree := Subtree; Tree_Element_Cb.Connect( Subtree, "select_child", Tree_Element_Cb.To_Marshaller (CB_Component_Select'Access), 0 ); Set_Subtree( CT(Parent), Subtree ); Show( Subtree ); else Subtree := CT(Parent).Subtree; end if; else Subtree := Component_Tree; -- R.2 end if; Gtk.Tree_Item.Initialize (Item, Title ); Put_Line("Adding subtree"); Append( Subtree, Item ); Put_Line("return from Add_element"); Show(item); end ; return Id; end Add_Element; -------------------- -- Delete_Element -- -------------------- procedure Delete_Element( Id : in Element_ID ) is -- delete an element from the compnent tree use Widget_List; Clear_List : Widget_List.Glist; begin if CT(Id) /= null then Widget_List.Prepend( Clear_List, Gtk_Widget(CT(Id)) ); Remove_Items( CT(CT(Id).Parent).Subtree, Clear_List ); Contents_Manager.Remove_Contents_Element( Id ); Free( Clear_List ); CT(Id) := null; else Error("Element does not exisits, id=" & Element_ID'Image(Id) ); end if; end Delete_Element; end Contents_Manager.GUI; gnade-1.6.2.orig/contrib/gsql/table_handler.ads0000644000175000017500000001044510670060161021261 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/table_handler.ads,v $ -- Description : Contents Handler for tables -- Author : Michael Erdmann -- -- Created : 8.8.2001 -- -- Last Modified By: $Author: persan $ -- Last Modified On: $Date: 2007/09/06 20:17:53 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with GSQL_Types; use GSQL_Types; with Contents_Handler; use Contents_Handler; with Contents_Manager; use Contents_Manager; with GUI_Table; use GUI_Table; package Table_Handler is type Object is new Contents_Handler.Object with private; type Handle is access all Object; procedure Initialize; procedure Finalize; Table_Prefix : constant String; private type Object is new Contents_Handler.Object with record Constructor : Contents_Manager.Constructor_Access := null; Id : Contents_Manager.Element_ID := Null_Element_ID; Table_Editor : GUI_Table.Object; Name : Unbounded_String := Null_Unbounded_String; end record; Table_Prefix : constant String := "tables"; procedure Initialize ( This : in out Object); procedure Finalize ( This : in out Object); procedure Selected ( This : in out Object); procedure Value ( This : in Object; Text : out Text_Buffer; Last : out Positive); procedure Save ( Item : in out Object; Value : in Text_Buffer; Name : in String := ""); procedure Load ( Item : in out Object; Value : out Text_Buffer; Last : out Natural); procedure Open_Editor ( This : in out Object); procedure Close_Editor ( This : in out Object); procedure Execute ( This : in out Object); end Table_Handler; gnade-1.6.2.orig/contrib/gsql/contents_manager-gui.ads0000644000175000017500000001013007352723542022611 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/contents_manager-gui.ads,v $ -- Description : Representation of the base document -- -- Author : Michael Erdmann -- -- Created : 8.8.2001 -- -- Last Modified By: $Author: me $ -- Last Modified On: $Date: 2001/09/21 20:47:30 $ -- Status : $State: Exp $ -- -- -- Copyright (C) 2000 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- -- -- -- -- -- -- Restrictions -- -- ============ -- -- -- -- -- -- -- ------------------------------------------------------------------------------- with Gtk.Box; use Gtk.Box; with Contents_Handler; use Contents_Handler; with Contents_Manager; use Contents_Manager; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; package Contents_Manager.GUI is Last_Selected : Element_ID := Null_Element_ID; -- add the component tree to the GUI procedure Show_Table_Of_Contents( Hbox : in out Gtk_Box ); -- add a section function Add_Element( Title : in String; Parent : in Element_ID := Null_Element_ID; Content : in Contents_Handler.Handle := null ) return Element_ID; procedure Delete_Element( Id : in Element_ID ); end Contents_Manager.GUI; gnade-1.6.2.orig/contrib/gsql/text_block.ads0000644000175000017500000000723507356666523020663 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNat Ada Database Environment - GNADE -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/text_block.ads,v $ -- Description : handle test blocks in text buffers -- Author : Michael Erdmann -- Created : 8.8.2001 -- Last Modified By: $Author: me $ -- Last Modified On: $Date: 2001/10/03 19:56:03 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with GSQL_Types; use GSQL_Types; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; package Text_Block is End_Of_Block_Reached : exception; -------------------- -- Get_text_Block -- -------------------- procedure Get_Text_Block( Dest : in out Text_Buffer; Src : in Text_Buffer; Last : in out Positive ); -------------------- -- Put_Text_Block -- -------------------- procedure Put_Text_Block( Dest : in out Text_buffer; Src : in Text_buffer; Last : in out Positive ); ---------------- -- Fetch_Next -- ---------------- procedure Fetch_Next( Dest : out Unbounded_String; Src : in Text_Buffer; Last : in out Positive ); --------------------- -- Is_End_Of_Block -- --------------------- function Is_End_Of_Block( S : in Unbounded_String ) return Boolean; ------------------------- -- Insert_End_Of_Block -- ------------------------- procedure Insert_End_Of_Block( Dest : in out Text_Buffer; Last : in out Positive ); end Text_Block; gnade-1.6.2.orig/contrib/gsql/contents_manager.adb0000644000175000017500000003046607356666523022035 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/contents_manager.adb,v $ -- Description : Handle the contents of the loaded document -- -- Author : Michael Erdmann -- -- Created : 8.8.2001 -- -- Last Modified By: $Author: me $ -- Last Modified On: $Date: 2001/10/03 19:56:03 $ -- Status : $State: Exp $ -- -- -- Copyright (C) 2000 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- The contents handler maintains on class level two lists -- -- -- -- * list of all document types -- -- * list of all document components -- -- -- -- This package provides additionaly the model for a so called contents -- -- handler. A contents handler is an implementation which handels data -- -- of one kind, e.g. all query definitions. -- -- -- -- The package copies by means of the Initialize procedure elements of the -- -- same class from the project file into the handler space. -- -- -- -- The method Finalize may be used to copy back elements of the same class -- -- into the project file. -- -- -- -- Restrictions -- -- ============ -- -- None -- -- -- ------------------------------------------------------------------------------- with Ada.Text_IO; use Ada.Text_IO; with Project_File; use Project_File; with GSQL_Types; use GSQL_Types; package body Contents_Manager is --- ********************************************************************* -- --- *** L O C A L D A T A TYPES *** -- --- ********************************************************************* -- ----------------- -- Class Table -- ----------------- type Class_Record_Type is record Name : Unbounded_String := Null_Unbounded_String; Constructor : Constructor_Access := null; end record; CT : array( 1..50 ) of Class_Record_Type; ------------------ -- Element List -- ------------------ type Element_Record_Type is record Class_Name : Unbounded_String := Null_Unbounded_String; Kind : Contents_Handler.Handle := null; Parent : Element_ID := Null_Element_ID; end record; ST : array( 1..Element_ID'Last ) of Element_Record_Type; --- ********************************************************************* -- --- *** L O C A L P R O C E D U R E S *** -- --- ********************************************************************* -- ------------- -- Matches -- ------------- function Matches( I : in Element_ID; Cls : in Unbounded_String; Name : in Unbounded_String ) return Boolean is X : Unbounded_String := Key(ST(I).Kind.all); begin return ST(I).Class_Name = Cls and Name = X ; end Matches; ----------------- -- Instanciate -- ----------------- function Constructor( Class_Name : in String ) return Constructor_Access is -- instanciate an instance of the given class name Result : Constructor_Access := null; begin for I in CT'Range loop if CT(I).Constructor /= null and then To_String(CT(I).Name) = Class_Name then Result := CT(I).Constructor; exit; end if; end loop; return Result; end Constructor; --- ********************************************************************* -- --- *** P U B L I C P R O C E D U R E S *** -- --- ** C L A S S M E T H O D S *** -- --- ********************************************************************* -- ---------------- -- Initialize -- ---------------- procedure Initialize( Class_Name : in String; Parent : in Element_ID ) is -- read out the elements of a given class Cat : Text_Buffer(1..Max_Catalog_Length); Item : Handle; Id : Element_ID; Instanciate : Constructor_Access := Constructor( Class_Name ); begin if Instanciate = null then return; end if; Project_File.Catalog( Class_Name, Cat ); for I in Cat'Range loop if Cat(I) /= Null_Unbounded_String then Item := Instanciate( To_String(Cat(I)) ); if Item = null then raise Instanciation_Error; end if; Contents_Handler.Key( Item.all, Cat(I) ); Id := Add_Contents_Element(Cat(I), item, Parent ); Initialize( Item.all ); end if; end loop; end Initialize; -------------- -- Finalize -- -------------- procedure Finalize( Class_Name : in String := "" ) is Data : Text_Buffer( 1..Max_Section_Length ); Last : Positive := 1; begin for I in ST'Range loop if ST(I).Kind /= null and then To_String(ST(I).Class_Name) = Class_Name then Value( ST(I).Kind.all, Data, Last ); Project_File.Update( To_String(ST(I).Class_Name), -- class name Contents_Handler.Key( St(I).Kind.all ), -- keyword Data(1..Last) -- value ); end if; end loop; end Finalize; -------------- -- Register -- -------------- procedure Register( Class_Name : in String; Constructor : in Constructor_Access ) is -- register a contents class name begin for I in CT'Range loop if CT(I).Constructor = null then CT(I).Constructor := Constructor; CT(I).Name := To_Unbounded_String( Class_Name ); return; end if; end loop; end Register; ------------ -- Create -- ------------ function Create( Class_Name : in Unbounded_String; Name : in Unbounded_String ) return Contents_Handler.Handle is begin return Create( To_String(Class_Name), To_String(Name) ); end Create; ------------ -- Create -- ------------ function Create( Class_Name : in String; Name : in String ) return Contents_Handler.Handle is -- create an instance based upon the document type Result : Contents_Handler.Handle; begin Result := Constructor(Class_Name)(Name); Contents_Handler.Key( Result.all, Name ); Initialize( Result.all ); return Result; end Create; --- ********************************************************************* -- --- *** P U B L I C P R O C E D U R E S *** -- --- ** I N S T A N C E M E T H O D S *** -- --- ********************************************************************* -- ------------------ -- Element_Name -- ------------------ function Element_Name( Id : in Element_ID ) return Unbounded_String is begin return To_Unbounded_String(Contents_Handler.Key(ST(Id).Kind.all)); end Element_Name; -------------- -- Contents -- -------------- function Contents( Id : in Element_ID ) return Contents_Handler.Handle is begin return ST(Id).Kind; end Contents; -------------- -- Contents -- -------------- function Contents( Cls : in Unbounded_String; Name : in Unbounded_String ) return Contents_Handler.Handle is begin for I in ST'Range loop if ST(I).Kind /= null and then Matches( Element_Id(I), Cls, Name ) then return ST(I).Kind; end if; end loop; raise Element_Not_Found; end Contents; ------------- -- Exisits -- ------------- function Get_Element_ID( Name : in String; Parent : in Element_ID) return Element_ID is begin for I in ST'Range loop if ST(I).Kind /= null and then ST(I).Parent = Parent then declare S : constant Unbounded_String := Key( ST(I).Kind.all ); begin if S = Name then return I; end if; end; end if; end loop; return Null_Element_ID; end Get_Element_ID; -------------------------- -- Add_Contents_Element -- -------------------------- function Add_Contents_Element( Name : in Unbounded_String; Handler : in Contents_Handler.Handle; Parent : in Element_ID := Null_Element_ID ) return Element_ID is begin Contents_Handler.Key( Handler.all, Name ); for I in ST'Range loop if ST(I).Kind = null then ST(I).Kind := Handler; ST(I).Parent := Parent; return I; end if; end loop; raise No_More_Elements; end Add_Contents_Element; ----------------------------- -- Remove_Contents_Element -- ----------------------------- procedure Remove_Contents_Element( Id : in Element_ID ) is -- remove the element from the contents manager memory begin ST(Id).Kind := null; end Remove_Contents_Element; -------------- -- Selected -- -------------- procedure Selected( Id : in Element_ID ) is -- to be called if the object has been selected begin Selected( ST(Id).Kind.all ); end Selected; end Contents_Manager; gnade-1.6.2.orig/contrib/gsql/text_block.adb0000644000175000017500000001071207360127577020630 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNat Ada Database Environment - GNADE -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/text_block.adb,v $ -- Description : handle test blocks in text buffers -- Author : Michael Erdmann -- Created : 8.8.2001 -- Last Modified By: $Author: me $ -- Last Modified On: $Date: 2001/10/07 19:39:43 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- package body Text_Block is Version : constant String := "$Id: text_block.adb,v 1.2 2001/10/07 19:39:43 me Exp $"; End_Of_Block : constant Unbounded_String := To_Unbounded_String("$"); -------------------- -- Get_text_Block -- -------------------- procedure Get_Text_Block( Dest : in out Text_Buffer; Src : in Text_Buffer; Last : in out Positive ) is begin for I in Dest'Range loop exit when not ( Last in Src'Range ) ; if Src(Last) /= End_Of_Block then Dest(I) := Src(Last); Last := Last + 1; else Dest(I) := Null_Unbounded_String; Last := Last + 1; exit; end if; end loop; end Get_Text_Block; -------------------- -- Put_Text_Block -- -------------------- procedure Put_Text_Block( Dest : in out Text_Buffer; Src : in Text_Buffer; Last : in out Positive ) is begin Insert( Dest, Src, Last ); Insert_End_Of_Block( Dest, Last ); end Put_Text_Block; --------------------- -- Is_End_Of_Block -- --------------------- function Is_End_Of_Block( S : in Unbounded_String ) return Boolean is begin return S = End_Of_Block ; end Is_End_Of_Block; ------------------------- -- Insert_End_Of_Block -- ------------------------- procedure Insert_End_Of_Block( Dest : in out Text_Buffer; Last : in out Positive ) is begin Dest(Last) := End_Of_Block; Last := Last + 1; end Insert_End_Of_Block; ---------------- -- Fetch_Next -- ---------------- procedure Fetch_Next( Dest : out Unbounded_String; Src : in Text_Buffer; Last : in out Positive ) is begin if not ( Last in Src'Range) then raise End_Of_Block_Reached; end if; Dest := Src(Last); Last := Last + 1; end Fetch_Next; end Text_Block; gnade-1.6.2.orig/contrib/gsql/contents_manager.ads0000644000175000017500000001311507356666523022046 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/contents_manager.ads,v $ -- Description : contents handler package -- -- Author : Michael Erdmann -- -- Created : 8.8.2001 -- -- Last Modified By: $Author: me $ -- Last Modified On: $Date: 2001/10/03 19:56:03 $ -- Status : $State: Exp $ -- -- -- Copyright (C) 2000 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Functional Description -- -- ====================== -- -- -- -- -- -- -- -- Author -- -- ====== -- -- Author: Michael Erdmann -- -- -- -- Restrictions -- -- ============ -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Contents_Handler; use Contents_Handler; package Contents_Manager is type Element_ID is private; Null_Element_ID : constant Element_ID; Max_Nbr_Of_Elements : constant Positive; Instanciation_Error : exception; -- a constructor for a document component type Constructor_Access is access function( Key : in String ) return Contents_Handler.Handle; -- register a constructor for a document class. procedure Register( Class_Name : in String; Constructor : in Constructor_Access ); function Create( Class_Name : in String; Name : in String ) return Contents_Handler.Handle; function Create( Class_Name : in Unbounded_String; Name : in Unbounded_String ) return Contents_Handler.Handle; -- initialize the contents handler with the selected class procedure Initialize( Class_Name : in String; Parent : in Element_ID); -- copy all all object of the given class into the project file procedure Finalize( Class_Name : in String := "" ); procedure Selected( Id : in Element_ID ); -- add a element to the contents manager. function Add_Contents_Element( Name : in Unbounded_String; Handler : in Contents_Handler.Handle; Parent : in Element_ID := Null_Element_ID ) return Element_ID; procedure Remove_Contents_Element( Id : in Element_ID ); -- name of the instance function Element_Name( Id : in Element_ID ) return Unbounded_String; function Contents( Id : in Element_ID ) return Contents_Handler.Handle; function Contents( Cls : in Unbounded_String; Name : in Unbounded_String ) return Contents_Handler.Handle; No_More_Elements : exception; Element_Not_Found : exception; -------------------------------------------------------------------------- private Max_Nbr_Of_Elements : constant Positive := 1000; type Element_ID is new Natural range 0..Max_Nbr_Of_Elements; Null_Element_ID : constant Element_ID := 0; function Get_Element_ID( Name : in String; Parent : in Element_ID) return Element_ID; end Contents_Manager; gnade-1.6.2.orig/contrib/gsql/datasource_handler.adb0000644000175000017500000002141510670060161022302 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/datasource_handler.adb,v $ -- Description : This package handles all ODBC data sources -- Author : Michael Erdmann -- Created : 8.8.2001 -- Last Modified By: $Author: persan $ -- Last Modified On: $Date: 2007/09/06 20:17:53 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Text_Io; use Ada.Text_IO; with Ada.Exceptions; use Ada.Exceptions; with Ada.Strings; use Ada.Strings; with Ada.Strings.Fixed; use Ada.Strings.Fixed; -- GSQL Support packages with GUI_Preferences; use GUI_Preferences; with Contents_Manager.GUI; use Contents_Manager.GUI; with GUI_Logging; use GUI_Logging; with Gui_Result; use GUI_Result; with Gui_Window; use Gui_Window; with Contents_Manager; use Contents_Manager; with Preferences; use Preferences; with ODBC; use ODBC; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; package body Datasource_Handler is Version : constant String := "$Id: datasource_handler.adb,v 1.16 2007/09/06 20:17:53 persan Exp $" ; Datasource_Section : Element_ID := Null_Element_ID; ------------------ -- Data Sources -- ------------------ CurrentDB : Handle := null; --------------------------- -- Load_All_Datasources -- --------------------------- procedure Load_All_Datasources is S : Source_Information; Db : ODBC.Object; Item : Handle := null; Id : Element_ID; begin Initialize(Db); S := Data_Source( Db, First => True ); while S /= Null_Source_Information loop Item := new Object; Item.Self := Item; Initialize( Item.Server ); Data_Source( Item.Server, To_String(S.Server) ); Id := Add_Element( Parent => Datasource_Section, Title => To_String( S.Description & "[" & S.Server & "]" ), Content => Contents_Handler.Handle(Item)); S := Data_Source(Db); end loop; Finalize(Db); end Load_All_Datasources; ---------------- -- Initialize -- ---------------- procedure Initialize is Item : Handle := new Object; begin Item.Datasource_Root := True; Datasource_Section := Add_Element( Title => "Data Sources", Content => Contents_Handler.Handle(Item) ); Load_All_Datasources; end Initialize; -------------- -- Finalize -- -------------- procedure Finalize is begin null; end Finalize; -------------- -- Selected -- -------------- procedure Selected( This : in out Object ) is -- connect to the selected data source P : String_Array_Access; begin if This.Datasource_Root then return; end if; if CurrentDB /= null then Disconnect( CurrentDB.Server ); end if; Authorization( This.Server, Login => Preference(Prf_Login), Password => Preference(Prf_Password ) ); Log("Connecting to data source"); Connect( This.Server ); CurrentDB := This.Self; Log("ok"); GUI_Logging.Active_Database( Key( This ) ); exception when The_Error : others => GUI_Logging.Error( Exception_Name( The_Error ) ); GUI_Logging.Error( Exception_Message( The_Error ) ); Display_DB_Info; Error( "Connect failed"); GUI_Logging.Active_Database( "no database connected" ); CurrentDB := null; end Selected; ----------- -- Value -- ----------- procedure Value( This : in Object; Text : out Text_Buffer; Last : out Positive ) is begin null; end Value; --------------------- -- Display_DB_Info -- --------------------- procedure Display_DB_Info is DB_Error: Unbounded_String; Message : Unbounded_String; begin if CurrentDB /= null then Get_Error( CurrentDB.Server, DB_Error, Message ); if DB_Error /= Null_Unbounded_String then Error( To_String(Db_Error) ); Error( To_String(Message) ); end if; end if; end Display_DB_Info; ---------------------- -- Current_Database -- ---------------------- function Current_Database return Handle is begin return CurrentDB; end Current_Database; ------------- -- Execute -- ------------- procedure Execute( Cmd : in String ) is -- execute a query and display the result Q : ODBC.Object renames CurrentDB.Server; Result : Result_Record := Null_Result_Record; Rows : Natural := 0; Error : Unbounded_String := Null_Unbounded_String; Msg : Unbounded_String := Null_Unbounded_String; begin ODBC.Query( Q, Cmd ); if Columns(Q) > 0 then Add_Result( Q, To_Unbounded_String("Result..") ); end if; Display_DB_Info; exception when Error : others => GUI_Logging.Error( Exception_Name (Error) ); GUI_Logging.Error( Exception_Message (Error) ); end Execute; ---------------------------- -- Datasource_Description -- ---------------------------- function Datasource_Description return String is Info : ODBC.Source_Information; begin if Current_Database = Not_Attached then return "- No Database connected "; end if; Info := Data_Source( Current_Database.Server ); return To_String( Info.Server ) & "[" & To_String( Info.Description ) & "]"; end Datasource_Description; ---------- -- Save -- ---------- procedure Save( Item : in out Object; Value : in Text_Buffer; Name : in String := "" ) is -- no save operation on a data source begin Log("No function for data sources"); end Save; ---------- -- Load -- ---------- procedure Load( Item : in out Object; Value : out Text_Buffer; Last : out Natural ) is -- no load operation on a data source begin Log("No function for data sources"); end Load; ----------------- -- Open_Editor -- ----------------- procedure Open_Editor( This : in out Object ) is -- no editor to open for data sources begin Log("No function for data sources"); end Open_Editor; ------------------ -- Close_Editor -- ------------------ procedure Close_Editor( This : in out Object ) is begin Log("No function for data sources"); end Close_Editor; ------------- -- Execute -- ------------- procedure Execute( This : in out Object ) is Name : Unbounded_String := Key( This ); begin Log("No function for data sources"); end Execute; end Datasource_Handler; gnade-1.6.2.orig/contrib/gsql/Queries/0000755000175000017500000000000011040716254017420 5ustar lbrentalbrentagnade-1.6.2.orig/contrib/gsql/Queries/employees.sql0000644000175000017500000000011507340003256022137 0ustar lbrentalbrenta-- -- This reads out the whole employees table -- select * from employees gnade-1.6.2.orig/contrib/gsql/datasource_handler.ads0000644000175000017500000000753710670060161022334 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/datasource_handler.ads,v $ -- Description : Contents Handler for Queries -- Author : Michael Erdmann -- -- Created : 8.8.2001 -- -- Last Modified By: $Author: persan $ -- Last Modified On: $Date: 2007/09/06 20:17:53 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with GSQL_Types; use GSQL_Types; with Contents_Handler; use Contents_Handler; with ODBC; use ODBC; package Datasource_Handler is type Object is new Contents_Handler.Object with private; type Handle is access all Object; procedure Initialize; procedure Finalize; procedure Display_DB_Info; function Current_Database return Handle; Not_Attached : constant Handle := null; procedure Execute ( Cmd : in String); function Datasource_Description return String; private type Object is new Contents_Handler.Object with record Datasource_Root : Boolean := False; Self : Handle := null; Server : ODBC.Object; end record; procedure Selected ( This : in out Object); procedure Value ( This : in Object; Text : out Text_Buffer; Last : out Positive); procedure Save ( Item : in out Object; Value : in Text_Buffer; Name : in String := ""); procedure Load ( Item : in out Object; Value : out Text_Buffer; Last : out Natural); procedure Open_Editor ( This : in out Object); procedure Close_Editor ( This : in out Object); procedure Execute ( This : in out Object); end Datasource_Handler; gnade-1.6.2.orig/contrib/gsql/default.prj0000644000175000017500000000333007501047041020141 0ustar lbrentalbrentaquery:List Attachments 9 List Attachments Fill in your description Author: No Author $ SELECT ID,Title FROM Attachments; $ query:display all employees 8 display all employees This query displays all employees data. Das ist ein Test $ select * from employees $ query:Display Test_Relation 11 Display Test_Relation This is a query in order to read out the test relation created by the Tables operation Author: Michael Erdmann $ SELECT * FROM Test_Relation $ tables:Test_Relation 41 Test_Relation This is a test relation Author: Michael Erdmann $ 3 name character(80) TRUE FALSE FALSE TRUE $ firstname character(20) FALSE FALSE FALSE FALSE $ data character(200) 'Hallo Welt' FALSE TRUE FALSE TRUE $ query:Failing Query 9 Failing Query Fill in your description Author: No Author $ SELECT * FROM XXXXX WHERE ; $ query:Unload a table 9 Unload a table Fill in your description Author: No Author $ UNLOAD TO "test.ubl" SELECT * FROM employees $ .environment:unnamed_cnt 1 50 query:Test_Releation 8 Test_Releation Fill in your description Author: No Author $ SELECT * FROM WHERE ..... $ procedures:FUNCTION Test 10 FUNCTION Test -- Fill in your description -- Author: No Author $ ( IN aName type ) RETURN DATA MODIFIES SQL DATA BEGIN END $ procedures:PROCEDURE TESTX 11 PROCEDURE TESTX -- Fill in your description -- Author: No Author $ () BEGIN END $ preference:login 1 gnade preference:password 1 gnade preference:catalog 1 GNADE preference:schema 1 GNADE preference:projecttitle 1 No Title preference:projectauthor 1 No Author preference:repositorypath 1 ./ preference:debuglevel 1 0 preference:installdir 1 /usr/local/gsql gnade-1.6.2.orig/contrib/gsql/environment.adb0000644000175000017500000001011610670060161021013 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNat Ada Database Environment - GNADE -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/environment.adb,v $ -- Description : handle the persistant environment variables -- Author : Michael Erdmann -- Created : 8.8.2001 -- Last Modified By: $Author: persan $ -- Last Modified On: $Date: 2007/09/06 20:17:53 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Text_IO; use Ada.Text_IO; with Ada.Command_Line; use Ada.Command_Line; with Ada.Exceptions; use Ada.Exceptions; with GSQL_Types; use GSQL_Types; with Project_File; use Project_File; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; package body Environment is Version : constant String := "$Id: environment.adb,v 1.4 2007/09/06 20:17:53 persan Exp $"; Prf_Environment : constant String := ".environment"; ---------------- -- Initialize -- ---------------- procedure Initialize is begin null; end Initialize; -------------- -- Finalize -- -------------- procedure Finalize is begin null; end Finalize; --------- -- Get -- --------- function Get ( Name : in String) return Natural is S : Text_Buffer (1 .. 10); Last : Positive; begin if not Section_Exists (Prf_Environment, Name) then Add (Prf_Environment, Name, " 0"); end if; Project_File.Get ( Prf_Environment, Name, S, Last); return Natural'Value (To_String (S (1))); end Get; --------- -- Set -- --------- procedure Set ( Name : in String; Value : in Natural) is begin Project_File.Update ( Prf_Environment, Name, Natural'Image (Value)); end Set; end Environment; gnade-1.6.2.orig/contrib/gsql/environment.ads0000644000175000017500000000544510670060161021045 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNat Ada Database Environment - GNADE -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/environment.ads,v $ -- Description : handle the persistent environment variables -- Author : Michael Erdmann -- Created : 22.9.2001 -- Last Modified By: $Author: persan $ -- Last Modified On: $Date: 2007/09/06 20:17:53 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- package Environment is procedure Initialize; procedure Finalize; function Get ( Name : in String) return Natural; procedure Set ( Name : in String; Value : in Natural); end Environment; gnade-1.6.2.orig/contrib/gsql/files.adb0000644000175000017500000001126607500621776017575 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/files.adb,v $ -- Description : Utitlity package for file handling -- Author : Michael Erdmann -- Created : 24.8.2001 -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2002/06/09 09:46:38 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Text_IO; use Ada.Text_IO; with Config; with Environment; use Environment; package body Files is Version : constant String := "$Id: files.adb,v 1.8 2002/06/09 09:46:38 merdmann Exp $"; Directory_Seperator : constant Character := '/'; Path_Seperator : constant Character := ':'; Last_Position : Positive := 1; Unnamed_Cnt : Natural := 0; --------------- -- Base_Name -- --------------- function Base_Name( S : in String ) return String is --- return the base name of a file N : Positive range S'First .. S'Last := S'First; begin for I in S'Range loop if S(I) = Directory_Seperator then N := I+1; end if; end loop; return S(N..S'Last); end Base_Name; --------------- -- Scan_Path -- --------------- function Scan_Path( Path : in String; Reset : in Boolean := False ) return String is Start : Positive := Last_Position; begin if Reset then Last_Position := Path'First; end if; -- end of path if not ( Last_Position in Path'Range ) then return No_More_Elements; end if; while Last_Position in Path'Range loop exit when Path(Last_Position) = Path_Seperator; Last_Position := Last_Position + 1; end loop; return Path( Start..Last_Position-1 ); end Scan_Path; ------------------ -- Buffer_Name -- ------------------ function Buffer_Name( Name : in Unbounded_String := Null_Unbounded_String) return Unbounded_String is begin if Name = Null_Unbounded_String then Unnamed_Cnt := Environment.Get("unnamed_cnt") + 1; Environment.Set( "unnamed_cnt", Unnamed_Cnt ); return To_Unbounded_String("unnamed" & Positive'Image(Unnamed_Cnt)); end if; return Name; end Buffer_Name; ----------------- -- Shared_File -- ----------------- function Shared_File( N : in String ) return String is F : File_Type; Name : constant String := Config.Shared_Path & "/" & N; begin Open( Name => Name, File => F, Mode => In_File ); Close( F ); return Name; exception when others => return N; end Shared_File; end Files; gnade-1.6.2.orig/contrib/gsql/files.ads0000644000175000017500000000544707500621776017622 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/files.ads,v $ -- Description : GUI for the data base client -- Author : Michael Erdmann -- Created : 8.8.2001 -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2002/06/09 09:46:38 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; package Files is No_More_Elements : constant String := ""; function Base_Name( S : in String ) return String; function Scan_Path( Path : in String; Reset : in Boolean := False ) return String; function Buffer_Name( Name : in Unbounded_String := Null_Unbounded_String) return Unbounded_String; function Shared_File( N : in String ) return String; end Files; gnade-1.6.2.orig/contrib/gsql/gsql.adb0000644000175000017500000001355410670060161017426 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNat Ada Database Environment - GNADE -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/gsql.adb,v $ -- Description : Small query client based upon odbc -- Author : Michael Erdmann -- Created : 8.8.2001 -- Last Modified By: $Author: persan $ -- Last Modified On: $Date: 2007/09/06 20:17:53 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Text_IO; use Ada.Text_IO; with Ada.Command_Line; use Ada.Command_Line; with Ada.Exceptions; use Ada.Exceptions; -- GUI components with GUI_Window; use GUI_Window; with GUI_Menu; use GUI_Menu; -- Application handlers with Query_Handler; use Query_Handler; with Table_Handler; use Table_Handler; with Procedure_Handler; use Procedure_Handler; with Datasource_Handler; use Datasource_Handler; -- other components with Project_File; use Project_File; with Environment; use Environment; ---------- -- GSQL -- ---------- procedure GSQL is pragma Comment ("$Id: gsql.adb,v 1.16 2007/09/06 20:17:53 persan Exp $"); Arg : Integer := 1; procedure Help is begin Put_Line (""); Put_Line ("usage: gsql [-p projectfile] [-h]"); Put_Line (""); Put_Line (" -p projectfile - use a project file for execution. If not "); Put_Line (" given, the file default.prj is used. "); Put_Line (" -h - This message"); Put_Line (""); end Help; begin Put_Line (""); Put_Line ("GNADE SQL (GSQL) Grafical User Interface, Version " & GUI_Window.Version); Put_Line ("Copyright (C) 2001-2002 Michael Erdmann"); Put_Line (""); ------------------------- -- Handle command line -- ------------------------- Project_File.File_Name := To_Unbounded_String ("default.prj"); while Arg <= Argument_Count loop if Argument (Arg) = "-p" then Arg := Arg + 1; Project_File.File_Name := To_Unbounded_String (Argument (Arg)); elsif Argument (Arg) = "-h" then Help; Set_Exit_Status (1); return; elsif Argument (Arg) (1) = '-' then Put_Line ("*** Error unknown switch " & Argument (Arg)); Help; Set_Exit_Status (1); return; end if; Arg := Arg + 1; end loop; ----------------------- -- Start Application -- ----------------------- Project_File.Open (Quiet => True); Environment.Initialize; GUI_Menu.Initialize; GUI_Window.Initialize; Query_Handler.Initialize; Table_Handler.Initialize; Procedure_Handler.Initialize; Datasource_Handler.Initialize; ------------------------- -- Execute Application -- ------------------------- GUI_Window.Main; ---------------------- -- Stop Application -- ---------------------- Query_Handler.Finalize; Table_Handler.Finalize; Procedure_Handler.Finalize; Datasource_Handler.Finalize; GUI_Menu.Finalize; GUI_Window.Finalize; Environment.Finalize; ---------------------- -- Save Environment -- ---------------------- if not GUI_Menu.Dont_Save then Project_File.Save; else Put_Line ("Project not saved!"); end if; Set_Exit_Status (0); ----------------------- -- Handle Exceptions -- ----------------------- exception when The_Error : others => Put_Line ("Exception " & Exception_Name (The_Error) & " occured "); Put_Line (" " & Exception_Message (The_Error)); Set_Exit_Status (1); end GSQL; gnade-1.6.2.orig/contrib/gsql/gsql_types.adb0000644000175000017500000001325207356026622020660 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/gsql_types.adb,v $ -- Description : commonly used types -- -- Author : Michael Erdmann -- -- Created : 8.8.2001 -- -- Last Modified By: $Author: me $ -- Last Modified On: $Date: 2001/10/01 08:47:14 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Functional description -- -- ====================== -- -- -- -- Author -- -- ====== -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Text_IO; use Ada.Text_IO; with Ada.Characters.Handling; use Ada.Characters.Handling; with Ada.Strings; use Ada.Strings; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Strings.Fixed; use Ada.Strings.Fixed; with Unchecked_Deallocation; with Ada.Characters.Latin_1; use Ada.Characters.Latin_1; package body GSQL_Types is Version : constant String := "$Id: gsql_types.adb,v 1.2 2001/10/01 08:47:14 me Exp $"; -------------------- -- To_Text_Buffer -- -------------------- procedure To_Text_Buffer( S : in String; T : out Text_Buffer; Last : out Positive ) is -- split a string into a text buffer. Start : Positive := S'First; begin for L in T'Range loop declare Result : Unbounded_String := Null_Unbounded_String; C : Character; begin while Start in S'Range loop C := S(Start); Start := Start + 1; if C /= LF then Result := Result & C; else exit; end if; end loop; T(L) := Result; end; Last := L; exit when not ( Start in S'Range ); end loop; end To_Text_Buffer; ------------------- -- To_Textbuffer -- ------------------- function To_Text_Buffer( S : in String ) return Text_Buffer is Result : Text_Buffer( 1..Max_Section_Length ); --- translate string into text buffer Last : Positive; begin To_Text_Buffer( S, Result, Last ); return Result( 1..Last ); end To_Text_Buffer; --------------- -- To_String -- --------------- function To_String( T : in Text_Buffer ) return String is R : Unbounded_String := Null_Unbounded_String; begin for I in T'Range loop R := R & (T(I) & ASCII.LF); end loop; return To_String( R ); end To_String; ------------ -- Insert -- ------------ procedure Insert( Dest : out Text_Buffer; Src : in Text_Buffer; Last : in out Positive ) is begin for I in Src'Range loop Dest(Last) := Src(I); Last := Last + 1; end loop; end Insert; ------------ -- Insert -- ------------ procedure Insert( Dest : out Text_Buffer; Src : in Unbounded_String; Last : in out Positive ) is begin if Last in Dest'Range then Dest(Last) := Src; Last := Last + 1; end if; end Insert; end GSQL_Types; gnade-1.6.2.orig/contrib/gsql/gsql_types.ads0000644000175000017500000000641307400233330020664 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/gsql_types.ads,v $ -- Description : commonly used types -- Author : Michael Erdmann -- -- Created : 8.8.2001 -- -- Last Modified By: $Author: me $ -- Last Modified On: $Date: 2001/11/25 18:22:16 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; package GSQL_Types is Max_Section_Length : constant Natural := 1000; Text_Buffer_Overflow : exception; type Text_Buffer is array( Positive range <> ) of Unbounded_String; function To_Text_Buffer( S : in String ) return Text_Buffer; procedure To_Text_Buffer( S : in String; T : out Text_Buffer; Last : out Positive ); function To_String( T : in Text_Buffer ) return String; procedure Insert( Dest : out Text_Buffer; Src : in Unbounded_String; Last : in out Positive ); procedure Insert( Dest : out Text_Buffer; Src : in Text_Buffer; Last : in out Positive ); end GSQL_Types; gnade-1.6.2.orig/contrib/gsql/gui.adb0000644000175000017500000001227207356026622017253 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/gui.adb,v $ -- Description : Build the IDE GUI -- Author : Michael Erdmann -- Created : 8.8.2001 -- Last Modified By: $Author: me $ -- Last Modified On: $Date: 2001/10/01 08:47:14 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Text_Io; use Ada.Text_IO; with Ada.Exceptions; use Ada.Exceptions; with Ada.Strings; use Ada.Strings; with Ada.Strings.Fixed; use Ada.Strings.Fixed; -- GTK Support packages (gtkada package) with Gtk.Box; use Gtk.Box; with Gtk.Notebook; use Gtk.Notebook; -- GSQL Support packages with Gui_Files; use GUI_Files; with GUI_Result; use GUI_Result; with GUI_Editor; use GUI_Editor; with GUI_Preferences; use GUI_Preferences; with GUI_Logging; use GUI_Logging; with GUI_Menu; use GUI_Menu; with GUI_Tools; use GUI_Tools; with GUI_Table; use GUI_Table; with GUI_Worksheet; use GUI_Worksheet; with Contents_Manager.GUI; use Contents_Manager.GUI; package body GUI is --- *********************************************************************** -- --- *** L O C A L D A T A TYPES *** -- --- *********************************************************************** -- ---------------- -- Initialize -- ---------------- procedure Initialize( Wbox : in out Gtk_Box ) is -- setup the GUI windows Hbox, Vbox : Gtk_Box; Workspace : Gtk_Notebook; Preferences : GUI_Preferences.Object; Pref_Title : constant Unbounded_String := To_Unbounded_String("Preferences"); begin --------------------- -- Add the Menubar -- --------------------- GUI_Menu.Add_Menubar(Wbox); --------------------- -- Add the toolbar -- --------------------- Add_Toolbar(Wbox); Gtk_New_Hbox (HBox, Homogeneous => False, Spacing => 3); Pack_Start(Wbox, Child => Hbox); Add_Status( Wbox ); GUI_Logging.Active_Database( "no database connected" ); -- create a vertical packer Gtk_New_Vbox (Vbox, Homogeneous => False, Spacing => 0); ------------------------------------ -- create the work space notebook -- ------------------------------------ Gtk_New (Workspace); Pack_Start(Vbox, Child => Workspace); GUI_Result.Toplevel := Workspace; GUI_Tools.Toplevel := Workspace; GUI_Worksheet.Toplevel := Workspace; GUI_Worksheet.Add_Sheet( Preferences, null, Pref_Title, Permanent => True ); --------------------- -- Add the logging -- --------------------- Add_Logging( Vbox ); ------------------------------- -- Add the table of contents -- ------------------------------- Show_Table_Of_Contents(Hbox); Pack_Start(HBox, VBox ); end Initialize; -------------- -- Finalize -- -------------- procedure Finalize( Wbox : in out Gtk_Box ) is begin null; end Finalize; end GUI; gnade-1.6.2.orig/contrib/gsql/gui.ads0000644000175000017500000000534107351402630017263 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/gui.ads,v $ -- Description : GUI top level window -- Author : Michael Erdmann -- -- Created : 8.8.2001 -- -- Last Modified By: $Author: me $ -- Last Modified On: $Date: 2001/09/17 14:15:52 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Gtk.Box; use Gtk.Box; package GUI is Version : constant String := "0.1"; procedure Initialize( Wbox : in out Gtk_Box ); procedure Finalize( Wbox : in out Gtk_Box ); end GUI; gnade-1.6.2.orig/contrib/gsql/gui_about.adb0000644000175000017500000001070507475351164020450 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/gui_about.adb,v $ -- Description : Display the version information -- -- Author : Michael Erdmann -- -- Created : 8.8.2001 -- -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2002/05/30 07:19:16 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Text_IO; use Ada.Text_IO; with Glib; use Glib; with Gdk.Color; use Gdk.Color; with Gdk.Font; use Gdk.Font; with Gtk.Box; use Gtk.Box; with Gtk.Check_Button; use Gtk.Check_Button; with Gtk.Enums; use Gtk.Enums; with Gtk.Hbutton_Box; use Gtk.Hbutton_Box; with Gtk.Handlers; use Gtk.Handlers; with Gtk.Label; use Gtk.Label; with Gtk.Frame; use Gtk.Frame; with Gtk; use Gtk; with GUI_Window; use GUI_Window; with GUI_Dialog; use GUI_Dialog; package body GUI_About is Version : constant String := "$Id: gui_about.adb,v 1.3 2002/05/30 07:19:16 merdmann Exp $"; -------------- -- Add_Text -- -------------- procedure Add_Text( Textbox : in out Gtk_Box; Text : in String; First : in Boolean := False ) is Label : Gtk_Label; begin Gtk_New( Label, Text ); if First then Pack_Start(Textbox, Label ); else Pack_End( Textbox, Label ); end if; end Add_Text; --------------------- -- Dialog_Contents -- --------------------- procedure Dialog_Contents( This : in out Object; Vbox : in Gtk_Box ) is Textbox : Gtk_Box; Fr : Gtk_Frame; begin Gtk_New( Fr ); Gtk_New_Vbox( Textbox ); Add( Fr, Textbox ); Add_Text( Textbox, "GNADE SQL (GSQL) Development IDE", First => True ); Add_Text( Textbox, "GNADE is located at http://gnade.sourceforge.net/"); Add_Text( Textbox, "http://purl.org/net/michal.erdmann"); Add_Text( Textbox, "Copyright (C) 2001-2002 Michael Erdmann"); Add_Text( Textbox, "Version " & GUI_Window.Version & " $State: Exp $"); Show_All(Fr); Pack_Start( Vbox, Fr ); end Dialog_Contents; end GUI_About; gnade-1.6.2.orig/contrib/gsql/gui_about.ads0000644000175000017500000000553307354430350020463 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/gui_about.ads,v $ -- Description : GUI top level window -- Author : Michael Erdmann -- -- Created : 8.8.2001 -- -- Last Modified By: $Author: me $ -- Last Modified On: $Date: 2001/09/26 19:47:52 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Gtk.Box; use Gtk.Box; with GUI_Dialog; use GUI_Dialog; package GUI_About is type Object is new GUI_Dialog.Object with private; private type Object is new GUI_Dialog.Object with null record; procedure Dialog_Contents( This : in out Object; Vbox : in Gtk_Box ); end GUI_About; gnade-1.6.2.orig/contrib/gsql/gui_addrow.adb0000644000175000017500000003621107400775001020602 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/gui_addrow.adb,v $ -- Description : dialog to add a row to a table description -- -- Author : Michael Erdmann -- -- Created : 8.8.2001 -- -- Last Modified By: $Author: me $ -- Last Modified On: $Date: 2001/11/27 20:39:29 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Functional description -- -- ====================== -- -- -- -- Author -- -- ====== -- -- -- -- Author: Michael Erdmann -- -- -- -- Restrictions -- -- ============ -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Text_IO; use Ada.Text_IO; with Glib; use Glib; with Gdk.Color; use Gdk.Color; with Gdk.Font; use Gdk.Font; with Gtk.Box; use Gtk.Box; with Gtk.Clist; use Gtk.Clist; with Gtk.Check_Button; use Gtk.Check_Button; with Gtk.Radio_Button; use Gtk.Radio_Button; with Gtk.Enums; use Gtk.Enums; with Gtk.Hbutton_Box; use Gtk.Hbutton_Box; with Gtk.Handlers; use Gtk.Handlers; with Gtk.Label; use Gtk.Label; with Gtk.Frame; use Gtk.Frame; with Gtk.Gentry; use Gtk.Gentry; with Gtk.Radio_Menu_Item; use Gtk.Radio_Menu_Item; with Gtk.Widget; use Gtk.Widget; with Gtk; use Gtk; with Gsql_Types; use Gsql_Types; with GUI_Window; use GUI_Window; with GUI_Dialog; use GUI_Dialog; with GUI_Common; use GUI_Common; with GUI_Logging; use GUI_Logging; with GUI_Table; use GUI_Table; package body GUI_AddRow is Version : constant String := "$Id: gui_addrow.adb,v 1.11 2001/11/27 20:39:29 me Exp $"; --- ************************************************************************** --- -- *** C L A S S D A T A *** --- --- ************************************************************************** --- Cmd_Apply : constant Natural := 100; Cmd_Ok : constant Natural := 101; List_Of_Sql_Types : constant Text_Buffer := ( To_Unbounded_String( "boolean" ), To_Unbounded_String( "character(...)" ), To_Unbounded_String( "date" ), To_Unbounded_String( "decimal(p,s)" ), To_Unbounded_String( "float(p)" ), To_Unbounded_String( "smallint" ), To_Unbounded_String( "int" ), To_Unbounded_String( "integer" ), To_Unbounded_String( "interval" ), To_Unbounded_String( "decimal(p,s)" ), To_Unbounded_String( "numeric(p,s)" ), To_Unbounded_String( "time" ), To_Unbounded_String( "time with time zone" ), To_Unbounded_String( "timestamp with time zone"), To_Unbounded_String( "character varying(n)" ) ); SQL_Undef : constant Positive := 1; SQL_NULL : constant Positive := 2; SQL_Not_Null : constant Positive := 3; SQL_Constraints : constant Text_Buffer := ( SQL_Undef => To_Unbounded_String( "Empty" ), SQL_Null => To_Unbounded_String( "NULL" ), SQL_Not_Null => To_Unbounded_String( "NOT NULL" ) ); type Choice_Result_Type is array( Positive range <> ) of Gtk_Radio_Button; ------------ -- Choice -- ------------ function Choice( Parent : in Gtk_Box; Text : in Text_Buffer; Border : in Boolean := True ) return Choice_Result is -- create a set of radio buttons First : Boolean := True; Button : Gtk_Radio_Button; Vbox : Gtk_Box; Fr : Gtk_Frame; Result : Choice_Result := new Choice_Result_Type( Text'Range ); begin Gtk_New_Vbox( Vbox ); if Border then Gtk_New( Fr ); Add( Fr, Vbox ); end if; for I in Text'Range loop if First then Gtk_New (Button, Widget_SList.Null_List, To_String( Text(I) )); First := False; else Gtk_New (Button, Group (Button), To_String( Text(I) ) ); end if; Pack_Start (Vbox, Button, True, True, 0); Result(I) := Button; end loop; if Border then Pack_Start( Parent, Fr, Expand => False ); else Pack_Start( Parent, Vbox, Expand => False ); end if; return Result; end Choice; -------------- -- Selected -- -------------- function Selected( Choice : in Choice_Result ) return Natural is begin for I in Choice'Range loop if Get_Active (Choice(I)) then return I; end if; end loop; return 0; end Selected; --------- -- Set -- --------- procedure Set( Choice : in Choice_Result; Button : in Positive; Active : in Boolean := True ) is begin Gtk.Check_Button.Set_Active( Gtk_Check_Button(Choice(Button)), Active ); end Set; ------------------- -- Name_And_Type -- ------------------- procedure Name_And_Type( This : in out Object; Parent : in out Gtk_Box; Data : in Row_Information_Record ) is Vbox : Gtk_Box; Fr : Gtk_Frame; Name : Gtk_Entry renames This.Name; Sql_Type : Gtk_Combo renames This.Sql_Type; Sql_Primary : GUI_Checkbutton.Handle renames This.Sql_Primary; Sql_Unique : GUI_Checkbutton.Handle renames This.Sql_Unique; begin Gtk_New( Fr ); Set_Label( Fr, "Column name & type"); Gtk_New_Vbox( Vbox ); Add( Fr, Vbox ); Entry_Field( Vbox, This.Name, "Name " ); Set_Text( Name, To_String( Data.Name ) ); Combo_Field( Vbox, Sql_Type, "Type ", List_Of_SQL_Types ); Set_Text( Get_Entry(SQL_Type), To_String( Data.Sql_Type ) ); This.Sql_Null := Choice( Vbox, SQL_Constraints, Border => True ); if Data.Is_Null then Set( This.Sql_Null, SQL_NULL ); elsif Data.Is_Not_Null then Set( This.Sql_Null, SQL_NOT_NULL ); else Set( This.Sql_Null, SQL_Undef ); end if; Add_Checkbutton( Vbox, Sql_Primary, "PRIMARY KEY", Data.Primary_Key ); Add_Checkbutton( Vbox, Sql_Unique, "UNIQUE", Data.Unique ); Pack_Start( Parent, Fr ); Show_All( Fr ); end Name_And_Type; ----------------- -- Constraints -- ----------------- procedure Default_Value( This : in out Object; Parent : in out Gtk_Box; Data : in Row_Information_Record ) is Vbox : Gtk_Box; Fr : Gtk_Frame; Sql_Default : Gtk_Entry renames This.Sql_Default; begin Gtk_New( Fr ); Set_Label( Fr, "Default value expression"); Gtk_New_Vbox( Vbox ); Add( Fr, Vbox ); Entry_Field( Vbox, Sql_Default,"Default " ); Set_Text( SQL_Default, To_String( Data.Default ) ); Pack_Start( Parent, Fr ); Show_All( Fr ); end Default_Value; ----------------- -- Constraints -- ----------------- procedure Constraints( This : in out Object; Parent : in out Gtk_Box; Data : in Row_Information_Record ) is Vbox : Gtk_Box; Fr : Gtk_Frame; Sql_Constraint : Gtk_Entry renames This.Sql_Constraint; Sql_Check : Gtk_Entry renames This.Sql_Check; begin Gtk_New( Fr ); Set_Label( Fr, "Column constraints"); Gtk_New_Vbox( Vbox ); Add( Fr, Vbox ); Entry_Field( Vbox, Sql_Constraint, "Constraint Name" ); Set_Text( SQL_Constraint, To_String( Data.Constraint ) ); Entry_Field( Vbox, Sql_Check, "Check Condition" ); Pack_Start( Parent, Fr ); Show_All( Fr ); end Constraints; --- ************************************************************************** --- --- *** P U B L I C P R O C E D U R E S *** --- --- ************************************************************************** --- ---------------- -- Initialize -- ---------------- procedure Initialize( This : in out Object; Row : in Row_Information_Record; Sheet : in GUI_Worksheet.Object'Class ) is begin GUI_Dialog.Initialize( GUI_Dialog.Object(This) ); This.Sheet := Self( Sheet ); This.Row := Row; end Initialize; -------------- -- Finalize -- -------------- procedure Finalize( This : in out Object ) is begin Destroy( This.Sql_Type ); Destroy( This.Name ); Destroy( This.Sql_Default ); Destroy( This.Sql_Constraint ); Destroy( This.Comment ); GUI_Dialog.Finalize( GUI_Dialog.Object(This) ); end Finalize; ---------------- -- Get_Result -- ---------------- procedure Get_Result( This : in out Object; Data : out Row_Information_Record ) is -- this function gets all set parameters from the panel and -- stores it in the text buffer. Name : Gtk_Entry renames This.Name; Sql_Type : Gtk_Combo renames This.Sql_Type; Sql_Default : Gtk_Entry renames This.Sql_Default; Sql_Constraint : Gtk_Entry renames This.SQL_Constraint; Comment : Gtk_Entry renames This.Comment; Sql_Primary : GUI_Checkbutton.Handle renames This.Sql_Primary; Sql_Unique : GUI_Checkbutton.Handle renames This.Sql_Unique; begin Data.Name := To_Unbounded_String( Get_Text( Name ) ); Data.Sql_Type := To_Unbounded_String( Get_Text( Get_Entry(Sql_Type)) ); Data.Default := To_Unbounded_String( Get_Text( Sql_Default ) ); Data.Constraint := To_Unbounded_String( Get_Text( Sql_Constraint ) ); Data.Comment := To_Unbounded_String( Get_Text( Comment ) ); Data.Primary_Key := Is_Active( Sql_Primary ); Data.Unique := Is_Active( Sql_Unique ); case Selected( This.Sql_Null ) is when SQL_NULL => Data.Is_Null := True; Data.Is_Not_Null := False; when SQL_NOT_NULL => Data.Is_Null := False; Data.Is_Not_Null := True; when others => Data.Is_Null := False; Data.Is_Not_Null := False; end case; end Get_result; --------------------- -- Dialog_Contents -- --------------------- procedure Dialog_Contents( This : in out Object; Vbox : in Gtk_Box ) is -- display the row dialog Textbox : Gtk_Box; Ebox : Gtk_Box; Fr : Gtk_Frame; Sql_Type : Gtk_Combo renames This.Sql_Type; Sql_Default : Gtk_Entry renames This.Sql_Default; Sql_Constraint : Gtk_Entry renames This.Sql_Constraint; Comment : Gtk_Entry renames This.Comment; Data : Row_Information_Record; begin Gtk_New(Fr); Gtk_New_Vbox( Textbox ); Add( Fr, Textbox ); Name_And_Type( This, Textbox, This.Row ); Default_Value( This, Textbox, This.Row); Constraints( This, Textbox, This.Row ); Entry_Field( Textbox , Comment, "Comment" ); Show_All( Fr ); Pack_Start( Vbox, Fr ); Add_Command( This, "Apply", Cmd_Apply ); Add_Command( This, "OK", Cmd_Ok ); end Dialog_Contents; ------------- -- Command -- ------------- procedure Command( This : in out Object; Cmd : in Natural ) is -- execute all commands in this dialog Name : Gtk_Entry renames This.Name; Sql_Type : Gtk_Combo renames This.Sql_Type; Sql_Default : Gtk_Entry renames This.Sql_Default; Sql_Constraint : Gtk_Entry renames This.SQL_Constraint; Comment : Gtk_Entry renames This.Comment; Data : Row_Information_Record; begin case Cmd is when Dlg_Cmd_Dismiss => Finalize( This ); when Cmd_Apply => Get_Result( This, Data); GUI_Table.Insert_Row( GUI_Table.Object(This.Sheet.all), Data ); when Cmd_Ok => Get_Result( This, Data ); GUI_Table.Insert_Row( GUI_Table.Object(This.Sheet.all), Data ); Command( This, Dlg_Cmd_Dismiss ); when others => GUI_Logging.Error("Unknown internal command in gui_addrow.adb"); end case; end Command; end GUI_AddRow; gnade-1.6.2.orig/contrib/gsql/gui_addrow.ads0000644000175000017500000001011507400775001020616 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- 2 -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/gui_addrow.ads,v $ -- Description : Dialog to define a row in a relation -- Author : Michael Erdmann -- -- Created : 7.10.2001 -- -- Last Modified By: $Author: me $ -- Last Modified On: $Date: 2001/11/27 20:39:29 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Gtk.Box; use Gtk.Box; with Gtk.Gentry; use Gtk.Gentry; with Gtk.Combo; use Gtk.Combo; with GUI_Rowdefinition; use GUI_Rowdefinition; with GUI_Dialog; use GUI_Dialog; with GUI_Worksheet; use GUI_Worksheet; with GUI_Checkbutton; use GUI_Checkbutton; package GUI_AddRow is type Object is new GUI_Dialog.Object with private; procedure Initialize( This : in out Object; Row : in Row_Information_Record; Sheet : in GUI_Worksheet.Object'Class ) ; procedure Finalize( This : in out Object ); private type Choice_Result_Type ; type Choice_Result is access Choice_Result_Type; type Object is new GUI_Dialog.Object with record Name : Gtk_Entry; Sql_Type : Gtk_Combo; Sql_Default : Gtk_Entry; Sql_Constraint : Gtk_Entry; Sql_Check : Gtk_Entry; Sql_Primary : GUI_Checkbutton.Handle; Sql_Unique : GUI_Checkbutton.Handle; Row : Row_Information_Record; Comment : Gtk_Entry; Sheet : GUI_Worksheet.Handle := null; SQL_Null : Choice_Result := null; end record; procedure Dialog_Contents( This : in out Object; Vbox : in Gtk_Box ); procedure Command( This : in out Object; Cmd : in Natural); end GUI_AddRow; gnade-1.6.2.orig/contrib/gsql/gui_checkbutton.adb0000644000175000017500000001232107400523221021622 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/gui_checkbutton.adb,v $ -- Description : simplfies check box package -- Author : Michael Erdmann -- -- Created : 25.9.2001 -- -- Last Modified By: $Author: me $ -- Last Modified On: $Date: 2001/11/26 20:31:13 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Text_IO; use Ada.Text_IO; with Gtk.Box; use Gtk.Box; with Gtk.Button; use Gtk.Button; with Gtk.Check_Button; use Gtk.Check_Button; with Gtk.Handlers; use Gtk.Handlers; with Gtk.Label; use Gtk.Label; with Gtk.Widget; use Gtk.Widget; with Gtk; use Gtk; with Glib; use Glib; with Gdk; use Gdk; with GUI_Logging; package body GUI_Checkbutton is Version : constant String := "$Id: gui_checkbutton.adb,v 1.2 2001/11/26 20:31:13 me Exp $"; --- ************************************************************************** --- --- *** P R I V A T E M E T H O D S *** --- --- ************************************************************************** --- package Check_Cb is new Handlers.User_Callback(Gtk_Check_Button_Record, Gtk_Box); --------------- -- CB_Toggle -- --------------- procedure CB_Toggle ( Button : access Gtk_Check_Button_Record'Class; Parent : in Gtk_Box) is This : Object renames Object(Button.all); begin Put_Line("Toggle : " & Boolean'Image( This.Active ) ); if This.Active then This.Active := False; else This.Active := True; end if; end CB_Toggle; --- ************************************************************************** --- --- *** P U B L I C M E T H O D S *** --- --- ************************************************************************** --- --------------------- -- Add_Checkbutton -- --------------------- procedure Add_Checkbutton( Parent : in out Gtk_Box; This : out Handle; Title : in String; Active : in Boolean := False ) is Result : Gtk_Check_Button := new Object; begin This := Handle(Result); Gtk.Check_Button.Initialize( Result, Title ); This.Active := Active; Gtk.Check_Button.Set_Active( Result, Active ); Pack_Start (Parent, Result, Expand => False ); Check_Cb.Connect ( Result, "clicked", Check_Cb.To_Marshaller (CB_Toggle'Access), Parent); end Add_Checkbutton; --------------- -- Is_Active -- --------------- function Is_Active( This : in Handle ) return Boolean is begin Put_Line("Is_Active : " & Boolean'Image( This.Active ) ); return This.Active = True; end Is_Active; --------- -- Set -- --------- procedure Set( This : in Handle; Active : in Boolean) is begin This.Active := Active; Gtk.Check_Button.Set_Active( Gtk_Check_Button(This), Active ); end Set; end GUI_Checkbutton; gnade-1.6.2.orig/contrib/gsql/gui_checkbutton.ads0000644000175000017500000000621507400233331021650 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/gui_checkbutton.ads,v $ -- Description : GUI Checkbutton type -- Author : Michael Erdmann -- -- Created : 8.8.2001 -- -- Last Modified By: $Author: me $ -- Last Modified On: $Date: 2001/11/25 18:22:17 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Gtk.Box; use Gtk.Box; with Gtk.Check_Button; use Gtk.Check_Button; package GUI_Checkbutton is type Object is tagged private; type Handle is access all Object'Class; procedure Add_Checkbutton( Parent : in out Gtk_Box; This : out Handle; Title : in String; Active : in Boolean := False); function Is_Active( This : in Handle ) return Boolean; procedure Set( This : in Handle; Active : in Boolean); private type Object is new Gtk_Check_Button_Record with record Active : Boolean := False; end record; end GUI_Checkbutton; gnade-1.6.2.orig/contrib/gsql/gui_common.adb0000644000175000017500000002316607400233331020612 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/gui_common.adb,v $ -- Description : Commonly used GTK functions for the GUI -- Author : Michael Erdmann -- Created : 8.8.2001 -- Last Modified By: $Author: me $ -- Last Modified On: $Date: 2001/11/25 18:22:17 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Text_Io; use Ada.Text_IO; with Ada.Exceptions; use Ada.Exceptions; with Ada.Strings; use Ada.Strings; with Ada.Strings.Fixed; use Ada.Strings.Fixed; with Unchecked_Deallocation; with Interfaces.C.Strings; with Glib; use Glib; -- Gdk with Gdk; with Gdk.Drawable; use Gdk.Drawable; with Gdk.Bitmap; use Gdk.Bitmap; with Gdk.Event; use Gdk.Event; with Gdk.Font; use Gdk.Font; with Gdk.Color; use Gdk.Color; with Gdk.GC; use Gdk.GC; with Gdk.Pixmap; use Gdk.Pixmap; with Gdk.Rectangle; use Gdk.Rectangle; with Gdk.Types; use Gdk.Types; with Gdk.Window; use Gdk.Window; -- Gtk with Gtk.Rc; with Gtk; use Gtk; with Gtk.Arguments; use Gtk.Arguments; with Gtk.Box; use Gtk.Box; with Gtk.Button; use Gtk.Button; with Gtk.Clist; use Gtk.Clist; with Gtk.Editable; use Gtk.Editable; with Gtk.Enums; use Gtk.Enums; with Gtk.Frame; use Gtk.Frame; with Gtk.Handlers; use Gtk.Handlers; with Gtk.Label; use Gtk.Label; with Gtkada.Handlers; use Gtkada.Handlers; with Gtk.Scrolled_Window; use Gtk.Scrolled_Window; with Gtk.Style; use Gtk.Style; with Gtk.Text; use Gtk.Text; with Gtk.Window; use Gtk.Window; with Gtk.Widget; use Gtk.Widget; with Gtk.GEntry; use Gtk.GEntry; with Gtk.Combo; use Gtk.Combo; with GSQL_Types; use GSQL_Types; with GUI_Preferences; use GUI_Preferences; with GUI_Logging; use GUI_Logging; with Project_File; use Project_File; with Files; use Files; with Contents_Handler; use Contents_Handler; package body GUI_Common is Version : constant String := "$Id: gui_common.adb,v 1.10 2001/11/25 18:22:17 me Exp $"; package ICS renames Interfaces.C.Strings; use type Interfaces.C.size_t; ----------------- -- Entry_Field -- ----------------- procedure Entry_Field( Vbox : in out Gtk_Box; Field : out Gtk_Entry; Description : in String; Default : in String := ""; Maxlength : in Natural := 60 ) is --- Descr : Gtk_Label; Hbox : Gtk_Box; begin Gtk_New_Hbox (Hbox); Set_Border_Width( Hbox, 4 ); Gtk_New( Descr, Description & " : " ); Pack_Start(Hbox, Descr, Expand => False ); Gtk_New( Field ); if Default /= "" then Set_Text( Field, Default ); end if; Set_Visibility (Field, True); Set_Max_Length (Field, Guint16(Maxlength) ); Show_All( Field ); Pack_End( Hbox, Field ); Show_All( Hbox ); Pack_Start( Vbox, Hbox ); end Entry_Field; ------------------ -- Display_Name -- ------------------ function Display_Name( S : in Unbounded_String ) return String is -- create a name part suitable for the notebook names R : constant String := To_String(S); L : constant Natural := R'Length; begin if L < 16 then return R; end if; return R(1..8) & ".." & R(L-5..L); end Display_Name; -------------- -- Add_Text -- -------------- procedure Add_Text( A : in Gtk_Box; Text : in String ) is L : Gtk_Label; begin Gtk_New( L, Text ); Pack_Start( A, L, Expand => False ); Show_All(L); end Add_Text; ---------------- -- Add_Editor -- ---------------- procedure Add_Editor( A : in out Gtk_Box; T : out Gtk_Text; Text : in String := "" ) is Scrolled : Gtk_Scrolled_Window; EdBox : Gtk_Box; L : Gtk_Label; begin Gtk_New_Vbox( Edbox ); if Text /= "" then Gtk_New( L, Text ); Pack_Start( Edbox, L, Expand => False ); Show_All(L); end if; Gtk_New (Scrolled); Pack_Start (Edbox, Scrolled, Expand => True ); Set_Policy (Scrolled, Policy_Never, Policy_Always); Show (Scrolled); Gtk_New( T ); Set_Editable (T, True); Add( Scrolled,T ); Pack_Start( A, Edbox, Expand => True ); Show_All (Edbox); end Add_Editor; --------------- -- Add_Table -- --------------- procedure Add_Table( A : in out Gtk_Box; Clist : out Gtk_Clist; Cols : in Integer ) is use ICS; Vbox : Gtk_Box; Scrolled : Gtk_Scrolled_Window; Titles : Chars_Ptr_Array (1 .. C.Size_T(Cols) ) := (others=>ICS.Null_Ptr); begin Gtk_New_Vbox( Vbox ); Show_All (Vbox); Gtk_New (Scrolled); Pack_Start (Vbox, Scrolled, True, True, 0); Set_Policy (Scrolled, Policy_Automatic, Policy_Automatic); Gtk_New (Clist, Gint (Cols), Titles); Add (Scrolled, Clist); Pack_Start( A, Vbox, Expand => True ); end Add_Table; ---------------- -- Insert_Row -- ---------------- procedure Insert_Row( Clist : in out Gtk_Clist; Text : in Text_Buffer; Row : in Natural := 0 ) is -- insert a row into a table. use ICS; Len : constant C.Size_T := C.Size_T( Text'Last - Text'First ); Texts : Chars_Ptr_Array (0 .. Len ):=(others=>ICS.Null_Ptr); New_Row : Gint; J : C.Size_T := Texts'First; begin for I in Text'Range loop Texts(J) := ICS.New_String(To_String( Text(I) ) ); J := J + 1; end loop; Freeze( Clist ); if Row = 0 then New_Row := Append (Clist, Texts); else Insert( Clist, Gint( Row - 1 ), Texts ); end if; Thaw( Clist ); -- Free( Texts ); end Insert_Row; ---------------------- -- Remove_Selection -- ---------------------- procedure Remove_Selection ( CList : in out Gtk_Clist ) is use Gint_List; I : Gint; begin Freeze (Clist); loop exit when Length (Get_Selection (CList)) = 0; I := Get_Data (First (Get_Selection (CList))); Remove (CList, I); exit when Get_Selection_Mode (CList) = Selection_Browse; end loop; Thaw (CList); end Remove_Selection; ----------------- -- Combo_field -- ----------------- procedure Combo_Field( Vbox : in out Gtk_Box; Field : out Gtk_Combo; Description : in String; Values : in Text_Buffer; Maxlength : in Natural := 60 ) is --- use String_List; Descr : Gtk_Label; List : String_List.Glist; Hbox : Gtk_Box; begin Gtk_New_Hbox (Hbox); Set_Border_Width( Hbox, 4 ); Gtk_New( Descr, Description & " : " ); Pack_Start(Hbox, Descr, Expand => False ); for I in Values'Range loop Append( List, To_String( Values(I) ) ); end loop; Gtk_New( Field ); Set_Popdown_Strings (Field, List); Gtk.GEntry.Select_Region (Get_Entry (Field), 0, -1); Show_All( Field ); Pack_Start( Hbox, Field, True, True, 0 ); Show_All( Hbox ); Pack_Start( Vbox, Hbox ); end Combo_Field; end GUI_Common; gnade-1.6.2.orig/contrib/gsql/gui_common.ads0000644000175000017500000000770007400233331020627 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/gui_common.ads,v $ -- Description : common GUI procedures -- Author : Michael Erdmann -- Created : 8.8.2001 -- Last Modified By: $Author: me $ -- Last Modified On: $Date: 2001/11/25 18:22:17 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Gsql_Types; use Gsql_Types; with Gtk.Box; use Gtk.Box; with Gtk.GEntry; use Gtk.GEntry; with Gtk.Combo; use Gtk.Combo; with Gtk.Text; use Gtk.Text; with Gtk.Clist; use Gtk.Clist; package GUI_Common is ----------------- -- Entry_Field -- ----------------- procedure Entry_Field( Vbox : in out Gtk_Box; Field : out Gtk_Entry; Description : in String; Default : in String := ""; Maxlength : in Natural := 60 ); ------------------ -- Display_Name -- ------------------ function Display_Name( S : in Unbounded_String ) return String; -------------- -- Add_Text -- -------------- procedure Add_Text( A : in Gtk_Box; Text : in String ); ---------------- -- Add_Editor -- ---------------- procedure Add_Editor( A : in out Gtk_Box; T : out Gtk_Text; Text : in String := "" ); --------------- -- Add_Table -- --------------- procedure Add_Table( A : in out Gtk_Box; Clist : out Gtk_Clist; Cols : in Integer ); procedure Insert_Row( Clist : in out Gtk_Clist; Text : in Text_Buffer; Row : in Natural := 0); procedure Remove_Selection ( CList : in out Gtk_Clist ); procedure Combo_Field( Vbox : in out Gtk_Box; Field : out Gtk_Combo; Description : in String; Values : in Text_Buffer; Maxlength : in Natural := 60 ); end GUI_Common; gnade-1.6.2.orig/contrib/gsql/gui_dialog.adb0000644000175000017500000001742407360403417020572 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/gui_dialog.adb,v $ -- Description : Top level class for all dialog windows -- Author : Michael Erdmann -- -- Created : 25.9.2001 -- -- Last Modified By: $Author: me $ -- Last Modified On: $Date: 2001/10/08 20:05:35 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Text_IO; use Ada.Text_IO; with Gtk.Box; use Gtk.Box; with Gtk.Button; use Gtk.Button; with Gtk.Dialog; use Gtk.Dialog; with Gtk.Handlers; use Gtk.Handlers; with Gtk.Label; use Gtk.Label; with Gtk.Widget; use Gtk.Widget; with Gtk; use Gtk; with Glib; use Glib; with Gdk; use Gdk; with GUI_Logging; package body GUI_Dialog is Version : constant String := "$Id: gui_dialog.adb,v 1.4 2001/10/08 20:05:35 me Exp $"; Active_Dlg : Gtk_Dialog; package Destroy_Dialog_Handler is new Handlers.User_Callback (Gtk_Dialog_Record, Handle); package Widget_Handler is new Handlers.Callback (Gtk_Widget_Record); -------------------------- -- Dialog_Button_Record -- -------------------------- type Dialog_Button_Record is new Gtk_Button_Record with record Receiver : Handle := null; Cmd : Natural := 0; end record; type Dialog_Button is access all Dialog_Button_Record'Class; package Button_Cb is new Handlers.Callback (Dialog_Button_Record); --- ************************************************************************** --- --- *** P R I V A T E M E T H O D S *** --- --- ************************************************************************** --- -------------------- -- Button pressed -- -------------------- procedure CB_Button_Pressed( Pressed : access Dialog_Button_Record'Class ) is begin if Pressed.Receiver /= null then Command(Pressed.Receiver.all, Pressed.Cmd ); else Put_Line("Command not executed"); end if; end CB_Button_Pressed; ---------------- -- Add_Button -- ---------------- procedure Add_Button( Receiver : in Object'Class; Title : in String; Cmd : in Natural; Box : in out Gtk_Box ) is Result : Dialog_Button := new Dialog_Button_Record; begin Gtk.Button.Initialize( Result, Title ); Result.Receiver := Receiver.Self; Result.Cmd := Cmd; Pack_Start (Box, Result, Expand => False ); Button_CB.Object_Connect( result, "clicked", Button_CB.To_Marshaller (CB_Button_Pressed'Access ), Slot_Object => Result ); end Add_Button; -------------------- -- Destroy_Dialog -- -------------------- procedure Destroy_Dialog ( Win : access Gtk.Dialog.Gtk_Dialog_Record'Class; Ptr : in Handle) is begin Active_DLG := null; end Destroy_Dialog; --- ************************************************************************** --- --- *** P U B L I C M E T H O D S *** --- --- ************************************************************************** --- ---------------- -- Initialize -- ---------------- procedure Initialize( This : in out Object ) is begin This.Self := This'Unchecked_Access; Gtk_New( This.Dialog ); end Initialize; -------------- -- Finalize -- -------------- procedure Finalize( This : in out Object ) is begin Active_DLG := null; Destroy( This.Dialog ); end Finalize; --------------------- -- Dialog_Contents -- --------------------- procedure Dialog_Contents( This : in out Object; Vbox : in Gtk_Box ) is -- this procedure has to be redefined in the application. Label : Gtk_Label; begin Gtk_New (Label, "Dialog_contents not yet implemented " ); Pack_Start( Vbox, Label, Expand => False ); end Dialog_Contents; ---------------- -- Add_Dialog -- ---------------- procedure Add_Dialog( This : in out Object'Class; Title : in String; SizeX : in Integer := 0; SizeY : in Integer := 0 ) is -- add a dialog window Area : Gtk_Box renames This.Area; Vbox : Gtk_Box renames This.Vbox; begin if Active_DLG /= null then GUI_Logging.Error("*** Internal error 001 in GUI_Dialog ***"); return; end if; Gtk_New (This.Dialog); Active_Dlg := This.Dialog; Destroy_Dialog_Handler.Connect (This.Dialog, "destroy", Destroy_Dialog_Handler.To_Marshaller (Destroy_Dialog'Access), This.Self); Set_Title (This.Dialog, Title ); Set_Border_Width (This.Dialog, 0); if SizeX > 0 and SizeY > 0 then Set_Usize (This.Dialog, GInt(SizeX), GInt(SizeY)); end if; Area := Get_Action_Area(This.Dialog); Show_All( Area ); Add_Command( This, "DISMISS", Dlg_Cmd_Dismiss ); Vbox := Get_VBox(This.Dialog); Dialog_Contents( This, Vbox ); Show_All( Vbox ); Show (This.Dialog); end Add_Dialog; ----------------- -- Add_Command -- ----------------- procedure Add_Command( This : in out Object'Class; Text : in String; Cmd : in Natural ) is begin Add_Button( This, Text,Cmd, This.Area); end Add_Command; ------------- -- Command -- ------------- procedure Command( This : in out Object; Cmd : in Natural ) is begin if Cmd = Dlg_Cmd_Dismiss then Finalize( This ); end if; end Command; end GUI_Dialog; gnade-1.6.2.orig/contrib/gsql/gui_dialog.ads0000644000175000017500000000706007360112142020576 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/gui_dialog.ads,v $ -- Description : GUI top level window -- Author : Michael Erdmann -- -- Created : 8.8.2001 -- -- Last Modified By: $Author: me $ -- Last Modified On: $Date: 2001/10/07 17:44:02 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Gtk.Box; use Gtk.Box; with Gtk.Dialog; use Gtk.Dialog; package GUI_Dialog is type Object is tagged private; type Handle is access all Object'Class; procedure Initialize( This : in out Object ); procedure Finalize( This : in out Object ); procedure Add_Dialog( This : in out Object'Class; Title : in String; SizeX : in Integer := 0; SizeY : in Integer := 0 ); procedure Dialog_Contents( This : in out Object; Vbox : in Gtk_Box ); procedure Add_Command( This : in out Object'Class; Text : in String; Cmd : in Natural ); procedure Command( This : in out Object; Cmd : in Natural ); Dlg_Cmd_Dismiss : constant Natural := 0; private type Object is tagged record Dialog : Gtk_Dialog; Self : Handle := null; Area : Gtk_Box; -- box where all command go into Vbox : Gtk_Box; -- boy where all dialog elements will be placed end record; end GUI_Dialog; gnade-1.6.2.orig/contrib/gsql/gui_editor.adb0000644000175000017500000002144407755664546020642 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/gui_editor.adb,v $ -- Description : managing the SQL eidtor -- Author : Michael Erdmann -- Created : 8.8.2001 -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2003/11/16 12:11:18 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Text_Io; use Ada.Text_IO; with Ada.Exceptions; use Ada.Exceptions; with Ada.Strings; use Ada.Strings; with Ada.Strings.Fixed; use Ada.Strings.Fixed; with Unchecked_Deallocation; with Glib; use Glib; -- Gdk with Gdk; with Gdk.Drawable; use Gdk.Drawable; with Gdk.Bitmap; use Gdk.Bitmap; with Gdk.Event; use Gdk.Event; with Gdk.Font; use Gdk.Font; with Gdk.Color; use Gdk.Color; with Gdk.GC; use Gdk.GC; with Gdk.Pixmap; use Gdk.Pixmap; with Gdk.Rectangle; use Gdk.Rectangle; with Gdk.Types; use Gdk.Types; with Gdk.Window; use Gdk.Window; -- Gtk with Gtk.Rc; with Gtk; use Gtk; with Gtk.Arguments; use Gtk.Arguments; with Gtk.Box; use Gtk.Box; with Gtk.Button; use Gtk.Button; with Gtk.Editable; use Gtk.Editable; with Gtk.Enums; use Gtk.Enums; with Gtk.Frame; use Gtk.Frame; with Gtk.Handlers; use Gtk.Handlers; with Gtk.Label; use Gtk.Label; with Gtk.Notebook; use Gtk.Notebook; with Gtkada.Handlers; use Gtkada.Handlers; with Gtk.Scrolled_Window; use Gtk.Scrolled_Window; with Gtk.Style; use Gtk.Style; with Gtk.Text; use Gtk.Text; with Gtk.Window; use Gtk.Window; with Gtk.Widget; use Gtk.Widget; with Gtk.GEntry; use Gtk.GEntry; with GUI_Logging; use GUI_Logging; with GUI_Common; use GUI_Common; with GSQL_Types; use GSQL_Types; with Project_File; use Project_File; with Files; use Files; with Contents_Handler; use Contents_Handler; with Text_Block; use Text_Block; package body GUI_Editor is Version : constant String := "$Id: gui_editor.adb,v 1.20 2003/11/16 12:11:18 merdmann Exp $"; --- ************************************************************************** --- -- *** C L A S S D A T A *** --- --- ************************************************************************** --- Dismiss_CMD : constant Natural := 1; --- ************************************************************************** --- --- *** I N S T A N C E D A T A *** --- --- ************************************************************************** --- ---------------- -- Get_Result -- ---------------- procedure Get_Result( This : in Object; Text : out Text_Buffer; Last : out Positive ) is -- copy the current editor contents into the buffer handled by the -- contents manager/handler. Description : Gtk_Text renames This.Description; Query : Gtk_Text renames This.Query; Title : Gtk_Entry renames This.Title; Result : Text_Buffer( 1..Max_Section_Length ); Item : Contents_Handler.Handle := Contents( This ); begin Last := Text'First; Text(Last) := To_Unbounded_String( Get_Text( Title ) ); Last := Last + 1; Put_Text_Block( Text, To_Text_Buffer(Get_Chars(Gtk_Editable(Description))), Last ); Put_Text_Block( Text, To_Text_Buffer( Get_Chars( Gtk_Editable(Query))), Last); end Get_Result; ----------- -- Query -- ----------- procedure Query( This : in Object; Text : out Text_Buffer; Last : out Positive ) is -- get only the query Query : Gtk_Text renames This.Query; begin Last := Text'First; Insert( Text, To_Text_Buffer(Get_Chars(Gtk_Editable(Query))), Last ); end Query; --------------- -- Set_Input -- --------------- procedure Set_Input( This : in Object; Text : in Text_Buffer ) is -- Description : Gtk_Text renames This.Description; Query : Gtk_Text renames This.Query; Title : Gtk_Entry renames This.Title; Last : Positive := Text'First; procedure Read_Block( Editor : in Gtk_Text) is begin Freeze(Editor); while Last in Text'Range loop if Is_End_Of_Block( Text(Last) ) then Last := Last + 1; exit; end if; Insert( Editor, Null_Font, Null_Color, Null_Color, To_String( Text(Last) ) & Ascii.LF, Gint (To_String( Text(Last) )'Length) + 1 ); Last := Last + 1; end loop; Thaw( Editor ); end Read_Block; begin Set_Text( Title, To_String( Text( Last ) ) ); Last := Last + 1; Read_Block( Description ); Read_Block( Query ); end Set_Input; --- ************************************************************************** --- --- *** Q U E R Y E D I T O R DEFINITION *** --- --- ************************************************************************** --- ---------------- -- Add_Editor -- ---------------- procedure Display( This : in out Object; Box : in out Gtk_Box ) is --- display the SQL editor Vbox : Gtk_Box renames This.Vbox; Title : Gtk_Entry renames This.Title; Description : Gtk_Text renames This.Description; Query : Gtk_Text renames This.Query; Text : Text_Buffer( 1..Max_Section_Length ); Last : Positive := 1; --- begin Gtk_New_Vbox (Vbox); Entry_Field( Vbox, Title, "Title" ); GUI_Common.Add_Editor( Vbox, Description, "Description" ); GUI_Common.Add_Editor( Vbox, Query, "Query Text" ); Load( Contents(This).all, Text, Last ); Set_Input( This, Text(1..Last) ); ---------------------- Pack_Start( Box, Vbox ); Show_All( Box ); Add_Command( This, "Dismiss", Dismiss_CMD ); end Display; ------------- -- Command -- ------------- procedure Command( This : in out Object; Cmd : in Natural ) is begin case Cmd is when Dismiss_CMD => Remove_Sheet( This ); when others => GUI_Logging.Log("Pressed cmd: " & Natural'Image( Cmd ) ); end case; end Command; end GUI_Editor; gnade-1.6.2.orig/contrib/gsql/gui_editor.ads0000644000175000017500000000672207360040501020630 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/gui_editor.ads,v $ -- Description : query editor implementation -- Author : Michael Erdmann -- Created : 8.8.2001 -- Last Modified By: $Author: me $ -- Last Modified On: $Date: 2001/10/07 11:49:21 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Gtk.Text; use Gtk.Text; with Gtk.Box; use Gtk.Box; with Gtk.Gentry; use Gtk.Gentry; with GSQL_Types; use GSQL_Types; with GUI_Worksheet; use GUI_Worksheet; package GUI_Editor is type Object is new GUI_Worksheet.Object with private; procedure Get_Result( This : in Object; Text : out Text_Buffer; Last : out Positive ); procedure Set_Input( This : in Object; Text : in Text_Buffer ); procedure Query( This : in Object; Text : out Text_Buffer; Last : out Positive ); private type Object is new GUI_Worksheet.Object with record Title : Gtk_Entry; Description : Gtk_Text; Query : Gtk_Text; Vbox : Gtk_Box; end record; procedure Display( This : in out Object; Box : in out Gtk_Box ); procedure Command( This : in out Object; Cmd : in Natural ); end GUI_Editor; gnade-1.6.2.orig/contrib/gsql/gui_files.adb0000644000175000017500000001155007352723542020434 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/gui_files.adb,v $ -- Description : File Select dialog -- Author : Michael Erdmann -- Created : 18.8.2001 -- Last Modified By: $Author: me $ -- Last Modified On: $Date: 2001/09/21 20:47:30 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Text_IO; use Ada.Text_IO; with Gtk.Box; use Gtk.Box; with Gtk.Button; use Gtk.Button; with Gtk.Enums; use Gtk.Enums; with Gtk.File_Selection; use Gtk.File_Selection; with Gtk.Handlers; use Gtk.Handlers; with Gtk.Widget; use Gtk.Widget; with Gtk; use Gtk; with GUI_Editor; use GUI_Editor; package body GUI_Files is type Gtk_File_Selection_Access is access all Gtk_File_Selection; package Destroy_Cb is new Handlers.User_Callback (Gtk_File_Selection_Record, Gtk_File_Selection_Access); package Files_Cb is new Handlers.Callback (Gtk_File_Selection_Record); package Widget_Handler is new Handlers.Callback (Gtk_Widget_Record); File_Select : aliased Gtk_File_Selection; --- *************************************************************************** -- --- *** HANDLE FILE SELECTION *** -- --- *************************************************************************** -- -------- -- Ok -- -------- procedure OK (Files : access Gtk_File_Selection_Record'Class) is File : File_Type ; begin Put_Line ("Selected " & Get_Filename (Files) & "."); -- GUI_Editor.Save_As( Name => Get_Filename( Files ) ); Destroy (Files); end Ok; ------------ -- Cancel -- ------------ procedure Cancel (Win : access Gtk_Widget_Record'Class) is begin Destroy (Win); end Cancel; --------------- -- Destroyed -- --------------- procedure Destroyed ( Win : access Gtk_File_Selection_Record'Class; Ptr : in Gtk_File_Selection_Access) is pragma Warnings (Off, Win); begin Ptr.all := null; end Destroyed; ------------------------ -- File_Select_Dialog -- ------------------------ procedure Dialog is Button : Gtk_Button; begin Gtk_New (File_Select, Title => "File Selection Dialog"); Hide_Fileop_Buttons (File_Select); Set_Position (File_Select, Win_Pos_Mouse); Destroy_Cb.Connect( File_Select, "destroy", Destroy_Cb.To_Marshaller (Destroyed'Access), File_Select'Access ); Files_Cb.Object_Connect( Get_Ok_Button (File_Select), "clicked", Files_Cb.To_Marshaller (Ok'Access), Slot_Object => File_Select ); Widget_Handler.Object_Connect( Get_Cancel_Button(File_Select), "clicked", Widget_Handler.To_Marshaller (Cancel'Access), Slot_Object => File_Select ); Show (File_Select); end Dialog; end GUI_Files; gnade-1.6.2.orig/contrib/gsql/gui_files.ads0000644000175000017500000000457607337455342020472 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/gui_files.ads,v $ -- Description : GUI for the data base client -- Author : Michael Erdmann -- Created : 8.8.2001 -- Last Modified By: $Author: me $ -- Last Modified On: $Date: 2001/08/18 12:09:06 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- package GUI_Files is procedure Dialog; end GUI_Files; gnade-1.6.2.orig/contrib/gsql/gui_license.adb0000644000175000017500000001231507475351164020757 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/gui_license.adb,v $ -- Description : Display the license information on in a small browser -- -- Author : Michael Erdmann -- -- Created : 23.9.2001 -- -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2002/05/30 07:19:16 $ -- Status : $State: Exp $ -- -- -- Copyright (C) 2000 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Text_IO; use Ada.Text_IO; with Glib; use Glib; with Gdk.Color; use Gdk.Color; with Gdk.Font; use Gdk.Font; with Gtk.Box; use Gtk.Box; with Gtk.Check_Button; use Gtk.Check_Button; with Gtk.Enums; use Gtk.Enums; with Gtk.Hbutton_Box; use Gtk.Hbutton_Box; with Gtk.Handlers; use Gtk.Handlers; with Gtk.Main; use Gtk.Main; with Gtk.Scrolled_Window; use Gtk.Scrolled_Window; with Gtk.Text; use Gtk.Text; with Gtk; use Gtk; with GUI_Dialog; use GUI_Dialog; with GUI_Logging; use GUI_Logging; with GUI_Menu; use GUI_Menu; package body GUI_License is Version : constant String := "$Id: gui_license.adb,v 1.4 2002/05/30 07:19:16 merdmann Exp $"; Cmd_Disagree : constant Natural := 100; --------------------- -- Dialog_Contents -- --------------------- procedure Dialog_Contents( This : in out Object; Vbox : in Gtk_Box ) is Scrolled : Gtk_Scrolled_Window; Text : Gtk_Text; begin Gtk_New (Scrolled); Pack_Start (Vbox, Scrolled, True, True, 0 ); Set_Policy (Scrolled, Policy_Never, Policy_Always); Show (Scrolled); Gtk_New (Text); Set_Editable (Text, False); Add( Scrolled, Text ); Show_All (Text); declare Buffer : String (1 .. 1024); Last : Natural; Infile : File_Type; begin Open (Infile, In_File, "COPYING"); while not End_Of_File (Infile) loop Get_Line (Infile, Buffer, Last); Insert (Text, Null_Font, Null_Color, Null_Color, Buffer (1 .. Last) & Ascii.LF, Gint (Last) + 1); end loop; Close (Infile); exception when Name_Error => Error ("License file not found"); end; Add_Command( This, "I disagree", Cmd_Disagree ); end Dialog_Contents; ------------- -- Command -- ------------- procedure Command( This : in out Object; Cmd : in Natural ) is begin Put_Line("Calling command"); case Cmd is when Dlg_Cmd_Dismiss => GUI_Dialog.Command( GUI_Dialog.Object(This), Cmd ); when Cmd_Disagree => GUI_Menu.Dont_Save := True; Gtk.Main.Main_Quit; when others => GUI_Logging.Error("Unknown internal command in gui_addrow.adb"); end case; end Command; end GUI_License; gnade-1.6.2.orig/contrib/gsql/gui_license.ads0000644000175000017500000000565707360112142020773 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/gui_license.ads,v $ -- Description : GUI top level window -- Author : Michael Erdmann -- -- Created : 8.8.2001 -- -- Last Modified By: $Author: me $ -- Last Modified On: $Date: 2001/10/07 17:44:02 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Gtk.Box; use Gtk.Box; with GUI_Dialog; use GUI_Dialog; package GUI_License is type Object is new GUI_Dialog.Object with private; private type Object is new GUI_Dialog.Object with null record; procedure Dialog_Contents( This : in out Object; Vbox : in Gtk_Box ); procedure Command( This : in out Object; Cmd : in Natural ); end GUI_License; gnade-1.6.2.orig/contrib/gsql/gui_logging.adb0000644000175000017500000001472507354160663020770 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/gui_logging.adb,v $ -- Description : GUI for the data base client -- Author : Michael Erdmann -- Created : 8.8.2001 -- Last Modified By: $Author: me $ -- Last Modified On: $Date: 2001/09/25 19:57:39 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Text_Io; use Ada.Text_IO; with Ada.Exceptions; use Ada.Exceptions; with Ada.Strings; use Ada.Strings; with Ada.Strings.Fixed; use Ada.Strings.Fixed; with Glib; use Glib; -- Gdk with Gdk; with Gdk.Drawable; use Gdk.Drawable; with Gdk.Bitmap; use Gdk.Bitmap; with Gdk.Event; use Gdk.Event; with Gdk.Font; use Gdk.Font; with Gdk.Color; use Gdk.Color; with Gdk.GC; use Gdk.GC; with Gdk.Pixmap; use Gdk.Pixmap; with Gdk.Rectangle; use Gdk.Rectangle; with Gdk.Types; use Gdk.Types; with Gdk.Window; use Gdk.Window; -- Gtk with Gtk.Rc; with Gtk; use Gtk; with Gtk.Arguments; use Gtk.Arguments; with Gtk.Box; use Gtk.Box; with Gtk.Button; use Gtk.Button; with Gtk.Enums; use Gtk.Enums; with Gtk.Frame; use Gtk.Frame; with Gtk.Handlers; use Gtk.Handlers; with Gtk.Label; use Gtk.Label; with Gtk.Pixmap; use Gtk.Pixmap; with Gtkada.Handlers; use Gtkada.Handlers; with Gtk.Status_Bar; use Gtk.Status_Bar; with Gtk.Style; use Gtk.Style; with Gtk.Text; use Gtk.Text; with Gtk.Window; use Gtk.Window; with Gtk.Widget; use Gtk.Widget; package body GUI_Logging is Version : constant String := "$Id: gui_logging.adb,v 1.3 2001/09/25 19:57:39 me Exp $"; ----------------- -- GTK Objects -- ----------------- Logging : Gtk_Text; Logging_Font : Gdk_Font; Status : Gtk_Status_Bar; DB_Status : Gtk_Status_Bar; Error_Color : Gdk_Color; Warning_Color : Gdk_Color; ---------------- -- Initialize -- ---------------- procedure Initialize is begin null; end Initialize; -------------- -- Finalize -- -------------- procedure Finalize is begin null; end Finalize; --------- -- Log -- --------- procedure Log( Text : in String ) is begin Insert ( Logging, Logging_Font, Warning_Color, Null_Color, Text & Ascii.LF, -1); end Log; ----------- -- Error -- ----------- procedure Error( Text : in String ) is begin Insert ( Logging, Logging_Font, Error_Color, Null_Color, Text & Ascii.LF, -1); end Error; ----------------- -- Add_logging -- ----------------- procedure Add_Logging( Vbox : in out Gtk_Box ) is begin Load (Logging_Font, "-adobe-courier-medium-r-normal--*-120-*-*-*-*-*-*"); Gtk_New(Logging); Pack_Start(Vbox, Logging, Expand=>False, Fill=>False); end Add_Logging; ---------------- -- Add_Status -- ---------------- procedure Add_Status( Wbox : in out Gtk_Box ) is St_Frame : Gtk_Frame; Hbox : Gtk_Box; begin Set_Rgb (Error_Color, 16#FFFF#, 16#0#, 16#0#); Set_Rgb (Warning_Color, 16#0# , 16#0#, 16#FFFF#); Gtk_New ( Status ); Gtk_New ( DB_Status ); Gtk_New ( St_Frame ); Gtk_New_Hbox( Hbox ); Add( St_Frame, Hbox ); Pack_Start( Hbox, Child => Status, Expand => True ); Pack_End( Hbox, Child => DB_Status, Expand => True ); Show_All( Hbox ); Pack_End (Wbox , Child => St_Frame, Expand => False); Show_All( St_Frame ); end Add_Status; ---------------- -- Set_Status -- ---------------- procedure Set_Status( S : in String ) is Id : Message_Id; begin Id := Push (Status, 1, S); end Set_Status; ------------------ -- Clear_Status -- ------------------ procedure Clear_Status is begin Pop( Status, 1 ); end Clear_Status; --------------------- -- Active_Database -- --------------------- procedure Active_Database( Name : in String ) is Id : Message_Id; begin Pop( DB_Status, 1); Id := Push (DB_Status, 1, Name); end Active_Database; end GUI_Logging; gnade-1.6.2.orig/contrib/gsql/gui_logging.ads0000644000175000017500000000603407353340345020777 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/gui_logging.ads,v $ -- Description : GUI for the SQL client -- Author : Michael Erdmann -- -- Created : 8.8.2001 -- -- Last Modified By: $Author: me $ -- Last Modified On: $Date: 2001/09/23 11:00:53 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Gtk.Box; use Gtk.Box; with Gtk.Frame; use Gtk.Frame; package GUI_Logging is procedure Initialize; procedure Finalize; procedure Log( Text : in String ); procedure Error( Text : in String ); procedure Add_Logging( Vbox : in out Gtk_Box ) ; procedure Add_Status( Wbox : in out Gtk_Box ); procedure Set_Status( S : in String ); procedure Clear_Status; procedure Active_Database( Name : in String ); end GUI_logging; gnade-1.6.2.orig/contrib/gsql/gui_menu.adb0000644000175000017500000002077710670060161020275 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/gui_menu.adb,v $ -- Description : Handling of menu entires -- -- Author : Michael Erdmann -- -- Created : 8.8.2001 -- -- Last Modified By: $Author: persan $ -- Last Modified On: $Date: 2007/09/06 20:17:53 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Strings; use Ada.Strings; -- Gdk with Gdk; with Gdk.Window; use Gdk.Window; -- Gtk with Gtk; use Gtk; with Gtk.Enums; use Gtk.Enums; with Gtk.Handlers; use Gtk.Handlers; with Gtk.Menu_Bar; use Gtk.Menu_Bar; with Gtk.Menu; use Gtk.Menu; with Gtk.Main; use Gtk.Main; with Gtk.Menu_Item; use Gtk.Menu_Item; with Gtk.Window; use Gtk.Window; with Gtk.Widget; use Gtk.Widget; with GUI_Dialog; use GUI_Dialog; with GUI_License; use GUI_License; with GUI_About; use GUI_About; package body GUI_Menu is Version : constant String := "$Id: gui_menu.adb,v 1.10 2007/09/06 20:17:53 persan Exp $"; ----------------- -- GTK Objects -- ----------------- Menubar : Gtk_Menu_Bar; MI_Exit : constant Natural := 1; MI_About : constant Natural := 2; MI_License : constant Natural := 3; MI_Save_As : constant Natural := 4; MI_Open_Project : constant Natural := 5; MI_Close_Project : constant Natural := 6; MI_New_Project : constant Natural := 7; File_Menu : Menu_Definition (1 .. 2) := ( 1 => (To_Unbounded_String ("Exit"), MI_Exit), 2 => (To_Unbounded_String ("Close"), MI_Close_Project) -- 3 => ( To_Unbounded_String("Save as"), MI_Save_As ), -- -- 4 => ( To_Unbounded_String("Open Project"), MI_Open_Project ), -- 5 => ( To_Unbounded_String("Close Project"), MI_Close_Project ), -- 6 => ( To_Unbounded_String("New Project"), MI_New_Project ) ); Help_Menu : Menu_Definition (1 .. 2) := ( 1 => (To_Unbounded_String ("About"), MI_About), 2 => (To_Unbounded_String ("License"), MI_License) ); ------------------------ -- Menu Item Handling -- ------------------------ type Menu_Item_Record is new Gtk_Menu_Item_Record with record Id : Natural := 0; end record; type Menu_Item is access all Menu_Item_Record; package Menu_Item_Callback is new Gtk.Handlers.Callback (Gtk_Menu_Item_Record); ---------------------- -- Support Packages -- ---------------------- package Destroyed is new Gtk.Handlers.Callback ( Widget_Type => Gtk_Window_Record); Dlg_License : GUI_License.Object; Dlg_About : GUI_About.Object; ---------------- -- Initialize -- ---------------- procedure Initialize is -- package initialization (non GTK related). begin null; end Initialize; -------------- -- Finalize -- -------------- procedure Finalize is -- package finalization (non GTK related). begin null; end Finalize; -------------------- -- CB_Menu_Select -- -------------------- procedure Cb_Menu_Select ( Object : access Gtk_Menu_Item_Record'Class) is -- this procedure is called every time a menu item has -- been selected. Item : constant Menu_Item := Menu_Item (Object); begin case Item.Id is when MI_Exit => Dont_Save := False; Gtk.Main.Main_Quit; when MI_Close_Project => Dont_Save := True; Gtk.Main.Main_Quit; when MI_License => Initialize (Dlg_License); Add_Dialog (Dlg_License, "License", 580, 550); when MI_About => Initialize (Dlg_About); Add_Dialog (Dlg_About, "GSQL About", 300, 190); when others => null; end case; end Cb_Menu_Select; ------------------- -- Add_Menu_Item -- ------------------- procedure Add_Menu_Item ( Submenu : in Gtk_Menu; Menu_Text : in Unbounded_String; Id : in Natural) is Item : Menu_Item := new Menu_Item_Record; begin Gtk.Menu_Item.Initialize (Item, To_String (Menu_Text)); Item.Id := Id; Menu_Item_Callback.Connect ( Item, "activate", Menu_Item_Callback.To_Marshaller (Cb_Menu_Select'Access) ); Insert (Submenu, Item); end Add_Menu_Item; ----------------- -- Add_Menubar -- ----------------- procedure Add_Menubar ( Wbox : in out Gtk_Box) is begin Gtk_New (Menubar); Pack_Start (Wbox, Child => Menubar, Expand => False); Show_All (Menubar); Add_Menu ("File", File_Menu); Add_Menu ("Help", Help_Menu); end Add_Menubar; ---------------- -- Menu_Entry -- ---------------- function Menu_Entry ( Name : in String; Id : in Natural) return Menu_Definition_Record is --- Result : Menu_Definition_Record := (Name => To_Unbounded_String (Name), Id => Id); begin return Result; end Menu_Entry; -------------- -- Add_Menu -- -------------- procedure Add_Menu ( Title : in String; Contents : in Menu_Definition) is Menu : Gtk_Menu_Item; Submenu : Gtk_Menu; begin Gtk_New (Menu, Title); Append (Menubar, Menu); Gtk_New (Submenu); for I in Contents'Range loop Add_Menu_Item (Submenu, Contents (I).Name, Contents (I).Id); end loop; Set_Submenu (Menu, Submenu); end Add_Menu; end GUI_Menu; gnade-1.6.2.orig/contrib/gsql/gui_menu.ads0000644000175000017500000000616310670060161020307 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/gui_menu.ads,v $ -- Description : GUI for the data base client -- Author : Michael Erdmann -- Created : 8.8.2001 -- Last Modified By: $Author: persan $ -- Last Modified On: $Date: 2007/09/06 20:17:53 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Gtk.Box; use Gtk.Box; package GUI_Menu is Dont_Save : Boolean := False; type Menu_Definition_Record is record Name : Unbounded_String := Null_Unbounded_String; Id : Natural := 0; end record; type Menu_Definition is array (Positive range <>) of Menu_Definition_Record; function Menu_Entry ( Name : in String; Id : in Natural) return Menu_Definition_Record; procedure Add_Menubar ( Wbox : in out Gtk_Box); procedure Add_Menu ( Title : in String; Contents : in Menu_Definition); procedure Initialize; procedure Finalize; end GUI_Menu; gnade-1.6.2.orig/contrib/gsql/gui_preferences.adb0000644000175000017500000002377007755664546021661 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/gui_preferences.adb,v $ -- Description : Preference GUI -- -- Author : Michael Erdmann -- -- Created : 8.8.2001 -- -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2003/11/16 12:11:18 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Text_Io; use Ada.Text_IO; with Ada.Exceptions; use Ada.Exceptions; with Ada.Strings; use Ada.Strings; with Ada.Strings.Fixed; use Ada.Strings.Fixed; with Glib; use Glib; with Gtk.Box; use Gtk.Box; with Gtk.Button; use Gtk.Button; with Gtk.Check_Button; use Gtk.Check_Button; with Gtk.Combo; use Gtk.Combo; with Gtk.GEntry; use Gtk.GEntry; with Gtk.Enums; use Gtk.Enums; with Gtk.Frame; use Gtk.Frame; with Gtk.Handlers; use Gtk.Handlers; with Gtk.Label; use Gtk.Label; with Gtk; use Gtk; with Project_File; use Project_File; with Preferences; use Preferences; package body GUI_Preferences is Version : constant String := "$Id: gui_preferences.adb,v 1.13 2003/11/16 12:11:18 merdmann Exp $"; -- ********************************************************************** -- -- *** L O C A L D A T A *** -- -- ********************************************************************** -- type Preference_Record is record Name : Unbounded_String := Null_Unbounded_String; Description : Unbounded_String := Null_Unbounded_String; Value_Entry : Gtk_Entry; end record; PT : array( 1..50 ) of Preference_Record; Pref_Prefix : constant String := "preference"; -- ********************************************************************** -- -- *** L O C A L P R O C E D U R E S *** -- -- ********************************************************************** -- ------------------- -- Get_Next_Free -- ------------------- function Get_Next_Free( Name : in String ) return Natural is begin for I in PT'Range loop if PT(I).Name = Null_Unbounded_String then PT(I).Name := To_Unbounded_String( Name ); return I; end if; end loop; raise No_More_Preferences; end Get_Next_Free; --------------------- -- Project_Default -- --------------------- function Project_Default( Name : in String; Default : in String ) return String is -- return the actual default value according to the following -- rules: -- -- R.1 - If there is a section "prefrences." in the project -- file return this value. -- R.2 - If there is no such entry create one with default -- value passed in the argument. -- begin if not Section_Exists( Pref_Prefix, Name ) then Add( Pref_Prefix, Name, Default ); end if; return Project_File.Get( Pref_Prefix, Name ); end Project_Default; ----------- -- Place -- ----------- procedure Place( VBox : in Gtk_Box; Name : in String; Description : in String; Default : in String := ""; Visible : in Boolean := True; Maxlength : in Natural := 30 ) is --- Descr : Gtk_Label; Field : Gtk_Entry; Hbox : Gtk_Box; Next_Free : Natural := Get_Next_Free(Name); begin Gtk_New_Hbox (Hbox); Set_Border_Width( Hbox, 4 ); Show_All( Hbox ); Gtk_New( Descr, Description & " : " ); Pack_Start(Hbox, Descr, Expand => False ); Gtk_New( Field ); Set_Text( Field, Project_Default(Name, Default) ); Set_Visibility (Field, Visible); Set_Max_Length (Field, Guint16(Maxlength) ); Pack_End( Hbox, Field, Expand => False ); PT( Next_Free ).Value_Entry := Field; PT( Next_Free ).Description := To_Unbounded_String( Description ); Pack_Start( Vbox, Hbox, Expand => False ); end Place; -- ********************************************************************** -- -- *** P U B L I C P R O C E D U R E S *** -- -- ********************************************************************** -- ---------------- -- Preference -- ---------------- function Preference( Name : in String ) return String is -- return the value of a preference begin for I in PT'Range loop if PT(I).Name /= Null_Unbounded_String and then To_String(PT(I).Name)=Name then return Get_Text( PT(I).Value_Entry ); end if; end loop; return ""; end Preference; --------------------- -- Add_Preferences -- --------------------- procedure Display( This : in out Object; Box : in out Gtk_Box ) is Gbox : Gtk_Box; Parent : Gtk_Box; -- add a group box to the parent procedure Group( Name : in String; Box : out Gtk_box ) is Frame : Gtk_Frame; begin Gtk_New( Frame ); Set_Label (Frame, Name ); Pack_Start( Parent, Frame, Expand => False ); Gtk_New_Vbox( Box ); Add(Frame, Box ); Show_All( Frame ); end Group; begin Gtk_New_Vbox (Parent); Set_Border_Width (Parent, 5); Show_All (Parent); ---- AUTHORIZATION -- Group( "Authorization", Gbox ); Place(Gbox, Prf_Login , "Login Name", Maxlength => 20, Default => "gnade" ); Place(Gbox, Prf_Password, "Password ", Visible => False, Maxlength => 20, Default => "gnade" ); ----- DATABASE DEFAULTS ---- Group( "Database Defaults", Gbox ); Place(Gbox, Prf_Catalog, "Catalog Name ", Maxlength => 40, Default => "GNADE" ); Place(Gbox, Prf_Schema, "Schema Name ", Maxlength => 40, Default => "GNADE" ); ----- PROJECT SETUP ------- Group( "Project Setup", Gbox ); Place( Gbox, Prf_Project, "Project Title", Default =>"No Title", Maxlength => 256 ); Place( Gbox, Prf_Author, "Author", Default =>"No Author", Maxlength => 256 ); Place( Gbox, Prf_Repository, "Repository Path", Default =>"./", Maxlength => 256 ); Group( "Program Attributes", Gbox ); Place( Gbox, Prf_Debug, "Debugging Level", Default =>"0", Maxlength => 256 ); ----- GSQL Internal ------- Group( "GSQL Environment", Gbox ); Place( Gbox, Prf_Inst_Dir, "GSQL Installation Directory", Default =>"/usr/local/gsql", Maxlength => 256 ); Pack_Start( Box, Parent ); Show_All( Box ); end Display; ------------------------- -- Copy_To_Projectfile -- ------------------------- procedure Copy_To_Projectfile is -- this procedure copies all preferences into the project file begin for I in PT'Range loop if PT(I).Name /= Null_Unbounded_String then Project_File.Update( Pref_Prefix, To_String(PT(I).Name), Preference( To_String(PT(I).Name) ) ); end if; end loop; end Copy_To_Projectfile; end GUI_Preferences; gnade-1.6.2.orig/contrib/gsql/gui_preferences.ads0000644000175000017500000000602507355676443021667 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/gui_preferences.ads,v $ -- Description : GUI for the data base client -- Author : Michael Erdmann -- Created : 8.8.2001 -- Last Modified By: $Author: me $ -- Last Modified On: $Date: 2001/09/30 20:14:27 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Gtk.Text; use Gtk.Text; with Gtk.Notebook; use Gtk.Notebook; with Gtk.Box; use Gtk.Box; with GUI_Worksheet; use GUI_Worksheet; package GUI_Preferences is type Object is new GUI_Worksheet.Object with private; No_More_Preferences : exception; function Preference( Name : in String ) return String; procedure Copy_To_Projectfile; private type Object is new GUI_Worksheet.Object with null record; procedure Display( This : in out Object; Box : in out Gtk_Box ) ; end GUI_Preferences; gnade-1.6.2.orig/contrib/gsql/gui_result.adb0000644000175000017500000002036607360127577020662 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/gui_result.adb,v $ -- Description : GUI for the data base client -- Author : Michael Erdmann -- Created : 8.8.2001 -- Last Modified By: $Author: me $ -- Last Modified On: $Date: 2001/10/07 19:39:43 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Text_IO; use Ada.Text_IO; with Glib; use Glib; with Gdk; use Gdk; with Gdk.Color; use Gdk.Color; with Gdk.Font; use Gdk.Font; with Gdk.Pixmap; use Gdk.Pixmap; with Gdk.Bitmap; use Gdk.Bitmap; with Gtk; use Gtk; with Gtk.Box; use Gtk.Box; with Gtk.Button; use Gtk.Button; with Gtk.Check_Button; use Gtk.Check_Button; with Gtk.Clist; use Gtk.Clist; with Gtk.Enums; use Gtk.Enums; with Gtk.Label; use Gtk.Label; with Gtk.Option_Menu; use Gtk.Option_Menu; with Gtk.Radio_Menu_Item; use Gtk.Radio_Menu_Item; with Gtk.Scrolled_Window; use Gtk.Scrolled_Window; with Gtk.Handlers; use Gtk.Handlers; with Gtk.Style; use Gtk.Style; with Gtk.Widget; use Gtk.Widget; with Gtkada.Types; use Gtkada.Types; with Interfaces.C.Strings; with GUI_Logging; use GUI_Logging; package body GUI_Result is Version : constant String := "$Id: gui_result.adb,v 1.5 2001/10/07 19:39:43 me Exp $"; package IC renames Interfaces.C; package ICS renames Interfaces.C.Strings; package Clist_Cb is new Handlers.Callback (Gtk_Clist_Record); package Check_Cb is new Handlers.User_Callback (Gtk_Check_Button_Record, Gtk_Clist); use type Interfaces.C.size_t; Current_Result : Gtk_Clist; ------------------ -- Click_Column -- ------------------ procedure Click_Column ( List : access Gtk_Clist_Record'Class; Column : Gint ) is begin if Column = 4 then Set_Column_Visibility (List, Column, False); elsif Column = Get_Sort_Column (List) then if Get_Sort_Type (List) = Ascending then Set_Sort_Type (List, Descending); else Set_Sort_Type (List, Ascending); end if; else Set_Sort_Column (List, Column); end if; Sort (List); end Click_Column; ------------------------- -- CB_Result_Activated -- ------------------------- procedure Cb_Result_Activated ( List : access Gtk_Clist_Record'Class) is begin Current_Result := Gtk_Clist(List); end CB_Result_Activated; --------------------- -- CB_Close_Result -- --------------------- procedure CB_Close_Result ( List : access Gtk_Clist_Record'Class) is begin Destroy( List ); Remove_Page( Toplevel, Get_Current_Page( Toplevel ) ); end CB_Close_Result; ---------------- -- Add_Result -- ---------------- procedure Add_Result( Q : in ODBC.Object; Name : in Unbounded_String) is -- Add an editor Vbox : Gtk_Box; HBox : Gtk_Box; Scrolled : Gtk_Scrolled_Window; Label_Box : Gtk_Box; Label : Gtk_Label; Menu_Box : Gtk_Box; Clist : Gtk_Clist; Titles : Chars_Ptr_Array (1 .. 512 ) := (others=>ICS.Null_Ptr); Cols : C.Size_t; Button : Gtk_Button; begin Gtk_New_Vbox (Vbox); Set_Border_Width (Vbox, 5); Show_All (Vbox); Gtk_New (Scrolled); Set_Border_Width (Scrolled, 5); Set_Policy (Scrolled, Policy_Automatic, Policy_Automatic); Pack_Start (Vbox, Scrolled, True, True, 0); Cols := C.Size_T(Columns(Q)); for I in Titles'Range loop --if Titles(I) /= ICS.Null_Ptr then -- ICS.Free( Titles(I) ); --end if; Titles(I) := ICS.New_String( Field_Name(Q,Integer(I)) ); end loop; Gtk_New (Clist, Gint (Cols), Titles); Clist_Cb.Connect ( Clist, "click_column", Clist_Cb.To_Marshaller (Click_Column'Access) ); Add (Scrolled, Clist); Show_All( Vbox ); -- get the query result set declare Result : Result_Record := Null_Result_Record; Rows : Natural := 0; New_Row : Gint; Texts : Chars_Ptr_Array (0 .. Cols-1):=(others=>ICS.Null_Ptr); begin if Columns(Q) > 0 then Result := Fetch( Q ); while Result /= Null_Result_Record loop for I in Texts'Range loop Texts(I) := ICS.New_String(To_String( Result,Integer(I)+1 )); end loop; New_Row := Append (Clist, Texts); Rows := Rows + 1; Result := Fetch( Q ); end loop; GUI_Logging.Log("Resultset size:" & Natural'Image(Rows) ); else GUI_Logging.Log("SQL command executed"); GUI_Logging.Log("Number affected rows:" & Integer'Image(Affected_Rows(Q))); end if; exception when Error : others => GUI_Logging.Error( "Error during execution" ); raise; end; Gtk_New_Hbox (Hbox, False, 5); Set_Border_Width (Hbox, 5); Pack_Start (Vbox, Hbox, Expand => False ); -------------------------- -- add the close button -- -------------------------- Gtk_New (Button, "Close"); Pack_Start (Hbox, Button, Expand => False ); Clist_Cb.Object_Connect (Button, "clicked", Clist_Cb.To_Marshaller (CB_Close_Result'Access), Slot_Object => Clist); Show_All( Hbox ); ------------------------ -- add the tab labels -- ------------------------ Gtk_New_Hbox (Label_Box, False, 0); Gtk_New (Label, To_String( Name ) ); Pack_Start (Label_Box, Label, False, True, 0); Show_All (Label_Box); Gtk_New_Vbox (Menu_Box, False, 0); Gtk_New (Label, To_String( Name ) ); Pack_Start (Menu_Box, Label, False, True, 0); Show_All (Menu_Box); Append_Page_Menu (Toplevel, Vbox, Label_Box, Menu_Box); Clist_CB.Object_Connect( Clist, "draw_focus", Clist_CB.To_Marshaller (CB_Result_Activated'Access ), Slot_Object => Clist ); -- bring result in fron Set_Page( Toplevel ); end Add_Result; end GUI_Result; gnade-1.6.2.orig/contrib/gsql/gui_result.ads0000644000175000017500000000521207340003255020654 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/gui_result.ads,v $ -- Description : GUI for the data base client -- Author : Michael Erdmann -- Created : 8.8.2001 -- Last Modified By: $Author: me $ -- Last Modified On: $Date: 2001/08/19 18:34:21 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with ODBC; use ODBC; with Gtk.Notebook; use Gtk.Notebook; package GUI_Result is Toplevel : Gtk_Notebook; procedure Add_Result( Q : in ODBC.Object; Name : in Unbounded_String ); end GUI_Result; gnade-1.6.2.orig/contrib/gsql/gui_rowdefinition.ads0000644000175000017500000000651407400233331022221 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/gui_rowdefinition.ads,v $ -- Description : Communication type between table and row handler. -- -- Author : Michael Erdmann -- -- Created : 8.8.2001 -- -- Last Modified By: $Author: me $ -- Last Modified On: $Date: 2001/11/25 18:22:17 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; package GUI_Rowdefinition is type Row_Information_Record is record Name : Unbounded_String := Null_Unbounded_String ; SQL_Type : Unbounded_String := Null_Unbounded_String ; Default : Unbounded_String := Null_Unbounded_String ; Constraint : Unbounded_String := Null_Unbounded_String ; Constraint_Name : Unbounded_String := Null_Unbounded_String ; Comment : Unbounded_String := Null_Unbounded_String ; Primary_Key : Boolean := False; Unique : Boolean := False; Is_Null : Boolean := False; Is_Not_Null : Boolean := False; end record; end GUI_Rowdefinition; gnade-1.6.2.orig/contrib/gsql/gui_table.adb0000644000175000017500000004657207410605335020427 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/gui_table.adb,v $ -- Description : Table Editor -- Author : Michael Erdmann -- Created : 8.8.2001 -- Last Modified By: $Author: me $ -- Last Modified On: $Date: 2001/12/21 10:11:41 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Text_Io; use Ada.Text_IO; with Ada.Exceptions; use Ada.Exceptions; with Ada.Strings; use Ada.Strings; with Ada.Strings.Fixed; use Ada.Strings.Fixed; with Unchecked_Deallocation; with Glib; use Glib; -- Gdk with Gdk; with Gdk.Drawable; use Gdk.Drawable; with Gdk.Bitmap; use Gdk.Bitmap; with Gdk.Event; use Gdk.Event; with Gdk.Font; use Gdk.Font; with Gdk.Color; use Gdk.Color; with Gdk.GC; use Gdk.GC; with Gdk.Pixmap; use Gdk.Pixmap; with Gdk.Rectangle; use Gdk.Rectangle; with Gdk.Types; use Gdk.Types; with Gdk.Window; use Gdk.Window; -- Gtk with Gtk.Rc; with Gtk; use Gtk; with Gtk.Arguments; use Gtk.Arguments; with Gtk.Box; use Gtk.Box; with Gtk.Clist; use Gtk.Clist; with Gtk.Editable; use Gtk.Editable; with Gtk.Event_Box; use Gtk.Event_Box; with Gtk.Enums; use Gtk.Enums; with Gtk.Frame; use Gtk.Frame; with Gtk.Handlers; use Gtk.Handlers; with Gtkada.Handlers; use Gtkada.Handlers; with Gtk.Scrolled_Window; use Gtk.Scrolled_Window; with Gtk.Text; use Gtk.Text; with Gtk.Window; use Gtk.Window; with Gtk.Widget; use Gtk.Widget; with Gtk.GEntry; use Gtk.GEntry; with GUI_Common; use GUI_Common; with GUI_Logging; use GUI_Logging; with GUI_Addrow; use GUI_Addrow; with GUI_Dialog; use GUI_Dialog; with Contents_Handler; use Contents_Handler; with Text_Block; use Text_Block; with Import_Export; use Import_Export; package body GUI_Table is Version : constant String := "$Id: gui_table.adb,v 1.17 2001/12/21 10:11:41 me Exp $"; --- ************************************************************************** --- -- *** C L A S S D A T A *** --- --- ************************************************************************** --- Dismiss_CMD : constant Natural := 1; Add_Row_CMD : constant Natural := 2; Remove_Row_CMD : constant Natural := 3; Edit_Row_CMD : constant Natural := 4; Import_CMD : constant Natural := 5; Export_CMD : constant Natural := 6; --- ************************************************************************** --- --- *** I N S T A N C E D A T A *** --- --- ************************************************************************** --- BLANK : constant Unbounded_String := To_Unbounded_String(" "); DML_DEFAULT : constant Unbounded_String := To_Unbounded_String(" DEFAULT"); DML_CHECK : constant Unbounded_String := To_Unbounded_String(" CHECK"); DML_PRIMARY_KEY: constant Unbounded_String := To_Unbounded_String(" PRIMARY KEY"); DML_UNIQUE : constant Unbounded_String := To_Unbounded_String(" UNIQUE"); DML_NOT_NULL : constant Unbounded_String := To_Unbounded_String(" NOT NULL"); DML_NULL : constant Unbounded_String := To_Unbounded_String(" NULL"); ---------------------------- -- DML_Type_Specification -- ---------------------------- function DML_Type_Specification( Def : in Row_Information_Record ) return Unbounded_String is Result : Unbounded_String := Null_Unbounded_String; begin Result := Def.Sql_Type; if Def.Default /= Null_Unbounded_String then Result := Result & DML_DEFAULT & BLANK & Def.Default; end if; if Def.Is_Null then Result := Result & DML_NULL; elsif Def.Is_Not_Null then Result := Result & DML_NOT_NULL; end if; if Def.Unique then Result := Result & DML_UNIQUE; end if; if Def.Primary_Key then Result := Result & DML_PRIMARY_KEY; end if; return Result; end DML_Type_Specification ; -------------------- -- Fetch_Row_Info -- -------------------- procedure Fetch_Row_Info( Text : in Text_Buffer; Last : in out Natural; Info : out Row_Information_Record ) is -- fetch next row information from the text buffer function Value( S :in Unbounded_String ) return Boolean is begin if S /= Null_Unbounded_String then return Boolean'Value(To_String(S)); else return False; end if; end Value; Result : Text_Buffer( 1..Max_Section_Length ); begin Get_Text_Block( Result, Text, Last ); Info.Name := Result(1); Info.Sql_Type := Result(2); Info.Default := Result(3); Info.Constraint := Result(4); Info.Constraint_Name := Result(5); Info.Comment := Result(6); Info.Primary_Key := Value( Result(7) ); Info.Unique := Value( Result(8) ); Info.Is_Null := Value( Result(9) ); Info.Is_Not_Null := Value( Result(10) ); end Fetch_Row_Info; ---------------------- -- DML_Create_Table -- ---------------------- function DML_Create_Table_Command( Text : in Text_Buffer ) return String is -- This procedure builds an SQL DML command in oder to create -- the specified table. Last : Positive := Text'First; Line : Unbounded_String := Null_Unbounded_String; Result : Unbounded_String := Null_Unbounded_String; Comment : constant Unbounded_String := To_Unbounded_String("--"); Info : Row_Information_Record; begin Fetch_Next( Line, Text, Last ); Result := To_Unbounded_String( "CREATE TABLE " & To_String(Line) & " ("); loop Fetch_Next( Line, Text, Last ); exit when Is_End_Of_Block(Line); -- Result := Result & Comment & ( Line & Ascii.LF ); end loop; Fetch_Next( Line, Text, Last ); if Line /= Null_Unbounded_String then declare Nbr_Of_Rows : Positive := Positive'Value( To_String( Line ) ); begin -- copy the domain information for I in 1..Nbr_Of_Rows loop Fetch_Row_Info( Text, Last, Info ); Result := Result & Info.Name & " " ; Result := Result & DML_Type_Specification( Info ); if I < Nbr_Of_Rows then Result := Result & "," & ASCII.LF; end if; end loop; end ; end if; Result := Result & ")"; return To_String(Result); end DML_Create_Table_Command; ------------------- -- To_Row_Format -- ------------------- procedure Display_Row_Info( This : in out Object ; Def : in Row_Information_Record; Row : in Natural := 0) is -- create a displayable for of the row information. The displayed -- information represents the information inserted later as -- sql (dml) statements. Display : Text_Buffer( 1..4 ); Result : Unbounded_String := Null_Unbounded_String; begin Display(1) := Def.Name ; Display(2) := DML_Type_Specification( Def ); Display(3) := Def.Comment; Insert_Row( This.Definition, Display, Row ); end Display_Row_Info; ---------------- -- Get_Result -- ---------------- procedure Get_Result( This : in Object; Text : out Text_Buffer; Last : out Positive ) is -- copy the current editor contents into the buffer handled by the -- contents manager/handler. Name : Gtk_Entry renames This.Name; Description : Gtk_Text renames This.Description; Definition : Gtk_Clist renames This.Definition; procedure Add( S : in Unbounded_String ) is begin Text(Last) := S; Last := Last + 1; end Add; procedure Add( S : in Boolean ) is begin Add( To_Unbounded_String(Boolean'Image(S)) ); end Add; begin Last := Text'First; Add( To_Unbounded_String(Get_Text( Name )) ); Put_Text_Block( Text, To_Text_Buffer(Get_Chars(Gtk_Editable(This.Description))), Last); Add( To_Unbounded_String(Positive'Image( This.Nbr_Of_Rows )) ); for I in 1..This.Nbr_Of_Rows loop Add( This.Row_Info(I).Name ); Add( This.Row_Info(I).Sql_Type ); Add( This.Row_Info(I).Default ); Add( This.Row_Info(I).Constraint ); Add( This.Row_Info(I).Constraint_Name ); Add( This.Row_Info(I).Comment ); Add( This.Row_Info(I).Primary_Key ); Add( This.Row_Info(I).Unique ); Add( This.Row_Info(I).Is_Null ); Add( This.Row_Info(I).Is_Not_Null ); Insert_End_Of_Block( Text, Last ); end loop; end Get_Result; --------------- -- Set_Input -- --------------- procedure Set_Input( This : in out Object; Text : in Text_Buffer ) is -- Name : Gtk_Entry renames This.Name; Description : Gtk_Text renames This.Description; Definition : Gtk_Clist := This.Definition; Import_Name : Gtk_Entry renames This.Import_Name; Export_Name : Gtk_Entry renames This.Export_Name; Last : Positive := Text'First; Line : Unbounded_String := Null_Unbounded_String; function Value( S :in Unbounded_String ) return Boolean is begin if S /= Null_Unbounded_String then return Boolean'Value(To_String(S)); else return False; end if; end Value; procedure Fetch_Row_Info( Info : out Row_Information_Record ) is -- fetch next row information Result : Text_Buffer( 1..Max_Section_Length ); begin Get_Text_Block( Result, Text, Last ); Info.Name := Result(1); Info.Sql_Type := Result(2); Info.Default := Result(3); Info.Constraint := Result(4); Info.Constraint_Name := Result(5); Info.Comment := Result(6); Info.Primary_Key := Value( Result(7) ); Info.Unique := Value( Result(8) ); Info.Is_Null := Value( Result(9) ); Info.Is_Not_Null := Value( Result(10) ); end Fetch_Row_Info; begin Set_Text( Name, Key( Contents(This).all ) ); Last := Last + 1; -- copy the description Freeze( Description); loop Fetch_Next( Line, Text, Last ); exit when Is_End_Of_Block(Line); Insert( Description, Null_Font, Null_Color, Null_Color, To_String( Line ) & Ascii.LF, Gint (To_String( Line )'Length) + 1 ); end loop; Thaw( Description ); Fetch_Next( Line, Text, Last ); if Line /= Null_Unbounded_String then This.Nbr_Of_Rows := Positive'Value( To_String( Line ) ); -- copy the domain information for I in 1..This.Nbr_Of_Rows loop Fetch_Row_Info( This.Row_Info(I) ); Display_Row_Info( This, This.Row_Info(I) ); end loop; end if; Set_Text( Import_Name, Key( Contents(This).all ) & ".import" ); Set_Text( Export_Name, Key( Contents(This).all ) & ".export" ); exception when End_Of_Block_Reached => GUI_Logging.Log("end of block" ); end Set_Input; ---------------- -- Insert_Row -- ---------------- procedure Insert_Row( This : in out Object; Def : in Row_Information_Record ) is -- Insert a row into the table data. -- -- R.1 If a row of the same name already exists the entry -- is deleted and newly inserted. -- R.2 if the number of rows allowes still a new entry, the -- it is inserted. Else an error is issued. This should -- never happen, but has been added for security. -- Display : Text_Buffer(1..4); use Gint_List; begin for I in 1..This.Nbr_Of_Rows loop if This.Row_Info(I).Name = Def.Name then -- R.1 This.Row_Info(I) := Def ; Remove( This.Definition, Gint( I - 1 ) ); Display_Row_Info(This, Def, Row => I ); return; end if; end loop; if This.Nbr_Of_Rows < This.Row_Info'Last then -- R.2 This.Nbr_Of_Rows := This.Nbr_Of_Rows + 1; This.Row_Info(This.Nbr_Of_Rows) := Def ; Display_Row_Info( This, Def); else GUI_Logging.Error("The number of rows per table has been exceeded"); end if; end Insert_Row; ------------- -- Display -- ------------- procedure Display( This : in out Object; Box : in out Gtk_Box ) is -- add the table information Name : Gtk_Entry renames This.Name; Import_Name : Gtk_Entry renames This.Import_Name; Export_Name : Gtk_Entry renames This.Export_Name; Description : Gtk_Text renames This.Description; Definition : Gtk_Clist renames This.Definition; Vbox : Gtk_Box; Text : Text_Buffer( 1..Max_Section_Length ); Last : Positive := 1; V1 : Gtk_Box; begin Gtk_New_VBox( Vbox ); Gtk_New_VBox( V1 ); ---------------- -- Table Name -- ---------------- Entry_Field( V1, Name, "Table Name" ); Entry_Field( V1, Export_Name, "Import File" ); Entry_Field( V1, Import_Name, "Export File" ); Pack_Start( Vbox, V1, Expand => False ); ---------------------- -- Decription Field -- ---------------------- GUI_Common.Add_Editor( Vbox, Description, "Description" ); ---------------------- -- Table components -- ---------------------- GUI_Common.Add_Table( Vbox, Definition, 3 ); Set_Column_Title( Definition, 0, "Domain " ); Set_Column_Title( Definition, 1, "Type " ); Set_Column_Title( Definition, 2, "Comment " ); ---------------------- Load( Contents(This).all, Text, Last ); Set_Input( This, Text(1..Last) ); ---------------------- Pack_Start( Box, Vbox ); Show_All( Box ); -------------- -- COMMANDS -- -------------- Add_Command( This, "New Column", Add_Row_CMD ); Add_Command( This, "Edit Column", Edit_Row_CMD ); Add_Command( This, "Remove Column", Remove_Row_CMD ); Add_Command( This, "Dismiss", Dismiss_CMD ); Add_Command( This, "Import Data", Import_CMD ); Add_Command( This, "Export Data", Export_CMD ); end Display; ------------- -- Command -- ------------- procedure Command( This : in out Object; Cmd : in Natural ) is -- execute a command Name : Gtk_Entry renames This.Name; Import_Name : Gtk_Entry renames This.Import_Name; Export_Name : Gtk_Entry renames This.Export_Name; Description : Gtk_Text renames This.Description; Definition : Gtk_Clist renames This.Definition; Row : Row_Information_Record; use Gint_List; I : Gint; J : Positive; begin case Cmd is when Dismiss_CMD => -- GUI_AddRow.Finalize( This.Row_Dialog ); Remove_Sheet( This ); when Add_Row_CMD => if This.Nbr_Of_Rows = This.Row_Info'Last then GUI_Logging.Error("The number of rows per table is exceeded"); else GUI_AddRow.Initialize( This.Row_Dialog, Row, This ); GUI_Dialog.Add_Dialog( This.Row_Dialog, "New column", 400, 500 ); end if; when Remove_Row_Cmd => Freeze (Definition); loop exit when Length (Get_Selection (Definition)) = 0; I := Get_Data (First (Get_Selection (Definition))); J := Positive( I + 1 ); for K in J..This.Row_Info'Last-1 loop This.Row_Info(K) := This.Row_Info(K+1); This.Row_Info(K+1).Name := Null_Unbounded_String; end loop; This.Nbr_Of_Rows := This.Nbr_Of_Rows - 1; Remove (Definition, I); end loop; Thaw (Definition); when Edit_Row_Cmd => J := Positive( Get_Data (First (Get_Selection (Definition))) + 1 ); Put_Line( Positive'Image(J) ); GUI_AddRow.Initialize( This.Row_Dialog, This.Row_Info(J), This ); GUI_Dialog.Add_Dialog( This.Row_Dialog, " Row : " & To_String(This.Row_Info(J).Name) , 400, 500 ); when Import_CMD => Import_Export.Export( Get_Text( Name ), Get_Text( Import_Name )); when Export_CMD => Import_Export.Export( Get_Text( Name ), Get_Text( Export_Name )); when others => GUI_Logging.Log("Unimplemented dialog command: " & Natural'Image( Cmd ) ); end case; end Command; end GUI_Table; gnade-1.6.2.orig/contrib/gsql/gui_table.ads0000644000175000017500000001014407402511114020422 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/gui_table.ads,v $ -- Description : GUI for the data base client -- Author : Michael Erdmann -- Created : 8.8.2001 -- Last Modified By: $Author: me $ -- Last Modified On: $Date: 2001/12/02 20:42:52 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Gtk.Box; use Gtk.Box; with Gtk.Event_Box; use Gtk.Event_Box; with Gtk.Label; use Gtk.Label; with Gtk.GEntry; use Gtk.GEntry; with Gtk.Clist; use Gtk.Clist; with Gtk.Text; use Gtk.Text; with GSQL_Types; use GSQL_Types; with GUI_Rowdefinition; use GUI_Rowdefinition; with GUI_Worksheet; use GUI_Worksheet; with GUI_Addrow; use GUI_Addrow; package GUI_Table is type Object is new GUI_Worksheet.Object with private; type Handle is access all Object; procedure Get_Result( This : in Object; Text : out Text_Buffer; Last : out Positive ); procedure Set_Input( This : in out Object; Text : in Text_Buffer); procedure Insert_Row( This : in out Object; Def : in Row_Information_Record ); function DML_Create_Table_Command( Text : in Text_Buffer ) return String; private type Row_Information_Array is array( Positive range <> ) of Row_Information_Record; type Object is new GUI_Worksheet.Object with record Name : Gtk_Entry; Import_Name : Gtk_Entry; Export_Name : Gtk_Entry; Description : Gtk_Text; Definition : Gtk_Clist; Row_Dialog : GUI_Addrow.Object; Nbr_Of_Rows : Natural := 0; Row_Info : Row_Information_Array( 1..1024 ); end record; procedure Command( This : in out Object; Cmd : in Natural ); procedure Display( This : in out Object; Box : in out Gtk_Box ); end GUI_Table; gnade-1.6.2.orig/contrib/gsql/gui_tools.adb0000644000175000017500000002631007500621776020473 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/gui_tools.adb,v $ -- Description : Handle the toolbar of a client -- Author : Michael Erdmann -- Created : 8.8.2001 -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2002/06/09 09:46:38 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Text_Io; use Ada.Text_IO; with Ada.Exceptions; use Ada.Exceptions; with Ada.Strings; use Ada.Strings; with Ada.Strings.Fixed; use Ada.Strings.Fixed; -- GTK Support packages (gtkada package) with Glib; use Glib; with Gdk; with Gdk.Drawable; use Gdk.Drawable; with Gdk.Bitmap; use Gdk.Bitmap; with Gdk.Event; use Gdk.Event; with Gdk.Font; use Gdk.Font; with Gdk.Color; use Gdk.Color; with Gdk.GC; use Gdk.GC; with Gdk.Pixmap; use Gdk.Pixmap; with Gdk.Rectangle; use Gdk.Rectangle; with Gdk.Types; use Gdk.Types; with Gdk.Window; use Gdk.Window; with Gtk.Rc; with Gtk; use Gtk; with Gtk.Arguments; use Gtk.Arguments; with Gtk.Box; use Gtk.Box; with Gtk.Button; use Gtk.Button; with Gtk.Enums; use Gtk.Enums; with Gtk.Frame; use Gtk.Frame; with Gtk.Handlers; use Gtk.Handlers; with Gtk.Label; use Gtk.Label; with Gtk.Notebook; use Gtk.Notebook; with Gtk.Pixmap; use Gtk.Pixmap; with Gtkada.Handlers; use Gtkada.Handlers; with Gtk.Style; use Gtk.Style; with Gtk.Text; use Gtk.Text; with Gtk.Window; use Gtk.Window; with Gtk.Widget; use Gtk.Widget; with Gtk.Toolbar; use Gtk.Toolbar; -- GSQL Support packages with ODBC; use ODBC; with GSQL_Types; use GSQL_Types; with Gui_Files; use GUI_Files; with GUI_Result; use GUI_Result; with GUI_Editor; use GUI_Editor; with GUI_Preferences; use GUI_Preferences; with GUI_Logging; use GUI_Logging; with GUI_Menu; use GUI_Menu; with GUI_Worksheet; use GUI_Worksheet; with Contents_Manager.GUI; use Contents_Manager.GUI; with Contents_Handler; use Contents_Handler; with Query_Handler; use Query_Handler; with Table_Handler; use Table_Handler; with Procedure_Handler; use Procedure_Handler; with Datasource_Handler; use Datasource_Handler; with Files; use Files; package body GUI_Tools is Version : constant String := "$Id: gui_tools.adb,v 1.11 2002/06/09 09:46:38 merdmann Exp $"; --- *********************************************************************** -- --- *** L O C A L D A T A TYPES *** -- --- *********************************************************************** -- ----------------- -- GTK Objects -- ----------------- Toolbar : Gtk_Toolbar; Tb_Frame : Gtk_Frame; Class_Name : Unbounded_String := Null_Unbounded_String; --- *********************************************************************** -- --- *** L O C A L P R O C E D U R E S *** -- --- *********************************************************************** -- ---------------------- -- Support Packages -- ---------------------- package Destroyed is new Gtk.Handlers.Callback ( Widget_Type => Gtk_Window_Record); package Toolbar_Cb is new Handlers.Callback (Gtk_Toolbar_Record); ---------------- -- New_Pixmap -- ---------------- function New_Pixmap ( Filename : in String ) return Gtk_Widget is -- place a new pixmap in the tool bar frame. Pixmap : Gdk_Pixmap; Mask : Gdk_Bitmap; GtkPixmap : Gtk_Pixmap; Window : constant Gdk_Window := Get_Window(Tb_Frame); Background : constant Gdk_Color := Get_Bg(Get_Style(Tb_Frame), State_Normal); begin Create_From_Xpm (Pixmap, Window, Mask, Background, Shared_File(Filename)); Gtk_New (GtkPixmap, Pixmap, Mask); return Gtk_Widget (GtkPixmap); end New_Pixmap; ---------------------------- -- Handle_Toolbar_Execute -- ---------------------------- procedure Handle_Toolbar_Execute( Toolbar : access Gtk_Toolbar_Record'Class) is Id : Element_ID := GUI.Last_Selected; begin Execute( Contents( Id ).all ); end Handle_Toolbar_Execute; ------------------------ -- Handle_Toolbar_New -- ------------------------ procedure Handle_Toolbar_New( Toolbar : access Gtk_Toolbar_Record'Class ) is --- create a new instance of the selected class Item : Contents_Handler.Handle; Name : Unbounded_String := Files.Buffer_Name; --- begin if Class_Name /= Null_Unbounded_String then Item := Contents_Manager.Create( Class_Name, Name ); Open_Editor( Item.all ); Set_Page( Toplevel ); Class_Name := Null_Unbounded_String; GUI_Logging.Clear_Status; else Error("Please select the instance class first"); end if; end Handle_Toolbar_New; --------------------------- -- Handle_Toolbar_Delete -- --------------------------- procedure Handle_Toolbar_Delete( Toolbar : access Gtk_Toolbar_Record'Class ) is -- delete the currently selected item Id : Element_ID := GUI.Last_Selected; begin Finalize( Contents(Id).all ); end Handle_Toolbar_Delete; ------------------------- -- Handle_Toolbar_Save -- ------------------------- procedure Handle_Toolbar_Save( Toolbar : access Gtk_Toolbar_Record'Class ) is Handler : Contents_Handler.Handle := GUI_Worksheet.Contents; Data : Text_Buffer( 1..Max_Section_Length ); Last : Positive := 1; begin if Handler /= null then Log("Saving " & Key( Handler.all )); Value( Handler.all, Data, Last ); Save( Handler.all, Data( 1..Last ), Key( Handler.all) ); else Error("No Editor active"); end if; end Handle_Toolbar_Save; -------------- -- Add_Tool -- -------------- -- procedure Add_Tool( -- Name : in String; -- Hint : in String; -- Xpm : in String; -- Handler : in Toolbar_CB.Widget_Marshaller.Handler ) is -- begin -- Toolbar_Cb.Object_Connect( -- Append_Item ( -- Toolbar, -- Name, -- Hint, -- "", -- New_Pixmap ( -- Xpm, -- Get_Window(Tb_Frame), -- Get_Bg (Get_Style(Tb_Frame), State_Normal) -- ) -- ), -- "clicked", -- Toolbar_Cb.To_Marshaller (Handler), -- Slot_Object => Toolbar -- ); -- end Add_Tool; procedure Add_Tools is begin Toolbar_Cb.Object_Connect( Append_Item ( Toolbar, "New", "Create a new query", "", New_Pixmap ( "test.xpm" )), "clicked", Toolbar_Cb.To_Marshaller (Handle_Toolbar_New'Access), Slot_Object => Toolbar ); Toolbar_Cb.Object_Connect( Append_Item ( Toolbar, "Delete", "Delete an object", "", New_Pixmap ( "test.xpm" )), "clicked", Toolbar_Cb.To_Marshaller (Handle_Toolbar_Delete'Access), Slot_Object => Toolbar ); Toolbar_Cb.Object_Connect( Append_Item ( Toolbar, "Save", "Save the current query", "", New_Pixmap ("test.xpm")), "clicked", Toolbar_Cb.To_Marshaller (Handle_Toolbar_Save'Access), Slot_Object => Toolbar ); Toolbar_Cb.Object_Connect( Append_Item ( Toolbar, "Execute", "Execute a query", "", New_Pixmap ("test.xpm")), "clicked", Toolbar_Cb.To_Marshaller (Handle_Toolbar_Execute'Access), Slot_Object => Toolbar ); end Add_Tools; --- *************************************************************************** -- --- *** M A I N P R O C E D U R E *** -- --- *************************************************************************** -- -------------- -- Activate -- -------------- procedure Activate( Cls : in String ) is begin Class_Name := To_Unbounded_String(Cls); GUI_Logging.Set_Status( Cls ); end Activate; ---------- -- Main -- ---------- procedure Add_Toolbar( Wbox : in out Gtk_Box ) is begin Gtk_New (Tb_Frame, ""); Gtk_New (Toolbar, Orientation_Horizontal, Toolbar_Both); Add_Tools; Set_Orientation (Toolbar, Orientation_Horizontal); Add( Tb_Frame, Toolbar ); Show_All(Tb_Frame); Pack_Start(Wbox, Child => TB_Frame, Expand => False ); end Add_Toolbar; end GUI_Tools; gnade-1.6.2.orig/contrib/gsql/gui_tools.ads0000644000175000017500000000564607352723542020524 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/gui_tools.ads,v $ -- Description : GUI top level window -- Author : Michael Erdmann -- -- Created : 8.8.2001 -- -- Last Modified By: $Author: me $ -- Last Modified On: $Date: 2001/09/21 20:47:30 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Gtk.Box; use Gtk.Box; with Gtk.Notebook; use Gtk.Notebook; with Contents_Manager; use Contents_Manager; package GUI_Tools is Toplevel : Gtk_Notebook; procedure Activate( Cls : in String ); procedure Add_Toolbar( Wbox : in out Gtk_Box ); end GUI_Tools ; gnade-1.6.2.orig/contrib/gsql/gui_window.adb0000644000175000017500000001203210670060161020621 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/gui_window.adb,v $ -- Description : GUI for the data base client -- Author : Michael Erdmann -- Created : 8.8.2001 -- Last Modified By: $Author: persan $ -- Last Modified On: $Date: 2007/09/06 20:17:53 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- -- GTK Support packages (gtkada package) with Glib; use Glib; with Gdk; with Gtk.Rc; with Gtk; use Gtk; with Gtk.Box; use Gtk.Box; with Gtk.Enums; use Gtk.Enums; with Gtk.Handlers; use Gtk.Handlers; with Gtk.Main; use Gtk.Main; with Gtkada.Handlers; use Gtkada.Handlers; with Gtk.Window; use Gtk.Window; -- gsql components with Preferences; use Preferences; with GUI_Preferences; use GUI_Preferences; with GUI; use GUI; package body GUI_Window is --- *************************************************************************** -- --- *** L O C A L D A T A TYPES *** -- --- *************************************************************************** -- ----------------- -- GTK Objects -- ----------------- Window : Gtk_Window; Wbox : Gtk_Box; ---------------------- -- Support Packages -- ---------------------- package Destroyed is new Gtk.Handlers.Callback ( Widget_Type => Gtk_Window_Record); --------- -- Bye -- --------- procedure Bye ( Window : access Gtk.Window.Gtk_Window_Record'Class) is pragma Warnings (Off, Window); begin Gtk.Main.Main_Quit; end Bye; --- *************************************************************************** -- --- *** G E N E R A L W I N D O W M A N A G E M E N T PROCEDURES *** -- --- *************************************************************************** -- ------------------ -- Window_Title -- ------------------ procedure Window_Title ( Text : in String) is begin Set_Title (Window, Preference (Prf_Project) & " : " & Text); end Window_Title; ---------------- -- Initialize -- ---------------- procedure Initialize is begin Gtk.Main.Init; Gtk.Rc.Parse ("testgtkrc"); -- create the top level window Gtk_New (Window, Window_Toplevel); Destroyed.Connect ( Window, "destroy", Destroyed.To_Marshaller (Bye'Access)); -- create a vbox which contains all elements Gtk_New_Vbox (Wbox, Homogeneous => False, Spacing => 0); Set_USize (Wbox, 950, 850); GUI.Initialize (Wbox); Add (Window, Wbox); Window_Title (""); Show_All (Window); end Initialize; -------------- -- Finalize -- -------------- procedure Finalize is begin GUI_Preferences.Copy_To_Projectfile; GUI.Finalize (Wbox); end Finalize; ---------- -- Main -- ---------- procedure Main is begin Gtk.Main.Main; end Main; end GUI_Window; gnade-1.6.2.orig/contrib/gsql/gui_window.ads0000644000175000017500000000547410670060161020656 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/gui_window.ads,v $ -- Description : GUI for the SQL client -- Author : Michael Erdmann -- -- Created : 8.8.2001 -- -- Last Modified By: $Author: persan $ -- Last Modified On: $Date: 2007/09/06 20:17:53 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Gdk.Window; use Gdk.Window; with Gtk.Widget; use Gtk.Widget; package GUI_Window is Version : constant String := "0.8"; procedure Initialize; procedure Finalize; procedure Window_Title ( Text : in String); procedure Main; end GUI_Window; gnade-1.6.2.orig/contrib/gsql/gui_window.gps0000644000175000017500000000555107353152146020705 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/gui_window.gps,v $ -- Description : GUI for the SQL client -- Author : Michael Erdmann -- -- Created : 8.8.2001 -- -- Last Modified By: $Author: me $ -- Last Modified On: $Date: 2001/09/22 18:11:50 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Gdk.Window; use Gdk.Window; with Gtk.Widget; use Gtk.Widget; with Gdk.Color; use Gdk.Color; package GUI_Window is Version : constant String := $Version; procedure Initialize; procedure Finalize; procedure Window_Title( Text : in String ); procedure Main; end GUI_Window; gnade-1.6.2.orig/contrib/gsql/gui_worksheet.adb0000644000175000017500000004111507755664546021364 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/gui_worksheet.adb,v $ -- Description : Basic Work sheet for the notebook -- Author : Michael Erdmann -- Created : 8.8.2001 -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2003/11/16 12:11:18 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Text_Io; use Ada.Text_IO; with Ada.Exceptions; use Ada.Exceptions; with Ada.Strings; use Ada.Strings; with Ada.Strings.Fixed; use Ada.Strings.Fixed; with Unchecked_Deallocation; with Glib; use Glib; -- Gdk with Gdk; with Gdk.Drawable; use Gdk.Drawable; with Gdk.Bitmap; use Gdk.Bitmap; with Gdk.Event; use Gdk.Event; with Gdk.Font; use Gdk.Font; with Gdk.Color; use Gdk.Color; with Gdk.GC; use Gdk.GC; with Gdk.Pixmap; use Gdk.Pixmap; with Gdk.Rectangle; use Gdk.Rectangle; with Gdk.Types; use Gdk.Types; with Gdk.Window; use Gdk.Window; -- Gtk with Gtk.Rc; with Gtk; use Gtk; with Gtk.Arguments; use Gtk.Arguments; with Gtk.Box; use Gtk.Box; with Gtk.Button; use Gtk.Button; with Gtk.Editable; use Gtk.Editable; with Gtk.Event_Box; use Gtk.Event_Box; with Gtk.Enums; use Gtk.Enums; with Gtk.Frame; use Gtk.Frame; with Gtk.Handlers; use Gtk.Handlers; with Gtk.Label; use Gtk.Label; with Gtk.Notebook; use Gtk.Notebook; with Gtkada.Handlers; use Gtkada.Handlers; with Gtk.Scrolled_Window; use Gtk.Scrolled_Window; with Gtk.Style; use Gtk.Style; with Gtk.Text; use Gtk.Text; with Gtk.Window; use Gtk.Window; with Gtk.Widget; use Gtk.Widget; with Gtk.GEntry; use Gtk.GEntry; with GUI_Preferences; use GUI_Preferences; with GUI_Logging; use GUI_Logging; with GUI_Common; use GUI_Common; with Project_File; use Project_File; with Files; use Files; with Contents_Handler; use Contents_Handler; package body GUI_Worksheet is Version : constant String := "$Id: gui_worksheet.adb,v 1.9 2003/11/16 12:11:18 merdmann Exp $"; --- ************************************************************************** --- -- *** C L A S S D A T A *** --- --- ************************************************************************** --- ---------------------------- -- List of active buffers -- ---------------------------- type Sheet_List_Record is record Name : Unbounded_String := Null_Unbounded_String; Sheet : Handle; end record; Sheet_List : array( 1..512 ) of Sheet_List_Record; ----------------- -- class table -- ----------------- type Class_Table_Record is record Name : Unbounded_String := Null_Unbounded_String; Allocator : Allocator_Access := null; end record; CT : array( 1..20 ) of Class_Table_Record; --- ************************************************************************** --- --- *** I N S T A N C E D A T A *** --- --- ************************************************************************** --- package Sheet_Cb is new Handlers.Callback (Sheet_Box_Record); ---------------------- -- Support Packages -- ---------------------- package Destroyed is new Gtk.Handlers.Callback ( Widget_Type => Gtk_Window_Record); ------------------------- -- Table_Button_Record -- ------------------------- type Table_Button_Record is new Gtk_Button_Record with record Receiver : Handle := null; Cmd : Natural := 0; end record; type Table_Button is access all Table_Button_Record'Class; package Button_Cb is new Handlers.Callback (Table_Button_Record); -------------- -- Register -- -------------- procedure Register( Name : in String; Alloc : in Allocator_Access ) is begin for I in CT'Range loop if CT(I).Name /= Null_Unbounded_String then CT(I).Name := To_Unbounded_String( Name ); Ct(I).Allocator := Alloc; exit; end if; end loop; end Register; ------------ -- Create -- ------------ function Create( Name : in String ) return Handle is Result : Handle := null; begin for I in CT'Range loop if CT(I).Name /= Null_Unbounded_String and then To_String(CT(I).Name) = Name then Result := CT(I).Allocator.all; Result.Self := Result; exit; end if; end loop; return Result; end Create; --- ************************************************************************** --- --- *** I N S T A N C E D A T A *** --- --- ************************************************************************** --- -------------------- -- Button pressed -- -------------------- procedure CB_Button_Pressed( Pressed : access Table_Button_Record'Class ) is begin Command(Pressed.Receiver.all, Pressed.Cmd ); end CB_Button_Pressed; ---------------- -- Add_Button -- ---------------- procedure Add_Button( Receiver : in Object'Class; Title : in String; Cmd : in Natural; Box : in out Gtk_Box ) is Result : Table_Button := new Table_Button_Record; begin Gtk.Button.Initialize( Result, Title ); Result.Receiver := Receiver.Self; Result.Cmd := Cmd; Pack_Start (Box, Result, Expand => False ); Button_CB.Object_Connect( result, "clicked", Button_CB.To_Marshaller (CB_Button_Pressed'Access ), Slot_Object => Result ); end Add_Button; ------------------- -- Locate_Buffer -- ------------------- function Locate_Buffer( Name : in Unbounded_String ) return Handle is begin for I in Sheet_List'Range loop if Sheet_List(I).Name /= Null_Unbounded_String and then Sheet_List(I).Name = Name then return Sheet_List(I).Sheet; end if; end loop; return null; end Locate_Buffer; --- ************************************************************************** --- --- *** H A N D L E B U F F E R S *** --- --- ************************************************************************** --- ------------- -- Is_Open -- ------------- function Is_Open( Sheet_Name : in Unbounded_String ) return Boolean is -- return true if the buffer is already open begin for I in Sheet_List'Range loop if Sheet_List(I).Name /= Null_Unbounded_String and then Sheet_List(I).Name = Sheet_Name then return True; end if; end loop; return False; end Is_Open; --- ************************************************************************** --- -- *** H A N D L E E D I T O R B U F F E R S *** --- --- ************************************************************************** --- --------------------- -- Register_Buffer -- --------------------- procedure Register_Buffer( Name : in Unbounded_String; Sheet : in Handle ) is begin for I in Sheet_List'Range loop if Sheet_List(I).Name = Null_Unbounded_String then Sheet_List(I).Name := Name; Sheet_List(I).Sheet := Sheet; return; end if; end loop; end Register_Buffer; -------------------- -- Bring_In_Front -- -------------------- procedure Bring_In_Front( Sheet_Name : in Unbounded_String ) is This : Handle := Locate_Buffer( Sheet_Name ); Pg : Gint; begin if This /= null then Pg := Page_Num( Toplevel, This.SheetBox ); Set_Page( Toplevel, Pg ); else Error( "not found: " & To_String(Sheet_Name) ); end if; end Bring_In_Front; --- ************************************************************************** --- --- *** E D I T O R F U N C T I O N S *** --- --- ************************************************************************** --- ---------------- -- Initialize -- ---------------- procedure Initialize( This : in out Object'Class ) is begin This.Self := This'Unchecked_Access; end Initialize; -------------- -- Finalize -- -------------- procedure Finalize( This : in out Object'Class ) is begin This.Self := null; end Finalize; ---------- -- Self -- ---------- function Self( This : in Object'Class ) return Handle is begin return This.Self; end Self; -------------- -- Contents -- -------------- function Contents( This : in Object'Class ) return Contents_Handler.Handle is begin return This.Handler; end Contents; -------------- -- Contents -- -------------- function Contents return Contents_Handler.Handle is W : Gtk_Widget; begin W := Get_Child( Get_Cur_Page( Toplevel ) ); if W /= null then return Sheet_Box( W ).Handler ; else return null; end if; end Contents; ----------------- -- CB_Activate -- ----------------- procedure CB_Activate( Box : access Sheet_Box_Record'Class ) is begin Put_Line("switch"); end CB_Activate; ---------------- -- Add_Sheet -- ---------------- procedure Add_Sheet( This : in out Object'Class; Handler : in Contents_Handler.Handle; Sheet_Name : in Unbounded_String; Permanent : in Boolean := False ) is --- Add an sql editor to the workspace notebook Abox : Gtk_Box renames This.Abox; Cbox : Gtk_Box renames This.Cbox; Vbox : Gtk_Box renames This.Vbox; Label_Box : Gtk_Box; Label : Gtk_Label; Menu_Box : Gtk_Box; Fr1, Fr2 : Gtk_Frame; SheetBox : Sheet_Box renames This.SheetBox; --- begin if Is_Open( Sheet_Name ) then return; end if; SheetBox := new Sheet_Box_Record; Gtk.Event_Box.Initialize( Sheetbox ); SheetBox.Handler := Handler; SheetBox.Sheet := This.Self; Register_Buffer( Sheet_Name, This.Self ); This.Buffer_Name := Sheet_Name; This.Handler := Handler; This.Permanent := Permanent; -------------------------------- -- The box which contains all -- -------------------------------- Gtk_New_Vbox (Vbox); Set_Border_Width (Vbox, 2); Show_All (This.Vbox); ------------------------------- -- Where to place the editor -- ------------------------------- Gtk_New( Fr1 ); Gtk_New_Hbox(Abox, False, 5 ); Set_Border_Width (Abox, 5); Add( Fr1, Abox ); Show_All( Abox ); ---------------------------- -- Where to place buttons -- ---------------------------- Gtk_New( Fr2 ); Gtk_New_Hbox (Cbox, False, 5); Set_Border_Width (cbox, 5); Add( Fr2, Cbox ); Show_All( Cbox ); Display( This, Abox ); Pack_Start (Vbox, fr1, Expand => True ); Pack_End (Vbox, fr2, Expand => False ); Add( SheetBox, Vbox ); Show_All( SheetBox ); ------------------------------ -- add the notebook labels -- ------------------------------ Gtk_New_Hbox (Label_Box, False, 0); Gtk_New (This.Label, Display_Name(Sheet_Name ) ); Pack_Start (Label_Box, This.Label, False, True, 0); Show_All (Label_Box); Gtk_New_Vbox (Menu_Box, False, 0); Gtk_New (Label, Display_Name( Sheet_Name ) ); Pack_Start (Menu_Box, This.Label, False, True, 0); Show_All (Menu_Box); -- Sheet_CB.Object_Connect( -- SheetBox, -- "draw_focus", -- Sheet_CB.To_Marshaller (CB_Activate'Access ), -- Slot_Object => SheetBox -- ); Append_Page_Menu (Toplevel, SheetBox, Label_Box, Menu_Box); -- bring sheet into front. Set_Page( Toplevel, Page_Num( Toplevel, This.SheetBox )); end Add_Sheet; ------------------- -- Remove_Sheet -- ------------------- procedure Remove_Sheet ( Sheet_Name : in Unbounded_String ) is --- Table : Handle := Locate_Buffer( Sheet_Name ); begin if Table.Permanent then return; end if; for I in Sheet_List'Range loop if Sheet_List(I).Name /= Null_Unbounded_String and then Sheet_List(I).Name = Sheet_Name then Sheet_List(I).Name := Null_Unbounded_String; end if; end loop; -- Destroy( Table.Vbox ); Remove_Page( Toplevel, Page_Num( Toplevel, Table.SheetBox )); end Remove_Sheet; ------------------- -- Remove_Sheet -- ------------------- procedure Remove_Sheet ( This : in out Object'Class ) is begin if This.Permanent then return; end if; for I in Sheet_List'Range loop if Sheet_List(I).Name /= Null_Unbounded_String and then Sheet_List(I).Sheet = This.Self then Sheet_List(I).Name := Null_Unbounded_String; Sheet_List(I).Sheet := null; exit; end if; end loop; Remove_Page( Toplevel, Page_Num( Toplevel, This.SheetBox )); end Remove_Sheet; ----------------- -- Add_Command -- ----------------- procedure Add_Command( This : in out Object'Class; Text : in String; Cmd : in Natural ) is begin Add_Button( This, Text,Cmd, This.Cbox); end Add_Command; --- ************************************************************************** --- --- *** PROCEDURES TO BE EXTENDED *** --- --- ************************************************************************** --- ------------- -- Command -- ------------- procedure Command( This : in out Object; Cmd : in Natural ) is begin GUI_Logging.Log("Pressed cmd: " & Natural'Image( Cmd ) ); end Command; ------------- -- Display -- ------------- procedure Display( This : in out Object; Box : in out Gtk_Box ) is begin GUI_Logging.Error( "GUI_Worksheet: Display not implemented"); end Display; end GUI_Worksheet; gnade-1.6.2.orig/contrib/gsql/gui_worksheet.ads0000644000175000017500000001264507475234417021400 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/gui_worksheet.ads,v $ -- Description : GUI for the data base client -- Author : Michael Erdmann -- Created : 8.8.2001 -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2002/05/29 20:24:47 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Gtk.Box; use Gtk.Box; with Gtk.Event_Box; use Gtk.Event_Box; with Gtk.Label; use Gtk.Label; with Gtk.Notebook; use Gtk.Notebook; with Contents_Handler; use Contents_Handler; package GUI_Worksheet is Toplevel : Gtk_Notebook; Unnamed_Buffer : constant Unbounded_String := Null_Unbounded_String; type Object is tagged private; type Handle is access all Object'Class; -- ******************************************************************** -- -- ** C L A S S I N T E R F A C E ** -- -- ******************************************************************** -- procedure Initialize( This : in out Object'Class ); procedure Finalize( This : in out Object'Class ); procedure Add_Sheet( This : in out Object'Class; Handler : Contents_Handler.Handle; Sheet_Name : in Unbounded_String; Permanent : in Boolean := False); procedure Remove_Sheet( Sheet_Name : in Unbounded_String ); procedure Remove_Sheet ( This : in out Object'Class ); function Is_Open( Sheet_Name : in Unbounded_String ) return Boolean; procedure Bring_In_Front( Sheet_Name : in Unbounded_String ); type Allocator_Access is access function return Handle; procedure Register( Name : in String; Alloc : in Allocator_Access ); function Create( Name : in String ) return Handle; function Contents( this : in Object'Class ) return Contents_Handler.Handle; function Contents return Contents_Handler.Handle; function Self( This : in Object'Class ) return Handle; -- ******************************************************************** -- -- ** E X T E N D A B L E I N T E R F A C E ** -- -- ******************************************************************** -- procedure Command( This : in out Object; Cmd : in Natural ); procedure Display( This : in out Object; Box : in out Gtk_Box ); procedure Add_Command( This : in out Object'Class; Text : in String; Cmd : in Natural ); private ------------------------ -- Extended Event box -- ------------------------ type Sheet_Box_Record is new Gtk_Event_Box_Record with record Sheet : Handle := null ; Handler : Contents_Handler.Handle := null; end record; type Sheet_Box is access all Sheet_Box_Record; type Object is tagged record Label : Gtk_Label; SheetBox : Sheet_Box; Vbox : Gtk_Box; Cbox : Gtk_Box; Abox : Gtk_Box; Buffer_Name : Unbounded_String := Null_Unbounded_String; Handler : Contents_Handler.Handle := null; Self : Handle := null; Permanent : Boolean := False; end record; end GUI_Worksheet; gnade-1.6.2.orig/contrib/gsql/odbc.adb0000644000175000017500000004747507755664546017433 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/odbc.adb,v $ -- Description : ODBC functions for ODBC explorer -- -- Author : Michael Erdmann -- -- Created : 8.8.2001 -- -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2003/11/16 12:11:18 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000, 2001 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- -- -- In contains the following sections: -- -- -- -- Section 1. General support procedures -- -- Section 2. Connection Management -- -- Section 3. Query Management -- -- -- -- Restrictions -- -- ============ -- -- None -- -- -- -- References -- -- ========== -- -- None -- -- -- ------------------------------------------------------------------------------- --* Ada with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Strings.Fixed; use Ada.Strings.Fixed; with Ada.Strings; use Ada.Strings; with Ada.Text_IO; use Ada.Text_IO; with Ada.Exceptions; use Ada.Exceptions; with System.Address_To_Access_Conversions; with System.Storage_Elements; with GNU.DB.SQLCLI; use GNU.DB.SQLCLI; with GNU.DB.SQLCLI.Bind; with GNU.DB.SQLCLI.Info; use GNU.DB.SQLCLI.Info; with GNU.DB.SQLCLI.Info.Debug; with GNU.DB.SQLCLI.Environment_Attribute; use GNU.DB.SQLCLI.Environment_Attribute; with GNU.DB.SQLCLI.Environment_Attribute.Debug; with GNU.DB.SQLCLI.Connection_Attribute; use GNU.DB.SQLCLI.Connection_Attribute; with GNU.DB.SQLCLI.Connection_Attribute.Debug; pragma Warnings (Off); with GNU.DB.SQLCLI.Desc; with GNU.DB.SQLCLI.Generic_Attr.Integer_Attribute; pragma Warnings (On); use GNU.DB.SQLCLI; with Gui_Preferences; use GUI_Preferences; with Preferences; use Preferences; package body ODBC is type Object_Data is record EnvironmentHandle : SQLHENV; ConnectionHandle : SQLHDBC; StatementHandle : SQLHSTMT; ServerName : Unbounded_String := To_Unbounded_String(""); UserName : Unbounded_String := To_Unbounded_String(""); Authentication : Unbounded_String := To_Unbounded_String(""); -- data realted to the last query Cols : Integer := 0; Rows : Integer := 0; Field_Name : String_Array_Access := null; Last_Error : Unbounded_String := Null_Unbounded_String; Last_Message : Unbounded_String := Null_Unbounded_String; end record; --- ********************************************************************* --- --- ** SECTION 1. S U P P O R T P R O C E D U R E S *** --- --- ** ==================================== *** --- --- ** *** --- --- ********************************************************************* --- ---------------- -- Initialize -- ---------------- procedure Initialize( This : in out Object ) is Data : Object_Data_Access := null; begin This.Data := new Object_Data; Data := This.Data; SQLAllocHandle ( SQL_HANDLE_ENV, SQL_NULL_HANDLE, Data.EnvironmentHandle ); SQLSetEnvAttr ( Data.EnvironmentHandle, Environment_Attribute_ODBC_Version' (Attribute => SQL_ATTR_ODBC_VERSION, Value => SQL_OV_ODBC3) ); end Initialize; -------------- -- Finalize -- -------------- procedure Finalize( This : in out Object ) is Data : Object_Data_Access := This.Data; begin SQLFreeHandle (SQL_HANDLE_ENV, Data.EnvironmentHandle); end Finalize; ------------- -- Columns -- ------------- function Columns( This : in Object ) return Integer is Data : Object_Data_Access := This.Data; begin return Data.Cols; end Columns; ------------------- -- Affected_Rows -- ------------------- function Affected_Rows( This : in Object ) return Integer is Data : Object_Data_Access := This.Data; begin return Data.Rows; end Affected_Rows; --------------- -- To_String -- --------------- function To_String( Result : in Result_Record; Pos : in Integer ) return String is begin return To_String( Result(Pos) ); end To_String; ----------------- -- Data_Source -- ----------------- procedure Data_Source( This : in out Object; Name : in String ) is Data : Object_Data_Access := This.Data; begin Data.ServerName := To_Unbounded_String( Name ); end Data_Source; ------------------- -- Authorization -- ------------------- procedure Authorization( This : in out Object; Login : in String; Password : in String ) is Data : Object_Data_Access := This.Data; begin Data.UserName := To_Unbounded_String( Login ); Data.Authentication := To_Unbounded_String( Password ); end Authorization; --------------- -- Get_Error -- --------------- procedure Get_Error( This : in out Object; Error : out Unbounded_String; Message : out Unbounded_String ) is Data : Object_Data_Access := This.Data; begin Error := Data.Last_Error; Message := Data.Last_Message; end Get_Error; ---------------- -- Field_Name -- ---------------- function Field_Name( This : in Object; Pos : in Positive ) return String is Data : Object_Data_Access := This.Data; begin if Pos in Data.Field_Name'Range then return To_String(Data.Field_Name( Pos )); else return ""; end if; end Field_Name; --- ********************************************************************* --- --- ** *** --- --- ** SECTION 2. C O N N E C T I O N M A N A G E M E N T *** --- --- ** *** --- --- ********************************************************************* --- ------------- -- Connect -- ------------- procedure Connect( This : in out Object; Source : in String := "" ) is -- connect to the data source and set all connection related -- attributes. Data : Object_Data_Access := This.Data; begin if Source /= "" then Data.ServerName := To_Unbounded_String(Source); end if; SQLAllocHandle ( SQL_HANDLE_DBC, Data.EnvironmentHandle, Data.ConnectionHandle); SQLSetEnvAttr ( Data.EnvironmentHandle, Environment_Attribute_ODBC_Version' (Attribute => SQL_ATTR_ODBC_VERSION, Value => SQL_OV_ODBC3) ); SQLConnect ( ConnectionHandle => Data.ConnectionHandle, ServerName => To_String( Data.ServerName ), UserName => To_String( Data.UserName ), Authentication => To_String( Data.Authentication) ); end Connect; ---------------- -- Disconnect -- ---------------- procedure Disconnect( This : in out Object ) is -- diconnect ffrom the data source Data : Object_Data_Access := This.Data; begin SQLDisconnect (Data.ConnectionHandle); SQLFreeHandle (SQL_HANDLE_DBC, Data.ConnectionHandle); end Disconnect; --- ********************************************************************* --- --- ** *** --- --- ** SECTION 3. Q U E R Y M A N A G E M E N T *** --- --- ** *** --- --- ********************************************************************* --- ----------- -- Query -- ----------- procedure Query( This : in out Object; -- execute the query and evaluate the number of columns and -- rows. Query_String : in String ) is Data : Object_Data_Access := This.Data; DataType : aliased SQL_DATA_TYPE; ColumnSize : aliased SQLUINTEGER; DecimalDigits : aliased SQLSMALLINT; Nullable : aliased SQL_NULLABLE_INFO; RC : aliased SQLRETURN; begin Data.Last_Error := Null_Unbounded_String; Data.Last_Message := Null_Unbounded_String; SQLAllocHandle ( SQL_HANDLE_STMT, Data.ConnectionHandle, Data.StatementHandle ); SQLExecDirect ( Data.StatementHandle, Query_String ); Data.Rows := Integer( SQLRowCount(Data.StatementHandle) ); Data.Cols := Integer( SQLNumResultCols ( Data.StatementHandle )); Put_Line("Data.cols =" & Integer'Image(Data.Cols)); Put_Line("Data.rows =" & Integer'Image(Data.Rows)); Data.Field_Name := new String_Array( 1..Integer(Data.Cols) ); for Col in 1..Data.Cols loop Data.Field_Name( Col ) := To_Unbounded_String( SQLDescribeCol( Data.StatementHandle, SQL_Column_Number(Col), SQLSMALLINT( 1024 ), DataType'Access, ColumnSize'Access, DecimalDigits'Access, Nullable'Access, RC'Access ) ); end loop; exception when Error : others => Data.Last_Error := To_Unbounded_String(Exception_Name (Error)); Data.Last_Message := To_Unbounded_String(Exception_Message (Error)); raise; end Query; ----------- -- Fetch -- ----------- function Fetch( This : in Object ) return Result_Record is -- fetch the next record from the result set and return a record Data : Object_Data_Access := This.Data; Result : String_Array_Access := null; RC : SQLRETURN; Buffer : aliased String( 1..512 ) := (others =>' '); Buffer_Length : aliased SQLINTEGER; begin Data.Last_Error := Null_Unbounded_String; Data.Last_Message := Null_Unbounded_String; SQLFetch( Data.StatementHandle ); Result := new String_Array(1..Data.Cols); for Col in 1..Data.Cols loop RC := SQLGetData ( Data.StatementHandle, ColumnNumber => SQL_Column_Number(Col), TargetType => SQL_C_CHAR, TargetValue => To_SQLPOINTER(Buffer'Address), BufferLength => Buffer'Length, StrLen_Or_Ind => Buffer_Length'Access ); Result(Col) := To_Unbounded_String(Buffer(1..Integer(Buffer_Length))); end loop; return Result_Record( Result ); exception when No_Data => SQLFreeHandle (SQL_HANDLE_STMT, Data.StatementHandle); return null; when Error : others => Data.Last_Error := To_Unbounded_String(Exception_Name (Error)); Data.Last_Message := To_Unbounded_String(Exception_Message (Error)); SQLFreeHandle (SQL_HANDLE_STMT, Data.StatementHandle); return null; end Fetch; --- ********************************************************************* --- --- ** *** --- --- ** SECTION 4. D A T A B A S E M A N A G E M E N T *** --- --- ** *** --- --- ********************************************************************* --- ---------------- -- Procedures -- ---------------- function Procedures( This : in Object ) return String_Array_Access is -- get a list of all table names Data : Object_Data_Access := This.Data; StatementHandle : SQLHSTMT; Result : String_Array_Access := null; Rows : Integer; RC : SQLRETURN; Pattern : String := SQL_ALL_PATTERN; Catalog : aliased String := 40 * ' '; Catalog_Len : aliased SQLINTEGER; Schema : aliased String := 40 * ' '; Schema_Len : aliased SQLINTEGER; Name : aliased String := 40 * ' '; Name_Len : aliased SQLINTEGER; Remarks : aliased String := 40 * ' '; Remarks_Len : aliased SQLINTEGER; begin Data.Last_Error := Null_Unbounded_String; Data.Last_Message := Null_Unbounded_String; SQLAllocHandle ( SQL_HANDLE_STMT, Data.ConnectionHandle, StatementHandle ); SQLProcedures ( StatementHandle, CatalogName => Preference(Prf_Catalog), SchemaName => Preference(Prf_Schema ) ); Rows := Integer( SQLRowCount(StatementHandle) ); Put_Line("Rows:" & Integer'Image(Rows)); Result := new String_Array( 1..Integer(Rows) ); Put_Line("Number of Procedures: " & Integer'Image(Rows)); SQLBindCol (StatementHandle, 1, Catalog'Access, Catalog_Len'Access); SQLBindCol (StatementHandle, 2, Schema'Access, Schema_Len'Access ); SQLBindCol (StatementHandle, 3, Name'Access, Name_Len'Access ); SQLBindCol (StatementHandle, 7, Remarks'Access, Remarks_Len'Access); loop RC := SQLFetch( Data.StatementHandle ); exit when RC /= SQL_SUCCESS; Put_Line("Procedure: " & Name(1..Integer(Name_Len)) ); end loop; SQLFreeHandle (SQL_HANDLE_STMT, StatementHandle); return Result; exception when Error : others => Put_Line("Exception in Precedures"); Data.Last_Error := To_Unbounded_String(Exception_Name (Error)); Data.Last_Message := To_Unbounded_String(Exception_Message (Error)); SQLFreeHandle (SQL_HANDLE_STMT, StatementHandle); raise; end Procedures; ------------ -- Tables -- ------------ function Tables( This : in Object ) return String_Array_Access is -- get a list of all table names Data : Object_Data_Access := This.Data; StatementHandle : SQLHSTMT; Result : String_Array_Access := null; Rows : Integer; RC : SQLRETURN; Pattern : String := SQL_ALL_PATTERN; Catalog : aliased String := 40 * ' '; Catalog_Len : aliased SQLINTEGER; Schema : aliased String := 40 * ' '; Schema_Len : aliased SQLINTEGER; Name : aliased String := 40 * ' '; Name_Len : aliased SQLINTEGER; begin Data.Last_Error := Null_Unbounded_String; Data.Last_Message := Null_Unbounded_String; SQLAllocHandle ( SQL_HANDLE_STMT, Data.ConnectionHandle, StatementHandle ); SQLTables (StatementHandle, CatalogName => Preference(Prf_Catalog), SchemaName => Preference(Prf_Schema), TableName => Pattern ); Rows := Integer( SQLRowCount(StatementHandle) ); Put_Line("Number of Tables: " & Integer'Image(Rows)); Result := new String_Array( 1..Integer(Rows) ); SQLBindCol (StatementHandle, 1, Catalog'Access, Catalog_Len'Access); SQLBindCol (StatementHandle, 2, Schema'Access, Schema_Len'Access ); SQLBindCol (StatementHandle, 3, Name'Access, Name_Len'Access ); loop RC := SQLFetch( Data.StatementHandle ); exit when RC /= SQL_SUCCESS; Put_Line("Table: " & Name(1..Integer(Name_Len)) ); end loop; SQLFreeHandle (SQL_HANDLE_STMT, StatementHandle); return Result; exception when Error : others => Data.Last_Error := To_Unbounded_String(Exception_Name (Error)); Data.Last_Message := To_Unbounded_String(Exception_Message (Error)); SQLFreeHandle (SQL_HANDLE_STMT, StatementHandle); raise; end Tables; ------------------ -- Data_Source -- ------------------ function Data_Source( This : in Object; First : in Boolean := False ) return Source_Information is -- return the data source available in this data base object Data : Object_Data_Access := This.Data; Direction : SQL_EXTENDED_FETCH_DIRECTION := SQL_FETCH_NEXT; ServerName : String( 1..256 ); Description : String( 1..256 ); RC : SQLRETURN; Result : Source_Information := Null_Source_Information; begin if First then Direction := SQL_FETCH_FIRST; end if; SQLDataSources( Data.EnvironmentHandle, Direction, ServerName, Description, RC); if RC = SQL_SUCCESS then Result.Server := To_Unbounded_String( Trim(ServerName,Right) ); Result.Description := To_Unbounded_String( Trim(Description,Right) ); end if; return Result; end Data_Source; end ODBC; gnade-1.6.2.orig/contrib/gsql/odbc.ads0000644000175000017500000001371707340003255017412 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/odbc.ads,v $ -- Description : Query Module based upon ODBC -- -- Author : Michael Erdmann -- -- Created : 8.8.2001 -- -- Last Modified By: $Author: me $ -- Last Modified On: $Date: 2001/08/19 18:34:21 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- -- -- In contains the following sections: -- -- -- -- Section 1. General support procedures -- -- Section 2. Connection Management -- -- Section 3. Query Management -- -- -- -- Restrictions -- -- ============ -- -- None -- -- -- -- References -- -- ========== -- -- None -- -- -- ------------------------------------------------------------------------------- --* Ada with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; package ODBC is type Object is private; type String_Array is array ( Positive range <> ) of Unbounded_String; type String_Array_Access is access String_Array; subtype Result_Record is String_Array_Access; Null_Result_Record : constant Result_Record := null; ------------------------ -- Source_Information -- ------------------------ type Source_Information is record Server : Unbounded_String := Null_Unbounded_String; Description : Unbounded_String := Null_Unbounded_String; end record; Null_Source_Information : constant Source_Information := ( Null_Unbounded_String, Null_Unbounded_String ); ---------------- -- Initialize -- ---------------- procedure Initialize( This : in out Object ); procedure Finalize( This : in out Object ); procedure Authorization( This : in out Object; Login : in String; Password : in String ); procedure Data_Source( This : in out Object; Name : in String ); function Data_Source( This : in Object; First : in Boolean := False ) return Source_Information; procedure Connect( This : in out Object; Source : in String := "" ); procedure Disconnect( This : in out Object ); procedure Query( This : in out Object; Query_String : in String ); function Field_Name( This : in Object; Pos : in Positive ) return String; function Fetch( This : in Object ) return Result_Record; function Columns( This : in Object ) return Integer; function Affected_Rows( This : in Object ) return Integer; function To_String( Result : in Result_Record; Pos : in Integer ) return String; function Tables( This : in Object ) return String_Array_Access; function Procedures( This : in Object ) return String_Array_Access; procedure Get_Error( This : in out Object; Error : out Unbounded_String; Message : out Unbounded_String ); private type Object_Data; type Object_Data_Access is access Object_Data; type Object is record Data : Object_Data_Access := null; end record; end ODBC; gnade-1.6.2.orig/contrib/gsql/preferences.ads0000644000175000017500000000606507354430350021007 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/preferences.ads,v $ -- Description : Preference GUI -- -- Author : Michael Erdmann -- -- Created : 8.8.2001 -- -- Last Modified By: $Author: me $ -- Last Modified On: $Date: 2001/09/26 19:47:52 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- package Preferences is Prf_Login : constant String := "login"; Prf_Password : constant String := "password"; Prf_Catalog : constant String := "catalog"; Prf_Schema : constant String := "schema"; Prf_Repository : constant String := "repositorypath"; Prf_Debug : constant String := "debuglevel"; Prf_Project : constant String := "projecttitle"; Prf_Author : constant String := "projectauthor"; Prf_Inst_Dir : constant String := "installdir"; end Preferences; gnade-1.6.2.orig/contrib/gsql/procedure_handler.adb0000644000175000017500000002406507475351164022163 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/procedure_handler.adb,v $ -- Description : handle the procedures of a project -- Author : Michael Erdmann -- -- Created : 8.8.2001 -- -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2002/05/30 07:19:16 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Text_IO; use Ada.Text_IO; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Project_File; use Project_File; with Datasource_Handler; use Datasource_Handler; with Contents_Manager; use Contents_Manager; with Text_Block; use Text_Block; with Preferences; use Preferences; with Contents_Manager.GUI; use Contents_Manager.GUI; with Gui_Preferences; use GUI_Preferences; with GUI_Logging; use GUI_Logging; with GUI_Tools; use GUI_Tools; with GUI_Worksheet; use GUI_Worksheet; package body Procedure_Handler is Version : constant String := "$Id: procedure_handler.adb,v 1.9 2002/05/30 07:19:16 merdmann Exp $"; -- ********************************************************************* -- -- ** L O C A L D A T A ** -- -- ********************************************************************* -- Procedure_Section : Element_ID := Null_Element_ID; -- ********************************************************************* -- -- ** L O C A L P R O C E D U R E S ** -- -- ********************************************************************* -- ----------------- -- Instanciate -- ----------------- function Instanciate( Key : in String ) return Contents_Handler.Handle is Result : Handle := new Object; begin Put_Line("Instanciate procedure entry :" & Key ); return Contents_Handler.Handle(Result); end Instanciate; -- ********************************************************************* -- -- ** P U B L I C P R O C E D U R E S ** -- -- ********************************************************************* -- ---------------- -- Initialize -- ---------------- procedure Initialize( This : in out Object ) is -- initialize the query (instance) begin Initialize( Contents_Handler.Object(This) ); This.Id := GUI.Add_Element( Key(This), Procedure_Section, Self(This) ); end Initialize; -------------- -- Finalize -- -------------- procedure Finalize( This : in out Object ) is Name : constant Unbounded_String := Key( This ); begin if GUI_Worksheet.Is_Open( Name ) then GUI_Worksheet.Remove_Sheet( Name ); end if; Project_File.Remove( Procedure_Prefix, Key(This) ); GUI.Delete_Element( This.Id ); Finalize( Contents_Handler.Object(This) ); end Finalize; ---------------- -- Initialize -- ---------------- procedure Initialize is Item : Handle := new Object; begin Item.Constructor := Instanciate'Access; Procedure_Section := Add_Element( Title => "Procedures", Content => Contents_Handler.Handle(Item) ); Contents_Manager.Register( Procedure_Prefix, Instanciate'Access ); Contents_Manager.Initialize( Procedure_Prefix, Procedure_Section); Put_Line("procedure handler initialized"); end Initialize; -------------- -- Finalize -- -------------- procedure Finalize is begin Contents_Manager.Finalize( Procedure_Prefix ); end Finalize; ----------- -- Value -- ----------- procedure Value( This : in Object; Text : out Text_Buffer; Last : out Positive ) is begin GUI_Editor.Get_Result( This.Editor, Text, Last); end Value; ---------- -- Save -- ---------- procedure Save( Item : in out Object; Value : in Text_Buffer; Name : in String := "" ) is -- save the procedure text in the project file. If the procedure -- name does not exist yet create a new entry. -- Afterwards update the project file. Current : constant String := Key( Item ); PName : constant String := To_String( Value(1) ); NewObj : Handle; begin if not Section_Exists( Procedure_Prefix, PName ) then NewObj := Handle(Contents_Manager.Create( Procedure_Prefix, PName ) ); Gui_Worksheet.Remove_Sheet( Item.Editor ); end if; Project_File.Update( Procedure_Prefix, PName, Value); end Save; ---------- -- Load -- ---------- procedure Load( Item : in out Object; Value : out Text_Buffer; Last : out Natural ) is -- load the procedure from the project file. If nothing is -- there generate a template procedure. Description : constant Text_Buffer := ( To_Unbounded_String( "-- Fill in your description" ), To_Unbounded_String( "-- Author: " & Preference(Prf_Author)) ); SQL_Body : constant Text_Buffer := ( To_Unbounded_String( "( IN aName type ) "), To_Unbounded_String( "MODIFIES SQL DATA "), To_Unbounded_String( "BEGIN "), To_Unbounded_String( "END ") ); begin Project_File.Get( Procedure_Prefix, Key(Item), Value, Last ); exception when Section_Not_Found => Last := Value'First; Value(Last) := To_Unbounded_String( "PROCEDURE/FUNCTION " & Key(Item) ); Last := Last + 1; Put_Text_Block( Value, Description, Last ); Put_Text_Block( Value, SQL_Body, Last ); end Load; -------------- -- Selected -- -------------- procedure Selected( This : in out Object ) is -- -- R.1 - If only the class is selected the toolbar is -- activated for the query class. -- -- R.2 - If an instance is selected, the instance is -- loaded into the editor. -- begin if This.Constructor /= null then -- R.1 GUI_Tools.Activate( Procedure_Prefix ); else -- R.2 Open_Editor( This ); end if; end Selected; ----------------- -- Open_Editor -- ----------------- procedure Open_Editor( This : in out Object ) is -- load the referenced instance into the query editor Name : Unbounded_String := Key( This ); begin if not GUI_Worksheet.Is_Open( Name ) then Initialize( This.Editor ); GUI_Worksheet.Add_Sheet( This.Editor, Self(This), Name ); else GUI_Worksheet.Bring_In_Front( Name ); end if; end Open_Editor; ------------------ -- Close_Editor -- ------------------ procedure Close_Editor( This : in out Object ) is begin GUI_Worksheet.Remove_Sheet( This.Editor ); end Close_Editor; ------------- -- Execute -- ------------- procedure Execute( This : in out Object ) is -- execute the current editor contents Name : Unbounded_String := Key( This ); Text : Text_Buffer( 1..Max_Section_Length ); Last : Positive; begin if Datasource_Handler.Current_Database = Not_Attached then Error("No data base connected"); return; end if; -- Datasource_Handler.Execute( GUI_Editor.Current_Editor_Contents ); Log("Removing " & To_String(Name) ); Datasource_Handler.Execute( "DROP " & To_String(Name) ); Log("Installing " & To_String(Name) ); GUI_Editor.Query(This.Editor, Text, Last); Datasource_Handler.Execute( "CREATE " & To_String(Name) & To_String( Text(1..Last) ) ); Log("Done"); end Execute; end Procedure_Handler; gnade-1.6.2.orig/contrib/gsql/procedure_handler.ads0000644000175000017500000001003307355676443022201 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/procedure_handler.ads,v $ -- Description : Contents Handler for procedures -- Author : Michael Erdmann -- -- Created : 8.8.2001 -- -- Last Modified By: $Author: me $ -- Last Modified On: $Date: 2001/09/30 20:14:27 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with GSQL_Types; use GSQL_Types; with Contents_Handler; use Contents_Handler; with Contents_Manager; use Contents_Manager; with Project_File; use Project_File; with GUI_Editor; use GUI_Editor; package Procedure_Handler is type Object is new Contents_Handler.Object with private; type Handle is access all Object; procedure Initialize; procedure Finalize; Procedure_Prefix : constant String; private Procedure_Prefix : constant String := "procedures"; type Object is new Contents_Handler.Object with record Constructor : Constructor_Access := null; Editor : GUI_Editor.Object; Id : Element_ID := Null_Element_ID; end record; procedure Initialize( This : in out Object ); procedure Finalize( This : in out Object ); procedure Selected( This : in out Object ); procedure Value( This : in Object; Text : out Text_Buffer; Last : out Positive ); procedure Save( Item : in out Object; Value : in Text_Buffer; Name : in String := "" ); procedure Load( Item : in out Object; Value : out Text_Buffer; Last : out Natural ); procedure Open_Editor( This : in out Object ); procedure Close_Editor( This : in out Object ); procedure Execute( This : in out Object ); end Procedure_Handler; gnade-1.6.2.orig/contrib/gsql/project_file.adb0000644000175000017500000003357410670060161021131 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/project_file.adb,v $ -- Description : project file handling -- -- Author : Michael Erdmann -- -- Created : 8.8.2001 -- -- Last Modified By: $Author: persan $ -- Last Modified On: $Date: 2007/09/06 20:17:53 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Functional description -- -- ====================== -- -- The project file contains defintio sections. A defintion section for -- -- a attribute consists one line with the attribute name and a free number -- -- of following lines containing the actual data of the attrbiute as for -- -- example: -- -- -- -- Path -- -- 2 -- -- /usr/bin -- -- /usr/local/bin -- -- -- -- Author -- -- ====== -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Text_IO; use Ada.Text_IO; with Ada.Strings; use Ada.Strings; with Ada.Strings.Fixed; use Ada.Strings.Fixed; with Unchecked_Deallocation; package body Project_File is type Attribute_Record (N : Positive) is record Class_Name : Unbounded_String := Null_Unbounded_String; Name : Unbounded_String := Null_Unbounded_String; Value : Text_Buffer (1 .. N); end record; type Attribute is access Attribute_Record; procedure Free is new Unchecked_Deallocation (Attribute_Record, Attribute); Attribute_List : array (1 .. Max_Catalog_Length) of Attribute; Next_Free : Positive := 1; --- ******************************************************************* --- --- *** L O C A L S U P P O R T PROCEDURES *** --- --- ******************************************************************* --- ---------------- -- Class_Name -- ---------------- function Class_Name ( S : in String) return Unbounded_String is -- fetch the class name from a line begin for I in S'Range loop if S (I) = ':' then return To_Unbounded_String (S (1 .. I - 1)); end if; end loop; return To_Unbounded_String (S); end Class_Name; ---------------- -- Entry_Name -- ---------------- function Entry_Name ( S : in String) return Unbounded_String is begin for I in S'Range loop if S (I) = ':' then return To_Unbounded_String (S (I + 1 .. S'Last)); end if; end loop; return To_Unbounded_String (S); end Entry_Name; ----------- -- Match -- ----------- function Match ( Id : in Positive; Cls : in String; Name : in String) return Boolean is begin return To_String (Attribute_List (Id).Name) = Name and To_String (Attribute_List (Id).Class_Name) = Cls; end Match; --- ******************************************************************* --- --- *** HANDLE P R O J E C T F I L E S *** --- --- ******************************************************************* --- ---------- -- Open -- ---------- procedure Open ( Path : in String := ""; Quiet : in Boolean := False) is -- load a complete project file into the memory File : File_Type; Line : String (1 .. 1024); Last : Natural; function Read_Paragraph ( Name_Line : in String) return Attribute is Nbr_Of_Lines : Natural; Result : Attribute; Name : Unbounded_String := Entry_Name (Name_Line); Cls_Name : Unbounded_String := Class_Name (Name_Line); begin Get_Line (File, Line, Last); Nbr_Of_Lines := Natural'Value (Line (2 .. Last)); Result := new Attribute_Record (Nbr_Of_Lines); Result.Name := Name; Result.Class_Name := Cls_Name; for I in 1 .. Nbr_Of_Lines loop Get_Line (File, Line, Last); Result.Value (I) := To_Unbounded_String (Line (1 .. Last)); end loop; return Result; end Read_Paragraph; begin if Path /= "" then Open (File, In_File, Path); else Open (File, In_File, To_String (File_Name)); end if; while not End_Of_File (File) loop Get_Line (File, Line, Last); Attribute_List (Next_Free) := Read_Paragraph (Trim (Line (1 .. Last), Right)); Next_Free := Next_Free + 1; end loop; Close (File); exception when others => if Quiet then return; else raise; end if; end Open; ----------- -- Close -- ----------- procedure Close is -- close the file and release all resources allocated to the file procedure Free is new Unchecked_Deallocation (Attribute_Record, Attribute); begin for I in Attribute_List'Range loop if Attribute_List (I) /= null then Free (Attribute_List (I)); Attribute_List (I) := null; end if; end loop; end Close; ---------- -- Save -- ---------- procedure Save ( Path : in String := "") is -- save the project data into a file File : File_Type; begin if Path /= "" then Create (File => File, Mode => Out_File, Name => Path); else Create (File => File, Mode => Out_File, Name => To_String (File_Name)); end if; for I in Attribute_List'Range loop if Attribute_List (I) /= null then Put_Line ( File, To_String (Attribute_List (I).Class_Name) & ":" & To_String (Attribute_List (I).Name)); Put_Line (File, Positive'Image (Attribute_List (I).Value'Length)); for J in Attribute_List (I).Value'Range loop Put_Line (File, To_String (Attribute_List (I).Value (J))); end loop; end if; end loop; Close (File); end Save; --- ******************************************************************* --- --- ** A C C E S S FUNCTIONS FOR S E C T I O N S *** --- --- ******************************************************************* --- ---------- -- Find -- ---------- function Find ( Cls : in String; Name : in String) return Attribute is begin for I in Attribute_List'Range loop if Attribute_List (I) /= null and then Match (I, Cls, Name) then return Attribute_List (I); end if; end loop; raise Section_Not_Found; end Find; --------- -- Get -- --------- procedure Get ( Cls : in String; Name : in String; Result : out Text_Buffer; Size : out Positive) is -- get the contents of a certain section Comp : Attribute; begin Comp := Find (Cls, Name); for J in Result'Range loop exit when not (J in Comp.Value'Range); Size := J; Result (J) := Comp.Value (J); end loop; end Get; --------- -- Get -- --------- function Get ( Cls : in String; Name : in String) return String is -- get the contents of a certain section Result : Unbounded_String := Null_Unbounded_String; Comp : constant Attribute := Find (Cls, Name); begin for J in Comp.Value'Range loop Result := Result & Comp.Value (J); end loop; return To_String (Result); end Get; --------- -- Add -- --------- procedure Add ( Cls : in String; Name : in String; Data : in Text_Buffer) is -- add a section to the project file Item : constant Attribute := new Attribute_Record (Data'Length); begin Item.Name := To_Unbounded_String (Name); Item.Class_Name := To_Unbounded_String (Cls); Item.Value := Data; if Next_Free in Attribute_List'Range then Attribute_List (Next_Free) := Item; Next_Free := Next_Free + 1; else raise No_More_Components; end if; end Add; --------- -- Add -- --------- procedure Add ( Cls : in String; Name : in String; Data : in String) is -- add a section to the project file T : Text_Buffer (1 .. Max_Section_Length); Last : Positive := 1; begin To_Text_Buffer (Data, T, Last); Add (Cls, Name, T (1 .. Last)); end Add; ------------ -- Update -- ------------ procedure Update ( Cls : in String; Name : in String; Data : in String) is -- update a section with a single string. The string might -- contain LF. begin if Section_Exists (Cls, Name) then Remove (Cls, Name); end if; Add (Cls, Name, Data); end Update; ------------ -- Update -- ------------ procedure Update ( Cls : in String; Name : in String; Data : in Text_Buffer) is -- update the section by means of a text buffer begin if Section_Exists (Cls, Name) then Remove (Cls, Name); end if; Add (Cls, Name, Data); end Update; -------------------- -- Section_Exists -- -------------------- function Section_Exists ( Cls : in String; Name : in String) return Boolean is -- return true if a section exists Result : Attribute; pragma Unreferenced (Result); begin Result := Find (Cls, Name); return True; exception when Section_Not_Found => return False; end Section_Exists; ------------ -- Remove -- ------------ procedure Remove ( Cls : in String; Name : in String; Quiet : in Boolean := True) is begin for I in Attribute_List'Range loop if Attribute_List (I) /= null and then Match (I, Cls, Name) then Free (Attribute_List (I)); Attribute_List (I) := null; return; end if; end loop; if not Quiet then raise Section_Not_Found; end if; end Remove; ------------- -- Catalog -- ------------- procedure Catalog ( Name : in String; Cat : out Text_Buffer) is J : Positive := 1; begin for I in Cat'Range loop Cat (I) := Null_Unbounded_String; end loop; for I in Attribute_List'Range loop exit when not (J in Cat'Range); if Attribute_List (I) /= null and then To_String (Attribute_List (I).Class_Name) = Name then Cat (J) := Attribute_List (I).Name; J := J + 1; end if; end loop; end Catalog; end Project_File; gnade-1.6.2.orig/contrib/gsql/project_file.ads0000644000175000017500000001046210670060161021141 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/project_file.ads,v $ -- Description : GUI top level window -- Author : Michael Erdmann -- -- Created : 8.8.2001 -- -- Last Modified By: $Author: persan $ -- Last Modified On: $Date: 2007/09/06 20:17:53 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with GSQL_Types; use GSQL_Types; package Project_File is Max_Catalog_Length : constant Natural := 1000; File_Name : Unbounded_String := Null_Unbounded_String; procedure Open ( Path : in String := ""; Quiet : in Boolean := False); procedure Save ( Path : in String := ""); procedure Close; No_More_Components : exception; Section_Not_Found : exception; procedure Get ( Cls : in String; Name : in String; Result : out Text_Buffer; Size : out Positive); function Get ( Cls : in String; Name : in String) return String; function Section_Exists ( Cls : in String; Name : in String) return Boolean; procedure Add ( Cls : in String; Name : in String; Data : in String); procedure Add ( Cls : in String; Name : in String; Data : in Text_Buffer); procedure Update ( Cls : in String; Name : in String; Data : in String); procedure Update ( Cls : in String; Name : in String; Data : in Text_Buffer); procedure Remove ( Cls : in String; Name : in String; Quiet : in Boolean := True); procedure Catalog ( Name : in String; Cat : out Text_Buffer); end Project_File; gnade-1.6.2.orig/contrib/gsql/query_handler.adb0000644000175000017500000002616010670060161021317 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/gsql/query_handler.adb,v $ -- Description : GUI for the SQL client -- Author : Michael Erdmann -- -- Created : 8.8.2001 -- -- Last Modified By: $Author: persan $ -- Last Modified On: $Date: 2007/09/06 20:17:53 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Functional description -- -- ====================== -- -- -- -- Author -- -- ====== -- -- -- -- Author: Michael Erdmann -- -- -- -- Restrictions -- -- ============ -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Text_IO; use Ada.Text_IO; with Text_Block; use Text_Block; with Contents_Manager.GUI; use Contents_Manager.GUI; with Datasource_Handler; use Datasource_Handler; with Preferences; use Preferences; with GUI_Preferences; use GUI_Preferences; with GUI_Logging; use GUI_Logging; with GUI_Tools; use GUI_Tools; with GUI_Worksheet; use GUI_Worksheet; package body Query_Handler is -- ********************************************************************* -- -- ** L O C A L D A T A ** -- -- ********************************************************************* -- Query_Section : Element_ID := Null_Element_ID; -- ********************************************************************* -- -- ** L O C A L P R O C E D U R E S ** -- -- ********************************************************************* -- ----------------- -- Instanciate -- ----------------- function Instanciate ( Key : in String) return Contents_Handler.Handle is pragma Unreferenced (Key); Result : constant Handle := new Object; begin return Contents_Handler.Handle (Result); end Instanciate; -- ********************************************************************* -- -- ** P U B L I C P R O C E D U R E S ** -- -- ** ( CLASS - Methods ) ** -- -- ********************************************************************* -- ---------------- -- Initialize -- ---------------- procedure Initialize is -- initialize the package (class) Item : constant Handle := new Object; begin Item.Constructor := Instanciate'Access; Query_Section := Add_Element ( Title => "Queries", Content => Contents_Handler.Handle (Item) ); Contents_Manager.Register (Query_Prefix, Item.Constructor); Contents_Manager.Initialize (Query_Prefix, Query_Section); end Initialize; -------------- -- Finalize -- -------------- procedure Finalize is -- finalize the package by writing out all contents elements -- into the project file. begin Contents_Manager.Finalize (Query_Prefix); end Finalize; ---------------- -- Initialize -- ---------------- procedure Initialize ( This : in out Object) is -- initialize the query (instance) begin Initialize (Contents_Handler.Object (This)); Put_Line ("Initialize: " & Key ( This ) ); This.Id := GUI.Add_Element ( Key (This), Query_Section, Self (This) ); end Initialize; -------------- -- Finalize -- -------------- procedure Finalize ( This : in out Object ) is Name : constant Unbounded_String := Key ( This ); begin if GUI_Worksheet.Is_Open ( Name ) then GUI_Worksheet.Remove_Sheet ( Name ); end if; Project_File.Remove ( Query_Prefix, Key (This) ); GUI.Delete_Element ( This.Id ); Finalize ( Contents_Handler.Object (This) ); end Finalize; -- ********************************************************************* -- -- ** P U B L I C P R O C E D U R E S ** -- -- ** ( INSATNCE - Methods ) ** -- -- ********************************************************************* -- ----------- -- Value -- ----------- procedure Value ( This : in Object; Text : out Text_Buffer; Last : out Positive ) is -- this procedure retrieves the contents of the GUI and sets the -- object name. begin GUI_Editor.Get_Result ( This.Editor, Text, Last); end Value; ---------- -- Save -- ---------- procedure Save ( Item : in out Object; Value : in Text_Buffer; Name : in String := "" ) is -- R.1 If the object is already in the project file, then simply -- update the data -- R.2 if the object is not in the project file, assume, that the -- element with the specified name has to be created newly. Current : constant String := Key ( Item ); NewObj : Handle; begin Item.Name := Value (1); if not Section_Exists ( Query_Prefix, To_String ( Item.Name ) ) then -- R.2 NewObj := Handle (Contents_Manager.Create ( Query_Prefix, To_String (Item.Name)) ); Gui_Worksheet.Remove_Sheet ( Item.Editor ); end if; -- R.1, R.2 Project_File.Update ( Query_Prefix, To_String (Item.Name), Value); end Save; ---------- -- Load -- ---------- procedure Load ( Item : in out Object; Value : out Text_Buffer; Last : out Natural ) is Description : constant Text_Buffer := ( To_Unbounded_String ( "Fill in your description" ), To_Unbounded_String ( "Author: " & Preference (Prf_Author)) ); Query : constant Text_Buffer := ( To_Unbounded_String ( "SELECT * FROM "), To_Unbounded_String ( "WHERE ..... ") ); begin Project_File.Get ( Query_Prefix, Key (Item), Value, Last ); exception when Section_Not_Found => Last := Value'First; Value (Last) := Item.Name; Last := Last + 1; Put_Text_Block ( Value, Description, Last ); Put_Text_Block ( Value, Query, Last ); end Load; -------------- -- Selected -- -------------- procedure Selected ( This : in out Object ) is -- -- R.1 - If only the class is selected the toolbar is -- activated for the query class. -- -- R.2 - If an instance is selected, the instance is -- loaded into the editor. -- begin if This.Constructor /= null then -- R.1 GUI_Tools.Activate ( Query_Prefix ); else -- R.2 Open_Editor ( This ); end if; end Selected; ----------------- -- Open_Editor -- ----------------- procedure Open_Editor ( This : in out Object ) is -- load the referenced instance into the query editor Name : Unbounded_String := Key ( This ); begin if not GUI_Worksheet.Is_Open ( Name ) then Initialize ( This.Editor ); GUI_Worksheet.Add_Sheet ( This.Editor, Self (This), Name ); else GUI_Worksheet.Bring_In_Front ( Name ); end if; end Open_Editor; ------------------ -- Close_Editor -- ------------------ procedure Close_Editor ( This : in out Object ) is Name : Unbounded_String := Key ( This ); begin GUI_Worksheet.Remove_Sheet ( Name ); end Close_Editor; ------------- -- Execute -- ------------- procedure Execute ( This : in out Object ) is -- execute the current editor contents Name : Unbounded_String := Key ( This ); Text : Text_Buffer ( 1 .. Max_Section_Length ); Last : Positive; begin if Datasource_Handler.Current_Database = Not_Attached then Error ("No data base connected"); return; end if; Log ("Executing " & To_String (Name) ); GUI_Editor.Query (This.Editor, Text, Last); Datasource_Handler.Execute ( To_String ( Text (1 .. Last ) ) ); end Execute; end Query_Handler; gnade-1.6.2.orig/contrib/gsql/test.xpm0000644000175000017500000000376707336551126017535 0ustar lbrentalbrenta/* XPM */ static char *openfile[] = { /* width height num_colors chars_per_pixel */ " 20 19 66 2", /* colors */ ".. c None", ".# c #000000", ".a c #dfdfdf", ".b c #7f7f7f", ".c c #006f6f", ".d c #00efef", ".e c #009f9f", ".f c #004040", ".g c #00bfbf", ".h c #ff0000", ".i c #ffffff", ".j c #7f0000", ".k c #007070", ".l c #00ffff", ".m c #00a0a0", ".n c #004f4f", ".o c #00cfcf", ".p c #8f8f8f", ".q c #6f6f6f", ".r c #a0a0a0", ".s c #7f7f00", ".t c #007f7f", ".u c #5f5f5f", ".v c #707070", ".w c #00f0f0", ".x c #009090", ".y c #ffff00", ".z c #0000ff", ".A c #00afaf", ".B c #00d0d0", ".C c #00dfdf", ".D c #005f5f", ".E c #00b0b0", ".F c #001010", ".G c #00c0c0", ".H c #000f0f", ".I c #00007f", ".J c #005050", ".K c #002f2f", ".L c #dfcfcf", ".M c #dfd0d0", ".N c #006060", ".O c #00e0e0", ".P c #00ff00", ".Q c #002020", ".R c #dfc0c0", ".S c #008080", ".T c #001f1f", ".U c #003f3f", ".V c #007f00", ".W c #00000f", ".X c #000010", ".Y c #00001f", ".Z c #000020", ".0 c #00002f", ".1 c #000030", ".2 c #00003f", ".3 c #000040", ".4 c #00004f", ".5 c #000050", ".6 c #00005f", ".7 c #000060", ".8 c #00006f", ".9 c #000070", "#. c #7f7f80", "## c #9f9f9f", /* pixels */ "........................................", "........................................", "........................................", ".......................#.#.#............", ".....................#.......#...#......", "...............................#.#......", ".......#.#.#.................#.#.#......", ".....#.y.i.y.#.#.#.#.#.#.#..............", ".....#.i.y.i.y.i.y.i.y.i.#..............", ".....#.y.i.y.i.y.i.y.i.y.#..............", ".....#.i.y.i.y.#.#.#.#.#.#.#.#.#.#.#....", ".....#.y.i.y.#.s.s.s.s.s.s.s.s.s.#......", ".....#.i.y.#.s.s.s.s.s.s.s.s.s.#........", ".....#.y.#.s.s.s.s.s.s.s.s.s.#..........", ".....#.#.s.s.s.s.s.s.s.s.s.#............", ".....#.#.#.#.#.#.#.#.#.#.#..............", "........................................", "........................................", "........................................" }; gnade-1.6.2.orig/contrib/lista4/0000755000175000017500000000000011040716254016235 5ustar lbrentalbrentagnade-1.6.2.orig/contrib/lista4/Makefile0000644000175000017500000000642207416647572017723 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/contrib/lista4/Makefile,v $ ## Description : Makefile for the direct PostgreSQL binding ## Author : Juergen Pfeifer ## Created On : 03-Jan-2001 ## Last Modified By: $Author: merdmann $ ## Last Modified On: $Date: 2002/01/08 19:58:50 $ ## Status : $State: Exp $ ## ## Copyright (C) 2000-2001 ## ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## This makefile build a nice example contributed by Julio Cano. ## ## ## Restrictions ## ============ ## ## References ## ========== ## ## include ../../make.conf ## all:: lista4 lista4 : pgrecordset.ads pgrecordset.adb \ data_bind.adb data_bind.ads \ lista4.adb gnatmake -g $(ADAFLAGS) lista4 -cargs $(CFLAGS) \ $(APP_BIND_FLAGS) $(APP_LINK_FLAGS) -largs -lodbc clean:: rm -f *.o *.ali demo b~lista4.ad[bs] core *~ rm -f lista4 gnade-1.6.2.orig/contrib/lista4/README0000644000175000017500000000614407417655604017140 0ustar lbrentalbrenta GNADE Recordset =============== Introduction ============ This package is a GNADE ODBC access simplification. It's mainly intended for simple applications or simple database access. The code needed to access the database is reduced at the cost of some flexibility, and maybe performance. Package description =================== These are the descriptions of the functions provided by the package. An example of how these functions are used is included in the file named lista4.adb pgrecordset_ptr Is the object to contain all the information about the DB connection and last query. function Recordset_New(Conninfo : String; Username : String := ""; Passwd : String := "") return Pgrecordset_ptr; This function creates a new recordset object. Parameters are the ODBC connection name, the user name and associated password. procedure recordset_Close(recordset : in out Pgrecordset_Ptr); This function closes the DB connection and deletes the recordset object. function Error (Recordset : Pgrecordset_Ptr) return Boolean; Returns if the last action taken in the connection resulted 0. function Error_Msg (Recordset : Pgrecordset_ptr) return String; procedure Error_Msg (Recordset : Pgrecordset_Ptr; Msg : out String); Both return a string containing the string associated to the error produced by the last operation. procedure Query (Recordset : in out Pgrecordset_Ptr; Query : String); Sends a SQL query trough this DB connection. The recordset object stores the query results. procedure MoveFirst (Recordset : Pgrecordset_Ptr); procedure MoveNext (Recordset : Pgrecordset_Ptr); These procedures let you move trough the query result. If at the end of the table, a NO_DATA exception is raised. procedure Exec (Recordset : in out Pgrecordset_Ptr; Cmd : String); This procedure sends a SQL command to the database, but gets no results. It's intended to be used with INSERT, DELETE, MODIFY, etc. function Getcolnums (Rs: Pgrecordset_Ptr) return Integer; Returns the number of columns in the last query. function Getcolname (Rs: Pgrecordset_Ptr; Num: integer) return String; Returns the name of the column or field in the last query given by its position. The first field is number 1. function GetData (Rs: Pgrecordset_Ptr; Column : String) return String; Returns the data contained in the actual record given the name of the column or field. BINDINGS -------- This package lets you to bind variables to the resulting field in a query. Actually only *string* variables are supported. Every data field will be converted to string. A binding can be make before, after the query is made or at any other time. procedure Registerdata (Recordset: Pgrecordset_Ptr; Str: String_Access; Field : String); This procedure creates a binding, associating str to the query field given its name. The str needs to be an access variable to be modified every time the the actual record in the query is changed. Note: The query result is not a dynamic table, so modifying binded variables will NOT change data in the database. It must be made through an SQL command using Exec. This package is provided by Julio Cano. julius_bip@yahoo.com gnade-1.6.2.orig/contrib/lista4/data_bind.adb0000644000175000017500000001601707416647572020641 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/lista4/data_bind.adb,v $ -- Description : binding package -- Author : Julio Cano -- -- Created : 8.8.2001 -- -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2002/01/08 19:58:50 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Julio Cano -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Julio Cano -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Text_Io; with Ada.Strings.Fixed; with Unchecked_Deallocation; with Gnu.Db.Sqlcli; use Gnu.Db.Sqlcli; package body Data_Bind is procedure DataFix (Elem : access Data_List) is begin Text_Io.Put_Line ("no DISPATCHINGGGG"); end; procedure DataFix (Elem : access String_Data) is begin SQLFixNTS (Elem.Binded.all, Elem.Data_Length); -- Elem.Data := new String'(Elem.Binded.all); Ada.Strings.Fixed.Move (Elem.Binded.all, Elem.Data.all); -- Text_Io.Put_Line ("**"&String(Elem.Binded.all)); -- Text_Io.Put_Line ("***"&Elem.Data.all); end DataFix; procedure DataListFix ( List : Base_Data) is Tmp : Base_Data; begin Tmp := List; while Tmp /= null loop DataFix (Tmp); Tmp := Tmp.Next; end loop; end DataListFix; function Name2col ( Stmt : Sqlhstmt; Column : Unbounded_String ) return Sql_Column_Number is Name : Unbounded_String; Ucolumn : Unbounded_String := Column; Datatype : aliased Sql_Data_Type; Col_Size : aliased Sqluinteger; Decimaldigits : aliased Sqlsmallint; Nullable : aliased Sql_Nullable_Info; Errorcode : aliased Sqlreturn; begin Trim (Ucolumn, Ada.Strings.Both); for I in 1..Sqlnumresultcols(Stmt) loop Name := To_Unbounded_String( Sqldescribecol (Stmt, Sql_Column_Number(I), Sqlsmallint(256), Datatype'access, Col_Size'access, Decimaldigits'access, Nullable'access, Errorcode'access)); Trim (Name, Ada.Strings.Both); if Ucolumn = Name then return I; end if; end loop; return 0; end; procedure Binddata ( Data : access Data_List; Stmt : Sqlhstmt ) is begin Text_Io.Put_Line ("NO DISPATCHING!!!!!!!!!"); null; end; procedure Binddata ( Data : access String_Data; Stmt : Sqlhstmt ) is begin Data.Binded := new Sql_Str; Sb.Sqlbindcol (Stmt, Name2col(Stmt, Data.Field), Sql_C_Char, Data.Binded , Data.Binded.all'Length, Data.Data_Length'access); -- Sb.Sqlbindcol (Recordset.Resultado, Name2col(Recordset.Resultado, -- List.Field), -- Sql_C_Char, List.Data'access, List.Data'Length, List.Data_Length'access); exception when INVALID_HANDLE => null; -- Data not binded, not statemente ready yet end; procedure Binddatalist ( List : Base_Data; Stmt : Sqlhstmt ) is Tmp : Base_Data := List; begin while tmp /= null loop Binddata (tmp, Stmt); tmp := Tmp.Next; end loop; end; procedure Registerdata ( List : in out Base_Data; Data : String_Access; Column : String ) is Elem : String_Data_Ptr; Tmp : Base_Data; begin Elem := new String_Data'( Field => To_Unbounded_String (Column), Next => null, Data => Data, Data_Length => 0, Binded => null); Tmp := List; if List = null then List := Base_Data(Elem); else while Tmp.Next /= null loop Tmp := Tmp.Next; end loop; Tmp.Next := Base_Data(Elem); end if; end Registerdata; procedure UnRegisterdata ( List : in out Base_Data; Column : String ) is type Data_list_ptr is access all Data_List; procedure Free is new unchecked_deallocation(Data_List, Data_list_ptr); -- Freed needs no class wide access Elem : Data_List_Ptr; Tmp : Base_Data; begin Tmp := List; if List /= null then if Tmp.Field = Column then List := List.Next; Elem := Data_List_Ptr(Tmp); Free (Elem); else while Tmp.Next /= null loop if Tmp.Next.Field = Column then Elem := Data_List_Ptr(Tmp.Next); Tmp.Next := Tmp.Next.Next; Free (Elem); end if; end loop; end if; end if; end UnRegisterdata; procedure UnregisterAll (List : in out Base_Data) is type Data_list_ptr is access all Data_List; procedure Free is new unchecked_deallocation(Data_List, Data_list_ptr); Elem : Data_List_Ptr; Tmp : Base_Data; begin Tmp := List; while Tmp /= Null loop Elem := Data_List_Ptr(Tmp); Tmp := Tmp.Next; Free (Elem); end loop; List := NULL; end; end Data_Bind; gnade-1.6.2.orig/contrib/lista4/data_bind.ads0000644000175000017500000001051207416647572020654 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/lista4/data_bind.ads,v $ -- Description : binding package -- Author : Julio Cano -- -- Created : 8.8.2001 -- -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2002/01/08 19:58:50 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Julio Cano -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Julio Cano -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Gnu.Db.Sqlcli; use Gnu.Db.Sqlcli; with Gnu.Db.Sqlcli.Bind; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; package Data_Bind is type Data_List is tagged private; type Base_Data is private; procedure DataFix (Elem : access Data_List); procedure Binddata (Data : access Data_List; Stmt : Sqlhstmt); type String_Data is private; type String_Data_Ptr is private; procedure DataFix (Elem : access String_Data); procedure Binddata (Data : access String_Data; Stmt : Sqlhstmt); -- This limits string data lenght to 256!!!!! subtype sql_str is String(1..256); type sql_str_access is access all sql_str; function Name2col (Stmt : Sqlhstmt; Column : Unbounded_String ) return Sql_Column_Number; -- procedure DataListFix ( List : access Data_List'Class); procedure DataListFix ( List : Base_Data); procedure RegisterData (List : in out Base_Data; Data : String_access; Column : String); procedure UnRegisterData (List : in out Base_Data; Column : String); procedure UnRegisterAll (List : in out Base_Data); procedure Binddatalist (List : Base_Data; Stmt : Sqlhstmt); private type Base_Data is access all Data_List'Class; type Data_List is tagged record Field : Unbounded_String; Next : Base_Data; end record; package String_Binding is new Gnu.Db.Sqlcli.Bind (Sql_Str, Sql_Str_Access); package Sb renames String_Binding; type String_Data is new Data_List with record Data : String_access; Data_Length : aliased Sqlinteger; Binded : Sql_Str_Access; end record; type String_Data_Ptr is access all String_Data; end Data_Bind; gnade-1.6.2.orig/contrib/lista4/lista4.adb0000644000175000017500000000722307423333036020114 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/lista4/lista4.adb,v $ -- Description : binding package -- Author : Julio Cano -- -- Created : 8.8.2001 -- -- Last Modified By: $Author: jukano $ -- Last Modified On: $Date: 2002/01/22 18:57:34 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Julio Cano -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Julio Cano -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Pgrecordset; with text_io; procedure Lista4 is package Db renames Pgrecordset; Conx : Db.Pgrecordset_Ptr; name : aliased String(1..20); salary : aliased String (1..13); date : aliased String(1..35); begin Conx := Db.Recordset_New("DEMO_DB","gnade"); db.registerdata (Conx, name'Unrestricted_access, "name"); db.query (conx, "select * from employees"); db.registerdata (Conx, salary'Unrestricted_access, "salary"); db.registerdata (Conx, date'Unrestricted_access, "since"); db.movefirst(conx); Text_Io.Put_Line("NAME SALARY SINCE"); declare fin : boolean := false; begin loop text_io.put (Name); text_io.put (Salary); text_io.put_line (Date); db.movenext(conx); exit when Fin; end loop; exception when db.no_data => fin := true; when others => text_io.put_line ("Unhandled exception."); end; begin Db.Recordset_Close (Conx); exception when others => Text_Io.Put_Line ("!!!!!!!"); end; end Lista4; gnade-1.6.2.orig/contrib/lista4/pgrecordset.adb0000644000175000017500000004355207416647572021261 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/lista4/pgrecordset.adb,v $ -- Description : binding package -- Author : Julio Cano -- -- Created : 8.8.2001 -- -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2002/01/08 19:58:50 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Julio Cano -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Julio Cano -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- --with Text_Io; with Ada.Strings.Fixed; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Exceptions; with Gnu.Db.Sqlcli; use Gnu.Db.Sqlcli; with Gnu.Db.Sqlcli.Diag; use Gnu.Db.Sqlcli.Diag; with Gnu.Db.Sqlcli.Environment_Attribute; use Gnu.Db.Sqlcli.Environment_Attribute; with Gnu.Db.Sqlcli.Statement_Attribute; use Gnu.Db.Sqlcli.Statement_Attribute; with Unchecked_Deallocation; package body Pgrecordset is -- this is for i commented package as generic conninfo : string := ""; username : string := ""; passwd : string := ""; type Fields_List is array (Natural range <>) of String_Access; type Fields_List_Ptr is access all Fields_List; procedure Free is new Unchecked_Deallocation (Fields_List, Fields_List_Ptr); Std_Conx : Pgrecordset_Ptr; type Pgrecordset is record Entorno : Sqlhenv; Conexion : Sqlhdbc; Resultado : Sqlhstmt; Error : Boolean := False; Error_Msg : String_Access; Actual : Integer; Ncampos : Integer; Campos : Fields_List_Ptr; Nregistros : Integer; Lista_String : Base_Data; Editando : Boolean; end record; procedure Free is new Unchecked_Deallocation(Pgrecordset, Pgrecordset_Ptr); function Get_Bind_List ( Recordset : Pgrecordset_Ptr ) return Base_Data is begin return Recordset.Lista_String; end Get_Bind_List; procedure Set_Bind_List ( Recordset : in out Pgrecordset_Ptr; List : Base_Data ) is begin Recordset.Lista_String := List; end Set_Bind_List; procedure Registerdata ( Recordset : Pgrecordset_Ptr; Str : String_Access; Field : String ) is List : Base_Data; begin List := Recordset.Lista_String; Registerdata (List, Str, Field); Binddatalist(List, Recordset.Resultado); -- Binddatalist(Recordset.Lista_String, Recordset.Resultado); Recordset.Lista_String := List; end Registerdata; function Recordset_New( Conninfo : String; Username : String := ""; Passwd : String := "") return Pgrecordset_Ptr is Pgr : Pgrecordset_Ptr; begin Pgr := new Pgrecordset; Pgr.Entorno := Sql_Null_Handle; Pgr.Conexion := Sql_Null_Handle; Pgr.Resultado := Sql_Null_Handle; Sqlallochandle (Sql_Handle_Env, Sql_Null_Handle, Pgr.Entorno); Sqlsetenvattr (Pgr.Entorno, Environment_Attribute_Odbc_Version' (Attribute => Sql_Attr_Odbc_Version, Value => Sql_Ov_Odbc3)); Sqlallochandle (Sql_Handle_Dbc, Pgr.Entorno, Pgr.Conexion); Sqlconnect (Pgr.Conexion, Conninfo, username, passwd); return Pgr; exception when others => Check_Errors (Pgr); return Pgr; end Recordset_New; procedure Recordset_Close ( Recordset : in out Pgrecordset_Ptr ) is begin Sqldisconnect (Recordset.Conexion); -- Sqlfreehandle (Sql_Handle_Stmt, Recordset.Resultado); Sqlfreehandle (Sql_Handle_Dbc, Recordset.Conexion); Sqlfreehandle (Sql_Handle_Env, Recordset.Entorno); -- for I in 1..Recordset.Ncampos loop -- if Recordset.Campos(I) /= null then -- Free (Recordset.Campos(I)); -- end if; -- end loop; Free (Recordset.Campos); Unregisterall (Recordset.Lista_String); -- Recordset := null; Free (Recordset); end Recordset_Close; function Recordset_New return Pgrecordset_Ptr is begin if Std_Conx /= null then -- if Std_Conx.Entorno = Sql_Null_Handle -- or Std_Conx.Conexion = Sql_Null_Handle then -- -- Reset -- Recordset_Close; -- Std_Conx := Recordset_New; -- end if; return Std_Conx; else Recordset_Close; Std_Conx := new Pgrecordset; Std_Conx.Entorno := Sql_Null_Handle; Std_Conx.Conexion := Sql_Null_Handle; Std_Conx.Resultado := Sql_Null_Handle; Sqlallochandle (Sql_Handle_Env, Sql_Null_Handle, Std_Conx. Entorno); Sqlsetenvattr (Std_Conx.Entorno, Environment_Attribute_Odbc_Version' (Attribute => Sql_Attr_Odbc_Version, Value => Sql_Ov_Odbc3)); Sqlallochandle (Sql_Handle_Dbc, Std_Conx.Entorno, Std_Conx. Conexion); Sqlconnect (Std_Conx.Conexion, Conninfo, username, passwd); return Std_Conx; end if; exception when others => Check_Errors (Std_Conx); return Std_Conx; end Recordset_New; procedure Recordset_Close is begin if Std_Conx /= null then if Std_Conx.Resultado /= Sql_Null_Handle then Sqlcommit (Std_Conx.Conexion); Sqlfreehandle (Sql_Handle_Stmt, Std_Conx.Resultado); end if; for I in 1..Std_Conx.Ncampos loop Free (Std_Conx.Campos(I)); end loop; Free (Std_Conx.Campos); Unregisterall (Std_Conx.Lista_String); end if; --free (std_conx); end Recordset_Close; function Actual ( Recordset : Pgrecordset_Ptr ) return Integer is begin return Recordset.Actual; end Actual; function Nrecords ( Recordset : Pgrecordset_Ptr ) return Integer is begin return Recordset.Nregistros; end Nrecords; function First_Record ( Recordset : Pgrecordset_Ptr ) return Integer is begin return 0; end First_Record; function Last_Record ( Recordset : Pgrecordset_Ptr ) return Integer is begin return Recordset.Nregistros -1; end Last_Record; function First_Field ( Recordset : Pgrecordset_Ptr ) return Integer is begin return 0; end First_Field; function Last_Field ( Recordset : Pgrecordset_Ptr ) return Integer is begin return Recordset.Ncampos -1; end Last_Field; procedure Movefirst ( Recordset : Pgrecordset_Ptr ) is begin -- SQLFetchScroll (Recordset.resultado, SQL_FETCH_FIRST); -- declare begin Sqlfetchscroll (Recordset.Resultado, Sql_Fetch_Absolute, 1); exception when others => null; -- not supported?? end; Datalistfix (Recordset.Lista_String); exception when Gnu.Db.Sqlcli.No_Data => raise No_Data; end; procedure Movenext ( Recordset : Pgrecordset_Ptr ) is begin begin Sqlfetchscroll (Recordset.Resultado, Sql_Fetch_Next); exception when Gnu.Db.Sqlcli.No_Data => raise No_Data; when others => null; -- not supported?? end; -- String Data needs to be "readjusted" Datalistfix (Recordset.Lista_String); exception when Gnu.Db.Sqlcli.No_Data => raise No_Data; end; function Error ( Recordset : Pgrecordset_Ptr ) return Boolean is -- Default is true if recordset is null! begin if Recordset /= null then return Recordset.Error; else return True; --Check_Errors(Recordset); end if; end Error; function Error_Msg ( Recordset : Pgrecordset_Ptr ) return String is begin if Recordset /= null then return Recordset.Error_Msg.all; else return "Recordset is null"; end if; end; procedure Error_Msg ( Recordset : Pgrecordset_Ptr; Msg : out String ) is begin -- Msg := To_String(Recordset.Error_Msg); --Msg := Recordset.Error_Msg.all; if Recordset /= null then Ada.Strings.Fixed.Move (Recordset.Error_Msg.all, Msg); else Ada.Strings.Fixed.Move ("Recordset is null", Msg); end if; end Error_Msg; function Getcolnums ( Rs : Pgrecordset_Ptr ) return Integer is begin return Integer(Sqlnumresultcols(Rs.Resultado)); end Getcolnums; function Getcolname ( Rs : Pgrecordset_Ptr; Num : Integer ) return String is begin return Rs.Campos(Num).all; end Getcolname; -- Private getcolname function P_Getcolname ( Rs : Pgrecordset_Ptr; Num : Integer ) return String is Datatype : aliased Sql_Data_Type; Col_Size : aliased Sqluinteger; Decimaldigits : aliased Sqlsmallint; Nullable : aliased Sql_Nullable_Info; Errorcode : aliased Sqlreturn; begin return Sqldescribecol (Rs.Resultado, Sql_Column_Number(Num), Sqlsmallint(256), Datatype'access, Col_Size'access, Decimaldigits'access, Nullable'access, Errorcode'access); end P_Getcolname; -- function Name2col ( -- Stmt : Sqlhstmt; -- Column : Unbounded_String ) -- return Sql_Column_Number is -- Name : Unbounded_String; -- Ucolumn : Unbounded_String := Column; -- Datatype : -- aliased Sql_Data_Type; -- Col_Size : -- aliased Sqluinteger; -- Decimaldigits : -- aliased Sqlsmallint; -- Nullable : -- aliased Sql_Nullable_Info; -- Errorcode : -- aliased Sqlreturn; -- begin -- Trim (Ucolumn, Ada.Strings.Both); -- for I in 1..Sqlnumresultcols(Stmt) loop -- Name := To_Unbounded_String( -- Sqldescribecol (Stmt, Sql_Column_Number(I), -- Sqlsmallint(256), -- Datatype'access, -- Col_Size'access, -- Decimaldigits'access, -- Nullable'access, -- Errorcode'access)); -- Trim (Name, Ada.Strings.Both); -- if Ucolumn = Name then -- return I; -- end if; -- end loop; -- return 0; -- end; procedure Query ( Recordset : in out Pgrecordset_Ptr; Query : String ) is -- List : Data_List_Ptr; begin Sqlallochandle (Sql_Handle_Stmt, Recordset.Conexion, Recordset. Resultado); -- declare -- begin -- Sqlsetstmtattr (Recordset.Resultado, Statement_Attribute_Cscr' -- (Attribute => Sql_Attr_Cursor_Scrollable, -- Value => Sql_Scrollable)); -- exception -- -- when others => Text_Io.Put_Line ("No soportado por el driver ODBC"); -- when others => -- null; -- Not supported by ODBC driver -- end; Sqlprepare (Recordset.Resultado, Query); Binddatalist (Recordset.Lista_String, Recordset.Resultado); Sqlexecute (Recordset.Resultado); -- SqlExecDirect (Recordset.Resultado, Query); Recordset.Ncampos := Integer(Sqlnumresultcols(Recordset.Resultado)); Recordset.Campos := new Fields_List(1..Recordset.Ncampos); for I in 1..Recordset.Ncampos loop Recordset.Campos(I) := new String'(P_Getcolname(Recordset,I)); end loop; Sqlfetch (Recordset.Resultado); --MoveFirst (Recordset); -- Not actally valid due to ODBC --Recordset.Nregistros := Integer(Sqlrowcount(Recordset.Resultado)); exception when Gnu.Db.Sqlcli.No_Data => raise No_Data; when Not_Implemented => Ada.Exceptions.Raise_Exception (Database_Error'Identity, "El driver no implementa la funcion"); -- when others => text_io.put_line ("Exception no procesada"); when others => check_errors(recordset); end Query; procedure Exec ( Recordset : in out Pgrecordset_Ptr; Cmd : String ) is begin Sqlallochandle (Sql_Handle_Stmt, Recordset.Conexion, Recordset. Resultado); Sqlprepare (Recordset.Resultado, Cmd); Sqlexecute (Recordset.Resultado); Recordset.Ncampos := Integer(Sqlnumresultcols (Recordset.Resultado)); -- Not actally valid due to ODBC --Recordset.Nregistros := Integer(Sqlrowcount(Recordset.Resultado)); exception when Gnu.Db.Sqlcli.No_Data => raise No_Data; when Not_Implemented => Ada.Exceptions.Raise_Exception (Database_Error'Identity, "El driver no implementa la funcion"); when others => check_errors(recordset); end Exec; procedure Set_Table ( Recordset : Pgrecordset_Ptr; Table : String ) is begin null; end Set_Table; procedure Connect_Table is begin null; end Connect_Table; function Getdata ( Rs : Pgrecordset_Ptr; Column : String ) return String is -- Limited to 256!!!!!!!! Text : String (1 .. 256); Len : aliased Sqlinteger; begin for I in 1 .. Rs.Ncampos loop Sqlgetdata (Rs.Resultado, Name2col (Rs.Resultado, To_Unbounded_String(Column)), Sql_C_Char, To_Sqlpointer(Text), Text'Length, Len'access); end loop; Sqlfixnts(Text, Len); return Text; end Getdata; procedure Check_Errors ( Conx : in out Pgrecordset_Ptr ) is State : aliased Sqlstate; Native_Error : aliased Sqlinteger; Msg : String_Access; begin if Conx = null then Msg := new String'("No Pgrecordset created"); Conx := new Pgrecordset; else if Conx.Resultado /= Sql_Null_Handle then Msg := new String'(Sqlgetdiagrec (Handletype => Sql_Handle_Stmt, Handle => Conx.Resultado, State => State'access, Nativeerror => Native_Error'access)); elsif Conx.Conexion /= Sql_Null_Handle then Msg := new String'(Sqlgetdiagrec (Handletype => Sql_Handle_Dbc, Handle => Conx.Conexion, State => State'access, Nativeerror => Native_Error'access)); elsif Conx.Entorno /= Sql_Null_Handle then Msg := new String'(Sqlgetdiagrec (Handletype => Sql_Handle_Env, Handle => Conx.Entorno, State => State'access, Nativeerror => Native_Error'access)); else Msg := new String'("No environment nor connection created"); end if; end if; -- Text_Io.Put_Line ("state: "&State); -- Text_Io.Put_Line ("error: "&Sqlinteger'Image(Native_Error)); if Msg.all /= "" then Conx.Error := True; Conx.Error_Msg := Msg; Ada.Exceptions.Raise_Exception(Database_Error'Identity, Msg.all); else Conx.Error := False; Conx.Error_Msg := Msg; end if; end Check_Errors; end Pgrecordset; gnade-1.6.2.orig/contrib/lista4/pgrecordset.ads0000644000175000017500000001072007420330321021241 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/lista4/pgrecordset.ads,v $ -- Description : binding package -- Author : Julio Cano -- -- Created : 8.8.2001 -- -- Last Modified By: $Author: jukano $ -- Last Modified On: $Date: 2002/01/13 16:07:45 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Julio Cano -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Julio Cano -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Data_Bind; use Data_Bind; package PGRecordset is type Pgrecordset_ptr is private; NO_DATA : exception; DATABASE_ERROR : exception; procedure Registerdata (Recordset: Pgrecordset_Ptr; Str: String_Access; Field : String); procedure MoveFirst (Recordset : Pgrecordset_Ptr); procedure MoveNext (Recordset : Pgrecordset_Ptr); function Recordset_New(Conninfo : String; Username : String := ""; Passwd : String := "") return Pgrecordset_ptr; procedure Recordset_Close(recordset : in out Pgrecordset_Ptr); function Error (Recordset : Pgrecordset_Ptr) return Boolean; -- Returns true if there was an error. function Error_Msg (Recordset : Pgrecordset_ptr) return String; -- Returns a string explaining the error. procedure Error_Msg (Recordset : Pgrecordset_Ptr; Msg : out String); -- Sets Msg with the error string; procedure Query (Recordset : in out Pgrecordset_Ptr; Query : String); -- Sends the query to the database and returns the resulting table -- to the recordset procedure Exec (Recordset : in out Pgrecordset_Ptr; Cmd : String); -- Sends the command to the database but returns no result. function GetColNums (Rs: Pgrecordset_Ptr) return Integer; -- Returns number of columns in query table. function GetColName (Rs: Pgrecordset_Ptr; Num: integer) return String; -- Returns the column name. function GetData (Rs: Pgrecordset_Ptr; Column : String) return String; -- Returns data in the named column in actual register. private type Pgrecordset; type Pgrecordset_Ptr is access all pgRecordset; end PGRecordset; gnade-1.6.2.orig/contrib/objects/0000755000175000017500000000000011040716254016466 5ustar lbrentalbrentagnade-1.6.2.orig/contrib/objects/Makefile0000644000175000017500000001166610554624342020145 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/contrib/objects/Makefile,v $ ## Description : Makefile for the odb package -- ## Author : Michael Erdmann -- ## Created On : 1-May-2002 -- ## Last Modified By: $Author: merdmann $ -- ## Last Modified On: $Date: 2007/01/21 08:48:34 $ -- ## Version : $Revision: 1.15 $ -- ## Status : $State: Exp $ -- ## -- ## Copyright (C) 2006 Michael Erdmann -- ## -- ## ODB is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## ODB distribution. -- ## -- ## ODB is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. ABE is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## ODB Ada units, or you link ABE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## Contact -- ## ======= -- ## Error reports shall be handled via http://gnade.sourceforge.net -- ## -- ## Author contact: -- ## purl:/net/michael.erdmann -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## ## THis is the top level makefile for the ODB package. It makes explicit usage ## of the GNAT project file facility. ## include make.conf prepunits=$(subst .gpq,.adb,$(wildcard *.gpq)) others=apps # add the connection information dep. on the configured data base DBAUTH= -DDBUSER=\"gnade\" \ -DDBPASSWD=\"gnade\" \ -DDBSOURCE=\"gnade\" # generate debug code # DEBUG=-debugcode ESQLFLAGS = -schema $*.sql $(DEBUG) -s $(FLAGS) $(DBAUTH) ## all global targets all :: $(prepunits) libobjects.a $(MAKE) dbinstall all distclean clean :: $(MAKE) -C./apps $@ dist:: all install:: ## the demo driver libobjects.a: $(prepunits) objects.ads \ persistent.adb persistent.ads person.adb person.ads \ account.ads account.adb group.ads group.adb \ account_transaction.ads account_transaction.adb \ string_table.ads string_table.adb \ root.ads root.adb \ md5.ads md5.adb \ key_type.ads key_type.adb gnatmake -x -P./libobjects.gpr ## database ifrastructure dbinstall: objects.sql $(MAKE) dbclean bsql -u gnade -p gnade gnade < objects.sql touch dbinstall dbclean: -bsql -u gnade -p gnade -q"DROP TABLE OBJECTS" gnade -bsql -u gnade -p gnade -q"DROP TABLE ROOTNAME" gnade -bsql -u gnade -p gnade -q"DROP TABLE RELATIONS" gnade $(RM) dbinstall dbreset: $(RM) dbinstall $(MAKE) dbinstall ## clean out local compilation results clean :: $(RM) *~* ## Cleanup completly distclean :: clean dbclean gnatclean -P./libobjects.gpr -$(RM) -f $(prepunits) *.ali *.o *.sql $(LIBDIR)/* $(INCDIR)/* gnade-1.6.2.orig/contrib/objects/README0000644000175000017500000000077610545557501017367 0ustar lbrentalbrentaIntroduction ============ 1. Datamodel The datamodel looks like this: 1..* Group --[Has_Account]--> Account ^ | [Is_Group_Member_XXX] | | 1..* Person --[Has_Account ]--> Accounts / \ [Has_Father][Has_Mother] / \ V V Person Person --[Has_Account ]--> Accounts where the XXX in the group member relation ship the name of the group represents. gnade-1.6.2.orig/contrib/objects/README.html0000644000175000017500000000272110546206627020323 0ustar lbrentalbrenta Objects README

Introduction

This directory contains a small technology domonstration for the following technical issues:
  1. Representing data objects using Ada 95
  2. Usage of an SQL based RDBMS to achieve persistency for Ada 95 instances.
  3. Relations between objects.

The data model used for the demonstration is quite simple. Each person identified by its name. Assigned to each person there are upto N accounts assgined. Each account includes a balance.  Each person may be included into multiple groups, e.g. family group. A group again may be associated with accounts.

Representing data objects using Ada 95

Each object of the data model is represented by data type which is derived from the type Persistent.Object which implements the basic functionality to serialize/deserialize the data instance into a blob which is stored in a database record. In order to retrieve such an instance a so called object id is used as a retieval key.  The key is defined when the objects is instanciated, e.g. in the example below

procedure Demo is
...
   Father  : Person.Object(1);

begin
----

end Demo;



  gnade-1.6.2.orig/contrib/objects/account.adb0000644000175000017500000001035410561121550020571 0ustar lbrentalbrenta-- ------------------------------------------------------------------------- -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/Makefile -- Description : Monetary accounts -- -- Author : Michael Erdmann -- -- Created On : 30-Dec-2006 -- -- Last Modified By: $Author: merdmann $ -- -- Last Modified On: $Date: 2007/02/03 14:59:52 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2006-2007 Michael Erdmann -- -- -- -- GNADE is copyrighted by the persons and institutions enumerated in the -- -- AUTHORS file. This file is located in the root directory of the -- -- GNADE distribution. -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNADE; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- GNADE Ada units, or you link GNADE Ada units or libraries with other -- -- files to produce an executable, these units or libraries do not by -- -- itself cause the resulting executable to be covered by the GNU -- -- General Public License. This exception does not however invalidate -- -- any other reasons why the executable file might be covered by the -- -- GNU Public License. -- -- -- -- ------------------------------------------------------------------------- -- with Ada.Text_IO; use Ada.Text_IO; with TAM.Persistent; use TAM.Persistent; with Objects; use Objects; package body Account is ------------ -- Create -- ------------ procedure Create( Owner : in Persistent.Object'Class; Title : in String; Value : in Integer := 0) is Acc : Account.Object; begin Acc.Title := To_Unbounded_String( Title ); Acc.Ballance := Value; Put_Object( Acc ); Relate( Owner, Acc, "Has_Account" ); end Create; ----------- -- Query -- ----------- procedure Query( This : in out Object; Owner : in Persistent.Object'Class; Title : in Unbounded_String ) is Acct : OID_Array_Type( 1..100 ); Length : Integer := 0; Found : Boolean := False; begin Get_Related( OID(Owner), "Has_Account", Acct, Length ); for i in 1..Length loop declare A : Account.Object; begin Get_Object(A, ID => Acct(i)); Found := A.Title = Title; if Found then This := A; exit; end if; end ; end loop; if not Found then raise Not_Existing; end if; end Query; ------------- -- Display -- ------------- procedure Display( Acct : in Object ) is begin Put_Line( To_String( Acct.Title ) & " : " & Integer'Image( Acct.Ballance ) ); end Display; end Account; gnade-1.6.2.orig/contrib/objects/account.ads0000644000175000017500000000663510547744344020641 0ustar lbrentalbrenta-- ------------------------------------------------------------------------- -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/Makefile -- Description : Monetary accounts -- -- Author : Michael Erdmann -- -- Created On : 30-Dec-2006 -- -- Last Modified By: $Author: merdmann $ -- -- Last Modified On: $Date: 2007/01/06 16:05:56 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2006-2007 Michael Erdmann -- -- -- -- GNADE is copyrighted by the persons and institutions enumerated in the -- -- AUTHORS file. This file is located in the root directory of the -- -- GNADE distribution. -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNADE; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- GNADE Ada units, or you link GNADE Ada units or libraries with other -- -- files to produce an executable, these units or libraries do not by -- -- itself cause the resulting executable to be covered by the GNU -- -- General Public License. This exception does not however invalidate -- -- any other reasons why the executable file might be covered by the -- -- GNU Public License. -- -- -- -- ------------------------------------------------------------------------- -- with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Persistent; use Persistent; package Account is Not_Existing : exception; type Object is new Persistent.Object with record Title : Unbounded_String := Null_Unbounded_String; Ballance : Integer := 0; end record; procedure Create( Owner : in Persistent.Object'Class; Title : in String; Value : in Integer := 0); procedure Display( Acct : in Object ); procedure Query( This : in out Object; Owner : in Persistent.Object'Class; Title : in Unbounded_String ); end Account; gnade-1.6.2.orig/contrib/objects/account_transaction.adb0000644000175000017500000000232310561121550023173 0ustar lbrentalbrentawith Ada.Text_IO; use Ada.Text_IO; with TAM.Persistent; use TAM.Persistent; with Persistent; use Persistent; with Account; use Account; with Objects; use Objects; package body Account_Transaction is Transaction_Number : Natural := 0; --------- -- Add -- --------- procedure Add( Acct : in out Account.Object; Value : in Integer ) is T : Object; begin T.Value := Value; T.ID := Transaction_Number; Put_Object(T); Relate( Acct, T, "Has_Transaction" ); Acct.Ballance := Acct.Ballance + Value; Put_Object( Acct ); end Add; ------------------------- -- Display_Tranactions -- ------------------------- procedure Display_Transactions( Acct : in Account.Object ) is Tids : OID_Array_Type( 1..1000); Length : Integer := 0; begin Get_Related( OID(Acct), "Has_Transaction", Tids, Length ); for i in 1..Length loop declare T : Object; begin OID( T, Tids(i) ); Get_Object( T ); Put_Line( Integer'Image( T.ID ) & " " & Integer'Image(T.Value)); end ; end loop; end Display_Transactions; end Account_Transaction; gnade-1.6.2.orig/contrib/objects/account_transaction.ads0000644000175000017500000000063110546551170023224 0ustar lbrentalbrentawith Persistent; use Persistent; with Account; use Account; package Account_Transaction is type Object is new Persistent.Object with record ID : Integer := 0; Value : Integer := 0; end record; procedure Add( Acct : in out Account.Object; Value : in Integer ); procedure Display_Transactions( Acct : in Account.Object ); end Account_Transaction; gnade-1.6.2.orig/contrib/objects/blob_stream.adb0000644000175000017500000001623410547144476021451 0ustar lbrentalbrenta-- ------------------------------------------------------------------------- -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/Makefile -- Description : Memory Stream -- -- Author : Michael Erdmann -- -- Created On : 30-Dec-2006 -- -- Last Modified By: $Author: merdmann $ -- -- Last Modified On: $Date: 2007/01/04 09:30:38 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2006 Michael Erdmann -- -- -- -- GNADE is copyrighted by the persons and institutions enumerated in the -- -- AUTHORS file. This file is located in the root directory of the -- -- GNADE distribution. -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNADE; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- GNADE Ada units, or you link GNADE Ada units or libraries with other -- -- files to produce an executable, these units or libraries do not by -- -- itself cause the resulting executable to be covered by the GNU -- -- General Public License. This exception does not however invalidate -- -- any other reasons why the executable file might be covered by the -- -- GNU Public License. -- -- -- -- ------------------------------------------------------------------------- -- with Ada.Streams; use Ada.Streams; with Ada.Text_IO; use Ada.Text_IO; use Ada; with Unchecked_Deallocation; package body BLOB_Stream is Version : constant String := "$Id: blob_stream.adb,v 1.4 2007/01/04 09:30:38 merdmann Exp $"; procedure Free is new Unchecked_Deallocation( Stream_Element_Array, Stream_Element_Array_Access); ---------------- -- Initialize -- ---------------- function Initialize( Size : Natural ) return Stream_Element_Array_Access is begin return new Stream_Element_Array(1..Stream_Element_Offset(Size)); end ; ------------ -- Stream -- ------------ function Stream( Size : Natural ) return Stream_Access is Result : Memory_Stream_Access := new Memory_Stream_Type( Size ); begin Result.Read_Next := Result.Data'First; return Stream_Access( Result ); end Stream; ------------- -- Destroy -- ------------- procedure Destroy( Stream : in out Stream_Access ) is procedure Free is new Unchecked_Deallocation( Memory_Stream_Type, Memory_Stream_Access ); begin Free( Memory_Stream_Access( Stream ) ); end Destroy; ---------- -- Read -- ---------- procedure Read( Stream : in out Memory_Stream_Type; Item : out Stream_Element_Array; Last : out Stream_Element_Offset) is begin Last := 0; for I in Item'Range loop exit when Stream.Read_Next > Stream.Write_Next ; Item( I ) := Stream.Data( Stream.Read_Next ); Last := I; Stream.Read_Next := Stream.Read_Next + 1; end loop; end Read; ----------- -- Write -- ----------- procedure Write( Stream : in out Memory_Stream_Type; Item : in Stream_Element_Array) is begin for I in Item'Range loop Stream.Write_Next := Stream.Write_Next + 1; if not ( Stream.Write_Next in Stream.Data'Range ) then declare Tmp : Stream_Element_Array_Access := Stream.Data ; begin Stream.Data := new Stream_Element_Array( 1..Stream.Write_Next + 2000 ); for i in Tmp'Range loop Stream.Data(i) := Tmp(i); end loop; Free( Tmp ); end ; end if; Stream.Data(Stream.Write_Next) := Item(I); end loop; end Write; ------------ -- Length -- ------------ function Length( Stream : in Stream_Access ) return Natural is Mem : Memory_Stream_Access := Memory_Stream_Access( Stream ); begin return Natural( Mem.Write_Next ); end Length; ------------------ -- Get_Contents -- ------------------ procedure Get_Contents( Stream : in Stream_Access; BLOB : out GNADE.BINARY; Length : out Natural ) is Mem : Memory_Stream_Access := Memory_Stream_Access( Stream ); Tmp : Stream_Element_Offset := Mem.Data'First; begin Length := 0; for i in BLOB'Range loop Length := Length + 1; BLOB(i) := SQL.SQLCHAR( Mem.Data( Tmp ) ); Tmp := Tmp + 1; exit when Tmp > Mem.Write_Next; end loop; end Get_Contents; procedure Raw_Data( Stream : in out Stream_Access; Data : out Stream_Element_Array_Access; Length : out Stream_Element_Offset ) is Mem : Memory_Stream_Access := Memory_Stream_Access( Stream ); begin Data := Mem.Data; Length := Mem.Write_Next; end Raw_data; ---------- -- Hash -- ---------- function Hash( Stream : in Stream_Access ) return Fingerprint is Mem : Memory_Stream_Access := Memory_Stream_Access( Stream ); Result : MD5.Fingerprint; begin Result := MD5.Hash( Mem.Data(1..Mem.Write_Next) ); return Result; end Hash; ------------------ -- Set_Contents -- ------------------ procedure Set_Contents( Stream : in Stream_Access; BLOB : GNADE.BINARY ) is -- get the given object into the memory Mem : Memory_Stream_Access := Memory_Stream_Access( Stream ); Tmp : Stream_Element_Offset; begin if Mem.Data /= null then Free( Mem.Data ); end if; Mem.Data := Initialize( BLOB'Length ); Tmp := Mem.Data'First; for i in BLOB'Range loop Mem.Data( Tmp ) := Stream_Element( BLOB(i) ); Tmp := Tmp + 1; end loop; Mem.Write_Next := BLOB'Length; Mem.Read_Next := Mem.Data'First; end Set_Contents; end BLOB_Stream; gnade-1.6.2.orig/contrib/objects/blob_stream.ads0000644000175000017500000001326210547144476021470 0ustar lbrentalbrenta-- ------------------------------------------------------------------------- -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/Makefile -- Description : Memory Stream -- -- Author : Michael Erdmann -- -- Created On : 30-April-2005 -- -- Last Modified By: $Author: merdmann $ -- -- Last Modified On: $Date: 2007/01/04 09:30:38 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2006 Michael Erdmann -- -- -- -- GNADE is copyrighted by the persons and institutions enumerated in the -- -- AUTHORS file. This file is located in the root directory of the -- -- SDB distribution. -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNADE; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- GNADE Ada units, or you link GNADE Ada units or libraries with other -- -- files to produce an executable, these units or libraries do not by -- -- itself cause the resulting executable to be covered by the GNU -- -- General Public License. This exception does not however invalidate -- -- any other reasons why the executable file might be covered by the -- -- GNU Public License. -- -- -- -- ------------------------------------------------------------------------- -- with Ada.Streams; use Ada.Streams; with Ada.Streams.Stream_IO; use Ada.Streams.Stream_IO; with System.Storage_Elements; use System.Storage_Elements; use System; with MD5; use MD5; with SQL_Standard; use SQL_Standard; package BLOB_Stream is type Stream_Element_Array_Access is access Stream_Element_Array; type Memory_Stream_Type( Size : Natural ) is new Root_Stream_Type with private; --------------------------------------------------------------------------- -- Description: -- Preconditions: -- Postconditions: -- Exceptions: -- Notes: --------------------------------------------------------------------------- function Stream( Size : Natural ) return Stream_Access ; --------------------------------------------------------------------------- -- Description: -- Preconditions: -- Postconditions: -- Exceptions: -- Notes: --------------------------------------------------------------------------- function Length( Stream : Stream_Access ) return Natural; --------------------------------------------------------------------------- -- Description: -- Preconditions: -- Postconditions: -- Exceptions: -- Notes: --------------------------------------------------------------------------- procedure Set_Contents( Stream : in Stream_Access; BLOB : in GNADE.BINARY); --------------------------------------------------------------------------- -- Description: -- Preconditions: -- Postconditions: -- Exceptions: -- Notes: --------------------------------------------------------------------------- procedure Get_Contents( Stream : in Stream_Access; BLOB : out GNADE.BINARY; Length : out Natural ); --------------------------------------------------------------------------- -- Description: -- Preconditions: -- Postconditions: -- Exceptions: -- Notes: --------------------------------------------------------------------------- procedure Destroy( Stream : in out Stream_Access ); function Hash( Stream : in Stream_Access ) return Fingerprint; -- ======================================================================== private function Initialize( Size : Natural ) return Stream_Element_Array_Access; type Memory_Stream_Type( Size : Natural ) is new Root_Stream_Type with record Write_Next : Stream_Element_Offset := 0; Read_Next : Stream_Element_Offset := 0; Data : Stream_Element_Array_Access := Initialize( Size ); end record; type Memory_Stream_Access is access all Memory_Stream_Type; procedure Read( Stream : in out Memory_Stream_Type; Item : out Stream_Element_Array; Last : out Stream_Element_Offset); procedure Write( Stream : in out Memory_Stream_Type; Item : in Stream_Element_Array); end BLOB_Stream; gnade-1.6.2.orig/contrib/objects/cache.adb0000644000175000017500000004001210554746251020207 0ustar lbrentalbrenta-- ------------------------------------------------------------------------- -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/objects/cache.adb,v $ -- Description : Base class for all persistent objects -- -- Author : Michael Erdmann -- -- Created On : 30-April-2005 -- -- Last Modified By: $Author: merdmann $ -- -- Last Modified On: $Date: 2007/01/21 20:27:21 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2006-2007 Michael Erdmann -- -- -- -- GNADE is copyrighted by the persons and institutions enumerated in the -- -- AUTHORS file. This file is located in the root directory of the -- -- GNADE distribution. -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNADE; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- GNADE Ada units, or you link GNADE Ada units or libraries with other -- -- files to produce an executable, these units or libraries do not by -- -- itself cause the resulting executable to be covered by the GNU -- -- General Public License. This exception does not however invalidate -- -- any other reasons why the executable file might be covered by the -- -- GNU Public License. -- -- -- -- ------------------------------------------------------------------------- -- with Ada.Streams; use Ada.Streams; with Ada.Streams.Stream_IO; use Ada.Streams.Stream_IO; with Ada.Text_IO; use Ada.Text_IO; with Ada.Storage_IO; use Ada; with System.Storage_Elements; use System.Storage_Elements; use System; with GNU.DB.SQLCLI; use GNU.DB.SQLCLI; with SQL_Standard; use SQL_Standard; with Util.Trace_Helper; with Util.Dynamic_Hashtable; with Util.Stack; with Util.Types; use Util.Types; use Util; with Objects; use Objects; with BLOB_Stream; use BLOB_Stream; with MD5; use MD5; package body Cache is Version : constant String := "$Id: cache.adb,v 1.2 2007/01/21 20:27:21 merdmann Exp $"; -- Trace facitlity package package Tracer is new Util.Trace_Helper( Module => "Cache"); use Tracer; -- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- -- ++++++++ P R I V A T E D A T A ++++++++++ -- -- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- -- -- -- Cache Tables -- -- ============ -- -- The cache mainaint two major hash tables. The so called object table -- -- which maps the object id into the actual cache entries and the so -- -- called finger print table, which maps the MD5 fingerprints onto -- -- object id's. -- -- -- -- Pools for BLOBS and Cache_Entries -- -- ================================= -- -- Since BLOBS and Cache_Entries are allocated diynamically they are -- -- only once allocate and put into a pool when they are freed. -- -- -- -- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- TTL_Default : constant Natural := 10; Cache_Hits : Natural := 0; Cache_Get : Natural := 0; Cache_Put : Natural := 0; ---------------------- -- Cache_Entry_Type -- ---------------------- type Cache_Entry_Type is record TTL : Natural := TTL_Default; Hi_Version : Natural := 0; Lo_Version : Natural := 0; Instance : BLOB_Access := Null; Length : Natural := 0; Ref_Count : Natural := 0; end record; type Cache_Entry_Access is access Cache_Entry_Type; package Cache_Entry_Pool is new Util.Stack( Element_Type => Cache_Entry_Access); use Cache_Entry_Pool; package BLOB_Pool is new Util.Stack( Element_Type => BLOB_Access ); use BLOB_Pool; -------------------- -- Object_Table -- -------------------- package Object_Table is new Dynamic_Hashtable( Payload_Type => Cache_Entry_Access ); use Object_Table; OT : Object_Table.Object( 1000 ) ; BLOBS : BLOB_Pool.Object := BLOB_Pool.Create; Cache_Entries : Cache_Entry_Pool.Object := Cache_Entry_Pool.Create; ----------------------- -- Fingerprint_Table -- ----------------------- package Fingerprint_Table is new Dynamic_Hashtable( Payload_Type => Integer ); FP : Fingerprint_Table.Object( 1000 ); -------------------- -- Object_ID_Type -- -------------------- type Object_ID_Type is record Id : Integer; Version : Integer; end record; package ObjectID_IO is new Storage_IO( Element_Type => Object_ID_Type ); -- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- -- ++++++++ P R I V A T E M E T H O D S ++++++++++ -- -- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- -- -- -- -- -- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- -------------- -- New_Blob -- -------------- function New_BLOB return Blob_Access is Result : Blob_Access; begin Enter("New_BLOB"); Pop( BLOBS, Result ); Leave("New_Blob"); return Result; exception when Blob_Pool.Stack_Empty => return new BLOB_Type; end New_Blob; --------------- -- Free_Blob -- --------------- procedure Free_Blob( Blob : BLOB_Access ) is begin Enter("Free_Blob"); Push( BLOBS, Blob ); Leave("Free_Blob"); end Free_Blob; --------------------- -- New_Cache_Entry -- --------------------- function New_Cache_Entry return Cache_Entry_Access is Result : Cache_Entry_Access := null; begin Enter("New_Cache_Entry"); Pop( Cache_Entries, Result ); Leave("New_Cache_Entry"); return Result; exception when Cache_Entry_Pool.Stack_Empty => return new Cache_Entry_Type; end New_Cache_Entry; --------------- -- Free_Blob -- --------------- procedure Free_Cache_Entry( Item : Cache_Entry_Access ) is begin Enter("Free_Cache_Entires"); Push( Cache_Entries, Item ); Leave("Free_Cache_Entry"); end Free_Cache_Entry; -------------- -- Make_Key -- -------------- function Make_Key( Id : in Integer; Vers : in Integer ) return Key_Type is use ObjectID_IO; OID : Object_ID_Type := (Id,Vers); Result : Buffer_Type; begin Enter("Make_Key(" & Integer'Image(Id) & ", " & Integer'Image(Vers) & ")" ); Write( Result, OID ); return Result; end Make_Key; ------------------ -- To_Object_ID -- ------------------ function To_Object_ID( Key : in Key_Type ) return Object_ID_Type is use ObjectID_IO; Data : Buffer_Type := Key( 1..Buffer_Type'Length ); Result : Object_ID_Type ; begin Read( Data, Result ); return Result; end To_Object_ID; -------------- -- Make_Key -- -------------- function Make_Key( FP : in GNADE.BINARY ) return Key_Type is Result : Key_Type(1..16); begin for i in FP'Range loop Result( Storage_Offset(i)) := Storage_Element(FP(i)); end loop; return Result; end Make_Key; -- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- -- ++++++++ P U B L I C M E T H O D S ++++++++++ -- -- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- -- -- -- -- -- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- ----------- -- Flush -- ----------- procedure Flush is -- flush the cache by writing out all object in the cache. begin Enter("Flush"); Info("Caching Statistics:"); Info(" Put :" & Natural'Image(Cache_Put)); Info(" Get :" & Natural'Image(Cache_Get)); Info(" Hits:" & Natural'Image(Cache_Hits)); Leave("Flush"); end Flush; ---------------- -- Invalidate -- ---------------- procedure Invalidate( Id : in Integer; Version : in Integer ) is Item : Cache_Entry_Access := null; Key : constant Key_Type := Make_Key( Id, Version ); begin Enter("Invalidate(" & Integer'Image(Id) & ", " & Integer'Image(Version) & ")" ); Object_Table.Get( OT, Key, Item ); Item.Ref_Count := Item.Ref_Count - 1; if Item.Ref_Count < 1 then Free_Blob( Item.Instance ); Object_Table.Delete( OT, Key ); Free_Cache_Entry( Item ); end if; Leave("Invalidate"); exception when Object_Table.Key_Not_Found => null; end Invalidate; --------- -- Put -- --------- procedure Put_Object( Id : in Integer; Version : in out Integer; Fprint : in GNADE.BINARY; BLOB : in GNADE.BINARY; Class_Name : in String) is -- store an object in the cache Item : Cache_Entry_Access := null; Object_Version : Integer := Version; begin Enter("Put_Object(" & Integer'Image(ID) & ", " & Integer'Image(Version) & ", " & Class_Name &")"); Cache_Put := Cache_Put + 1; begin Object_Table.Get( OT, Make_Key(Id, Version), Item); Item.Instance(1..BLOB'Length) := BLOB; Item.Length := BLOB'Length; Item.TTL := Item.TTL + 1; Cache_Hits := Cache_Hits + 1; exception when Object_Table.Key_Not_Found => Info("Key_Not_Found =>"); Item := new Cache_Entry_Type; Item.Instance := New_Blob; Item.Instance(1..BLOB'Length) := BLOB; Item.Length := BLOB'Length; Object_Table.Put( OT, Make_Key(Id,Version), Item ); end; Insert_Object( ID, Object_Version, BLOB, Fprint, Class_Name ); case Version is when Highest_Version => Item.Hi_Version := Object_Version; when Lowest_Version => Item.Lo_Version := Object_Version; when others => null; end case; Version := Object_Version; Leave("Put_Object(" & Integer'Image(ID) & ", " & Integer'Image(Version) & ", " & Class_Name &")"); end Put_Object; ---------------- -- Get_Object -- ---------------- procedure Get_Object( Id : in Integer; Version : in out Integer; BLOB : out BLOB_Access; Length : out Natural) is -- get an object by means of the object id aqnd version Object_Version : Integer := Version; Item : Cache_Entry_Access := null; begin Enter("Get_Object( " & Integer'Image(Id) & ", " & Integer'Image(Version) & ")" ); Cache_Get := Cache_Get + 1; begin Object_Table.Get( OT, Make_Key(Id, Version), Item); Cache_Hits := Cache_Hits + 1; BLOB := Item.Instance; Length := Item.Length; Item.TTL := Item.TTL + 1; Item.Ref_Count := Item.Ref_Count + 1; case Version is when Highest_Version => Object_Version := Item.Hi_Version; when Lowest_Version => Object_Version := Item.Lo_Version; when others => null; end case; exception when Object_Table.Key_Not_Found => begin BLOB := New_Blob; Objects.Get_Object( Id, Object_Version, BLOB.all, Length ); Item := new Cache_Entry_Type ; Item.Instance := BLOB; Item.Length := Length; Item.Ref_Count := 1; case Version is when Highest_Version => Item.Hi_Version := Object_Version; when Lowest_Version => Item.Lo_Version := Object_Version; when others => null; end case; Object_Table.Put( OT, Make_Key(Id,Version), Item ); end ; end; Version := Object_Version; Leave("Get_Object(" & "Id=" & Integer'Image( Id ) & ", " & "Version=" & Integer'Image( Version ) & ", " & "Length=" & Natural'Image( Length ) & ")" ); end Get_Object; ---------------- -- Get_Object -- ---------------- procedure Get_Object( Fprint : in GNADE.BINARY; Version : in out Integer; BLOB : out BLOB_Access; Length : out Natural) is ID : Integer; begin Enter("Get_Object( , Version=" & Integer'Image(Version) & ")" ); begin Fingerprint_Table.Get( FP, Make_Key( Fprint ), ID ); Cache.Get_Object( ID, Version, BLOB, Length ); exception when Fingerprint_Table.Key_Not_Found => declare Object_Version : Integer := Version; Item : Cache_Entry_Access := new Cache_Entry_Type ; begin Cache_Get := Cache_Get + 1; BLOB := New_Blob; Objects.Get_Object( Fprint, Object_Version, ID, BLOB.all, Length ); Fingerprint_Table.Put( FP, Make_Key( Fprint ), ID ); Item.Instance := BLOB; Item.Length := Length; Item.Ref_Count := 1; case Version is when Highest_Version => Item.Hi_Version := Object_Version; when Lowest_Version => Item.Lo_Version := Object_Version; when others => null; end case; Object_Table.Put( OT, Make_Key(ID,Version), Item ); Version := Object_Version; end ; end ; Leave("Get_Object( ," & "Id=" & Integer'Image(ID) & "Version=" & Integer'Image(Version) & ", " & "Length=" & Natural'Image(Length) & ")" ); end ; end Cache; gnade-1.6.2.orig/contrib/objects/cache.ads0000644000175000017500000001361010554746251020234 0ustar lbrentalbrenta-- ------------------------------------------------------------------------- -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/objects/cache.ads,v $ -- Description : Base class for all persistent objects -- -- Author : Michael Erdmann -- -- Created On : 30-April-2005 -- -- Last Modified By: $Author: merdmann $ -- -- Last Modified On: $Date: 2007/01/21 20:27:21 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2006-2007 Michael Erdmann -- -- -- -- GNADE is copyrighted by the persons and institutions enumerated in the -- -- AUTHORS file. This file is located in the root directory of the -- -- GNADE distribution. -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNADE; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- GNADE Ada units, or you link GNADE Ada units or libraries with other -- -- files to produce an executable, these units or libraries do not by -- -- itself cause the resulting executable to be covered by the GNU -- -- General Public License. This exception does not however invalidate -- -- any other reasons why the executable file might be covered by the -- -- GNU Public License. -- -- -- -- Functional Description -- -- ====================== -- -- This module implement a simple cache functionality in order to reduce -- -- the number of database accesses. -- -- -- -- Read Access -- -- -- -- Read access to objects is based on object id's and finger prints. The -- -- method Get_Object allows to retieve the blob contents. -- -- If the Object of the given id or finger print is not already loaded, the -- -- blob representing the object is loaded into the memory. -- -- -- -- Write Access -- -- -- -- If and Put_Object is invoked, the object is wirtten back to the data- -- -- base and the new blob is keept in the cache for retrival. -- -- -- -- Invalidation -- -- -- -- There is no automatic invalidation. When is client decides not using an -- -- object any more and explict call to the Invalidate method has to be -- -- done. -- -- -- -- Restriction -- -- =========== -- -- R.1 - Not Tasking save -- -- ------------------------------------------------------------------------- -- with Ada.Streams; use Ada.Streams; with Ada.Streams.Stream_IO; use Ada.Streams.Stream_IO; with Ada.Text_IO; use Ada.Text_IO; use Ada; with GNU.DB.SQLCLI; use GNU.DB.SQLCLI; with SQL_Standard; use SQL_Standard; with Objects; use Objects; with BLOB_Stream; use BLOB_Stream; with MD5; use MD5; package Cache is subtype BLOB_Type is GNADE.BINARY( 1..Blob_Size ); type BLOB_Access is access BLOB_Type; procedure Flush; procedure Get_Object( Id : in Integer; Version : in out Integer; BLOB : out BLOB_Access; Length : out Natural); procedure Get_Object( Fprint : in GNADE.BINARY; Version : in out Integer; BLOB : out BLOB_Access; Length : out Natural); procedure Put_Object( Id : in Integer; Version : in out Integer; Fprint : in GNADE.BINARY; BLOB : in GNADE.BINARY; Class_Name : in String); procedure Invalidate( Id : in Integer; Version : in Integer ); end Cache; gnade-1.6.2.orig/contrib/objects/class_procedure.ads0000644000175000017500000000701210547546277022355 0ustar lbrentalbrenta-- ------------------------------------------------------------------------- -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/objects/class_procedure.ads,v $ -- Description : class iterator -- -- Author : Michael Erdmann -- -- Created On : 30-Dec-2006 -- -- Last Modified By: $Author: merdmann $ -- -- Last Modified On: $Date: 2007/01/05 22:10:07 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2006-2007 Michael Erdmann -- -- -- -- GNADE is copyrighted by the persons and institutions enumerated in the -- -- AUTHORS file. This file is located in the root directory of the -- -- GNADE distribution. -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNADE; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- GNADE Ada units, or you link GNADE Ada units or libraries with other -- -- files to produce an executable, these units or libraries do not by -- -- itself cause the resulting executable to be covered by the GNU -- -- General Public License. This exception does not however invalidate -- -- any other reasons why the executable file might be covered by the -- -- GNU Public License. -- -- -- -- ------------------------------------------------------------------------- -- with Ada.Streams; use Ada.Streams; with Ada.Streams.Stream_IO; use Ada.Streams.Stream_IO; with SQL_Standard; use SQL_Standard; with Persistent; use Persistent; package Class_Procedure is type Object is abstract tagged record Stream : Stream_Access := null; end record; Execution_Aborted : exception; Execution_Done : exception; procedure Execute( This : in out Object; Instance : in Persistent.Object'Class ) is abstract; procedure Run( This : in out Object'Class; Instance : in out Persistent.Object'Class; Completed : out Boolean); procedure Initialize; procedure Finalize; end Class_Procedure; gnade-1.6.2.orig/contrib/objects/class_procedure.gpq0000644000175000017500000001316710547546447022404 0ustar lbrentalbrenta-- ------------------------------------------------------------------------- -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/objects/class_procedure.gpq,v $ -- Description : class iterator -- -- Author : Michael Erdmann -- -- Created On : 30-Dec-2006 -- -- Last Modified By: $Author: merdmann $ -- -- Last Modified On: $Date: 2007/01/05 22:11:51 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2006-2007 Michael Erdmann -- -- -- -- GNADE is copyrighted by the persons and institutions enumerated in the -- -- AUTHORS file. This file is located in the root directory of the -- -- GNADE distribution. -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNADE; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- GNADE Ada units, or you link GNADE Ada units or libraries with other -- -- files to produce an executable, these units or libraries do not by -- -- itself cause the resulting executable to be covered by the GNU -- -- General Public License. This exception does not however invalidate -- -- any other reasons why the executable file might be covered by the -- -- GNU Public License. -- -- -- -- ------------------------------------------------------------------------- -- with Ada.Tags; use Ada.Tags; use Ada; with BLOB_Stream; use BLOB_Stream; package body Class_Procedure is Version : constant String := "$Id: class_procedure.gpq,v 1.1 2007/01/05 22:11:51 merdmann Exp $"; Blob_Size : constant Natural := 10_000; EXEC SQL DECLARE DB01 DATABASE ; -------------------- -- Class_Iterator -- -------------------- procedure Class_Iterator( This : in out Object'Class; Instance : in out Persistent.Object'Class; Cls : in String ) is -- ++++++++++++++++++++++++++++++++++++ EXEC SQL BEGIN DECLARE SECTION END-EXEC VERSION : INT := 0; DATA : GNADE.VARBINARY( Blob_Size ); CLASSNAME : GNADE.VARCHAR(60); ID : INT := 0; EXEC SQL END DECLARE SECTION END-EXEC EXEC SQL INCLUDE SQLCA ; -- +++++++++++++++++++++++++++++++++++ begin To_VARCHAR( Cls, CLASSNAME ); EXEC SQL AT DB01 DECLARE obj_cursor LOCAL CURSOR FOR SELECT ID, DATA FROM OBJECTS WHERE CLASS = :CLASSNAME ; EXEC SQL AT DB01 OPEN obj_cursor; loop declare BLOB : GNADE.BINARY( 1..Blob_Size ); Length : Integer := 0; begin EXEC SQL AT DB01 FETCH FROM obj_cursor INTO :ID, :DATA ; exit when SQLCODE in SQL_STANDARD.NOT_FOUND; To_Binary( Data, BLOB, Length ); Set_Contents( This.Stream, BLOB(1..Length)); Instance := Persistent.Object'Class'Input(This.Stream); Execute( This, Instance ); end; end loop; EXEC SQL AT DB01 CLOSE obj_cursor; end Class_Iterator; ------------- -- Connect -- ------------- procedure Connect is begin -- connect to gnade data base EXEC SQL CONNECT $DBUSER IDENTIFIED BY $DBPASSWD BY DB01 TO $DBSOURCE ; end Connect; --------- -- Run -- --------- procedure Run( This : in out Object'Class; Instance : in out Persistent.Object'Class; Completed : out Boolean ) is begin This.Stream := BLOB_Stream.Stream( Blob_Size ); Completed := False; Class_Iterator( This, Instance, External_Tag( Instance'Tag ) ); Completed := True; Destroy(This.Stream); exception when Execution_Aborted => Completed := False; Destroy(This.Stream); when Execution_Done => Completed := True; Destroy(This.Stream); end Run; ---------------- -- Initialize -- ---------------- procedure Initialize is begin Connect; end; -------------- -- Finalize -- -------------- procedure Finalize is begin null; end Finalize; end Class_Procedure; gnade-1.6.2.orig/contrib/objects/group.adb0000644000175000017500000001175010561121550020272 0ustar lbrentalbrenta-- ------------------------------------------------------------------------- -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/objects/group.adb,v $ -- Description : Groups -- -- Author : Michael Erdmann -- -- Created On : 30-Dec-2006 -- -- Last Modified By: $Author: merdmann $ -- -- Last Modified On: $Date: 2007/02/03 14:59:52 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2006-2007 Michael Erdmann -- -- -- -- GNADE is copyrighted by the persons and institutions enumerated in the -- -- AUTHORS file. This file is located in the root directory of the -- -- GNADE distribution. -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNADE; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- GNADE Ada units, or you link GNADE Ada units or libraries with other -- -- files to produce an executable, these units or libraries do not by -- -- itself cause the resulting executable to be covered by the GNU -- -- General Public License. This exception does not however invalidate -- -- any other reasons why the executable file might be covered by the -- -- GNU Public License. -- -- -- -- ------------------------------------------------------------------------- -- with Ada.Text_IO; use Ada.Text_IO; with Account; use Account; with Person; use Person; with Objects; use Objects; with TAM.Persistent; use TAM.Persistent; package body Group is Version : constant String := "$Id: group.adb,v 1.5 2007/02/03 14:59:52 merdmann Exp $"; Membership_Rel : constant String := "Is_Member"; ------------ -- Create -- ------------ procedure Create( This : in out Object; Owner : in Persistent.Object'Class; Name : in Unbounded_String ) is begin This.Name := Name; Put_Object( This ); Account.Create( This, To_String( Name ) & " Account" ); Relate( Owner, This, "Group_Owner" ); end Create; --------- -- Add -- --------- procedure Add( This : in out Object; Item : in out Persistent.Object'Class) is begin Relate( Item, This, Membership_Rel ); end Add; ------------- -- Display -- ------------- procedure Display( This : in out Object ) is Persons : OID_Array_Type( 1..100 ) := (others=>0); Length : Integer := 0; begin Put_Line("Displaying group " & To_String( This.Name ) ); Get_References( OID(This), Membership_Rel , Persons, Length ); for i in 1..Length loop declare A : Person.Object; begin Get_Object(A, ID => Persons(i)); Person.Display( A ); end ; end loop; end Display; ----------- -- Query -- ----------- procedure Query( This : in out Object; Owner : in Persistent.Object'Class; Name : in Unbounded_String) is Groups : OID_Array_Type( 1..100 ); Length : Integer := 0; Found : Boolean := False; begin Get_Related( OID(Owner), "Group_Owner", Groups, Length ); for i in 1..Length loop declare G : Object; begin Get_Object(G, ID=>Groups(i) ); Found := G.Name = Name; if Found then This := G; exit; end if; end; end loop; if not Found then raise Not_Existing; end if; end Query; end Group; gnade-1.6.2.orig/contrib/objects/group.ads0000644000175000017500000000676410546551170020334 0ustar lbrentalbrenta-- ------------------------------------------------------------------------- -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/objects/group.ads,v $ -- Description : Main Driver of the Demo -- -- Author : Michael Erdmann -- -- Created On : 30-Dec-2006 -- -- Last Modified By: $Author: merdmann $ -- -- Last Modified On: $Date: 2007/01/02 21:45:28 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2006-2007 Michael Erdmann -- -- -- -- GNADE is copyrighted by the persons and institutions enumerated in the -- -- AUTHORS file. This file is located in the root directory of the -- -- GNADE distribution. -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNADE; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- GNADE Ada units, or you link GNADE Ada units or libraries with other -- -- files to produce an executable, these units or libraries do not by -- -- itself cause the resulting executable to be covered by the GNU -- -- General Public License. This exception does not however invalidate -- -- any other reasons why the executable file might be covered by the -- -- GNU Public License. -- -- -- -- ------------------------------------------------------------------------- -- with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Persistent; use Persistent; package Group is Not_Existing : exception; type Object is new Persistent.Object with record Name : Unbounded_String := Null_Unbounded_String; end record; procedure Create( This : in out Object; Owner : in Persistent.Object'Class; Name : in Unbounded_String ); procedure Add( This : in out Object; Item : in out Persistent.Object'Class); procedure Display( This : in out Object ); procedure Query( This : in out Object; Owner : in Persistent.Object'Class; Name : in Unbounded_String); end Group; gnade-1.6.2.orig/contrib/objects/key_type.adb0000644000175000017500000000307210552251310020763 0ustar lbrentalbrentawith Ada.Streams; use Ada.Streams; with Ada.Streams.Stream_IO; use Ada.Streams.Stream_IO; --with Ada.Text_IO; use Ada.Text_IO; --with Ada.Calendar; use Ada.Calendar; with Ada.Unchecked_Conversion; use Ada; with GNU.DB.SQLCLI; use GNU.DB.SQLCLI; with BLOB_Stream; use BLOB_Stream; with MD5; use MD5; package body Key_Type is Version : String := "$Id: key_type.adb,v 1.2 2007/01/13 21:44:40 merdmann Exp $"; --------------- -- To_Binary -- --------------- function To_BINARY( F : in MD5.Fingerprint ) return GNADE.BINARY is function To_SQLCHAR is new Ada.Unchecked_Conversion (Target => SQL.SQLCHAR, Source => Stream_Element ); Result : GNADE.BINARY( 1..16 ); begin for i in F'Range loop Result(Integer(i)) := To_SQLCHAR( F(i) ); end loop; return Result; end To_BINARY; ---------- -- Hash -- ---------- function Hash( This : in Object'Class ) return GNADE.BINARY is S : Stream_Access := BLOB_Stream.Stream( Key_Size ); Result : GNADE.BINARY(1..16); begin Object'Class'Output(S, This ); Result := To_Binary(Hash(S)); Destroy(S); return Result; end Hash; ---------- -- Hash -- ---------- function Hash( ID : in Integer ) return GNADE.BINARY is S : Stream_Access := BLOB_Stream.Stream( Key_Size ); Result : GNADE.BINARY(1..16); begin Integer'Output(S, ID ); Result := To_Binary(Hash(S)); Destroy(S); return Result; end Hash; end Key_Type; gnade-1.6.2.orig/contrib/objects/key_type.ads0000644000175000017500000000044410552251310021004 0ustar lbrentalbrentawith SQL_Standard; use SQL_Standard; package Key_Type is type Object is tagged null record; Key_Size : constant Natural := 10_000; function Hash( This : in Object'Class ) return GNADE.BINARY; function Hash( ID : in Integer ) return GNADE.BINARY; end Key_Type; gnade-1.6.2.orig/contrib/objects/libobjects.gpr0000644000175000017500000000076310637241242021327 0ustar lbrentalbrentawith "../../../tools/util/util.gpr"; with "tam/tam.gpr"; project Libobjects is for Languages use ("Ada", "Makefile"); for Library_Name use "objects"; for Library_Dir use "lib"; for Library_Ali_Dir use "include"; for Library_Kind use "dynamic"; for Library_Src_Dir use "."; for Source_Dirs use ("."); package Naming is for Specification_Suffix ("makefile") use "Makefile"; end Naming; package Ide is for Vcs_Kind use "CVS"; end Ide; end Libobjects; gnade-1.6.2.orig/contrib/objects/md5.adb0000644000175000017500000003254010547144501017630 0ustar lbrentalbrenta-- $Id: md5.adb,v 1.1 2007/01/04 09:30:41 merdmann Exp $ -- ----------------------------------------------------------------------------- -- Copyright (C) 2002 Rolf Ebert -- -- The implementation of the MD5 hash written in Ada in this file -- -- is partly based on the reference implementation written in C as -- -- published in http://www.faqs.org/rfcs/rfc1321.html. It -- -- therefor can be considered "derived from the RSA Data Security, -- -- Inc. MD5 Message-Digest Algorithm". -- -- Admittendly I am far from a native English speaker nor am I a -- -- lawer. Personally, I see this software as an "implementation" -- -- of the published algorithm; it is not "derived" from the -- -- algorithm. -- -- This is free software you can redistribute it and/or modify it -- -- under terms of the GNU General Public License as published by the Free -- -- Software Foundation; either version 2, or (at your option) any later -- -- version. ASCL is distributed in the hope that it will be useful, but -- -- WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- -- General Public License for more details. You should have received a -- -- copy of the GNU General Public License distributed with this software; -- -- see the file COPYING. If not, write to the Free Software Foundation, -- -- 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- this unit, or you link this unit with other files to produce an -- -- executable, this unit does not by itself cause the resulting -- -- executable to be covered by the GNU General Public License. This -- -- exception does not however invalidate any other reasons why the -- -- executable file might be covered by the GNU Public License. -- -- -- ----------------------------------------------------------------------------- with Interfaces; with Ada.Streams; package body MD5 is use type Interfaces.Unsigned_32; use type Ada.Streams.Stream_Element; use type Ada.Streams.Stream_Element_Offset; subtype Offset is Ada.Streams.Stream_Element_Offset; subtype Byte is Ada.Streams.Stream_Element; subtype Byte_Array is Ada.Streams.Stream_Element_Array; subtype Word is Interfaces.Unsigned_32; type Word_Array is array (Offset range <>) of Word; pragma Pack (Word_Array); subtype ABCD_State is Word_Array(1 .. 4); subtype Count_T is Word_Array(1 .. 2); subtype Buffer_T is Byte_Array(1 .. 64); type Context is record State : ABCD_State; Count : Count_T; Buffer: Buffer_T; end record; procedure Init (Ctx: out Context); procedure Update(Ctx: in out Context; Data : in Byte_Array); procedure Final (Ctx: in out Context; Digest: out Fingerprint); ------------------------------------------------------------------------ -- F, G, H, I are the basic MD5 functions function F(X, Y, Z: Word) return Word is begin return (X and Y) or ((not X) and Z); end F; pragma Inline(F); function G(X, Y, Z: Word) return Word is begin return (X and Z) or (Y and (not Z)); end G; pragma Inline(G); function H(X, Y, Z: Word) return Word is begin return X xor Y xor Z; end H; pragma Inline(H); function I(X, Y, Z: Word) return Word is begin return Y xor (X or (not Z)); end I; pragma Inline(I); ------------------------------------------------------------------------ procedure FF(A : in out Word; B, C, D, X: in Word; S : in Natural; AC : in Word) is begin A := A + F(B, C, D) + X + AC; A := Interfaces.Rotate_Left(A, S) + B; end FF; pragma Inline(FF); procedure GG(A : in out Word; B, C, D, X: in Word; S : in Natural; AC : in Word) is begin A := A + G(B, C, D) + X + AC; A := Interfaces.Rotate_Left(A, S) + B; end GG; pragma Inline(GG); procedure HH(A : in out Word; B, C, D, X: in Word; S : in Natural; AC : in Word) is begin A := A + H(B, C, D) + X + AC; A := Interfaces.Rotate_Left(A, S) + B; end HH; pragma Inline(HH); procedure II(A : in out Word; B, C, D, X: in Word; S : in Natural; AC : in Word) is begin A := A + I(B, C, D) + X + AC; A := Interfaces.Rotate_Left(A, S) + B; end II; pragma Inline(II); ------------------------------------------------------------------------ procedure Encode(Output: out Byte_Array; Input : in Word_Array) is use Interfaces; -- make Shift_Right directly visible J : Offset := Output'First; begin for I in Input'range loop Output(J ) := Byte( Input(I) and 16#FF#); Output(J + 1) := Byte(Shift_Right(Input(I), 8) and 16#FF#); Output(J + 2) := Byte(Shift_Right(Input(I), 16) and 16#FF#); Output(J + 3) := Byte(Shift_Right(Input(I), 24) and 16#FF#); J := J + 4; end loop; end Encode; procedure Decode(Output: out Word_Array; Input : in Byte_Array) is use Interfaces; -- make Shift_Left directly visible J : Offset := Input'First; begin for I in Output'range loop Output(I) := Word(Input(J )) or Shift_Left(Word(Input(J + 1)), 8) or Shift_Left(Word(Input(J + 2)), 16) or Shift_Left(Word(Input(J + 3)), 24); J := J + 4; end loop; end Decode; ------------------------------------------------------------------------ S11: constant := 7; S12: constant := 12; S13: constant := 17; S14: constant := 22; S21: constant := 5; S22: constant := 9; S23: constant := 14; S24: constant := 20; S31: constant := 4; S32: constant := 11; S33: constant := 16; S34: constant := 23; S41: constant := 6; S42: constant := 10; S43: constant := 15; S44: constant := 21; procedure Transform(State: in out ABCD_State; Block: in Buffer_T) is A: Word := State(1); B: Word := State(2); C: Word := State(3); D: Word := State(4); X: Word_Array(0 .. 15); begin Decode(X, Block); -- Round 1 FF(A, B, C, D, X( 0), S11, 16#D76AA478#); -- 1 FF(D, A, B, C, X( 1), S12, 16#E8C7B756#); -- 2 FF(C, D, A, B, X( 2), S13, 16#242070DB#); -- 3 FF(B, C, D, A, X( 3), S14, 16#C1BDCEEE#); -- 4 FF(A, B, C, D, X( 4), S11, 16#F57C0FAF#); -- 5 FF(D, A, B, C, X( 5), S12, 16#4787C62A#); -- 6 FF(C, D, A, B, X( 6), S13, 16#A8304613#); -- 7 FF(B, C, D, A, X( 7), S14, 16#FD469501#); -- 8 FF(A, B, C, D, X( 8), S11, 16#698098D8#); -- 9 FF(D, A, B, C, X( 9), S12, 16#8B44F7AF#); -- 10 FF(C, D, A, B, X(10), S13, 16#FFFF5BB1#); -- 11 FF(B, C, D, A, X(11), S14, 16#895CD7BE#); -- 12 FF(A, B, C, D, X(12), S11, 16#6B901122#); -- 13 FF(D, A, B, C, X(13), S12, 16#FD987193#); -- 14 FF(C, D, A, B, X(14), S13, 16#A679438E#); -- 15 FF(B, C, D, A, X(15), S14, 16#49B40821#); -- 16 -- Round 2 GG(A, B, C, D, X( 1), S21, 16#F61E2562#); -- 17 GG(D, A, B, C, X( 6), S22, 16#C040B340#); -- 18 GG(C, D, A, B, X(11), S23, 16#265E5A51#); -- 19 GG(B, C, D, A, X( 0), S24, 16#E9B6C7AA#); -- 20 GG(A, B, C, D, X( 5), S21, 16#D62F105D#); -- 21 GG(D, A, B, C, X(10), S22, 16#02441453#); -- 22 GG(C, D, A, B, X(15), S23, 16#D8A1E681#); -- 23 GG(B, C, D, A, X( 4), S24, 16#E7D3FBC8#); -- 24 GG(A, B, C, D, X( 9), S21, 16#21E1CDE6#); -- 25 GG(D, A, B, C, X(14), S22, 16#C33707D6#); -- 26 GG(C, D, A, B, X( 3), S23, 16#F4D50D87#); -- 27 GG(B, C, D, A, X( 8), S24, 16#455A14ED#); -- 28 GG(A, B, C, D, X(13), S21, 16#A9E3E905#); -- 29 GG(D, A, B, C, X( 2), S22, 16#FCEFA3F8#); -- 30 GG(C, D, A, B, X( 7), S23, 16#676F02D9#); -- 31 GG(B, C, D, A, X(12), S24, 16#8D2A4C8A#); -- 32 -- Round 3 HH(A, B, C, D, X( 5), S31, 16#FFFA3942#); -- 33 HH(D, A, B, C, X( 8), S32, 16#8771F681#); -- 34 HH(C, D, A, B, X(11), S33, 16#6D9D6122#); -- 35 HH(B, C, D, A, X(14), S34, 16#FDE5380C#); -- 36 HH(A, B, C, D, X( 1), S31, 16#A4BEEA44#); -- 37 HH(D, A, B, C, X( 4), S32, 16#4BDECFA9#); -- 38 HH(C, D, A, B, X( 7), S33, 16#F6BB4B60#); -- 39 HH(B, C, D, A, X(10), S34, 16#BEBFBC70#); -- 40 HH(A, B, C, D, X(13), S31, 16#289B7EC6#); -- 41 HH(D, A, B, C, X( 0), S32, 16#EAA127FA#); -- 42 HH(C, D, A, B, X( 3), S33, 16#D4EF3085#); -- 43 HH(B, C, D, A, X( 6), S34, 16#04881D05#); -- 44 HH(A, B, C, D, X( 9), S31, 16#D9D4D039#); -- 45 HH(D, A, B, C, X(12), S32, 16#E6DB99E5#); -- 46 HH(C, D, A, B, X(15), S33, 16#1FA27CF8#); -- 47 HH(B, C, D, A, X( 2), S34, 16#C4AC5665#); -- 48 -- Round 4 II(A, B, C, D, X( 0), S41, 16#F4292244#); -- 49 II(D, A, B, C, X( 7), S42, 16#432AFF97#); -- 50 II(C, D, A, B, X(14), S43, 16#AB9423A7#); -- 51 II(B, C, D, A, X( 5), S44, 16#FC93A039#); -- 52 II(A, B, C, D, X(12), S41, 16#655B59C3#); -- 53 II(D, A, B, C, X( 3), S42, 16#8F0CCC92#); -- 54 II(C, D, A, B, X(10), S43, 16#FFEFF47D#); -- 55 II(B, C, D, A, X( 1), S44, 16#85845DD1#); -- 56 II(A, B, C, D, X( 8), S41, 16#6FA87E4F#); -- 57 II(D, A, B, C, X(15), S42, 16#FE2CE6E0#); -- 58 II(C, D, A, B, X( 6), S43, 16#A3014314#); -- 59 II(B, C, D, A, X(13), S44, 16#4E0811A1#); -- 60 II(A, B, C, D, X( 4), S41, 16#F7537E82#); -- 61 II(D, A, B, C, X(11), S42, 16#BD3AF235#); -- 62 II(C, D, A, B, X( 2), S43, 16#2AD7D2BB#); -- 63 II(B, C, D, A, X( 9), S44, 16#EB86D391#); -- 64 State(1) := State(1) + A; State(2) := State(2) + B; State(3) := State(3) + C; State(4) := State(4) + D; -- Zeroize sensitive information. X :=(others => 0); end Transform; ------------------------------------------------------------------------ procedure Init(Ctx: out Context) is begin Ctx := (State => (1 => 16#67452301#, 2 => 16#EFCDAB89#, 3 => 16#98BADCFE#, 4 => 16#10325476#), Count => (others => 0), Buffer => (others => 0)); end Init; procedure Update(Ctx: in out Context; Data: in Byte_Array) is use Interfaces; -- make Shift_Left/Shift_Right directly visible Index : Offset; Part_Len : Offset; I : Offset; begin -- compute number of bytes mod 64 Index := Offset(Shift_Right(Ctx.Count(1), 3) and 16#3F#); -- update number of bits Ctx.Count(1) := Ctx.Count(1) + Shift_Left(Word(Data'Length), 3); if Ctx.Count(1) < Shift_Left(Word(Data'Length), 3) then Ctx.Count(2) := Ctx.Count(2) + 1; end if; Ctx.Count(2) := Ctx.Count(2) + Shift_Right(Word(Data'Length), 29); Part_Len := 64 - Index; -- Transform as many times as possible. if Data'Length >= Part_Len then Ctx.Buffer(Index + 1 .. Index + Part_Len) := Data(Data'First .. Data'First + Part_Len - 1); Transform(Ctx.State, Ctx.Buffer); I := Part_Len; while I + 63 < Data'Length loop Transform(Ctx.State, Data(I + 1 .. I + 64)); I := I + 64; end loop; Index := 0; else I := 0; end if; -- Buffer remaining input Ctx.Buffer(Index + 1 .. Index + Data'Length - I) := Data(I + 1 .. Data'Length); end Update; procedure Final(Ctx: in out Context; Digest: out Fingerprint) is use Interfaces; -- make Shift_Right directly visible Bits : Byte_Array(1 .. 8); Index : Offset; Pad_Length : Offset; Padding : constant Buffer_T := (1 => 16#80#, others => 0); begin -- save number of bits Encode(Bits, Ctx.Count); -- Pad out to 56 mod 64. Index := Offset(Shift_Right(Ctx.Count(1), 3) and 16#3F#); if Index < 56 then Pad_Length := 56 - Index; else Pad_Length := 120 - Index; end if; Update(Ctx, Padding(1 .. Pad_Length)); -- Append length (before padding) Update(Ctx, Bits); -- Store state in digest Encode(Digest, Ctx.State); -- Zeroize sensitive information. Ctx := (State => (others => 0), Count => (others => 0), Buffer => (others => 0)); end Final; function Hash(Input : Ada.Streams.Stream_Element_Array) return Fingerprint is Result : Fingerprint; State : Context; begin Init(State); Update(State, Input); Final(State, Result); return Result; end Hash; end MD5; gnade-1.6.2.orig/contrib/objects/md5.ads0000644000175000017500000001070310547144501017646 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/objects/md5.ads,v $ -- Description : MD5 Driver -- -- Author : Rolf Ebert -- -- Created On : 11-07-2002 -- -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2007/01/04 09:30:41 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2002 Rolf Ebert -- -- -- -- ASCL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Functional Description -- -- ====================== -- -- -- -- The implementation of the MD5 hash written in Ada in this file -- -- is partly based on the reference implementation written in C as -- -- published in http://www.faqs.org/rfcs/rfc1321.html. It -- -- therefor can be considered "derived from the RSA Data Security, -- -- Inc. MD5 Message-Digest Algorithm". -- -- -- -- Admittendly I am far from a native English speaker nor am I a -- -- lawer. Personally, I see this software as an "implementation" -- -- of the published algorithm; it is not "derived" from the -- -- algorithm. -- -- -- -- Restrictions -- -- ============ -- -- R.1 - -- -- -- -- References -- -- ========== -- -- None -- ------------------------------------------------------------------------------- with Ada.Streams; use Ada.Streams; package MD5 is subtype Fingerprint is Ada.Streams.Stream_Element_Array(1 .. 16); -- 128 bits --------------------------------------------------------------------------- -- Description: -- Preconditions: -- Postconditions: -- Exceptions: -- Notes: -- None --------------------------------------------------------------------------- function Hash( Input : Ada.Streams.Stream_Element_Array) return Fingerprint; end MD5; gnade-1.6.2.orig/contrib/objects/objects.ads0000644000175000017500000001430510554624342020620 0ustar lbrentalbrenta--- ------------------------------------------------------------------------- -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/Makefile -- Description : Database layer -- -- Author : Michael Erdmann -- -- Created On : 30-April-2005 -- -- Last Modified By: $Author: merdmann $ -- -- Last Modified On: $Date: 2007/01/21 08:48:34 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2006 Michael Erdmann -- -- -- -- GNADE is copyrighted by the persons and institutions enumerated in the -- -- AUTHORS file. This file is located in the root directory of the -- -- GNADE distribution. -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNADE; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- GNADE Ada units, or you link GNADE Ada units or libraries with other -- -- files to produce an executable, these units or libraries do not by -- -- itself cause the resulting executable to be covered by the GNU -- -- General Public License. This exception does not however invalidate -- -- any other reasons why the executable file might be covered by the -- -- GNU Public License. -- -- -- -- ------------------------------------------------------------------------- -- with SQL_Standard; use SQL_Standard; package Objects is Blob_Size : constant Positive := 10_000; Key_Size : constant Positive := 17; Lowest_Version : constant Integer := -1; Highest_Version : constant Integer := -2; New_Version : constant Integer := -3; All_Versions : constant Integer := -4; Current_Version : constant Integer := -5; Insert_Failed : exception; Object_Not_Existing : exception; Invalid_Arguments : exception; Relation_Exists : exception; To_Many_Objects : exception; --------------------------------------------------------------------------- -- Description: -- Preconditions: -- Postconditions: -- Exceptions: -- Notes: --------------------------------------------------------------------------- procedure Insert_Object( Object_ID : in Integer; Object_Version : in out Integer; BLOB : in GNADE.BINARY; Hash_Value : in GNADE.BINARY; Class_Name : in String ); --------------------------------------------------------------------------- -- Description: -- Preconditions: -- Postconditions: -- Exceptions: -- Notes: --------------------------------------------------------------------------- procedure Get_Object( Object_ID : in Integer; Object_Version : in out Integer ; BLOB : out GNADE.BINARY; Length : out Positive); procedure Get_Object( Key : in GNADE.BINARY; Object_Version : in out Integer ; Object_ID : out Integer; BLOB : out GNADE.BINARY; Length : out Positive); --------------------------------------------------------------------------- -- Description: -- Preconditions: -- Postconditions: -- Exceptions: -- Notes: --------------------------------------------------------------------------- procedure Delete_Object( Object_ID : in Integer; Object_Version : in Integer := Highest_Version ); --------------------------------------------------------------------------- -- Description: -- Preconditions: -- Postconditions: -- Exceptions: -- Notes: --------------------------------------------------------------------------- function Rootname( Name : in String ) return Integer; procedure Rootname( Name : in String; Object_ID : in Integer ); --------------------------------------------------------------------------- -- Description: -- Preconditions: -- Postconditions: -- Exceptions: -- Notes: --------------------------------------------------------------------------- procedure Relate( Source_ID : in Integer; Target_ID : in Integer; Rel_Name : in String ); procedure Unrelate( Source_ID : in Integer; Target_ID : in Integer; Rel_Name : in String ); procedure Unrelate( Source_ID : in Integer; Rel_Name : in String ); type OID_Array_Type is array( Natural range <> ) of Integer; procedure Get_Related( Object_ID : in Integer; Rel_Name : in String; Objects : in out OID_Array_Type; Length : out Integer ); procedure Get_References( Object_ID : in Integer; Rel_Name : in String; Objects : in out OID_Array_Type; Length : out Integer ); procedure Connect; end Objects; gnade-1.6.2.orig/contrib/objects/objects.gpq0000644000175000017500000004234010554746251020644 0ustar lbrentalbrenta-- ------------------------------------------------------------------------- -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/objects/objects.gpq,v $ -- Description : Interface to the RDBMS -- -- Author : Michael Erdmann -- -- Created On : 30-April-2005 -- -- Last Modified By: $Author: merdmann $ -- -- Last Modified On: $Date: 2007/01/21 20:27:21 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2007 Michael Erdmann -- -- -- -- GNADE is copyrighted by the persons and institutions enumerated in the -- -- AUTHORS file. This file is located in the root directory of the -- -- GNADE distribution. -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNADE; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- GNADE Ada units, or you link GNADE Ada units or libraries with other -- -- files to produce an executable, these units or libraries do not by -- -- itself cause the resulting executable to be covered by the GNU -- -- General Public License. This exception does not however invalidate -- -- any other reasons why the executable file might be covered by the -- -- GNU Public License. -- -- -- -- ------------------------------------------------------------------------- -- with Ada.Text_IO; use Ada.Text_IO; with Ada.Unchecked_Conversion; with GNU.DB.SQLCLI; use GNU.DB.SQLCLI; with SQL_STANDARD; use SQL_STANDARD; with Util.Trace_Helper; package body Objects is Version : constant String := "$Id: objects.gpq,v 1.16 2007/01/21 20:27:21 merdmann Exp $"; package Tracer is new Util.Trace_Helper( Module => "Objects" ); use Tracer; EXEC SQL DECLARE DB01 DATABASE ; -- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- -- +++ TABLE DEFINITIONS +++ -- -- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- EXEC SQL DECLARE OBJECTS TABLE ( ID INT, VERSION INT, HASH VARBINARY(17), CLASS VARCHAR(60), DATA BLOB(10000) ); -- PRIMARY KEY ( HASH ), -- This table decribes the relation ship between a source -- object and the target object. The refname specifies the relation -- name which is normally identical with an attribute of an object EXEC SQL DECLARE RELATIONS TABLE ( SOURCE INT, TARGET INT, REFNAME VARCHAR(60) ) ; EXEC SQL DECLARE ROOTNAME TABLE ( NAME VARCHAR(200), ID INT ) ; -- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- -- +++ API CODE SECTION +++ -- -- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- ------------------- -- Insert_Object -- ------------------- procedure Insert_Object( Object_ID : in Integer; Object_Version : in out Integer; BLOB : in GNADE.BINARY; Hash_Value : in GNADE.BINARY; Class_Name : in String ) is -- ++++++++++++++++++++++++++++++++++++ EXEC SQL BEGIN DECLARE SECTION END-EXEC ID : INT ; VERSION : INT := INT(0); DATA : GNADE.VARBINARY( Blob_Size ); HASH : GNADE.VARBINARY( 16 ); CLASSNAME : GNADE.VARCHAR(60); EXEC SQL END DECLARE SECTION END-EXEC -- ++++++++++++++++++++++++++++++++++++ begin Enter("Insert(" & Integer'Image(Object_ID) & ", " & Integer'Image(Object_Version) & ",..," & Class_Name & ")" ); ID := INT( Object_ID ); To_VARBINARY( BLOB, DATA ); To_VARBINARY( Hash_Value, HASH ); To_VARCHAR( Class_Name, CLASSNAME ); if Object_Version = New_Version then -- insert a new version EXEC SQL AT DB01 SELECT MAX(VERSION) INTO :VERSION FROM OBJECTS WHERE ID = :ID ; VERSION := VERSION + 1; Object_Version := Integer( VERSION ); EXEC SQL AT DB01 WHENEVER SQLERROR RAISE Insert_Failed ; EXEC SQL AT DB01 INSERT INTO OBJECTS VALUES ( :ID, :VERSION, :HASH,:CLASSNAME, :DATA ); else -- update an existing version VERSION := INT( Object_Version ); EXEC SQL AT DB01 WHENEVER SQLERROR RAISE Insert_Failed ; EXEC SQL AT DB01 UPDATE OBJECTS SET DATA = :DATA , HASH = :HASH WHERE ID = :ID AND VERSION = :VERSION; end if; Leave("Insert(" & Integer'Image(Object_ID) & ", " & Integer'Image(Object_Version) & ",..," & Class_Name & ")" ); end Insert_Object; -------------------- -- Get_Object -- -------------------- procedure Get_Object( Object_ID : in Integer; Object_Version : in out Integer; BLOB : out GNADE.BINARY; Length : out Positive ) is -- ++++++++++++++++++++++++++++++++++++ EXEC SQL BEGIN DECLARE SECTION END-EXEC ID : INT := INT(Object_ID); VERSION : INT := INT(Object_Version); DATA : GNADE.VARBINARY( Blob_Size ); EXEC SQL END DECLARE SECTION END-EXEC -- ++++++++++++++++++++++++++++++++++++ begin Enter("Get_Object(" & Integer'Image(Object_ID) & ", " & Integer'Image(Object_Version) & ",..," & Positive'Image(Length) & ")" ); if Object_Version = Highest_Version then EXEC SQL AT DB01 SELECT MAX(VERSION) INTO :VERSION FROM OBJECTS WHERE ID = :ID ; Object_Version := Integer( VERSION ); elsif Object_Version = Lowest_Version then EXEC SQL AT DB01 SELECT MIN(VERSION) INTO :VERSION FROM OBJECTS WHERE ID = :ID; Object_Version := Integer( VERSION ); end if; EXEC SQL AT DB01 WHENEVER SQLERROR RAISE Object_Not_Existing ; EXEC SQL AT DB01 SELECT Data INTO :Data FROM OBJECTS WHERE ID = :ID AND Version = :VERSION ; if SQLCODE in SQL_STANDARD.NOT_FOUND then raise Object_Not_Existing; end if; To_Binary( Data, BLOB, Length ); Leave("Get_Object(" & Integer'Image(Object_ID) & ", " & Integer'Image(Object_Version) & ",..," & Positive'Image(Length) & ")" ); end Get_Object; ---------------- -- Get_Object -- ---------------- procedure Get_Object( Key : in GNADE.BINARY; Object_Version : in out Integer ; Object_ID : out Integer; BLOB : out GNADE.BINARY; Length : out Positive) is -- ++++++++++++++++++++++++++++++++++++ EXEC SQL BEGIN DECLARE SECTION END-EXEC HASH : GNADE.VARBINARY( Key_Size ); VERSION : INT := INT(Object_Version); ID : INT := 0; DATA : GNADE.VARBINARY( Blob_Size ); EXEC SQL END DECLARE SECTION END-EXEC -- ++++++++++++++++++++++++++++++++++++ begin Enter("Get_Object( ," & Integer'Image(Object_ID) & ", " & Integer'Image(Object_Version) & ",..," & Positive'Image(Length) & ")" ); To_VARBINARY( Key, HASH ); if Object_Version = Highest_Version then EXEC SQL AT DB01 SELECT MAX(VERSION) INTO :VERSION FROM OBJECTS WHERE HASH = :HASH ; Object_Version := Integer( VERSION ); elsif Object_Version = Lowest_Version then EXEC SQL AT DB01 SELECT MIN(VERSION) INTO :VERSION FROM OBJECTS WHERE HASH = :HASH; Object_Version := Integer( VERSION ); end if; EXEC SQL AT DB01 WHENEVER SQLERROR RAISE Object_Not_Existing ; EXEC SQL AT DB01 SELECT ID, Data INTO :ID, :Data FROM OBJECTS WHERE HASH = :HASH AND Version = :VERSION ; if SQLCODE in SQL_STANDARD.NOT_FOUND then raise Object_Not_Existing; end if; To_Binary( Data, BLOB, Length ); Object_ID := Integer(ID); Leave("Get_Object( ," & Integer'Image(Object_ID) & ", " & Integer'Image(Object_Version) & ",..," & Positive'Image(Length) & ")" ); end Get_Object; ------------------- -- Delete_Object -- ------------------- procedure Delete_Object( Object_ID : in Integer; Object_Version : in Integer := Highest_Version ) is -- ++++++++++++++++++++++++++++++++++++ EXEC SQL BEGIN DECLARE SECTION END-EXEC ID : INT := INT(Object_ID); VERSION : INT := INT(Object_Version); EXEC SQL END DECLARE SECTION END-EXEC -- +++++++++++++++++++++++++++++++++++ begin EXEC SQL AT DB01 WHENEVER SQLERROR RAISE Object_Not_Existing ; if Object_Version /= All_Versions then if Object_Version = Highest_Version then EXEC SQL AT DB01 SELECT MAX(VERSION) INTO :VERSION FROM OBJECTS WHERE ID = :ID ; elsif Object_Version = Lowest_Version then EXEC SQL AT DB01 SELECT MIN(VERSION) INTO :VERSION FROM OBJECTS WHERE ID = :ID ; end if; EXEC SQL at DB01 DELETE FROM OBJECTS WHERE ID = :ID AND VERSION = :Version ; else EXEC SQL at DB01 DELETE FROM OBJECTS WHERE ID = :ID ; end if; end Delete_Object; ------------ -- Relate -- ------------ procedure Relate( Source_ID : in Integer; Target_ID : in Integer; Rel_Name : in String ) is -- ++++++++++++++++++++++++++++++++++++ EXEC SQL BEGIN DECLARE SECTION END-EXEC SOURCE : INT := INT( Source_ID ); TARGET : INT := int( Target_ID ); TMP : INT ; REFNAME : GNADE.VARCHAR(60); EXEC SQL END DECLARE SECTION END-EXEC -- +++++++++++++++++++++++++++++++++++ begin To_VARCHAR( Rel_Name, REFNAME ); EXEC SQL AT DB01 SELECT TARGET INTO :TMP FROM RELATIONS WHERE REFNAME = :REFNAME AND SOURCE = :SOURCE AND TARGET = :TARGET ; if SQLCODE in SQL_STANDARD.NOT_FOUND then TARGET := INT( Target_ID ); SOURCE := INT( Source_ID ); EXEC SQL AT DB01 INSERT INTO RELATIONS VALUES ( :SOURCE, :TARGET, :REFNAME ); else raise Relation_Exists; end if; end Relate; -------------- -- Unrelate -- -------------- procedure Unrelate( Source_ID : in Integer; Target_ID : in Integer; Rel_Name : in String ) is -- ++++++++++++++++++++++++++++++++++++ EXEC SQL BEGIN DECLARE SECTION END-EXEC SOURCE : INT := INT( Source_ID ); TARGET : INT := INT( Target_ID ); REFNAME : GNADE.VARCHAR(60); EXEC SQL END DECLARE SECTION END-EXEC -- +++++++++++++++++++++++++++++++++++ begin To_VARCHAR( Rel_Name, REFNAME ); EXEC SQL AT DB01 DELETE FROM RELATIONS WHERE SOURCE = :SOURCE AND TARGET = :TARGET AND REFNAME = :REFNAME; end Unrelate; -------------- -- Unrelate -- -------------- procedure Unrelate( Source_ID : in Integer; Rel_Name : in String ) is -- ++++++++++++++++++++++++++++++++++++ EXEC SQL BEGIN DECLARE SECTION END-EXEC SOURCE : INT := INT( Source_ID ); REFNAME : GNADE.VARCHAR(60); EXEC SQL END DECLARE SECTION END-EXEC -- +++++++++++++++++++++++++++++++++++ begin To_VARCHAR( Rel_Name, REFNAME ); EXEC SQL AT DB01 DELETE FROM RELATIONS WHERE SOURCE = :SOURCE AND REFNAME = :REFNAME; end Unrelate; ----------------- -- Get_Related -- ----------------- procedure Get_Related( Object_ID : in Integer; Rel_Name : in String; Objects : in out OID_Array_Type; Length : out Integer ) is -- ++++++++++++++++++++++++++++++++++++ EXEC SQL BEGIN DECLARE SECTION END-EXEC TARGET : INT := 0; SOURCE : INT := INT( Object_ID ); REFNAME : GNADE.VARCHAR(60); EXEC SQL END DECLARE SECTION END-EXEC EXEC SQL INCLUDE SQLCA ; -- +++++++++++++++++++++++++++++++++++ J : Integer := Objects'First; begin To_VARCHAR( Rel_Name, REFNAME ); EXEC SQL AT DB01 DECLARE obj_cursor LOCAL CURSOR FOR SELECT TARGET FROM RELATIONS WHERE SOURCE = :SOURCE AND REFNAME = :REFNAME; EXEC SQL AT DB01 OPEN obj_cursor; Length := 0; loop EXEC SQL AT DB01 FETCH FROM obj_cursor INTO :TARGET ; exit when SQLCODE in SQL_STANDARD.NOT_FOUND; Objects(J) := Integer( TARGET ); Length := Length + 1; J := J + 1; if not ( J in Objects'Range ) then EXEC SQL AT DB01 CLOSE obj_cursor; raise To_Many_Objects; end if; end loop; EXEC SQL AT DB01 CLOSE obj_cursor; end Get_Related; ----------------- -- Get_Related -- ----------------- procedure Get_References( Object_ID : in Integer; Rel_Name : in String; Objects : in out OID_Array_Type; Length : out Integer ) is -- ++++++++++++++++++++++++++++++++++++ EXEC SQL BEGIN DECLARE SECTION END-EXEC TARGET : INT := INT( Object_ID ); SOURCE : INT := 0; REFNAME : GNADE.VARCHAR(60); EXEC SQL END DECLARE SECTION END-EXEC EXEC SQL INCLUDE SQLCA ; -- +++++++++++++++++++++++++++++++++++ J : Integer := Objects'First; begin To_VARCHAR( Rel_Name, REFNAME ); EXEC SQL AT DB01 DECLARE obj_cursor LOCAL CURSOR FOR SELECT SOURCE FROM RELATIONS WHERE TARGET = :TARGET AND REFNAME = :REFNAME; EXEC SQL AT DB01 OPEN obj_cursor; Length := 0; loop EXEC SQL AT DB01 FETCH FROM obj_cursor INTO :SOURCE ; exit when SQLCODE in SQL_STANDARD.NOT_FOUND; Objects(J) := Integer( SOURCE ); Length := Length + 1; J := J + 1; if not ( J in Objects'Range ) then EXEC SQL AT DB01 CLOSE obj_cursor; raise To_Many_Objects; end if; end loop; EXEC SQL AT DB01 CLOSE obj_cursor; end Get_References; -------------- -- Rootname -- -------------- procedure Rootname( Name : in String; Object_ID : in Integer ) is -- ++++++++++++++++++++++++++++++++++++ EXEC SQL BEGIN DECLARE SECTION END-EXEC ID : INT := INT( Object_ID ); TMP : GNADE.VARCHAR(100); EXEC SQL END DECLARE SECTION END-EXEC -- +++++++++++++++++++++++++++++++++++ begin To_VARCHAR( NAME, TMP ); EXEC SQL AT DB01 INSERT INTO ROOTNAME VALUES ( :TMP, :ID ); end Rootname; -------------- -- Rootname -- -------------- function Rootname( Name : in String ) return Integer is -- ++++++++++++++++++++++++++++++++++++ EXEC SQL BEGIN DECLARE SECTION END-EXEC ID : INT := INT(0); TMP : GNADE.VARCHAR(100); EXEC SQL END DECLARE SECTION END-EXEC -- +++++++++++++++++++++++++++++++++++ begin To_VARCHAR( Name, TMP ); EXEC SQL AT DB01 SELECT ID INTO :ID FROM ROOTNAME WHERE NAME = :TMP; if SQLCODE in SQL_STANDARD.NOT_FOUND then ID := INT(0); end if; return Integer(ID); end Rootname; ------------- -- Connect -- ------------- procedure Connect is begin -- connect to gnade data base EXEC SQL CONNECT $DBUSER IDENTIFIED BY $DBPASSWD BY DB01 TO $DBSOURCE ; end Connect; end Objects; gnade-1.6.2.orig/contrib/objects/objects.gpr0000644000175000017500000000066710544306626020650 0ustar lbrentalbrentaproject Objects is for Languages use ("Ada", "Makefile"); for Main use ("demo.adb"); package Naming is for Specification_Suffix ("makefile") use "Makefile"; end Naming; package Ide is for Vcs_Kind use "CVS"; end Ide; package Builder is for Default_Switches ("ada") use ("-g"); end Builder; package Compiler is for Default_Switches ("ada") use ("-g"); end Compiler; end Objects; gnade-1.6.2.orig/contrib/objects/persistent.adb0000644000175000017500000002266410561121550021344 0ustar lbrentalbrenta-- ------------------------------------------------------------------------- -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/objects/persistent.adb,v $ -- Description : Base class for all persistent objects -- -- Author : Michael Erdmann -- -- Created On : 30-April-2005 -- -- Last Modified By: $Author: merdmann $ -- -- Last Modified On: $Date: 2007/02/03 14:59:52 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2006-2007 Michael Erdmann -- -- -- -- GNADE is copyrighted by the persons and institutions enumerated in the -- -- AUTHORS file. This file is located in the root directory of the -- -- GNADE distribution. -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNADE; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- GNADE Ada units, or you link GNADE Ada units or libraries with other -- -- files to produce an executable, these units or libraries do not by -- -- itself cause the resulting executable to be covered by the GNU -- -- General Public License. This exception does not however invalidate -- -- any other reasons why the executable file might be covered by the -- -- GNU Public License. -- -- -- -- ------------------------------------------------------------------------- -- with Ada.Streams; use Ada.Streams; with Ada.Streams.Stream_IO; use Ada.Streams.Stream_IO; with Ada.Text_IO; use Ada.Text_IO; with Ada.Calendar; use Ada.Calendar; with Ada.Tags; use Ada.Tags; with Ada.Unchecked_Conversion; use Ada; with GNU.DB.SQLCLI; use GNU.DB.SQLCLI; with SQL_Standard; use SQL_Standard; with Util.Trace_Helper; use Util; with Cache; use Cache; with Objects; use Objects; with BLOB_Stream; use BLOB_Stream; with MD5; use MD5; package body Persistent is Version : constant String := "$Id: persistent.adb,v 1.16 2007/02/03 14:59:52 merdmann Exp $"; -- Trace facitlity package package Tracer is new Util.Trace_Helper( Module => "Persistent"); use Tracer; ---------------- -- Initialize -- ---------------- procedure Initialize( This : in out Object ) is begin Enter("Initialize"); Leave("Initialize"); end Initialize; -------------- -- Finalize -- -------------- procedure Finalize( This : in out Object ) is begin Enter("Finalize( " & "ID=" & Integer'Image(OID(This)) & ", " & "Version=" & Integer'Image(This.Version) & ")" ); Cache.Invalidate( OID(This), This.Version ); -- Finalize( Persistent.Object(This) ); Leave("Finalize"); end Finalize; ----------------- -- Get_Object -- ----------------- procedure Get_Object( This : in out Object'Class; Create : in Boolean := False; Version : in Integer := Highest_Version; ID : Integer := 0) is -- open the persitent object for reading S : Stream_Access := BLOB_Stream.Stream( Blob_Size ); BLOB : BLOB_Access := null; Length : Integer := 0; Vers : Integer := Version; begin Enter("Get_Object(" & Integer'Image(OID(This)) & ", " & Boolean'Image(Create) & ", " & Integer'Image(Version) & ", " & Integer'Image(ID) & ")" ); if ID /= 0 then OID( This, ID ); end if; begin Cache.Get_Object( OID(This), Vers, BLOB, Length ); exception when Object_Not_Existing => if Create then Put_Object( This, Create => True ); else raise ; end if; end ; This.Version := Vers; Set_Contents( S, BLOB(1..Length) ); This := Object'Class'Input(S); Self( This ); Destroy(S); Leave("Get_Object"); end Get_Object; ---------------- -- Get_Object -- ---------------- procedure Get_Object( This : in out Object'Class; Key : Key_Type.Object'Class; Create : in Boolean := False; Version : in Integer := Highest_Version ) is -- open the persitent object for reading S : Stream_Access := BLOB_Stream.Stream( Blob_Size ); BLOB : BLOB_Access := null; Length : Integer := 0; Vers : Integer := Version; begin Enter("Get_Object( , " & Boolean'Image(Create) & ", " & Integer'Image(Version) & ")" ); begin Cache.Get_Object( Hash(Key), Vers, BLOB, Length ); exception when Object_Not_Existing => if Create then Put_Object( This, Key, Create => True ); else raise ; end if; end ; This.Version := Vers; Set_Contents( S, BLOB(1..Length) ); This := Object'Class'Input(S); Self( This ); Destroy(S); Leave("Get_Object( ," & "Version = " & Integer'Image(Version) & "," & "Id =" & Integer'Image(OID(This)) & ")" ); end Get_Object; --------------- -- To_Binary -- --------------- function To_BINARY( F : in MD5.Fingerprint ) return GNADE.BINARY is function To_SQLCHAR is new Ada.Unchecked_Conversion (Target => SQL.SQLCHAR, Source => Stream_Element ); Result : GNADE.BINARY( 1..16 ); begin for i in F'Range loop Result(Integer(i)) := To_SQLCHAR( F(i) ); end loop; return Result; end To_BINARY; ---------------- -- Put_Object -- ---------------- procedure Put_Object( This : in out Object'Class; Create : in Boolean := True ) is -- store an object and create a new version if requested. Vers : Integer := New_Version; S : Stream_Access := BLOB_Stream.Stream( Blob_Size ); BLOB : GNADE.BINARY( 1..Blob_Size ); Length : Integer := 0; begin Enter("Put_Object( " & "This.ID =" & Integer'Image(OID(This)) & "," & "Create =" & Boolean'Image(Create) & ")" ); if not Create then Vers := This.Version; end if; Object'Class'Output(S, This ); Get_Contents( S, BLOB, Length ); Cache.Put_Object( OID(This), Vers, Hash(This), BLOB(1..Length), External_Tag(This'Tag) ); This.Version := Vers; Destroy(S); Leave("Put_Object( This.Version =" & Integer'Image(This.Version) & ")" ); end Put_Object; ---------------- -- Put_Object -- ---------------- procedure Put_Object( This : in out Object'Class; Key : in Key_Type.Object'Class; Create : in Boolean := True ) is -- create an object with key Vers : Integer := New_Version; S : Stream_Access := BLOB_Stream.Stream( Blob_Size ); BLOB : GNADE.BINARY( 1..Blob_Size ); Length : Integer := 0; begin Enter("Put_Object( " & "This.ID =" & Integer'Image(OID(This)) & ", , " & "Create =" & Boolean'Image(Create) & ")" ); if not Create then Vers := This.Version; end if; Object'Class'Output(S, This ); Get_Contents( S, BLOB, Length ); Cache.Put_Object( OID(This), Vers, Key_Type.Hash(Key), BLOB(1..Length), External_Tag( This'Tag ) ); This.Version := Vers; Destroy(S); Leave("Put_Object( This.Version =" & Integer'Image(This.Version) & ")" ); end Put_Object; ------------ -- Relate -- ------------ procedure Relate( This : in Object'Class; Other : in Object'Class; Relation : in String ) is begin Relate( OID(This), OID(Other), Relation ); end Relate; ---------- -- Hash -- ---------- function Hash( This : in Object'Class ) return GNADE.BINARY is S : Stream_Access := BLOB_Stream.Stream( Blob_Size ); begin Object'Class'Output(S, This ); return To_Binary(Hash(S)); end Hash; end Persistent; gnade-1.6.2.orig/contrib/objects/persistent.ads0000644000175000017500000001203410561121550021353 0ustar lbrentalbrenta--- ------------------------------------------------------------------------ -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/Makefile -- Description : Base class for all persistent objects -- -- Author : Michael Erdmann -- -- Created On : 30-April-2005 -- -- Last Modified By: $Author: merdmann $ -- -- Last Modified On: $Date: 2007/02/03 14:59:52 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2005 Michael Erdmann -- -- -- -- GNADE is copyrighted by the persons and institutions enumerated in the -- -- AUTHORS file. This file is located in the root directory of the -- -- GNADE distribution. -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNADE; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- GNADE Ada units, or you link GNADE Ada units or libraries with other -- -- files to produce an executable, these units or libraries do not by -- -- itself cause the resulting executable to be covered by the GNU -- -- General Public License. This exception does not however invalidate -- -- any other reasons why the executable file might be covered by the -- -- GNU Public License. -- -- -- -- ------------------------------------------------------------------------- -- with Ada.Finalization; use Ada.Finalization; use Ada; with Objects; use Objects; with SQL_Standard; use SQL_Standard; with Key_Type; use Key_Type; with TAM.Persistent; use TAM.Persistent; package Persistent is type Object_Type is ( Cached, Non_Cached ); type Object is new TAM.Persistent.Object with private; type Handle is access all Object'Class; Null_Handle : constant Handle := null; --------------------------------------------------------------------------- -- Description: -- Get an object from the object data base -- Preconditions: -- P.1 - Database is connected -- Postconditions: -- Exceptions: -- Notes: --------------------------------------------------------------------------- procedure Get_Object( This : in out Object'Class; Create : in Boolean := False; Version : in Integer := Highest_Version; ID : Integer := 0); procedure Get_Object( This : in out Object'Class; Key : Key_Type.Object'Class; Create : in Boolean := False; Version : in Integer := Highest_Version ); --------------------------------------------------------------------------- -- Description: -- Store an object in the underlying data base -- Preconditions: -- P.1 - Database is connected -- Postconditions: -- Exceptions: -- Notes: --------------------------------------------------------------------------- procedure Put_Object( This : in out Object'Class; Create : in Boolean := True ); procedure Put_Object( This : in out Object'Class; Key : in Key_Type.Object'Class; Create : in Boolean := True ); procedure Relate( This : in Object'Class; Other : in Object'Class; Relation : in String ); function Hash( This : in Object'Class ) return GNADE.BINARY; -- ======================================================================= -- private type Object is new TAM.Persistent.Object with record Version : Integer := 0; Mode : Object_Type := Cached; end record; procedure Initialize( This : in out Object ); procedure Finalize( This : in out Object ); end Persistent; gnade-1.6.2.orig/contrib/objects/person.adb0000644000175000017500000001315710561121550020447 0ustar lbrentalbrenta-- ------------------------------------------------------------------------- -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/objects/person.adb,v $ -- Description : Handle the Person related information -- -- Author : Michael Erdmann -- -- Created On : 30-Dec-2006 -- -- Last Modified By: $Author: merdmann $ -- -- Last Modified On: $Date: 2007/02/03 14:59:52 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2006-2007 Michael Erdmann -- -- -- -- GNADE is copyrighted by the persons and institutions enumerated in the -- -- AUTHORS file. This file is located in the root directory of the -- -- GNADE distribution. -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNADE; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- GNADE Ada units, or you link GNADE Ada units or libraries with other -- -- files to produce an executable, these units or libraries do not by -- -- itself cause the resulting executable to be covered by the GNU -- -- General Public License. This exception does not however invalidate -- -- any other reasons why the executable file might be covered by the -- -- GNU Public License. -- -- -- -- ------------------------------------------------------------------------- -- with Ada.Text_IO; use Ada.Text_IO; with TAM.Persistent; use TAM.Persistent; with Objects; use Objects; with Account; use Account; package body Person is ------------ -- Create -- ------------ procedure Create( This : in out Object; Firstname : in Unbounded_String ; Lastname : in Unbounded_String ) is begin This.Firstname := Firstname; This.Lastname := Lastname; Put_Object( This, Make_Key( This ) ); -- Account.Create( This, "Private Account" ); -- Account.Create( This, "Business Account" ); end ; -------------- -- Make_Key -- -------------- function Make_Key( This : in Object'Class ) return Key_Object is Result : Key_Object; begin Result.Name := This.Firstname & This.Lastname ; return Result; end Make_Key; --------------- -- Object_ID -- --------------- function Object_ID( Firstname : in Unbounded_String ; Lastname : in Unbounded_String ) return Integer is begin return Rootname( To_String(Firstname) & To_String(Lastname) ); end Object_ID; ----------- -- Query -- ----------- procedure Query( This : in out Object; Firstname : in Unbounded_String ; Lastname : in Unbounded_String ) is begin This.Firstname := Firstname; This.Lastname := Lastname ; Get_Object( This, Make_Key( This )); exception when Objects.Object_Not_Existing => raise Person.Not_Existing; end Query; ------------ -- Lookup -- ------------ function Lookup( Firstname : in Unbounded_String ; Lastname : in Unbounded_String ) return Person.Object is This : Person.Object; begin This.Firstname := Firstname; This.Lastname := Lastname ; Get_Object( This, Make_Key( This )); return This; exception when Objects.Object_Not_Existing => raise Person.Not_Existing; end Lookup; ------------- -- Display -- ------------- procedure Display( This : in out Object ) is procedure Display_Accounts is Account_ID : OID_Array_Type( 1..100 ) := (others=>0); Length : Integer := 0; begin Get_Related( OID( This ), "Has_Account" , Account_ID, Length ); for i in 1..Length loop declare A : Account.Object; begin OID( A, Account_ID(i)); Get_Object(A); Display( A ); end ; end loop; Put_Line("" ); end Display_Accounts; begin Get_Object( This ); Put_Line( "" ); Put_Line( "First Name : " & To_String(This.Firstname) ); Put_Line( "Last Name : " & To_String( This.Lastname)); Put_Line( ""); Display_Accounts; end; end Person; gnade-1.6.2.orig/contrib/objects/person.ads0000644000175000017500000000747710554624342020511 0ustar lbrentalbrenta-- ------------------------------------------------------------------------- -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/objects/person.ads,v $ -- Description : Handle the Person related information -- -- Author : Michael Erdmann -- -- Created On : 30-Dec-2006 -- -- Last Modified By: $Author: merdmann $ -- -- Last Modified On: $Date: 2007/01/21 08:48:34 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2006-2007 Michael Erdmann -- -- -- -- GNADE is copyrighted by the persons and institutions enumerated in the -- -- AUTHORS file. This file is located in the root directory of the -- -- GNADE distribution. -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNADE; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- GNADE Ada units, or you link GNADE Ada units or libraries with other -- -- files to produce an executable, these units or libraries do not by -- -- itself cause the resulting executable to be covered by the GNU -- -- General Public License. This exception does not however invalidate -- -- any other reasons why the executable file might be covered by the -- -- GNU Public License. -- -- -- -- ------------------------------------------------------------------------- -- with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Persistent; use Persistent; with Key_Type; use Key_Type; package Person is Not_Existing : exception; type Object is new Persistent.Object with record Firstname : Unbounded_String := Null_Unbounded_String; Lastname : Unbounded_String := Null_unbounded_String ; end record; procedure Create( This : in out Object; Firstname : in Unbounded_String ; Lastname : in Unbounded_String ); procedure Query( This : in out Object; Firstname : in Unbounded_String ; Lastname : in Unbounded_String ); function Lookup( Firstname : in Unbounded_String ; Lastname : in Unbounded_String ) return Person.Object; procedure Display( This : in out Object ); type Key_Object is new Key_Type.Object with record Name : Unbounded_String; end record; function Make_Key( This : in Object'Class ) return Key_Object; end Person; gnade-1.6.2.orig/contrib/objects/root.adb0000644000175000017500000001072510561121550020122 0ustar lbrentalbrenta-- ------------------------------------------------------------------------- -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/objects/root.adb,v $ -- Description : Root object of the database -- -- Author : Michael Erdmann -- -- Created On : 30-April-2005 -- -- Last Modified By: $Author: merdmann $ -- -- Last Modified On: $Date: 2007/02/03 14:59:52 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2006 Michael Erdmann -- -- -- -- GNADE is copyrighted by the persons and institutions enumerated in the -- -- AUTHORS file. This file is located in the root directory of the -- -- SDB distribution. -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNADE; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- GNADE Ada units, or you link GNADE Ada units or libraries with other -- -- files to produce an executable, these units or libraries do not by -- -- itself cause the resulting executable to be covered by the GNU -- -- General Public License. This exception does not however invalidate -- -- any other reasons why the executable file might be covered by the -- -- GNU Public License. -- -- -- -- ------------------------------------------------------------------------- -- with Ada.Text_IO; use Ada.Text_IO; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with TAM.Persistent; use TAM.Persistent; with Objects; use Objects; with String_Table; use String_Table; package body Root is Version : constant String := "$Id: root.adb,v 1.4 2007/02/03 14:59:52 merdmann Exp $"; -------------- -- Get_Root -- -------------- procedure Get_Root( This : in out Object) is ID : Integer := Rootname("MyDB"); begin if ID = 0 then declare GT : String_Table.Object( Grouptable_Size ); ACCT : String_Table.Object( AccTypeTable_Size ); begin -- setup the account default types Put_Object( ACCT ); This.Account_Types := OID( ACCT ); Add( ACCT, "Business"); Add( ACCT, "Private"); -- setup the default group types Put_Object( GT ); This.Group_Types := OID( GT ); Add( GT, "Family"); Add( GT, "Friends"); -- save root object Put_Object( This ); Rootname( "MyDB", OID(This) ); end ; else Get_OBject( This, ID => ID ); end if; Put_Line("Group Types: " & Integer'Image( This.Group_Types ) ); Put_Line("Acct Types: " & Integer'Image( This.Account_Types ) ); end Get_Root; ---------------- -- Initialize -- ---------------- procedure Initialize is begin Connect; Get_Root( Root_Object ); end Initialize; -------------- -- Finalize -- -------------- procedure Finalize is begin null; end Finalize; end Root; gnade-1.6.2.orig/contrib/objects/root.ads0000644000175000017500000000637610546551170020162 0ustar lbrentalbrenta-- ------------------------------------------------------------------------- -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/objects/root.ads,v $ -- Description : Root object of the database -- -- Author : Michael Erdmann -- -- Created On : 30-April-2005 -- -- Last Modified By: $Author: merdmann $ -- -- Last Modified On: $Date: 2007/01/02 21:45:28 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2006 Michael Erdmann -- -- -- -- GNADE is copyrighted by the persons and institutions enumerated in the -- -- AUTHORS file. This file is located in the root directory of the -- -- SDB distribution. -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNADE; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- GNADE Ada units, or you link GNADE Ada units or libraries with other -- -- files to produce an executable, these units or libraries do not by -- -- itself cause the resulting executable to be covered by the GNU -- -- General Public License. This exception does not however invalidate -- -- any other reasons why the executable file might be covered by the -- -- GNU Public License. -- -- -- -- ------------------------------------------------------------------------- -- with Persistent; use Persistent; package Root is type Object is new Persistent.Object with record Transaction_Number : Integer := 0; Account_Types : Integer := 0; Group_Types : Integer := 0; end record; Grouptable_Size : constant Natural := 100; AccTypeTable_Size : constant Natural := 100; Root_Object : Object; procedure Initialize; procedure Finalize; end Root; gnade-1.6.2.orig/contrib/objects/string_table.adb0000644000175000017500000001146710547376664021646 0ustar lbrentalbrenta-- ------------------------------------------------------------------------- -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/objects/string_table.adb,v $ -- Description : String Table -- -- Author : Michael Erdmann -- -- Created On : 30-April-2005 -- -- Last Modified By: $Author: merdmann $ -- -- Last Modified On: $Date: 2007/01/05 07:26:44 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2006 Michael Erdmann -- -- -- -- GNADE is copyrighted by the persons and institutions enumerated in the -- -- AUTHORS file. This file is located in the root directory of the -- -- SDB distribution. -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNADE; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- GNADE Ada units, or you link GNADE Ada units or libraries with other -- -- files to produce an executable, these units or libraries do not by -- -- itself cause the resulting executable to be covered by the GNU -- -- General Public License. This exception does not however invalidate -- -- any other reasons why the executable file might be covered by the -- -- GNU Public License. -- -- -- -- ------------------------------------------------------------------------- -- with Objects; use Objects; package body String_Table is Version : constant String := "$Id: string_table.adb,v 1.3 2007/01/05 07:26:44 merdmann Exp $"; --------- -- Add -- --------- procedure Add( This : in out Object; Value : in Unbounded_String ) is Done : Boolean := False; begin Get_Object(This); for i in This.Strings'Range loop if This.Strings(i) = Null_Unbounded_String then This.Strings(i) := Value; Done := True; exit; end if; end loop; if not Done then raise Table_Full; end if; Put_Object(This); end Add; --------- -- Add -- --------- procedure Add( This : in out Object; Value : in String ) is begin Add( This, To_Unbounded_String(Value)); end Add; --------- -- Get -- --------- procedure Get( This : in out Object; Pos : Natural; Result : out Unbounded_String ) is begin if Pos in This.Strings'Range then Get_Object( This ); Result := This.Strings(Pos); else raise Out_Of_Range; end if; end Get; -------------- -- Contains -- -------------- function Contains( This : in Object; Value : in Unbounded_String ) return Boolean is Result : Boolean := False; begin for i in This.Strings'Range loop if This.Strings(i) /= Null_Unbounded_String and then This.Strings(i) = Value then Result := True; exit; end if; end loop; return Result; end Contains; ------------ -- Delete -- ------------ procedure Delete( This : in out Object; Pos : in Natural ) is begin if Pos in This.Strings'Range then Get_Object(This); This.Strings(Pos) := Null_Unbounded_String; Put_Object(This); else raise Out_Of_Range; end if; end Delete; end String_Table; gnade-1.6.2.orig/contrib/objects/string_table.ads0000644000175000017500000000160310547376664021656 0ustar lbrentalbrentawith Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Persistent; use Persistent; package String_Table is Out_Of_Range : exception; Table_Full : exception; type String_Array_Type is array( Natural range <> ) of Unbounded_String; type Object( Size : Natural ) is new Persistent.Object with record Strings : String_Array_Type(1..Size) := (others => Null_Unbounded_String); end record; procedure Add( This : in out Object; Value : in Unbounded_String ); procedure Add( This : in out Object; Value : in String ); procedure Get( This : in out Object; Pos : Natural; Result : out Unbounded_String); function Contains( This : in Object; Value : in Unbounded_String ) return Boolean; procedure Delete( This : in out Object; Pos : in Natural ); end String_Table; gnade-1.6.2.orig/contrib/objects/apps/0000755000175000017500000000000011040716254017431 5ustar lbrentalbrentagnade-1.6.2.orig/contrib/objects/apps/Makefile0000644000175000017500000001010110552451075021066 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/contrib/objects/apps/Makefile,v $ ## Description : Makefile for the odb package -- ## Author : Michael Erdmann -- ## Created On : 1-May-2002 -- ## Last Modified By: $Author: merdmann $ -- ## Last Modified On: $Date: 2007/01/14 15:54:37 $ -- ## Version : $Revision: 1.4 $ -- ## Status : $State: Exp $ -- ## -- ## Copyright (C) 2006 Michael Erdmann -- ## -- ## ODB is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## ODB distribution. -- ## -- ## ODB is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. ABE is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## ODB Ada units, or you link ABE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## Contact -- ## ======= -- ## Error reports shall be handled via http://gnade.sourceforge.net -- ## -- ## Author contact: -- ## purl:/net/michael.erdmann -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## ## THis is the top level makefile for the ODB package. It makes explicit usage ## of the GNAT project file facility. ## ## all global targets all :: demo insert billing dist:: all install:: insert ./insert test.inp demo: demo.adb person_browser.ads person_browser.adb gnatmake -x -P./demo.gpr insert: insert.adb gnatmake -x -P./insert.gpr billing: billing.adb billing_run.ads billing_run.adb gnatmake -x -P./billing ## clean out local compilation results clean :: $(RM) *~* ## Cleanup completly distclean :: clean gnatclean -P./demo.gpr gnatclean -P./insert.gpr gnatclean -P./billing.gpr $(RM) *.ali *.o *.sql data.* gnade-1.6.2.orig/contrib/objects/apps/demo.adb0000644000175000017500000000612310637241242021030 0ustar lbrentalbrenta-- ------------------------------------------------------------------------- -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/objects/apps/demo.adb,v $ -- Description : Main Driver of the Demo -- -- Author : Michael Erdmann -- -- Created On : 30-Dec-2006 -- -- Last Modified By: $Author: merdmann $ -- -- Last Modified On: $Date: 2007/06/23 15:56:18 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2006-2007 Michael Erdmann -- -- -- -- GNADE is copyrighted by the persons and institutions enumerated in the -- -- AUTHORS file. This file is located in the root directory of the -- -- GNADE distribution. -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNADE; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- GNADE Ada units, or you link GNADE Ada units or libraries with other -- -- files to produce an executable, these units or libraries do not by -- -- itself cause the resulting executable to be covered by the GNU -- -- General Public License. This exception does not however invalidate -- -- any other reasons why the executable file might be covered by the -- -- GNU Public License. -- -- -- -- ------------------------------------------------------------------------- -- with Application.Base; use Application.Base; with Demo_Application; use Demo_Application; procedure Demo is Version : constant String := "$Id: demo.adb,v 1.6 2007/06/23 15:56:18 merdmann Exp $"; App : Demo_Application.Object; begin Run(App); end Demo; gnade-1.6.2.orig/contrib/objects/apps/demo.gpr0000644000175000017500000000072610637241242021075 0ustar lbrentalbrentawith "../../../../tools/application/application.gpr"; with "../libobjects.gpr"; project Demo is for Languages use ("Ada", "Makefile"); for Main use ("demo.adb"); for Source_Files use ("demo.adb", "person_browser.adb", "person_browser.ads", "demo_application.adb", "demo_application.ads"); package Ide is for Vcs_Kind use "CVS"; end Ide; package Naming is for Specification_Suffix ("makefile") use "Makefile"; end Naming; end Demo; gnade-1.6.2.orig/contrib/objects/apps/insert.adb0000644000175000017500000001400010552367320021403 0ustar lbrentalbrenta-- ------------------------------------------------------------------------- -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/objects/apps/insert.adb,v $ -- Description : Main Driver of the Demo -- -- Author : Michael Erdmann -- -- Created On : 30-Dec-2006 -- -- Last Modified By: $Author: merdmann $ -- -- Last Modified On: $Date: 2007/01/14 08:50:24 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2006-2007 Michael Erdmann -- -- -- -- GNADE is copyrighted by the persons and institutions enumerated in the -- -- AUTHORS file. This file is located in the root directory of the -- -- GNADE distribution. -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNADE; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- GNADE Ada units, or you link GNADE Ada units or libraries with other -- -- files to produce an executable, these units or libraries do not by -- -- itself cause the resulting executable to be covered by the GNU -- -- General Public License. This exception does not however invalidate -- -- any other reasons why the executable file might be covered by the -- -- GNU Public License. -- -- -- -- ------------------------------------------------------------------------- -- with Ada.Text_IO; use Ada.Text_IO; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Exceptions; use Ada.Exceptions; with Ada.Command_Line; use Ada.Command_Line; with Persistent; use Persistent; with Person; use Person; with Account; use Account; with Group; use Group; with Account_Transaction; use Account_Transaction; with Root; use Root; with String_Table; use String_Table; with Objects; use Objects; procedure Insert is Version : constant String := "$Id: insert.adb,v 1.4 2007/01/14 08:50:24 merdmann Exp $"; Input_Record: String( 1..1024 ); Next_Pos : Natural := Input_Record'First; Length : Natural := 0; End_Of_Line : exception; --------------- -- Get_Token -- --------------- function Get_Token return String is Result : String( 1..1024 ); J : Natural := Result'First; begin if Next_Pos > Length then raise End_of_Line; end if; while Next_Pos in Input_Record'First..Length loop Result(J) := Input_Record(Next_Pos); Next_Pos := Next_Pos + 1; exit when Next_Pos > Length or Input_Record(Next_Pos) = ';'; J := J + 1; end loop; -- skip the ';' if Next_Pos in Input_Record'First..Length then Next_Pos := Next_Pos + 1; end if; return Result( 1..J ); end Get_Token; Input : File_Type ; begin if Argument_Count < 1 then Put_Line("usage:"); Put_Line(" insert file(s)"); return; end if; Put_Line("Database Insertion tool; Version 0.1"); Put_Line("Copyright (C) 2006-2007 Michael Erdmann"); Put_Line("" ); Root.Initialize; for i in 1..Argument_Count loop Open( Name => Argument(i), File => Input, Mode => In_File ); while not End_of_File( Input ) loop declare Firstname : Unbounded_String; Lastname : Unbounded_String; Account_Type : Unbounded_String; Value : Integer; P : Person.Object; begin Get_Line( Input, Input_Record, Length ); Put_Line(Positive_Count'Image(Line(Input))); Next_Pos := Input_Record'First; if Input_Record(1) /= '#' then Firstname := To_Unbounded_String( Get_Token ); Lastname := To_Unbounded_String( Get_Token ); Person.Create( P, Firstname, Lastname ); loop Account_Type := To_Unbounded_String( Get_Token ); Value := Integer'Value( Get_Token ); Account.Create( P, To_String(Account_Type), Value ); end loop; end if; exception when End_Of_Line => null; when OBJECTS.INSERT_FAILED => Put_Line("Error at line : " & Positive_Count'Image( Line(Input) )); end; end loop; Close( Input ); end loop; Root.Finalize; Put_Line(""); Put_Line("Terminating normally"); exception when Error : others => Put_Line("abnormal termination."); Put_Line( Exception_Name( Error ) & " at " & Exception_Message( Error ) ); end Insert; gnade-1.6.2.orig/contrib/objects/apps/insert.sh0000755000175000017500000000011010552367320021267 0ustar lbrentalbrentasplit -l 200 mass.inp data. for i in data.* ; do ./insert $i & done gnade-1.6.2.orig/contrib/objects/apps/mass.inp0000644000175000017500000022240310552367320021112 0ustar lbrentalbrenta#$Source: /cvsroot/gnade/gnade/contrib/objects/apps/mass.inp,v $ Once;Ethucer;Private;223;Buisiness;22 Saugi;Etontec;Private;223;Buisiness;22 Orm;Rerezie;Private;223;Buisiness;22 Huish;Aguruc;Private;223;Buisiness;22 Tcuc;Nrireth;Private;223;Buisiness;22 Acamam;Ierne;Private;223;Buisiness;22 Ucka;Eramisy;Private;223;Buisiness;22 Rvi;Celalit;Private;223;Buisiness;22 Stoeya;Owianer;Private;223;Buisiness;22 Tyaye;Ennelba;Private;223;Buisiness;22 Alalo;Zanco;Private;223;Buisiness;22 Hil;Uthet;Private;223;Buisiness;22 Erun;Tomain;Private;223;Buisiness;22 Lash;Iassa;Private;223;Buisiness;22 Arie;Tyane;Private;223;Buisiness;22 Erat;Onyam;Private;223;Buisiness;22 Eyro;Sadyan;Private;223;Buisiness;22 Awo;Meili;Private;223;Buisiness;22 Ardi;Rtobu;Private;223;Buisiness;22 Arri;Marenda;Private;223;Buisiness;22 Ranety;Elerwin;Private;223;Buisiness;22 Rarca;Rrant;Private;223;Buisiness;22 Oninc;Ditetr;Private;223;Buisiness;22 Ella;Rrevi;Private;223;Buisiness;22 Ergo;Lereshe;Private;223;Buisiness;22 Bre;Iganrit;Private;223;Buisiness;22 Oshere;Rgerea;Private;223;Buisiness;22 Nkin;Tanal;Private;223;Buisiness;22 Ernobo;Orcomon;Private;223;Buisiness;22 Ete;Arubj;Private;223;Buisiness;22 Hta;Nerel;Private;223;Buisiness;22 Useg;Mutri;Private;223;Buisiness;22 Oni;Stolinr;Private;223;Buisiness;22 Adin;Raldu;Private;223;Buisiness;22 Enos;Eneshi;Private;223;Buisiness;22 Irud;Eomorye;Private;223;Buisiness;22 Lirva;Hernabr;Private;223;Buisiness;22 Itr;Hicla;Private;223;Buisiness;22 Wal;Derdil;Private;223;Buisiness;22 Ath;Warteso;Private;223;Buisiness;22 Acel;Osyal;Private;223;Buisiness;22 Lan;Qumain;Private;223;Buisiness;22 Eder;Miserla;Private;223;Buisiness;22 Ivemor;Bonik;Private;223;Buisiness;22 One;Hawiah;Private;223;Buisiness;22 Nerl;Ylenno;Private;223;Buisiness;22 Avist;Isheghe;Private;223;Buisiness;22 Ceyd;Annanni;Private;223;Buisiness;22 Ssalu;Arbud;Private;223;Buisiness;22 Aty;Arahe;Private;223;Buisiness;22 Anr;Hunol;Private;223;Buisiness;22 Nenar;Order;Private;223;Buisiness;22 Ylurt;Erwert;Private;223;Buisiness;22 Meel;Lleon;Private;223;Buisiness;22 Eokiez;Gerug;Private;223;Buisiness;22 Higa;Briff;Private;223;Buisiness;22 Arucha;Eylilit;Private;223;Buisiness;22 Obrul;Uldart;Private;223;Buisiness;22 Isal;Aligo;Private;223;Buisiness;22 Ashor;Ierai;Private;223;Buisiness;22 Onna;Hopean;Private;223;Buisiness;22 Llann;Ogexa;Private;223;Buisiness;22 Zetrui;Wrenil;Private;223;Buisiness;22 Lilv;Nettot;Private;223;Buisiness;22 Lder;Erlerer;Private;223;Buisiness;22 Cayre;Donely;Private;223;Buisiness;22 Ncawo;Endalil;Private;223;Buisiness;22 Erey;Ahourur;Private;223;Buisiness;22 Rosha;Irudn;Private;223;Buisiness;22 Iantoz;Urmoney;Private;223;Buisiness;22 Usyeri;Uterer;Private;223;Buisiness;22 Dannev;Usonie;Private;223;Buisiness;22 Ond;Wtony;Private;223;Buisiness;22 Tot;Erilis;Private;223;Buisiness;22 Oyn;Lyern;Private;223;Buisiness;22 Ankev;Pevan;Private;223;Buisiness;22 Ont;Ymobe;Private;223;Buisiness;22 Obeod;Atonc;Private;223;Buisiness;22 Nfa;Wahub;Private;223;Buisiness;22 Irlu;Hadenn;Private;223;Buisiness;22 Seruk;Hedse;Private;223;Buisiness;22 Amobr;Lelelay;Private;223;Buisiness;22 Odw;Iasaber;Private;223;Buisiness;22 Ortaxa;Ulled;Private;223;Buisiness;22 Lmini;Hanyey;Private;223;Buisiness;22 Ononan;Tcallus;Private;223;Buisiness;22 Edgil;Esutef;Private;223;Buisiness;22 Arun;Tyasele;Private;223;Buisiness;22 Eor;Orranr;Private;223;Buisiness;22 Armi;Enker;Private;223;Buisiness;22 Harcen;Hierru;Private;223;Buisiness;22 Oblaib;Serren;Private;223;Buisiness;22 Bet;Adiuno;Private;223;Buisiness;22 Evas;Oense;Private;223;Buisiness;22 Ickel;Aryadac;Private;223;Buisiness;22 Linez;Thalr;Private;223;Buisiness;22 Sonen;Pelalli;Private;223;Buisiness;22 Ggerge;Eveli;Private;223;Buisiness;22 Nsoom;Aukisos;Private;223;Buisiness;22 Oronya;Rnena;Private;223;Buisiness;22 Iexa;Drena;Private;223;Buisiness;22 Dorta;Etendil;Private;223;Buisiness;22 Ulnial;Liver;Private;223;Buisiness;22 Ina;Eella;Private;223;Buisiness;22 Dons;Elyar;Private;223;Buisiness;22 Oeda;Verlie;Private;223;Buisiness;22 Ynanee;Eomle;Private;223;Buisiness;22 Rarat;Ziame;Private;223;Buisiness;22 Erfo;Ydalce;Private;223;Buisiness;22 Ulband;Ylela;Private;223;Buisiness;22 Ennes;Adoge;Private;223;Buisiness;22 Fri;Ryevaly;Private;223;Buisiness;22 Anu;Imalli;Private;223;Buisiness;22 Cki;Eryalli;Private;223;Buisiness;22 Eane;Onelane;Private;223;Buisiness;22 Duipe;Nnelos;Private;223;Buisiness;22 Uge;Amind;Private;223;Buisiness;22 Ugga;Lullers;Private;223;Buisiness;22 Ottoki;Judwou;Private;223;Buisiness;22 Ooncas;Ufeuli;Private;223;Buisiness;22 Lis;Enene;Private;223;Buisiness;22 Agi;Ubeabar;Private;223;Buisiness;22 Niner;Iangave;Private;223;Buisiness;22 Luze;Emouton;Private;223;Buisiness;22 Aidw;Orenar;Private;223;Buisiness;22 Boonya;Ildis;Private;223;Buisiness;22 Eyvabu;Nkarwa;Private;223;Buisiness;22 Ldomiv;Uneysa;Private;223;Buisiness;22 Ahil;Viston;Private;223;Buisiness;22 Oleone;Rarande;Private;223;Buisiness;22 Uldier;Eluga;Private;223;Buisiness;22 Ena;Tefla;Private;223;Buisiness;22 Nnion;Ellald;Private;223;Buisiness;22 Her;Asyabey;Private;223;Buisiness;22 Oste;Lewin;Private;223;Buisiness;22 Yencu;Auscon;Private;223;Buisiness;22 Huba;Ekahu;Private;223;Buisiness;22 Taclo;Iglera;Private;223;Buisiness;22 Ncayr;Igram;Private;223;Buisiness;22 Ife;Sherg;Private;223;Buisiness;22 Ermole;Giveomo;Private;223;Buisiness;22 Ornaw;Rmoron;Private;223;Buisiness;22 Athi;Bipheng;Private;223;Buisiness;22 Ordon;Nyaresi;Private;223;Buisiness;22 Thuth;Encuzad;Private;223;Buisiness;22 Urt;Ancim;Private;223;Buisiness;22 Udya;Ncoson;Private;223;Buisiness;22 Anca;Anelbe;Private;223;Buisiness;22 Ruce;Exoyan;Private;223;Buisiness;22 Sar;Isuda;Private;223;Buisiness;22 Onyalm;Teday;Private;223;Buisiness;22 Anem;Nwafogr;Private;223;Buisiness;22 Rliedg;Ieduz;Private;223;Buisiness;22 Rurro;Thodyam;Private;223;Buisiness;22 Calaug;Ylofr;Private;223;Buisiness;22 Otierl;Ithan;Private;223;Buisiness;22 Onyamb;Peram;Private;223;Buisiness;22 Nevito;Etherso;Private;223;Buisiness;22 Nner;Rnelol;Private;223;Buisiness;22 Onda;Udufl;Private;223;Buisiness;22 Kanal;Comadan;Private;223;Buisiness;22 Tirb;Nercini;Private;223;Buisiness;22 Htareb;Uthalan;Private;223;Buisiness;22 Rtonte;Ncanal;Private;223;Buisiness;22 Bieymo;Erortek;Private;223;Buisiness;22 Ollely;Ahala;Private;223;Buisiness;22 Der;Owaran;Private;223;Buisiness;22 Umoli;Sasqusy;Private;223;Buisiness;22 Onsene;Tyazze;Private;223;Buisiness;22 Lige;Ynekeld;Private;223;Buisiness;22 Ukit;Maldia;Private;223;Buisiness;22 Evie;Evero;Private;223;Buisiness;22 Rdia;Onayayn;Private;223;Buisiness;22 Yri;Lahiena;Private;223;Buisiness;22 Othalt;Achei;Private;223;Buisiness;22 Onerb;Emivet;Private;223;Buisiness;22 Incatr;Entaud;Private;223;Buisiness;22 Ncor;Isarto;Private;223;Buisiness;22 Iont;Erand;Private;223;Buisiness;22 Tun;Benera;Private;223;Buisiness;22 Eyma;Ertunco;Private;223;Buisiness;22 Arfos;Narnoes;Private;223;Buisiness;22 Emoppe;Ilyaneb;Private;223;Buisiness;22 Yrudal;Raneva;Private;223;Buisiness;22 Llende;Eddaym;Private;223;Buisiness;22 Esan;Uzilan;Private;223;Buisiness;22 Ain;Erorr;Private;223;Buisiness;22 Edas;Aseson;Private;223;Buisiness;22 Ete;Bobrerm;Private;223;Buisiness;22 Amanre;Lerge;Private;223;Buisiness;22 Eti;Iarumer;Private;223;Buisiness;22 Ton;Ebrun;Private;223;Buisiness;22 Nconew;Uburta;Private;223;Buisiness;22 Eldi;Horguso;Private;223;Buisiness;22 Ulen;Tanelin;Private;223;Buisiness;22 Yal;Estota;Private;223;Buisiness;22 Ner;Ettogic;Private;223;Buisiness;22 Osilli;Etharl;Private;223;Buisiness;22 Edya;Ontazis;Private;223;Buisiness;22 Orele;Raundi;Private;223;Buisiness;22 Nelemo;Hortet;Private;223;Buisiness;22 Anend;Helela;Private;223;Buisiness;22 Urorm;Tcemone;Private;223;Buisiness;22 Rfol;Inneba;Private;223;Buisiness;22 Ewishe;Erdenau;Private;223;Buisiness;22 Perren;Isatey;Private;223;Buisiness;22 Stersa;Rrarv;Private;223;Buisiness;22 Erel;Regrag;Private;223;Buisiness;22 Ufu;Unnety;Private;223;Buisiness;22 Onetya;Rrona;Private;223;Buisiness;22 Sher;Alerum;Private;223;Buisiness;22 Erico;Ubeth;Private;223;Buisiness;22 Oer;Aderli;Private;223;Buisiness;22 Adgad;Ynanwa;Private;223;Buisiness;22 Arus;Hodion;Private;223;Buisiness;22 Rare;Oniah;Private;223;Buisiness;22 Ara;Yrunco;Private;223;Buisiness;22 Eos;Nnartar;Private;223;Buisiness;22 Esile;Insinn;Private;223;Buisiness;22 Riperg;Anteror;Private;223;Buisiness;22 Scetco;Offant;Private;223;Buisiness;22 Rae;Ereodan;Private;223;Buisiness;22 Oerwa;Fourd;Private;223;Buisiness;22 Rrer;Peyveyn;Private;223;Buisiness;22 Ormere;Udwale;Private;223;Buisiness;22 Linze;Oranari;Private;223;Buisiness;22 Rforga;Utharie;Private;223;Buisiness;22 Onyad;Alyenc;Private;223;Buisiness;22 Fro;Eoldob;Private;223;Buisiness;22 Ill;Evanda;Private;223;Buisiness;22 Ndekir;Nepes;Private;223;Buisiness;22 Rne;Ttelb;Private;223;Buisiness;22 Wie;Obrarl;Private;223;Buisiness;22 Acocen;Aerna;Private;223;Buisiness;22 Adar;Erneork;Private;223;Buisiness;22 Ien;Esterya;Private;223;Buisiness;22 Oro;Ysadli;Private;223;Buisiness;22 Erne;Analyan;Private;223;Buisiness;22 Usar;Emora;Private;223;Buisiness;22 Tco;Indot;Private;223;Buisiness;22 Ilala;Wadyeye;Private;223;Buisiness;22 Orauli;Achon;Private;223;Buisiness;22 Sacio;Ldenedw;Private;223;Buisiness;22 Dboma;Ichirli;Private;223;Buisiness;22 Gro;Perdis;Private;223;Buisiness;22 Sera;Ahexti;Private;223;Buisiness;22 Arcel;Igence;Private;223;Buisiness;22 Thake;Ercend;Private;223;Buisiness;22 Ertar;Rusodso;Private;223;Buisiness;22 Ittone;Emigran;Private;223;Buisiness;22 Scex;Avoyd;Private;223;Buisiness;22 Oryeen;Insedos;Private;223;Buisiness;22 Arimas;Nteysa;Private;223;Buisiness;22 Pela;Rorum;Private;223;Buisiness;22 Ortet;Byeub;Private;223;Buisiness;22 Senti;Ipebro;Private;223;Buisiness;22 Waroer;Aneloba;Private;223;Buisiness;22 Nezone;Wettei;Private;223;Buisiness;22 Eonyal;Rramen;Private;223;Buisiness;22 Orrube;Llalely;Private;223;Buisiness;22 Altals;Elyavin;Private;223;Buisiness;22 Syawi;Rwillen;Private;223;Buisiness;22 Iusade;Elelaha;Private;223;Buisiness;22 Sule;Erdey;Private;223;Buisiness;22 One;Uforivo;Private;223;Buisiness;22 Orue;Xaric;Private;223;Buisiness;22 Ttotu;Orenne;Private;223;Buisiness;22 Ufnemo;Linarr;Private;223;Buisiness;22 Nzekel;Ldolma;Private;223;Buisiness;22 Sone;Oritivi;Private;223;Buisiness;22 Ollert;Arleo;Private;223;Buisiness;22 Ompi;Udopul;Private;223;Buisiness;22 Nga;Erailv;Private;223;Buisiness;22 Insor;Ysadya;Private;223;Buisiness;22 Yman;Lalacla;Private;223;Buisiness;22 Une;Eddomob;Private;223;Buisiness;22 Asip;Cheyrel;Private;223;Buisiness;22 Teri;Haizill;Private;223;Buisiness;22 Usto;Ernole;Private;223;Buisiness;22 Hevad;Edyaso;Private;223;Buisiness;22 Lalle;Enasp;Private;223;Buisiness;22 Cla;Inarony;Private;223;Buisiness;22 Lude;Ustam;Private;223;Buisiness;22 Uzzean;Incelus;Private;223;Buisiness;22 Inoto;Endorti;Private;223;Buisiness;22 Evi;Urbuck;Private;223;Buisiness;22 Vin;Igtosom;Private;223;Buisiness;22 Adyale;Seroeyd;Private;223;Buisiness;22 Gama;Elubeve;Private;223;Buisiness;22 Lopei;Unwinne;Private;223;Buisiness;22 Utine;Yanoer;Private;223;Buisiness;22 Osie;Arersas;Private;223;Buisiness;22 Xapo;Othayre;Private;223;Buisiness;22 Unemit;Rdaixaw;Private;223;Buisiness;22 Kuthi;Obyer;Private;223;Buisiness;22 Ror;Gurarli;Private;223;Buisiness;22 Ala;Lmigi;Private;223;Buisiness;22 Obu;Andenor;Private;223;Buisiness;22 Sodb;Isotle;Private;223;Buisiness;22 Yaral;Onyantu;Private;223;Buisiness;22 Azivi;Ttusar;Private;223;Buisiness;22 Nyale;Oercezo;Private;223;Buisiness;22 Izwon;Orial;Private;223;Buisiness;22 Dil;Arealos;Private;223;Buisiness;22 Iol;Dosya;Private;223;Buisiness;22 Trie;Erunz;Private;223;Buisiness;22 Eniall;Arist;Private;223;Buisiness;22 Onevig;Aylufri;Private;223;Buisiness;22 Anre;Isahonu;Private;223;Buisiness;22 Rma;Adieviv;Private;223;Buisiness;22 Sionan;Ukinrer;Private;223;Buisiness;22 Rahai;Aivonn;Private;223;Buisiness;22 Chu;Nomyant;Private;223;Buisiness;22 Rnelbe;Oncorm;Private;223;Buisiness;22 Alvish;Earutr;Private;223;Buisiness;22 Amane;Uroview;Private;223;Buisiness;22 Rol;Aleyr;Private;223;Buisiness;22 Wal;Etnab;Private;223;Buisiness;22 Ylerya;Ontomis;Private;223;Buisiness;22 Rnalie;Arlipe;Private;223;Buisiness;22 Ost;Ycermen;Private;223;Buisiness;22 Azarde;Onziar;Private;223;Buisiness;22 Daryab;Walan;Private;223;Buisiness;22 Waush;Alasana;Private;223;Buisiness;22 Yli;Stonze;Private;223;Buisiness;22 Dyal;Wiviah;Private;223;Buisiness;22 Auke;Rnoryal;Private;223;Buisiness;22 Hudya;Otorarg;Private;223;Buisiness;22 Uylerl;Ertinte;Private;223;Buisiness;22 Isom;Rwill;Private;223;Buisiness;22 Gelit;Ernaha;Private;223;Buisiness;22 Oonw;Ankeyra;Private;223;Buisiness;22 Ulento;Ganato;Private;223;Buisiness;22 Ntor;Eteve;Private;223;Buisiness;22 Uron;Elder;Private;223;Buisiness;22 Order;Insew;Private;223;Buisiness;22 Unwixt;Ertumo;Private;223;Buisiness;22 Ospent;Yaurtor;Private;223;Buisiness;22 Rto;Ntorta;Private;223;Buisiness;22 Eor;Ernist;Private;223;Buisiness;22 Etza;Iantor;Private;223;Buisiness;22 Irun;Trasur;Private;223;Buisiness;22 Anyay;Ycinis;Private;223;Buisiness;22 Wist;Pento;Private;223;Buisiness;22 Erda;Eriglad;Private;223;Buisiness;22 Hay;Rlerge;Private;223;Buisiness;22 Onke;Encigep;Private;223;Buisiness;22 Ava;Ghevi;Private;223;Buisiness;22 Orea;Ebrarn;Private;223;Buisiness;22 Ela;Thitaro;Private;223;Buisiness;22 Teon;Onney;Private;223;Buisiness;22 Arte;Onnil;Private;223;Buisiness;22 Alton;Ergon;Private;223;Buisiness;22 Torn;Eunte;Private;223;Buisiness;22 Fob;Elain;Private;223;Buisiness;22 Ffi;Ildoken;Private;223;Buisiness;22 Laucl;Anton;Private;223;Buisiness;22 Enee;Onanco;Private;223;Buisiness;22 Llamay;Udaraya;Private;223;Buisiness;22 Albale;Rlante;Private;223;Buisiness;22 Eyleri;Udguru;Private;223;Buisiness;22 Ovi;Dalant;Private;223;Buisiness;22 Erc;Ancer;Private;223;Buisiness;22 Ilyaut;Ularel;Private;223;Buisiness;22 Inergi;Kerof;Private;223;Buisiness;22 Alala;Kinker;Private;223;Buisiness;22 Evien;Iggelig;Private;223;Buisiness;22 Hell;Arlem;Private;223;Buisiness;22 Earne;Rsoniac;Private;223;Buisiness;22 Ono;Vawan;Private;223;Buisiness;22 Etto;Dlinti;Private;223;Buisiness;22 Arn;Wagus;Private;223;Buisiness;22 Epe;Iglenda;Private;223;Buisiness;22 Iskixw;Rgern;Private;223;Buisiness;22 Acey;Encetac;Private;223;Buisiness;22 Tsig;Iallia;Private;223;Buisiness;22 Bez;Erele;Private;223;Buisiness;22 Yarn;Edert;Private;223;Buisiness;22 Bev;Citho;Private;223;Buisiness;22 Anerli;Orerel;Private;223;Buisiness;22 Esy;Yrionse;Private;223;Buisiness;22 Ycaso;Rrolub;Private;223;Buisiness;22 Ryar;Ckalesi;Private;223;Buisiness;22 Uic;Eruga;Private;223;Buisiness;22 Usi;Ussola;Private;223;Buisiness;22 Mon;Esonri;Private;223;Buisiness;22 Adeng;Idada;Private;223;Buisiness;22 Alda;Alonran;Private;223;Buisiness;22 Elloni;Neneeyl;Private;223;Buisiness;22 Devi;Ledes;Private;223;Buisiness;22 Odalya;Clorco;Private;223;Buisiness;22 Enence;Erlall;Private;223;Buisiness;22 Enau;Acordei;Private;223;Buisiness;22 Edd;Tophi;Private;223;Buisiness;22 Ylorai;Ussonin;Private;223;Buisiness;22 Elmal;Ebrisec;Private;223;Buisiness;22 Otepa;Isoper;Private;223;Buisiness;22 Arm;Ozonsut;Private;223;Buisiness;22 Ledorv;Ichahot;Private;223;Buisiness;22 Nely;Ikicony;Private;223;Buisiness;22 Dailye;Udamile;Private;223;Buisiness;22 Cyar;Udith;Private;223;Buisiness;22 Onsa;Gelisis;Private;223;Buisiness;22 Nenel;Emerke;Private;223;Buisiness;22 Cerety;Ltert;Private;223;Buisiness;22 Orre;Usoperm;Private;223;Buisiness;22 Llar;Isarta;Private;223;Buisiness;22 Die;Nnoro;Private;223;Buisiness;22 Ensa;Iarem;Private;223;Buisiness;22 Llube;Ererl;Private;223;Buisiness;22 Oyv;Tisiso;Private;223;Buisiness;22 Eaha;Toron;Private;223;Buisiness;22 Ahye;Ldelp;Private;223;Buisiness;22 Udierv;Utoon;Private;223;Buisiness;22 Lon;Ilello;Private;223;Buisiness;22 Erlo;Aongese;Private;223;Buisiness;22 Airlef;Anerter;Private;223;Buisiness;22 Leedo;Leonco;Private;223;Buisiness;22 Rtene;Attos;Private;223;Buisiness;22 Lya;Ylewir;Private;223;Buisiness;22 Ullel;Eranico;Private;223;Buisiness;22 Llosho;Semanda;Private;223;Buisiness;22 Frunt;Lelonn;Private;223;Buisiness;22 Getya;Odeort;Private;223;Buisiness;22 Leni;Oriner;Private;223;Buisiness;22 Anton;Aqunne;Private;223;Buisiness;22 Yveme;Andip;Private;223;Buisiness;22 Thest;Otlemon;Private;223;Buisiness;22 Ervo;Nilsa;Private;223;Buisiness;22 Ellur;Ttort;Private;223;Buisiness;22 Ephazi;Iagey;Private;223;Buisiness;22 Dwa;Oolbor;Private;223;Buisiness;22 Erdale;Etonero;Private;223;Buisiness;22 Eilfo;Ntirola;Private;223;Buisiness;22 Etnas;Iselauz;Private;223;Buisiness;22 Etseg;Erbun;Private;223;Buisiness;22 Edr;Tonyayr;Private;223;Buisiness;22 Ofrele;Emalb;Private;223;Buisiness;22 Onrons;Rnelelo;Private;223;Buisiness;22 Eved;Felinis;Private;223;Buisiness;22 Udene;Tcedemi;Private;223;Buisiness;22 Emale;Urucan;Private;223;Buisiness;22 Erat;Ilder;Private;223;Buisiness;22 Ahif;Ivion;Private;223;Buisiness;22 Tto;Ixtas;Private;223;Buisiness;22 Honive;Uthaisa;Private;223;Buisiness;22 Ordan;Cornar;Private;223;Buisiness;22 Achee;Artimim;Private;223;Buisiness;22 Viesi;Ukigr;Private;223;Buisiness;22 Inaly;Eleke;Private;223;Buisiness;22 Lorlee;Enerel;Private;223;Buisiness;22 Ner;Leran;Private;223;Buisiness;22 Eobrer;Adaze;Private;223;Buisiness;22 Oworso;Igubrer;Private;223;Buisiness;22 Orre;Enenerf;Private;223;Buisiness;22 Keadal;Wiperus;Private;223;Buisiness;22 Iala;Tarcele;Private;223;Buisiness;22 Herise;Nesalc;Private;223;Buisiness;22 Ymud;Grinez;Private;223;Buisiness;22 Ngeli;Cedyar;Private;223;Buisiness;22 Ller;Liconn;Private;223;Buisiness;22 Urelte;Ellarle;Private;223;Buisiness;22 Egara;Aqure;Private;223;Buisiness;22 Nilo;Terde;Private;223;Buisiness;22 Igelma;Lomar;Private;223;Buisiness;22 Eniarl;Enner;Private;223;Buisiness;22 Udude;Adelyer;Private;223;Buisiness;22 Allal;Ashonag;Private;223;Buisiness;22 Feles;Alonora;Private;223;Buisiness;22 Emon;Pereta;Private;223;Buisiness;22 Ncau;Leleeme;Private;223;Buisiness;22 Elyal;Futya;Private;223;Buisiness;22 Yecay;Auron;Private;223;Buisiness;22 Tti;Nahottu;Private;223;Buisiness;22 Usad;Bbedr;Private;223;Buisiness;22 Iatya;Odenero;Private;223;Buisiness;22 Dalora;Nzicyer;Private;223;Buisiness;22 Rnen;Ierel;Private;223;Buisiness;22 Omo;Opererd;Private;223;Buisiness;22 Apeyle;Ermori;Private;223;Buisiness;22 Mobuse;Erlane;Private;223;Buisiness;22 Uto;Ierca;Private;223;Buisiness;22 Orolve;Ewiga;Private;223;Buisiness;22 Rton;Redeu;Private;223;Buisiness;22 Itellu;Hiemar;Private;223;Buisiness;22 Anaixt;Neroyna;Private;223;Buisiness;22 Ldise;Ashir;Private;223;Buisiness;22 Isa;Irgar;Private;223;Buisiness;22 Enerd;Ermas;Private;223;Buisiness;22 Nde;Isuel;Private;223;Buisiness;22 Eane;Ushagr;Private;223;Buisiness;22 Audr;Nnane;Private;223;Buisiness;22 Ucom;Ipalil;Private;223;Buisiness;22 Axaly;Erarwi;Private;223;Buisiness;22 Burea;Neriaba;Private;223;Buisiness;22 Veel;Lemige;Private;223;Buisiness;22 Arlut;Myeelv;Private;223;Buisiness;22 Wileol;Asorot;Private;223;Buisiness;22 Onto;Ostadwa;Private;223;Buisiness;22 Orion;Inetu;Private;223;Buisiness;22 Ens;Agien;Private;223;Buisiness;22 Nalle;Elencah;Private;223;Buisiness;22 Asonal;Teurin;Private;223;Buisiness;22 Rdeel;Shelier;Private;223;Buisiness;22 Uneri;Igewian;Private;223;Buisiness;22 Umari;Lillat;Private;223;Buisiness;22 Ronas;Tetti;Private;223;Buisiness;22 Perise;Warneyl;Private;223;Buisiness;22 Ookent;Llemi;Private;223;Buisiness;22 Alm;Uitorus;Private;223;Buisiness;22 Otoo;Heudo;Private;223;Buisiness;22 Are;Viene;Private;223;Buisiness;22 Semoo;Enyab;Private;223;Buisiness;22 Oshi;Osalla;Private;223;Buisiness;22 Ise;Earned;Private;223;Buisiness;22 Uim;Alames;Private;223;Buisiness;22 Esluta;Allerl;Private;223;Buisiness;22 Torani;Rserdix;Private;223;Buisiness;22 She;Orfou;Private;223;Buisiness;22 Phar;Eysenne;Private;223;Buisiness;22 Eiv;Eeneam;Private;223;Buisiness;22 Velal;Niand;Private;223;Buisiness;22 Iman;Hanal;Private;223;Buisiness;22 Ong;Iveni;Private;223;Buisiness;22 Seruen;Nzili;Private;223;Buisiness;22 Tyand;Isere;Private;223;Buisiness;22 Ulel;Usieser;Private;223;Buisiness;22 Yliond;Adorg;Private;223;Buisiness;22 Iga;Idyao;Private;223;Buisiness;22 Eneri;Ntonnau;Private;223;Buisiness;22 Owa;Nyanke;Private;223;Buisiness;22 Sananc;Calicl;Private;223;Buisiness;22 Exan;Urero;Private;223;Buisiness;22 Daldi;Etely;Private;223;Buisiness;22 Arel;Rtomah;Private;223;Buisiness;22 Geruc;Dukenn;Private;223;Buisiness;22 Anniz;Sorfety;Private;223;Buisiness;22 Lonere;Emener;Private;223;Buisiness;22 Iserda;Rothi;Private;223;Buisiness;22 Nney;Rteran;Private;223;Buisiness;22 Roe;Aursos;Private;223;Buisiness;22 Ili;Urriaha;Private;223;Buisiness;22 Engeed;Ddeyved;Private;223;Buisiness;22 Alle;Orgir;Private;223;Buisiness;22 Falone;Yarya;Private;223;Buisiness;22 Ldithe;Larar;Private;223;Buisiness;22 Usalya;Erolie;Private;223;Buisiness;22 Rishet;Anerya;Private;223;Buisiness;22 Ero;Ollaro;Private;223;Buisiness;22 Aherm;Enyale;Private;223;Buisiness;22 Esy;Adert;Private;223;Buisiness;22 Enaxwa;Anosas;Private;223;Buisiness;22 Derli;Ewier;Private;223;Buisiness;22 Erga;Nadane;Private;223;Buisiness;22 Lke;Ishat;Private;223;Buisiness;22 Ale;Eadse;Private;223;Buisiness;22 Gle;Idoyci;Private;223;Buisiness;22 Ern;Ronasc;Private;223;Buisiness;22 Yner;Gerint;Private;223;Buisiness;22 Bobj;Usisond;Private;223;Buisiness;22 Ketenc;Onserue;Private;223;Buisiness;22 Igigig;Uruilra;Private;223;Buisiness;22 Aha;Thipena;Private;223;Buisiness;22 Elyas;Heydese;Private;223;Buisiness;22 Hola;Anisorr;Private;223;Buisiness;22 Igera;Onted;Private;223;Buisiness;22 Aistoy;Azzoph;Private;223;Buisiness;22 Yveth;Beldi;Private;223;Buisiness;22 Ufan;Inambu;Private;223;Buisiness;22 Olye;Erari;Private;223;Buisiness;22 Nerneb;Misoutr;Private;223;Buisiness;22 Hermip;Issor;Private;223;Buisiness;22 Erler;Illey;Private;223;Buisiness;22 Lleys;Irtopal;Private;223;Buisiness;22 Anarfe;Uletala;Private;223;Buisiness;22 Lvera;Ancet;Private;223;Buisiness;22 Rnen;Isarema;Private;223;Buisiness;22 Sce;Ercodna;Private;223;Buisiness;22 Ureysa;Nyari;Private;223;Buisiness;22 Lior;Oovel;Private;223;Buisiness;22 Aheb;Opantal;Private;223;Buisiness;22 Edanal;Erost;Private;223;Buisiness;22 Esahe;Iclen;Private;223;Buisiness;22 Aurayr;Acotha;Private;223;Buisiness;22 Ell;Aranne;Private;223;Buisiness;22 Adinee;Lalnell;Private;223;Buisiness;22 Isto;Lilacet;Private;223;Buisiness;22 Gonz;Oshicu;Private;223;Buisiness;22 Udereu;Ongilum;Private;223;Buisiness;22 Ger;Enderro;Private;223;Buisiness;22 Ontev;Frilveb;Private;223;Buisiness;22 Rcoda;Vedarli;Private;223;Buisiness;22 Rau;Ucerun;Private;223;Buisiness;22 Ame;Ahellar;Private;223;Buisiness;22 Pasoda;Oerton;Private;223;Buisiness;22 Iada;Denisof;Private;223;Buisiness;22 Eyni;Narra;Private;223;Buisiness;22 Eysisa;Bermien;Private;223;Buisiness;22 San;Goluder;Private;223;Buisiness;22 Rderiv;Ustuyle;Private;223;Buisiness;22 Urta;Entermi;Private;223;Buisiness;22 Esteso;Chodala;Private;223;Buisiness;22 Mah;Ilyan;Private;223;Buisiness;22 Ilonca;Ashorlo;Private;223;Buisiness;22 Emoni;Amacel;Private;223;Buisiness;22 Usw;Onilun;Private;223;Buisiness;22 Aniso;Ianar;Private;223;Buisiness;22 Iny;Aneroe;Private;223;Buisiness;22 Usarva;Aursali;Private;223;Buisiness;22 Wall;Pethu;Private;223;Buisiness;22 Oun;Valibe;Private;223;Buisiness;22 Ynes;Andum;Private;223;Buisiness;22 Oner;Lbuny;Private;223;Buisiness;22 Ryal;Ilfane;Private;223;Buisiness;22 Yse;Dlankil;Private;223;Buisiness;22 Htorb;Nedever;Private;223;Buisiness;22 Lord;Aqurmis;Private;223;Buisiness;22 Lburev;Ncettu;Private;223;Buisiness;22 Wile;Lmeanci;Private;223;Buisiness;22 Eni;Ibonar;Private;223;Buisiness;22 Unador;Lyevi;Private;223;Buisiness;22 Dneer;Byamma;Private;223;Buisiness;22 Atophe;Ibugl;Private;223;Buisiness;22 Ericho;Wahale;Private;223;Buisiness;22 Spe;Rneane;Private;223;Buisiness;22 Cerdo;Lsarely;Private;223;Buisiness;22 Elaurd;Tcorle;Private;223;Buisiness;22 Urm;Lendet;Private;223;Buisiness;22 Rarero;Zgerr;Private;223;Buisiness;22 Nam;Engilb;Private;223;Buisiness;22 Ayl;Usaude;Private;223;Buisiness;22 Buf;Nivipe;Private;223;Buisiness;22 Eylogr;Elbahe;Private;223;Buisiness;22 Ullado;Aberac;Private;223;Buisiness;22 One;Aromiud;Private;223;Buisiness;22 Xte;Airele;Private;223;Buisiness;22 Mmonne;Nnisar;Private;223;Buisiness;22 Zominf;Sonicat;Private;223;Buisiness;22 Rleasy;Adann;Private;223;Buisiness;22 Nyen;Errolas;Private;223;Buisiness;22 Ahelu;Esheera;Private;223;Buisiness;22 Erou;Witoo;Private;223;Buisiness;22 Lli;Wyahebe;Private;223;Buisiness;22 Rull;Rtorsan;Private;223;Buisiness;22 Iasilv;Lubetto;Private;223;Buisiness;22 Unando;Ospone;Private;223;Buisiness;22 Lya;Edont;Private;223;Buisiness;22 Newi;Relal;Private;223;Buisiness;22 Enseli;Yleto;Private;223;Buisiness;22 Het;Estange;Private;223;Buisiness;22 Echura;Armal;Private;223;Buisiness;22 Kera;Ynivee;Private;223;Buisiness;22 Thisto;Amans;Private;223;Buisiness;22 Zor;Heorter;Private;223;Buisiness;22 Eyayl;Yvetz;Private;223;Buisiness;22 Doyr;Ntasai;Private;223;Buisiness;22 Abrenn;Eyero;Private;223;Buisiness;22 Ropel;Ararus;Private;223;Buisiness;22 Engole;Anuyavi;Private;223;Buisiness;22 Aylor;Jonne;Private;223;Buisiness;22 Elgela;Routh;Private;223;Buisiness;22 Rfarw;Wites;Private;223;Buisiness;22 Zora;Ryarbo;Private;223;Buisiness;22 Ndadu;Anelfu;Private;223;Buisiness;22 Iskale;Idorl;Private;223;Buisiness;22 Bugore;Beeyli;Private;223;Buisiness;22 Onn;Oyrong;Private;223;Buisiness;22 Und;Erlogu;Private;223;Buisiness;22 Ncellu;Nanose;Private;223;Buisiness;22 Enaru;Unopen;Private;223;Buisiness;22 Arud;Iffowar;Private;223;Buisiness;22 Ader;Hudsebe;Private;223;Buisiness;22 Ery;Enteoyl;Private;223;Buisiness;22 Dela;Ebell;Private;223;Buisiness;22 Honac;Iarabe;Private;223;Buisiness;22 Eli;Ardeven;Private;223;Buisiness;22 All;Aspali;Private;223;Buisiness;22 Ertu;Ernevic;Private;223;Buisiness;22 Rune;Etrip;Private;223;Buisiness;22 Bahert;Hiartal;Private;223;Buisiness;22 Rte;Allee;Private;223;Buisiness;22 Anasoc;Themcen;Private;223;Buisiness;22 Heu;Robuc;Private;223;Buisiness;22 Esel;Lleru;Private;223;Buisiness;22 Ance;Eyaldu;Private;223;Buisiness;22 Annac;Bruma;Private;223;Buisiness;22 Rne;Encel;Private;223;Buisiness;22 Unneb;Iaheyna;Private;223;Buisiness;22 Anoc;Ornauby;Private;223;Buisiness;22 Deabo;Olman;Private;223;Buisiness;22 Rne;Erezi;Private;223;Buisiness;22 Uiscit;Erteli;Private;223;Buisiness;22 Toli;Entuis;Private;223;Buisiness;22 Esto;Relero;Private;223;Buisiness;22 Lev;Hetong;Private;223;Buisiness;22 Uroena;Tovere;Private;223;Buisiness;22 Skan;Udricax;Private;223;Buisiness;22 Achig;Ormal;Private;223;Buisiness;22 Orali;Aneedi;Private;223;Buisiness;22 Alangi;Hartoon;Private;223;Buisiness;22 Tenan;Arope;Private;223;Buisiness;22 Rmera;Ruter;Private;223;Buisiness;22 Ndo;Artel;Private;223;Buisiness;22 Ynacel;Oncom;Private;223;Buisiness;22 Ezenda;Seomol;Private;223;Buisiness;22 Aliern;Dengak;Private;223;Buisiness;22 Nne;Utyan;Private;223;Buisiness;22 Eldo;Nener;Private;223;Buisiness;22 Ial;Abrasi;Private;223;Buisiness;22 Elis;Oshanc;Private;223;Buisiness;22 Edisya;Elierg;Private;223;Buisiness;22 Shal;Adamarc;Private;223;Buisiness;22 Icereu;Apari;Private;223;Buisiness;22 Erre;Nishe;Private;223;Buisiness;22 Ait;Adanwa;Private;223;Buisiness;22 Eryee;Startou;Private;223;Buisiness;22 Walibe;Alaggo;Private;223;Buisiness;22 Run;Habey;Private;223;Buisiness;22 Aso;Oysonn;Private;223;Buisiness;22 Heyma;Rginey;Private;223;Buisiness;22 Inder;Hinali;Private;223;Buisiness;22 Ssahel;Arsah;Private;223;Buisiness;22 Ear;Berdicl;Private;223;Buisiness;22 Ttap;Ayron;Private;223;Buisiness;22 Ophosa;Loela;Private;223;Buisiness;22 Therd;Iaryaco;Private;223;Buisiness;22 Eractu;Ydeels;Private;223;Buisiness;22 Eshe;Debjo;Private;223;Buisiness;22 Ison;Nzeysat;Private;223;Buisiness;22 Peesa;Roton;Private;223;Buisiness;22 Ith;Wacebay;Private;223;Buisiness;22 Elbuli;Robengu;Private;223;Buisiness;22 Ewaush;Onden;Private;223;Buisiness;22 Elderg;Lnasano;Private;223;Buisiness;22 Aylia;Ylealpe;Private;223;Buisiness;22 Erl;Ilaust;Private;223;Buisiness;22 Sca;Eorari;Private;223;Buisiness;22 Eman;Ercorv;Private;223;Buisiness;22 Ory;Soncope;Private;223;Buisiness;22 Urso;Nnelde;Private;223;Buisiness;22 Inang;Narde;Private;223;Buisiness;22 Nerg;Eleynob;Private;223;Buisiness;22 Ain;Erdodal;Private;223;Buisiness;22 Nente;Tasoti;Private;223;Buisiness;22 Zec;Ervela;Private;223;Buisiness;22 Esene;Aneleu;Private;223;Buisiness;22 Enn;Riclir;Private;223;Buisiness;22 Onerye;Erbelul;Private;223;Buisiness;22 Rucon;Amederv;Private;223;Buisiness;22 Stade;Egrens;Private;223;Buisiness;22 Serten;Erind;Private;223;Buisiness;22 Erro;Ekander;Private;223;Buisiness;22 Dwanco;Aurtoo;Private;223;Buisiness;22 Hur;Nella;Private;223;Buisiness;22 Esh;Aylendi;Private;223;Buisiness;22 Orlank;Wopho;Private;223;Buisiness;22 Mah;Onescep;Private;223;Buisiness;22 Tinia;Gaxote;Private;223;Buisiness;22 Vey;Urasya;Private;223;Buisiness;22 Icie;Unaba;Private;223;Buisiness;22 Teler;Rlelat;Private;223;Buisiness;22 Iclan;Inilbu;Private;223;Buisiness;22 Ure;Hache;Private;223;Buisiness;22 Letniz;Lmosi;Private;223;Buisiness;22 Yrugie;Wetsara;Private;223;Buisiness;22 Tide;Ueteg;Private;223;Buisiness;22 Nnit;Ettorge;Private;223;Buisiness;22 Asini;Illenc;Private;223;Buisiness;22 Ggiadl;Rnend;Private;223;Buisiness;22 Eeshum;Ldice;Private;223;Buisiness;22 Allai;Inennig;Private;223;Buisiness;22 Rli;Alerara;Private;223;Buisiness;22 Elomp;Ttetri;Private;223;Buisiness;22 Aver;Ainahee;Private;223;Buisiness;22 Ius;Lmail;Private;223;Buisiness;22 Erni;Ucobe;Private;223;Buisiness;22 Ldenri;Aryan;Private;223;Buisiness;22 Eromoo;Alayr;Private;223;Buisiness;22 Vee;Ammerf;Private;223;Buisiness;22 Uttis;Spenwal;Private;223;Buisiness;22 Zare;Airtube;Private;223;Buisiness;22 Otharm;Angera;Private;223;Buisiness;22 Ellen;Rophelb;Private;223;Buisiness;22 Rrahe;Seydad;Private;223;Buisiness;22 Mewa;Anonen;Private;223;Buisiness;22 Alad;Uratid;Private;223;Buisiness;22 Udach;Selder;Private;223;Buisiness;22 Lli;Dolis;Private;223;Buisiness;22 Sac;Aveic;Private;223;Buisiness;22 Umela;Artom;Private;223;Buisiness;22 Yvin;Andida;Private;223;Buisiness;22 Oneydu;Inertou;Private;223;Buisiness;22 Ibro;Enela;Private;223;Buisiness;22 Retya;Omaysan;Private;223;Buisiness;22 Rlal;Axada;Private;223;Buisiness;22 Oshu;Etzon;Private;223;Buisiness;22 Eys;Kancel;Private;223;Buisiness;22 Ilela;Ithicer;Private;223;Buisiness;22 Frello;Erirdel;Private;223;Buisiness;22 Allia;Ntiamag;Private;223;Buisiness;22 Ond;Rnitle;Private;223;Buisiness;22 Inde;Eashis;Private;223;Buisiness;22 Ead;Ollil;Private;223;Buisiness;22 Ilyagr;Amyarar;Private;223;Buisiness;22 Art;Ilitya;Private;223;Buisiness;22 Terni;Thema;Private;223;Buisiness;22 Ahorde;Ennispa;Private;223;Buisiness;22 Ierle;Ithinuz;Private;223;Buisiness;22 Boga;Umont;Private;223;Buisiness;22 Ilerta;Oggelu;Private;223;Buisiness;22 Thale;Ainice;Private;223;Buisiness;22 Sas;Oruspew;Private;223;Buisiness;22 Gar;Ubecl;Private;223;Buisiness;22 Aliely;Elanyel;Private;223;Buisiness;22 Yralbu;Andar;Private;223;Buisiness;22 Dwasa;Xtetyer;Private;223;Buisiness;22 Ikia;Manco;Private;223;Buisiness;22 Tic;Ydack;Private;223;Buisiness;22 Evelor;Ellolad;Private;223;Buisiness;22 Ubu;Inyarl;Private;223;Buisiness;22 Onisho;Utoll;Private;223;Buisiness;22 Eet;Anerla;Private;223;Buisiness;22 Rfo;Eyann;Private;223;Buisiness;22 Lder;Achese;Private;223;Buisiness;22 Enero;Flish;Private;223;Buisiness;22 Aracy;Mentost;Private;223;Buisiness;22 Ann;Melerna;Private;223;Buisiness;22 Ond;Teffart;Private;223;Buisiness;22 Hogewi;Uysast;Private;223;Buisiness;22 Sked;Husatro;Private;223;Buisiness;22 Uldild;Halbu;Private;223;Buisiness;22 Iam;Palah;Private;223;Buisiness;22 Alyal;Enceyd;Private;223;Buisiness;22 Tyede;Zinilai;Private;223;Buisiness;22 Uchah;Stobjea;Private;223;Buisiness;22 Ais;Syarar;Private;223;Buisiness;22 Alc;Eycesa;Private;223;Buisiness;22 Arurto;Elcerde;Private;223;Buisiness;22 Eletha;Ysolen;Private;223;Buisiness;22 Esol;Nedallo;Private;223;Buisiness;22 Aze;Erkiede;Private;223;Buisiness;22 Annero;Eleyni;Private;223;Buisiness;22 Eent;Ilemor;Private;223;Buisiness;22 Onden;Ngurnel;Private;223;Buisiness;22 Eyme;Ryari;Private;223;Buisiness;22 Ient;Eyalye;Private;223;Buisiness;22 Ordomo;Antarar;Private;223;Buisiness;22 Ormion;Betarte;Private;223;Buisiness;22 Ain;Eliema;Private;223;Buisiness;22 Ephic;Aruton;Private;223;Buisiness;22 Evigri;Rteyda;Private;223;Buisiness;22 Llib;Etannev;Private;223;Buisiness;22 Edan;Dorahe;Private;223;Buisiness;22 Udla;Hetonc;Private;223;Buisiness;22 Udl;Rutheny;Private;223;Buisiness;22 Catone;Eralema;Private;223;Buisiness;22 Nerer;Anobr;Private;223;Buisiness;22 Oru;Eafai;Private;223;Buisiness;22 Nnoew;Eaxolye;Private;223;Buisiness;22 Urcur;Ictonc;Private;223;Buisiness;22 Ulaydi;Oruere;Private;223;Buisiness;22 Eseund;Amonroe;Private;223;Buisiness;22 Lle;Lenzes;Private;223;Buisiness;22 Leysad;Rierun;Private;223;Buisiness;22 Onceys;Odorr;Private;223;Buisiness;22 Erya;Iserru;Private;223;Buisiness;22 Ico;Ebuton;Private;223;Buisiness;22 Mol;Arude;Private;223;Buisiness;22 Zifone;Hostori;Private;223;Buisiness;22 Erome;Pednar;Private;223;Buisiness;22 Ert;Eelortu;Private;223;Buisiness;22 Erezg;Itner;Private;223;Buisiness;22 Sant;Lofre;Private;223;Buisiness;22 Ria;Wiuka;Private;223;Buisiness;22 Arinki;Eludo;Private;223;Buisiness;22 Iller;Trineml;Private;223;Buisiness;22 Ertani;Quesw;Private;223;Buisiness;22 Anal;Rbenc;Private;223;Buisiness;22 Enahaw;Yeald;Private;223;Buisiness;22 Hau;Uleyru;Private;223;Buisiness;22 Reyner;Ellato;Private;223;Buisiness;22 Raner;Etten;Private;223;Buisiness;22 Wistub;Unispas;Private;223;Buisiness;22 Egrom;Ntontay;Private;223;Buisiness;22 Disoe;Ilospa;Private;223;Buisiness;22 Cle;Eraber;Private;223;Buisiness;22 Onto;Amaist;Private;223;Buisiness;22 Ause;Rufento;Private;223;Buisiness;22 Alite;Erayri;Private;223;Buisiness;22 Arg;Usher;Private;223;Buisiness;22 Iandud;Panem;Private;223;Buisiness;22 Amic;Arudath;Private;223;Buisiness;22 Enal;Ancormi;Private;223;Buisiness;22 Onese;Alvis;Private;223;Buisiness;22 Iarto;Ereyne;Private;223;Buisiness;22 Xton;Onoynas;Private;223;Buisiness;22 Yson;Arten;Private;223;Buisiness;22 Eyne;Nilailv;Private;223;Buisiness;22 Eshes;Ysosic;Private;223;Buisiness;22 Ndevos;Rdoul;Private;223;Buisiness;22 Asetow;Hiesp;Private;223;Buisiness;22 Arlan;Dathit;Private;223;Buisiness;22 Ogr;Zawal;Private;223;Buisiness;22 Rta;Efosu;Private;223;Buisiness;22 Aro;Ebernon;Private;223;Buisiness;22 Aram;Errear;Private;223;Buisiness;22 Lonine;Nrewa;Private;223;Buisiness;22 Vene;Erinev;Private;223;Buisiness;22 Ubre;Rmist;Private;223;Buisiness;22 Nde;Elitoka;Private;223;Buisiness;22 Uclodd;Ijahert;Private;223;Buisiness;22 Odyado;Uffonc;Private;223;Buisiness;22 Eltea;Asaske;Private;223;Buisiness;22 Epe;Amarond;Private;223;Buisiness;22 Oreerf;Ynilag;Private;223;Buisiness;22 Aric;Nethad;Private;223;Buisiness;22 Uthaym;Raldenc;Private;223;Buisiness;22 Line;Offanye;Private;223;Buisiness;22 Lenne;Rarod;Private;223;Buisiness;22 Ler;Trietya;Private;223;Buisiness;22 Ervie;Lipent;Private;223;Buisiness;22 Lmalse;Inily;Private;223;Buisiness;22 Arrus;Quceron;Private;223;Buisiness;22 Tonar;Etoere;Private;223;Buisiness;22 Onals;Adayler;Private;223;Buisiness;22 Peler;Habegui;Private;223;Buisiness;22 Llerl;Urache;Private;223;Buisiness;22 Ras;Floru;Private;223;Buisiness;22 Wion;Ortar;Private;223;Buisiness;22 Ordati;Wakerr;Private;223;Buisiness;22 Atu;Arnedig;Private;223;Buisiness;22 Zoro;Zonedin;Private;223;Buisiness;22 Toyd;Ilosk;Private;223;Buisiness;22 Arterg;Onamare;Private;223;Buisiness;22 Abugri;Anerce;Private;223;Buisiness;22 Exwol;Oroeti;Private;223;Buisiness;22 Erse;Acomi;Private;223;Buisiness;22 Hall;Yaigli;Private;223;Buisiness;22 Adia;Nceler;Private;223;Buisiness;22 Uchili;Eelia;Private;223;Buisiness;22 Orut;Udope;Private;223;Buisiness;22 Gtab;Aupeorm;Private;223;Buisiness;22 Udoser;Hasea;Private;223;Buisiness;22 Lemo;Auzwar;Private;223;Buisiness;22 Isev;Aryen;Private;223;Buisiness;22 Torinn;Erudom;Private;223;Buisiness;22 Esi;Erotto;Private;223;Buisiness;22 Ercali;Eliboma;Private;223;Buisiness;22 Eric;Ertee;Private;223;Buisiness;22 Rone;Wonele;Private;223;Buisiness;22 They;Cither;Private;223;Buisiness;22 Deron;Mobah;Private;223;Buisiness;22 Atti;Ttenen;Private;223;Buisiness;22 Eldu;Tenere;Private;223;Buisiness;22 Abewa;Omarar;Private;223;Buisiness;22 Rte;Iperemo;Private;223;Buisiness;22 Neb;Rderorl;Private;223;Buisiness;22 Dwien;Altalam;Private;223;Buisiness;22 Exonar;Brauleo;Private;223;Buisiness;22 Ldusa;Keige;Private;223;Buisiness;22 Usoud;Unerann;Private;223;Buisiness;22 Ilde;Nimma;Private;223;Buisiness;22 Vic;Ushik;Private;223;Buisiness;22 Avil;Fadansu;Private;223;Buisiness;22 Ellern;Rustor;Private;223;Buisiness;22 Rel;Lalix;Private;223;Buisiness;22 Tee;Olbut;Private;223;Buisiness;22 Eme;Ulmarna;Private;223;Buisiness;22 Inerl;Heloudu;Private;223;Buisiness;22 Olligl;Onyany;Private;223;Buisiness;22 Ital;Viuday;Private;223;Buisiness;22 Earn;Nnantue;Private;223;Buisiness;22 Rasc;Ldonse;Private;223;Buisiness;22 Ome;Roloper;Private;223;Buisiness;22 Tyara;Oungad;Private;223;Buisiness;22 Elye;Tobene;Private;223;Buisiness;22 Inde;Rlomaco;Private;223;Buisiness;22 Onerli;Utani;Private;223;Buisiness;22 Miar;Istorec;Private;223;Buisiness;22 Eonelt;Ansas;Private;223;Buisiness;22 Illa;Uttuly;Private;223;Buisiness;22 Zethal;Ayseagu;Private;223;Buisiness;22 Nge;Yvizals;Private;223;Buisiness;22 Akel;Eranew;Private;223;Buisiness;22 Wak;Concem;Private;223;Buisiness;22 Ago;Elkesh;Private;223;Buisiness;22 Dern;Nnerdi;Private;223;Buisiness;22 Uso;Alade;Private;223;Buisiness;22 Aropit;Ahemil;Private;223;Buisiness;22 Udn;Arrov;Private;223;Buisiness;22 Nyam;Almalor;Private;223;Buisiness;22 Ucevin;Mistun;Private;223;Buisiness;22 Ulico;Ensal;Private;223;Buisiness;22 Lser;Elleu;Private;223;Buisiness;22 Eace;Ioremal;Private;223;Buisiness;22 Iande;Madora;Private;223;Buisiness;22 Aha;Rgune;Private;223;Buisiness;22 Lde;Erure;Private;223;Buisiness;22 Eevero;Lordi;Private;223;Buisiness;22 Ernom;Ineve;Private;223;Buisiness;22 Oden;Ayris;Private;223;Buisiness;22 Omen;Ibrau;Private;223;Buisiness;22 Eist;Rodeott;Private;223;Buisiness;22 Ndo;Alliso;Private;223;Buisiness;22 Yay;Ugurlaw;Private;223;Buisiness;22 Are;Aisca;Private;223;Buisiness;22 Lilye;Rerol;Private;223;Buisiness;22 Fers;Aicker;Private;223;Buisiness;22 Erten;Odedne;Private;223;Buisiness;22 Eesya;Ududan;Private;223;Buisiness;22 Ldetsa;Ishapan;Private;223;Buisiness;22 Nahe;Orirge;Private;223;Buisiness;22 Ishig;Intori;Private;223;Buisiness;22 Onelim;Lareyn;Private;223;Buisiness;22 Eylos;Erter;Private;223;Buisiness;22 Yeyd;Marol;Private;223;Buisiness;22 Eturvo;Aronto;Private;223;Buisiness;22 Nanke;Aronen;Private;223;Buisiness;22 Oniv;Adaconc;Private;223;Buisiness;22 Nzetho;Izaip;Private;223;Buisiness;22 Lety;Olvit;Private;223;Buisiness;22 Reoru;Lueri;Private;223;Buisiness;22 Tyeito;Arevig;Private;223;Buisiness;22 Nneto;Ugtach;Private;223;Buisiness;22 Setayc;Cyeton;Private;223;Buisiness;22 Tonya;Ydissam;Private;223;Buisiness;22 Ervis;Beril;Private;223;Buisiness;22 Usow;Theneri;Private;223;Buisiness;22 Ynilla;Eliana;Private;223;Buisiness;22 Evern;Abara;Private;223;Buisiness;22 Ogurte;Eldonzi;Private;223;Buisiness;22 Ngemo;Ududdol;Private;223;Buisiness;22 Odoeve;Yrabeyc;Private;223;Buisiness;22 Rtili;Vizge;Private;223;Buisiness;22 Shis;Aronele;Private;223;Buisiness;22 Eom;Waner;Private;223;Buisiness;22 Ebui;Eicer;Private;223;Buisiness;22 Lde;Adner;Private;223;Buisiness;22 Erunt;Yanzi;Private;223;Buisiness;22 Sugoru;Larixw;Private;223;Buisiness;22 Rlen;Ensere;Private;223;Buisiness;22 Samom;Rbelanr;Private;223;Buisiness;22 Kerur;Elisou;Private;223;Buisiness;22 Rie;Endesc;Private;223;Buisiness;22 Aca;Ernen;Private;223;Buisiness;22 Everdu;Nsanenn;Private;223;Buisiness;22 Adbo;Emijo;Private;223;Buisiness;22 Arne;Usedi;Private;223;Buisiness;22 Abra;Osexayr;Private;223;Buisiness;22 Ana;Diler;Private;223;Buisiness;22 Omo;Ierin;Private;223;Buisiness;22 Ymas;Onden;Private;223;Buisiness;22 Aheu;Tubun;Private;223;Buisiness;22 Ucha;Aronnin;Private;223;Buisiness;22 Ither;Aropa;Private;223;Buisiness;22 Vorig;Aneord;Private;223;Buisiness;22 Elor;Rnarri;Private;223;Buisiness;22 Ulengo;Hannic;Private;223;Buisiness;22 Tteli;Isetoze;Private;223;Buisiness;22 Roley;Orron;Private;223;Buisiness;22 Ere;Eredgo;Private;223;Buisiness;22 Urolit;Othel;Private;223;Buisiness;22 Amane;Aster;Private;223;Buisiness;22 Jerdic;Udwise;Private;223;Buisiness;22 Ncin;Evayrut;Private;223;Buisiness;22 Rmee;Froro;Private;223;Buisiness;22 Flald;Hunay;Private;223;Buisiness;22 Adan;Elyaror;Private;223;Buisiness;22 Orinte;Nderem;Private;223;Buisiness;22 Oylird;Eanahe;Private;223;Buisiness;22 Icyara;Revats;Private;223;Buisiness;22 Ewalin;Ilisc;Private;223;Buisiness;22 Eviet;Ngian;Private;223;Buisiness;22 Ero;Ergol;Private;223;Buisiness;22 Hiedom;Erose;Private;223;Buisiness;22 Rencus;Unrudud;Private;223;Buisiness;22 Rilm;Abruch;Private;223;Buisiness;22 Ldora;Inipene;Private;223;Buisiness;22 Ylacka;Anerus;Private;223;Buisiness;22 Aro;Sornag;Private;223;Buisiness;22 Ylene;Aletori;Private;223;Buisiness;22 Ulursa;Zicker;Private;223;Buisiness;22 Ezo;Tyazil;Private;223;Buisiness;22 Eont;Ruipen;Private;223;Buisiness;22 Ldal;Anines;Private;223;Buisiness;22 Alee;Theam;Private;223;Buisiness;22 Ahar;Hedge;Private;223;Buisiness;22 Hon;Eydorbu;Private;223;Buisiness;22 Iar;Udaron;Private;223;Buisiness;22 Ilya;Lafail;Private;223;Buisiness;22 Ron;Hosacu;Private;223;Buisiness;22 Orrur;Erona;Private;223;Buisiness;22 Wan;Comobu;Private;223;Buisiness;22 Thamon;Syante;Private;223;Buisiness;22 Eri;Eseturu;Private;223;Buisiness;22 Thale;Shetyar;Private;223;Buisiness;22 Ermete;Dackaxt;Private;223;Buisiness;22 Abow;Perti;Private;223;Buisiness;22 Oone;Inniub;Private;223;Buisiness;22 Unertu;Teoli;Private;223;Buisiness;22 Esa;Inkazis;Private;223;Buisiness;22 Nelele;Arnebe;Private;223;Buisiness;22 Elee;Iguro;Private;223;Buisiness;22 Orli;Rudsoe;Private;223;Buisiness;22 Tern;Inetom;Private;223;Buisiness;22 Amowai;Eryen;Private;223;Buisiness;22 Eryen;Interub;Private;223;Buisiness;22 Uisy;Ardufir;Private;223;Buisiness;22 Alp;Erlill;Private;223;Buisiness;22 Ner;Ingama;Private;223;Buisiness;22 Lanust;Eoffoz;Private;223;Buisiness;22 Adetob;Ipeerea;Private;223;Buisiness;22 Neng;Ssetoon;Private;223;Buisiness;22 Nzene;Rounto;Private;223;Buisiness;22 Eno;Rtaldas;Private;223;Buisiness;22 Abudya;Atine;Private;223;Buisiness;22 Nde;Tolled;Private;223;Buisiness;22 Awa;Unigt;Private;223;Buisiness;22 Ier;Spersar;Private;223;Buisiness;22 Berell;Omeldi;Private;223;Buisiness;22 Rom;Arannet;Private;223;Buisiness;22 Ontoy;Orner;Private;223;Buisiness;22 Sulyar;Enaden;Private;223;Buisiness;22 Llale;Ylian;Private;223;Buisiness;22 Rlange;Ucupeld;Private;223;Buisiness;22 Emad;Isparlo;Private;223;Buisiness;22 Iju;Adisi;Private;223;Buisiness;22 Itort;Agoliv;Private;223;Buisiness;22 Ches;Lgelman;Private;223;Buisiness;22 Erripp;Uciti;Private;223;Buisiness;22 Odiays;Euzafo;Private;223;Buisiness;22 Come;Yratto;Private;223;Buisiness;22 Narg;Darlic;Private;223;Buisiness;22 Ialyen;Rmice;Private;223;Buisiness;22 One;Eabrad;Private;223;Buisiness;22 Dni;Ostota;Private;223;Buisiness;22 Fra;Acomal;Private;223;Buisiness;22 Ald;Elvalan;Private;223;Buisiness;22 Arv;Ilose;Private;223;Buisiness;22 Ororal;Aroneg;Private;223;Buisiness;22 Anild;Erilahy;Private;223;Buisiness;22 Wahi;Rnaste;Private;223;Buisiness;22 Ceri;Apeanre;Private;223;Buisiness;22 Aderg;Alindis;Private;223;Buisiness;22 Cero;Ewased;Private;223;Buisiness;22 Adut;Amase;Private;223;Buisiness;22 Anor;Untevia;Private;223;Buisiness;22 Dirs;Ldusono;Private;223;Buisiness;22 Rterl;Aripe;Private;223;Buisiness;22 Attuy;Ggemo;Private;223;Buisiness;22 Ggad;Amelyan;Private;223;Buisiness;22 Ahyena;Alahee;Private;223;Buisiness;22 Heu;Encos;Private;223;Buisiness;22 Ann;Reryen;Private;223;Buisiness;22 Hirent;Iestelv;Private;223;Buisiness;22 Onn;Inelenn;Private;223;Buisiness;22 Exta;Anenne;Private;223;Buisiness;22 Thu;Orerlo;Private;223;Buisiness;22 Ludy;Ethett;Private;223;Buisiness;22 Eta;Ezgacho;Private;223;Buisiness;22 Ulele;Monda;Private;223;Buisiness;22 Onedwa;Eranna;Private;223;Buisiness;22 Lelf;Eleaha;Private;223;Buisiness;22 Orain;Halyal;Private;223;Buisiness;22 Ell;Ttallel;Private;223;Buisiness;22 Htudio;Arnier;Private;223;Buisiness;22 Orormi;Osone;Private;223;Buisiness;22 Sasa;Syasez;Private;223;Buisiness;22 Yaise;Ontar;Private;223;Buisiness;22 Toder;Sorayla;Private;223;Buisiness;22 Inti;Egnerr;Private;223;Buisiness;22 Pale;Griarv;Private;223;Buisiness;22 Ysu;Thebi;Private;223;Buisiness;22 Uda;Oymozi;Private;223;Buisiness;22 Ran;Erwin;Private;223;Buisiness;22 Kemi;Oonebar;Private;223;Buisiness;22 Osonce;Wyeyn;Private;223;Buisiness;22 Tenene;Tunes;Private;223;Buisiness;22 Lderor;Ncadwa;Private;223;Buisiness;22 Astous;Rcardu;Private;223;Buisiness;22 Gator;Onadr;Private;223;Buisiness;22 Iasw;Onrie;Private;223;Buisiness;22 Cail;Orest;Private;223;Buisiness;22 Ieri;Lsomalb;Private;223;Buisiness;22 Mant;Anasalo;Private;223;Buisiness;22 Iste;Rudwau;Private;223;Buisiness;22 Zge;Eurwi;Private;223;Buisiness;22 Rlagal;Utokerr;Private;223;Buisiness;22 Orisy;Oorinar;Private;223;Buisiness;22 Eldes;Kilel;Private;223;Buisiness;22 Ityan;Enopa;Private;223;Buisiness;22 Togoke;Usurtu;Private;223;Buisiness;22 Ella;Aucont;Private;223;Buisiness;22 Turi;Oldolf;Private;223;Buisiness;22 Ine;Eerdan;Private;223;Buisiness;22 Ant;Eddal;Private;223;Buisiness;22 Danin;Laner;Private;223;Buisiness;22 Bre;Eerriph;Private;223;Buisiness;22 Err;Eyaro;Private;223;Buisiness;22 Ilt;Sherd;Private;223;Buisiness;22 Ucene;Stewr;Private;223;Buisiness;22 Waswau;Utonda;Private;223;Buisiness;22 Inc;Usaki;Private;223;Buisiness;22 Ttone;Nodlan;Private;223;Buisiness;22 Ikalon;Hendeo;Private;223;Buisiness;22 Ersan;Onalde;Private;223;Buisiness;22 Teldab;Asigar;Private;223;Buisiness;22 Ucl;Ettora;Private;223;Buisiness;22 Ala;Eored;Private;223;Buisiness;22 Uscex;Orahisk;Private;223;Buisiness;22 Yret;Rafut;Private;223;Buisiness;22 Icyane;Arorl;Private;223;Buisiness;22 Irmere;Undadwi;Private;223;Buisiness;22 Aupeo;Taneron;Private;223;Buisiness;22 Arenel;Amawe;Private;223;Buisiness;22 Nalu;Zeman;Private;223;Buisiness;22 Ooban;Gutteb;Private;223;Buisiness;22 Nzon;Anely;Private;223;Buisiness;22 Ukar;Denyar;Private;223;Buisiness;22 Ell;Dusyale;Private;223;Buisiness;22 Oone;Llerish;Private;223;Buisiness;22 Ielupa;Inigiga;Private;223;Buisiness;22 Esy;Eteril;Private;223;Buisiness;22 Ila;Ubrer;Private;223;Buisiness;22 Oexo;Onyala;Private;223;Buisiness;22 Utte;Asarr;Private;223;Buisiness;22 Isar;Heydu;Private;223;Buisiness;22 Brebu;Omeipe;Private;223;Buisiness;22 Len;Uzeld;Private;223;Buisiness;22 Ergilm;Omaugin;Private;223;Buisiness;22 Nisorv;Wisalda;Private;223;Buisiness;22 Nge;Ahahe;Private;223;Buisiness;22 Ouswev;Anerr;Private;223;Buisiness;22 Alu;Useor;Private;223;Buisiness;22 Eris;Udahein;Private;223;Buisiness;22 Rsisse;Udyeve;Private;223;Buisiness;22 Pherl;Rcacke;Private;223;Buisiness;22 Anz;Htahar;Private;223;Buisiness;22 Thala;Uscul;Private;223;Buisiness;22 She;Etyayd;Private;223;Buisiness;22 Han;Onsodre;Private;223;Buisiness;22 Ysorv;Eegaogl;Private;223;Buisiness;22 Omonzi;Lexon;Private;223;Buisiness;22 Iltac;Aberdo;Private;223;Buisiness;22 Tad;Thancey;Private;223;Buisiness;22 Nedo;Linern;Private;223;Buisiness;22 Rale;Ednea;Private;223;Buisiness;22 Ulen;Dlaster;Private;223;Buisiness;22 Oli;Utreram;Private;223;Buisiness;22 Ldet;Enivel;Private;223;Buisiness;22 Innige;Axwiera;Private;223;Buisiness;22 Yman;Darob;Private;223;Buisiness;22 Elicy;Olass;Private;223;Buisiness;22 Alon;Ellerus;Private;223;Buisiness;22 Lispo;Eynalla;Private;223;Buisiness;22 Hacana;Dralie;Private;223;Buisiness;22 Eli;Berando;Private;223;Buisiness;22 Liene;Neacer;Private;223;Buisiness;22 Unand;Usorya;Private;223;Buisiness;22 Ysiski;Ndonek;Private;223;Buisiness;22 Dede;Namoug;Private;223;Buisiness;22 Ankeya;Nnivorc;Private;223;Buisiness;22 Hiro;Ddeketa;Private;223;Buisiness;22 Adya;Nerto;Private;223;Buisiness;22 Oesyes;Llorush;Private;223;Buisiness;22 Rde;Zwiany;Private;223;Buisiness;22 Mesono;Thaxard;Private;223;Buisiness;22 Uste;Audowal;Private;223;Buisiness;22 Areri;Ndewis;Private;223;Buisiness;22 Nce;Ardiam;Private;223;Buisiness;22 Rcizin;Boylil;Private;223;Buisiness;22 Xte;Solial;Private;223;Buisiness;22 Iussam;Lorre;Private;223;Buisiness;22 Onn;Objuder;Private;223;Buisiness;22 Udyed;Shala;Private;223;Buisiness;22 Oliol;Orado;Private;223;Buisiness;22 And;Rneny;Private;223;Buisiness;22 Umaru;Stilf;Private;223;Buisiness;22 Arde;Yrauge;Private;223;Buisiness;22 Obathi;Adinton;Private;223;Buisiness;22 Ldi;Hineri;Private;223;Buisiness;22 Ysett;Hackin;Private;223;Buisiness;22 Stacki;Lyaha;Private;223;Buisiness;22 Dah;Entanzi;Private;223;Buisiness;22 Arcoet;Ulasti;Private;223;Buisiness;22 Anda;Neteki;Private;223;Buisiness;22 Asa;Cligeal;Private;223;Buisiness;22 Gussa;Lyaki;Private;223;Buisiness;22 Eladan;Ayahe;Private;223;Buisiness;22 Arine;Barnerb;Private;223;Buisiness;22 Maycad;Opera;Private;223;Buisiness;22 Amal;Hanul;Private;223;Buisiness;22 Alerli;Scinsou;Private;223;Buisiness;22 Ryag;Oraney;Private;223;Buisiness;22 Warit;Oushe;Private;223;Buisiness;22 Feod;Ndeyve;Private;223;Buisiness;22 Erucay;Onnert;Private;223;Buisiness;22 Els;Erterie;Private;223;Buisiness;22 Hellia;Ollisu;Private;223;Buisiness;22 Uroe;Evayve;Private;223;Buisiness;22 Nema;Dinored;Private;223;Buisiness;22 Sto;Rwierta;Private;223;Buisiness;22 Hanzea;Nnonz;Private;223;Buisiness;22 Ude;Ounne;Private;223;Buisiness;22 Yaucl;Winca;Private;223;Buisiness;22 Uss;Arnele;Private;223;Buisiness;22 Elt;Uphan;Private;223;Buisiness;22 Arc;Sherarl;Private;223;Buisiness;22 Phor;Xalsorg;Private;223;Buisiness;22 Hodo;Alanca;Private;223;Buisiness;22 Talu;Aifrudu;Private;223;Buisiness;22 Urg;Selinc;Private;223;Buisiness;22 Andio;Igirna;Private;223;Buisiness;22 Endil;Arterto;Private;223;Buisiness;22 Ielbe;Kalla;Private;223;Buisiness;22 Tia;Roruma;Private;223;Buisiness;22 Yrave;Ttiner;Private;223;Buisiness;22 Zof;Asudy;Private;223;Buisiness;22 Uitalo;Ercon;Private;223;Buisiness;22 Igo;Pterrer;Private;223;Buisiness;22 Ivic;Erami;Private;223;Buisiness;22 Eas;Rondord;Private;223;Buisiness;22 Epper;Incona;Private;223;Buisiness;22 Lse;Ysonain;Private;223;Buisiness;22 Averc;Aderga;Private;223;Buisiness;22 Tyeo;Ookan;Private;223;Buisiness;22 Rory;Ilitcod;Private;223;Buisiness;22 Arn;Uedan;Private;223;Buisiness;22 Axtian;Udondev;Private;223;Buisiness;22 Opeve;Llenar;Private;223;Buisiness;22 Getilk;Banes;Private;223;Buisiness;22 Tte;Akebude;Private;223;Buisiness;22 Relye;Unona;Private;223;Buisiness;22 Thex;Exann;Private;223;Buisiness;22 Ylufor;Ymelrer;Private;223;Buisiness;22 Azom;Rneraru;Private;223;Buisiness;22 Dda;Reyderg;Private;223;Buisiness;22 Iam;Themo;Private;223;Buisiness;22 Antont;Encull;Private;223;Buisiness;22 Eru;Rloty;Private;223;Buisiness;22 Rerd;Ugoni;Private;223;Buisiness;22 Onoet;Usoydar;Private;223;Buisiness;22 Truki;Lisalb;Private;223;Buisiness;22 Upha;Ureney;Private;223;Buisiness;22 Eyseri;Urielb;Private;223;Buisiness;22 Earge;Wisson;Private;223;Buisiness;22 Ucl;Oryarna;Private;223;Buisiness;22 Dus;Ayerelo;Private;223;Buisiness;22 Ers;Lucorar;Private;223;Buisiness;22 Olleex;Uscewa;Private;223;Buisiness;22 Balya;Eaner;Private;223;Buisiness;22 Ugist;Utoedo;Private;223;Buisiness;22 Eysos;Otovel;Private;223;Buisiness;22 Eolom;Eorothe;Private;223;Buisiness;22 Ver;Naron;Private;223;Buisiness;22 Cya;Sintalo;Private;223;Buisiness;22 Oucar;Uchenn;Private;223;Buisiness;22 Ulab;Ongayso;Private;223;Buisiness;22 Nele;Utubeci;Private;223;Buisiness;22 Rali;Gonsafa;Private;223;Buisiness;22 Isacu;Eoydiro;Private;223;Buisiness;22 Onyar;Rnigal;Private;223;Buisiness;22 Itlac;Oerac;Private;223;Buisiness;22 Eosten;Corto;Private;223;Buisiness;22 Ich;Ackelva;Private;223;Buisiness;22 Pede;Eresyas;Private;223;Buisiness;22 Upail;Airerad;Private;223;Buisiness;22 Endar;Ilirl;Private;223;Buisiness;22 Gon;Rtigli;Private;223;Buisiness;22 Oya;Entor;Private;223;Buisiness;22 Rahit;Thermon;Private;223;Buisiness;22 Earexa;Ildeaco;Private;223;Buisiness;22 Hori;Erirc;Private;223;Buisiness;22 Vern;Ennonta;Private;223;Buisiness;22 Vol;Ncevem;Private;223;Buisiness;22 Ude;Atort;Private;223;Buisiness;22 Relaru;Pentud;Private;223;Buisiness;22 Tos;Dwiubri;Private;223;Buisiness;22 Yav;Hervi;Private;223;Buisiness;22 Lde;Engom;Private;223;Buisiness;22 Ixt;Ironn;Private;223;Buisiness;22 Ulber;Nniant;Private;223;Buisiness;22 Egav;Itrish;Private;223;Buisiness;22 Etorl;Rostoda;Private;223;Buisiness;22 Ose;Avitni;Private;223;Buisiness;22 Iera;Rallett;Private;223;Buisiness;22 Ijora;Alallel;Private;223;Buisiness;22 Obay;Oledgas;Private;223;Buisiness;22 New;Onezart;Private;223;Buisiness;22 Udloso;Theyrem;Private;223;Buisiness;22 Fror;Arnel;Private;223;Buisiness;22 Eet;Uynen;Private;223;Buisiness;22 Evebr;Rnerru;Private;223;Buisiness;22 Lle;Ussiaya;Private;223;Buisiness;22 Ill;Exaruso;Private;223;Buisiness;22 Riso;Uginer;Private;223;Buisiness;22 Oteva;Dillenr;Private;223;Buisiness;22 Ugwo;Ruscar;Private;223;Buisiness;22 Nce;Ubuscus;Private;223;Buisiness;22 Oldu;Omcive;Private;223;Buisiness;22 Oman;Icorat;Private;223;Buisiness;22 Aem;Inton;Private;223;Buisiness;22 Onk;Hebuns;Private;223;Buisiness;22 Eso;Ynobu;Private;223;Buisiness;22 Nyee;Tcerno;Private;223;Buisiness;22 Nteri;Araege;Private;223;Buisiness;22 Eami;Thalus;Private;223;Buisiness;22 Dgom;Ufrar;Private;223;Buisiness;22 Thari;Erderi;Private;223;Buisiness;22 Ubero;Aymonen;Private;223;Buisiness;22 Ard;Narwit;Private;223;Buisiness;22 Cti;Ndurne;Private;223;Buisiness;22 Inowit;Onelban;Private;223;Buisiness;22 Syel;Ordelo;Private;223;Buisiness;22 Yagumo;Ittel;Private;223;Buisiness;22 Hezi;Shurra;Private;223;Buisiness;22 Ade;Oylave;Private;223;Buisiness;22 Ardenn;Ngiseg;Private;223;Buisiness;22 Hie;Elyan;Private;223;Buisiness;22 Aresu;Ranka;Private;223;Buisiness;22 Alvon;Thaldan;Private;223;Buisiness;22 Ymia;Abjone;Private;223;Buisiness;22 Walye;Ermant;Private;223;Buisiness;22 Aba;Efeya;Private;223;Buisiness;22 Aro;Aneteng;Private;223;Buisiness;22 Ler;Toent;Private;223;Buisiness;22 Beye;Eoneki;Private;223;Buisiness;22 Edwi;Hatter;Private;223;Buisiness;22 Omat;Rtort;Private;223;Buisiness;22 Onec;Ernerte;Private;223;Buisiness;22 Eylich;Eleneyn;Private;223;Buisiness;22 Ixame;Lolbar;Private;223;Buisiness;22 Elera;Atand;Private;223;Buisiness;22 Ont;Ydelv;Private;223;Buisiness;22 Odac;Imaclo;Private;223;Buisiness;22 Argo;Wadris;Private;223;Buisiness;22 Uylah;Caleyle;Private;223;Buisiness;22 Ishia;Ineono;Private;223;Buisiness;22 Uleb;Iunda;Private;223;Buisiness;22 Ste;Lishara;Private;223;Buisiness;22 Iad;Wilvi;Private;223;Buisiness;22 Mar;Eenrare;Private;223;Buisiness;22 Ttons;Giogone;Private;223;Buisiness;22 Harisq;Rivodr;Private;223;Buisiness;22 Afon;Flortol;Private;223;Buisiness;22 Oulla;Iesoner;Private;223;Buisiness;22 Dwi;Rende;Private;223;Buisiness;22 Afahon;Aidonye;Private;223;Buisiness;22 Lasenn;Iveranc;Private;223;Buisiness;22 Oppeyl;Lilelal;Private;223;Buisiness;22 Tolf;Aneme;Private;223;Buisiness;22 Ckes;Eltin;Private;223;Buisiness;22 Arled;Extan;Private;223;Buisiness;22 Ahar;Ailet;Private;223;Buisiness;22 Ishe;Ragive;Private;223;Buisiness;22 Ercim;Rterf;Private;223;Buisiness;22 Sati;Ornera;Private;223;Buisiness;22 Eva;Aromais;Private;223;Buisiness;22 Ldahar;Aynau;Private;223;Buisiness;22 Isee;Hickill;Private;223;Buisiness;22 Ofe;Elemeri;Private;223;Buisiness;22 Eene;Reylern;Private;223;Buisiness;22 Udo;Emang;Private;223;Buisiness;22 Lever;Ssony;Private;223;Buisiness;22 Oern;Igalmil;Private;223;Buisiness;22 Osw;Wickeno;Private;223;Buisiness;22 Eri;Erlie;Private;223;Buisiness;22 Ocayle;Eloelic;Private;223;Buisiness;22 Shor;Onfor;Private;223;Buisiness;22 Oneib;Hialm;Private;223;Buisiness;22 Hor;Erelle;Private;223;Buisiness;22 Lentar;Tober;Private;223;Buisiness;22 Steror;Utionel;Private;223;Buisiness;22 Eren;Obinal;Private;223;Buisiness;22 Weerod;Laroth;Private;223;Buisiness;22 Tyain;Iggert;Private;223;Buisiness;22 Rgi;Goriph;Private;223;Buisiness;22 Ord;Dewije;Private;223;Buisiness;22 Clel;Orelbu;Private;223;Buisiness;22 Lyai;Ealya;Private;223;Buisiness;22 Iralso;Rorcer;Private;223;Buisiness;22 Uiloru;Aronile;Private;223;Buisiness;22 Ardoro;Arsert;Private;223;Buisiness;22 Nnet;Ulwald;Private;223;Buisiness;22 Uyee;Hianel;Private;223;Buisiness;22 Acyew;Harmo;Private;223;Buisiness;22 Trop;Esetyan;Private;223;Buisiness;22 Antoke;Perne;Private;223;Buisiness;22 Yliaha;Usane;Private;223;Buisiness;22 Nzia;Odayr;Private;223;Buisiness;22 Warna;Umala;Private;223;Buisiness;22 Icke;Duence;Private;223;Buisiness;22 Ner;Udonen;Private;223;Buisiness;22 Eronol;Ootri;Private;223;Buisiness;22 Orrola;Ugenne;Private;223;Buisiness;22 Ora;Drarn;Private;223;Buisiness;22 Slinea;Eronit;Private;223;Buisiness;22 Rtisa;Tifel;Private;223;Buisiness;22 Eld;Cesad;Private;223;Buisiness;22 Oyse;Udala;Private;223;Buisiness;22 Eal;Alevith;Private;223;Buisiness;22 Zelu;Forop;Private;223;Buisiness;22 Icio;Yloer;Private;223;Buisiness;22 Alexte;Onnieli;Private;223;Buisiness;22 Aser;Ayneutt;Private;223;Buisiness;22 Ile;Otexonn;Private;223;Buisiness;22 Tesist;Phooyr;Private;223;Buisiness;22 Alongi;Salet;Private;223;Buisiness;22 Ugg;Corda;Private;223;Buisiness;22 Eyd;Ynere;Private;223;Buisiness;22 Isar;Eonip;Private;223;Buisiness;22 Vemery;Llenrem;Private;223;Buisiness;22 Lay;Nduil;Private;223;Buisiness;22 Larero;Drishe;Private;223;Buisiness;22 Etert;Iertosa;Private;223;Buisiness;22 Many;Onnada;Private;223;Buisiness;22 Odgu;Molisay;Private;223;Buisiness;22 Ealso;Eitafr;Private;223;Buisiness;22 Onen;Avean;Private;223;Buisiness;22 Onc;Unelera;Private;223;Buisiness;22 Eloli;Nceya;Private;223;Buisiness;22 Ysem;Frell;Private;223;Buisiness;22 Ini;Ostale;Private;223;Buisiness;22 Oseyn;Llervel;Private;223;Buisiness;22 Olvev;Anodro;Private;223;Buisiness;22 Isour;Maush;Private;223;Buisiness;22 Onz;Idist;Private;223;Buisiness;22 Esiset;Lealus;Private;223;Buisiness;22 Ronerd;Ogretro;Private;223;Buisiness;22 Arlo;Enyahe;Private;223;Buisiness;22 Mans;Erdan;Private;223;Buisiness;22 Era;Licer;Private;223;Buisiness;22 Ane;Annerno;Private;223;Buisiness;22 Udw;Erlin;Private;223;Buisiness;22 Ordol;Alloev;Private;223;Buisiness;22 Than;Optel;Private;223;Buisiness;22 Aldesa;Ilinex;Private;223;Buisiness;22 Mmon;Leyneb;Private;223;Buisiness;22 Land;Iardea;Private;223;Buisiness;22 Okuc;Enyeri;Private;223;Buisiness;22 Devil;Indonna;Private;223;Buisiness;22 Nyante;Syentee;Private;223;Buisiness;22 Eya;Ertora;Private;223;Buisiness;22 Erlev;Edliast;Private;223;Buisiness;22 Asho;Ebren;Private;223;Buisiness;22 Hea;Orturia;Private;223;Buisiness;22 Anen;Earbude;Private;223;Buisiness;22 Sanaw;Erial;Private;223;Buisiness;22 Awabu;Nniers;Private;223;Buisiness;22 Cotolu;Rento;Private;223;Buisiness;22 Ais;Hartigi;Private;223;Buisiness;22 Lta;Vielon;Private;223;Buisiness;22 Erdui;Lmott;Private;223;Buisiness;22 Onel;Ellosho;Private;223;Buisiness;22 Ure;Nondow;Private;223;Buisiness;22 Tes;Lveere;Private;223;Buisiness;22 Igewa;Thada;Private;223;Buisiness;22 Weamn;Eldavey;Private;223;Buisiness;22 Urade;Osillip;Private;223;Buisiness;22 Urlon;Anceyri;Private;223;Buisiness;22 Ocelah;Oeneran;Private;223;Buisiness;22 Ahusel;Atanor;Private;223;Buisiness;22 Ckal;Toreldo;Private;223;Buisiness;22 Uciby;Taronea;Private;223;Buisiness;22 Enso;Ynone;Private;223;Buisiness;22 Iarto;Amnert;Private;223;Buisiness;22 Etl;Inamai;Private;223;Buisiness;22 Terl;Eylerud;Private;223;Buisiness;22 Lope;Ercay;Private;223;Buisiness;22 Efea;Enito;Private;223;Buisiness;22 Esca;Yasort;Private;223;Buisiness;22 Rer;Arned;Private;223;Buisiness;22 Encis;Utureod;Private;223;Buisiness;22 Aiched;Aponn;Private;223;Buisiness;22 Htato;Aryacke;Private;223;Buisiness;22 Urcesy;Avelali;Private;223;Buisiness;22 Uman;Ostoni;Private;223;Buisiness;22 Icet;Ulwallo;Private;223;Buisiness;22 Anyeda;Niallat;Private;223;Buisiness;22 Ner;Ntiaser;Private;223;Buisiness;22 Shabe;Rneratr;Private;223;Buisiness;22 Rwa;Ianamaw;Private;223;Buisiness;22 Ete;Oraken;Private;223;Buisiness;22 Oneled;Ubrasa;Private;223;Buisiness;22 Oud;Alanne;Private;223;Buisiness;22 Dyatin;Theror;Private;223;Buisiness;22 Rwic;Erewarc;Private;223;Buisiness;22 Elanen;Ucith;Private;223;Buisiness;22 Avito;Ulaman;Private;223;Buisiness;22 Nci;Olrarsu;Private;223;Buisiness;22 Yaudo;Liodoro;Private;223;Buisiness;22 Rereto;Iterra;Private;223;Buisiness;22 Lero;Artext;Private;223;Buisiness;22 Enk;Ericel;Private;223;Buisiness;22 Axade;Udosk;Private;223;Buisiness;22 Ucor;Ennie;Private;223;Buisiness;22 Ern;Ysude;Private;223;Buisiness;22 Altan;Miscam;Private;223;Buisiness;22 Cenist;Opernen;Private;223;Buisiness;22 Oyn;Ruleve;Private;223;Buisiness;22 Alal;Nenasha;Private;223;Buisiness;22 Uck;Erdaror;Private;223;Buisiness;22 Esqude;Aheipo;Private;223;Buisiness;22 Roo;Evanna;Private;223;Buisiness;22 Tyeor;Anrop;Private;223;Buisiness;22 Icerl;Aharya;Private;223;Buisiness;22 Erl;Hernal;Private;223;Buisiness;22 Hana;Naroner;Private;223;Buisiness;22 Onano;Oylag;Private;223;Buisiness;22 Unk;Eoynena;Private;223;Buisiness;22 Ena;Ewonesc;Private;223;Buisiness;22 Eille;Erala;Private;223;Buisiness;22 Evirli;Ezgoni;Private;223;Buisiness;22 Dosad;Ashaste;Private;223;Buisiness;22 Osi;Eroravi;Private;223;Buisiness;22 Rlevil;Truscit;Private;223;Buisiness;22 Tozals;Wisheyn;Private;223;Buisiness;22 Era;Isicart;Private;223;Buisiness;22 Omana;Irrale;Private;223;Buisiness;22 Umashe;Ifrolil;Private;223;Buisiness;22 Aram;Omadya;Private;223;Buisiness;22 Owane;Pharre;Private;223;Buisiness;22 Ustorg;Ntinn;Private;223;Buisiness;22 Warl;Isail;Private;223;Buisiness;22 Unde;Venift;Private;223;Buisiness;22 Erte;Hencal;Private;223;Buisiness;22 Iukezi;Rcaneo;Private;223;Buisiness;22 Nge;Elduf;Private;223;Buisiness;22 Sar;Ckisya;Private;223;Buisiness;22 Utrery;Toner;Private;223;Buisiness;22 Mistar;Hipatro;Private;223;Buisiness;22 Isonek;Miriand;Private;223;Buisiness;22 Udal;Nzerlal;Private;223;Buisiness;22 Erooro;Theymop;Private;223;Buisiness;22 Nria;Urola;Private;223;Buisiness;22 Deve;Tuseon;Private;223;Buisiness;22 Albe;Ylexa;Private;223;Buisiness;22 Uth;Ggonce;Private;223;Buisiness;22 Abe;Juzel;Private;223;Buisiness;22 Rsomm;Unenke;Private;223;Buisiness;22 Erte;Nridyas;Private;223;Buisiness;22 Ont;Evier;Private;223;Buisiness;22 Enipe;Pelde;Private;223;Buisiness;22 Eegige;Umalale;Private;223;Buisiness;22 Opevie;Hagler;Private;223;Buisiness;22 Ite;Ugorya;Private;223;Buisiness;22 Ril;Ayrexon;Private;223;Buisiness;22 Ussa;Ircipet;Private;223;Buisiness;22 Sha;Enant;Private;223;Buisiness;22 Uclerd;Ieyleom;Private;223;Buisiness;22 Dwann;Arorga;Private;223;Buisiness;22 Rnert;Ashefo;Private;223;Buisiness;22 Rlaton;Onyacke;Private;223;Buisiness;22 Aril;Aderdu;Private;223;Buisiness;22 Igel;Oloner;Private;223;Buisiness;22 Isyall;Oston;Private;223;Buisiness;22 Amarfa;Utoyl;Private;223;Buisiness;22 Igli;Withier;Private;223;Buisiness;22 Oneani;Oncal;Private;223;Buisiness;22 Elerk;Urder;Private;223;Buisiness;22 Ntort;Acona;Private;223;Buisiness;22 Doro;Ernar;Private;223;Buisiness;22 Unerer;Rernea;Private;223;Buisiness;22 One;Edenci;Private;223;Buisiness;22 Hivab;Reanya;Private;223;Buisiness;22 Uder;Aruba;Private;223;Buisiness;22 Inrud;Olgety;Private;223;Buisiness;22 Ahu;Llaxane;Private;223;Buisiness;22 Dererl;Llinda;Private;223;Buisiness;22 Rnarw;Udunti;Private;223;Buisiness;22 Dne;Pheobab;Private;223;Buisiness;22 Anerl;Nnilo;Private;223;Buisiness;22 Osqud;Seldarl;Private;223;Buisiness;22 Ninere;Nwasya;Private;223;Buisiness;22 Hierus;Entern;Private;223;Buisiness;22 Devery;Argiar;Private;223;Buisiness;22 Alyam;Dekarya;Private;223;Buisiness;22 Iconne;Usteys;Private;223;Buisiness;22 Ugu;Osyadn;Private;223;Buisiness;22 Tya;Ieler;Private;223;Buisiness;22 Malf;Hitha;Private;223;Buisiness;22 Aben;Asyarma;Private;223;Buisiness;22 Ewanta;Anyargi;Private;223;Buisiness;22 Ensi;Ivish;Private;223;Buisiness;22 Rdir;Oedera;Private;223;Buisiness;22 Oen;Inosh;Private;223;Buisiness;22 Nyav;Aldinn;Private;223;Buisiness;22 Nind;Merteld;Private;223;Buisiness;22 Osyayn;Bususha;Private;223;Buisiness;22 Ial;Ancis;Private;223;Buisiness;22 Lador;Anerda;Private;223;Buisiness;22 Cevo;Rertetl;Private;223;Buisiness;22 Esca;Eragle;Private;223;Buisiness;22 Sos;Earli;Private;223;Buisiness;22 Utedin;Tenru;Private;223;Buisiness;22 Onorus;Ahaut;Private;223;Buisiness;22 Oli;Owanyal;Private;223;Buisiness;22 Tianye;Onorru;Private;223;Buisiness;22 Onugo;Getrar;Private;223;Buisiness;22 Rma;Fonso;Private;223;Buisiness;22 Age;Ebuso;Private;223;Buisiness;22 Rneud;Hipel;Private;223;Buisiness;22 Orace;Grietol;Private;223;Buisiness;22 Wig;Funnist;Private;223;Buisiness;22 Edew;Ukinac;Private;223;Buisiness;22 Nesi;Erben;Private;223;Buisiness;22 Non;Llicebr;Private;223;Buisiness;22 Orsive;Helisha;Private;223;Buisiness;22 Ten;Ubrosel;Private;223;Buisiness;22 Lie;Onnitt;Private;223;Buisiness;22 Elern;Elisor;Private;223;Buisiness;22 Tha;Manau;Private;223;Buisiness;22 Igri;Eynena;Private;223;Buisiness;22 Yli;Istea;Private;223;Buisiness;22 Ubrasi;Arboota;Private;223;Buisiness;22 Rsiner;Erdet;Private;223;Buisiness;22 Walegr;Lserorn;Private;223;Buisiness;22 Vinc;Eupoe;Private;223;Buisiness;22 Fomal;Sacierg;Private;223;Buisiness;22 Omert;Ezwonet;Private;223;Buisiness;22 Rets;Audorye;Private;223;Buisiness;22 Thedw;Adost;Private;223;Buisiness;22 Ever;Erdin;Private;223;Buisiness;22 Odn;Tzadu;Private;223;Buisiness;22 Nte;Rveen;Private;223;Buisiness;22 Ora;Arteo;Private;223;Buisiness;22 Alen;Ullex;Private;223;Buisiness;22 Lnez;Oshen;Private;223;Buisiness;22 Ubuy;Nedolar;Private;223;Buisiness;22 Amla;Arola;Private;223;Buisiness;22 Umerl;Erevo;Private;223;Buisiness;22 Eoph;Inenere;Private;223;Buisiness;22 Usto;Ibrer;Private;223;Buisiness;22 Nac;Extafis;Private;223;Buisiness;22 Ane;Arerf;Private;223;Buisiness;22 Leolye;Orfimp;Private;223;Buisiness;22 Nemey;Dorruc;Private;223;Buisiness;22 Isuer;Sortili;Private;223;Buisiness;22 Enc;Intis;Private;223;Buisiness;22 Relian;Ndosqur;Private;223;Buisiness;22 Esor;Dorlac;Private;223;Buisiness;22 Lif;Asonab;Private;223;Buisiness;22 Bremi;Rmashai;Private;223;Buisiness;22 Hinale;Brimo;Private;223;Buisiness;22 Endela;Asuded;Private;223;Buisiness;22 Gineni;Lastoz;Private;223;Buisiness;22 Erdod;Ercerva;Private;223;Buisiness;22 Enenc;Tenet;Private;223;Buisiness;22 Omamed;Unnary;Private;223;Buisiness;22 Rezand;Eleane;Private;223;Buisiness;22 Entah;Phisob;Private;223;Buisiness;22 Torvan;Rlimeet;Private;223;Buisiness;22 Eyl;Viney;Private;223;Buisiness;22 Iforli;Arronsi;Private;223;Buisiness;22 Ndesti;Atilsal;Private;223;Buisiness;22 Eoshan;Thado;Private;223;Buisiness;22 Dgale;Exool;Private;223;Buisiness;22 Colens;Eennet;Private;223;Buisiness;22 Eld;Ethieli;Private;223;Buisiness;22 Enin;Ewinso;Private;223;Buisiness;22 Neder;Olincel;Private;223;Buisiness;22 Aner;Arlelu;Private;223;Buisiness;22 Elsa;Aqucono;Private;223;Buisiness;22 Toncey;Eluldet;Private;223;Buisiness;22 Ashee;Iladero;Private;223;Buisiness;22 Erud;Heakia;Private;223;Buisiness;22 Ysau;Ebucen;Private;223;Buisiness;22 Emp;Ashis;Private;223;Buisiness;22 Oyser;Olanatt;Private;223;Buisiness;22 Eleron;Mondeka;Private;223;Buisiness;22 Stel;Alenta;Private;223;Buisiness;22 Yare;Ekennor;Private;223;Buisiness;22 Pesce;Ryernen;Private;223;Buisiness;22 Mar;Ibuspet;Private;223;Buisiness;22 Gerc;Ylamel;Private;223;Buisiness;22 Onyah;Erenr;Private;223;Buisiness;22 Deyl;Ntope;Private;223;Buisiness;22 Uteady;Yront;Private;223;Buisiness;22 Newemy;Oncar;Private;223;Buisiness;22 Inta;Aushar;Private;223;Buisiness;22 Hter;Orilie;Private;223;Buisiness;22 Oyrop;Rtiga;Private;223;Buisiness;22 Alle;Oneysae;Private;223;Buisiness;22 Iener;Ishasen;Private;223;Buisiness;22 Anee;Usuyv;Private;223;Buisiness;22 Uga;Thononn;Private;223;Buisiness;22 Uns;Lveryan;Private;223;Buisiness;22 Uba;Enolins;Private;223;Buisiness;22 Zzia;Igive;Private;223;Buisiness;22 Orell;Eylau;Private;223;Buisiness;22 Iuneil;Alleton;Private;223;Buisiness;22 Ster;Aqudwi;Private;223;Buisiness;22 Nenay;Rrilala;Private;223;Buisiness;22 Esta;Evines;Private;223;Buisiness;22 Udu;Ayneru;Private;223;Buisiness;22 Wan;Rcune;Private;223;Buisiness;22 Eneth;Oteonsi;Private;223;Buisiness;22 Silloo;Comon;Private;223;Buisiness;22 Aran;Rlorie;Private;223;Buisiness;22 Ireut;Malid;Private;223;Buisiness;22 Rota;Grinyea;Private;223;Buisiness;22 Emamon;Aricel;Private;223;Buisiness;22 Thurev;Eshere;Private;223;Buisiness;22 Odwava;Hanela;Private;223;Buisiness;22 Ete;Barde;Private;223;Buisiness;22 Allo;Eyruser;Private;223;Buisiness;22 Nnonc;Dadenea;Private;223;Buisiness;22 Wie;Rfopa;Private;223;Buisiness;22 Rde;Abrup;Private;223;Buisiness;22 Yla;Ncorino;Private;223;Buisiness;22 Hailel;Rufrian;Private;223;Buisiness;22 Elel;Anenye;Private;223;Buisiness;22 Iad;Iteny;Private;223;Buisiness;22 Yceson;Chordo;Private;223;Buisiness;22 Ludlar;Oraleym;Private;223;Buisiness;22 Eer;Upalon;Private;223;Buisiness;22 Cert;Tanib;Private;223;Buisiness;22 Pexwe;Ebanel;Private;223;Buisiness;22 Ixa;Naman;Private;223;Buisiness;22 Ryerd;Loreyru;Private;223;Buisiness;22 Meler;Eamar;Private;223;Buisiness;22 Tonee;Enilli;Private;223;Buisiness;22 Ancevi;Dironar;Private;223;Buisiness;22 Tah;Zisper;Private;223;Buisiness;22 Iage;Reman;Private;223;Buisiness;22 Ine;Nelacha;Private;223;Buisiness;22 Ahonun;Teste;Private;223;Buisiness;22 Tellas;Acenric;Private;223;Buisiness;22 Der;Onday;Private;223;Buisiness;22 Onosy;Therdil;Private;223;Buisiness;22 Rorilu;Ezanav;Private;223;Buisiness;22 Ahan;Auderan;Private;223;Buisiness;22 Halde;Etradw;Private;223;Buisiness;22 Rtinde;Endenne;Private;223;Buisiness;22 Haydar;Gonack;Private;223;Buisiness;22 Eysa;Uiton;Private;223;Buisiness;22 Sish;Hatses;Private;223;Buisiness;22 Rac;Etent;Private;223;Buisiness;22 Erla;Nniot;Private;223;Buisiness;22 Ylarl;Kenax;Private;223;Buisiness;22 Unnelo;Dginson;Private;223;Buisiness;22 Nun;Eareene;Private;223;Buisiness;22 Lelak;Tickar;Private;223;Buisiness;22 Isceri;Ysaydom;Private;223;Buisiness;22 Wigla;Icabico;Private;223;Buisiness;22 Rlorta;Uthiar;Private;223;Buisiness;22 Rlilit;Kickiar;Private;223;Buisiness;22 Ulen;Ndilda;Private;223;Buisiness;22 Tocere;Aittiva;Private;223;Buisiness;22 Ail;Cerkild;Private;223;Buisiness;22 Lor;Paner;Private;223;Buisiness;22 Eya;Ixatont;Private;223;Buisiness;22 Edw;Udesar;Private;223;Buisiness;22 Dwivi;Entey;Private;223;Buisiness;22 Une;Lirriv;Private;223;Buisiness;22 Shar;Gishar;Private;223;Buisiness;22 Eyrew;Waneth;Private;223;Buisiness;22 Oeku;Nerwan;Private;223;Buisiness;22 Anaduk;Ylunt;Private;223;Buisiness;22 Eme;Ushid;Private;223;Buisiness;22 Onna;Ndiadr;Private;223;Buisiness;22 Fecl;Naich;Private;223;Buisiness;22 Tonkew;Onkex;Private;223;Buisiness;22 Sto;Eexwo;Private;223;Buisiness;22 Arto;Ariti;Private;223;Buisiness;22 Aram;Chewo;Private;223;Buisiness;22 Lentev;Chuld;Private;223;Buisiness;22 Mosine;Yderis;Private;223;Buisiness;22 Eryab;Tcaor;Private;223;Buisiness;22 Heshar;Erier;Private;223;Buisiness;22 Ondic;Erillit;Private;223;Buisiness;22 Wis;Namasc;Private;223;Buisiness;22 Walone;Anise;Private;223;Buisiness;22 Obr;Ahawa;Private;223;Buisiness;22 Uchabe;Aherrio;Private;223;Buisiness;22 Eoroll;Nicher;Private;223;Buisiness;22 Ellop;Anyaken;Private;223;Buisiness;22 Mila;Deanca;Private;223;Buisiness;22 Tta;Nerit;Private;223;Buisiness;22 Yvinzi;Lnitre;Private;223;Buisiness;22 Ivania;Afaro;Private;223;Buisiness;22 Ecello;Chasqu;Private;223;Buisiness;22 Ade;Zgeli;Private;223;Buisiness;22 Enc;Ondaty;Private;223;Buisiness;22 Elaher;Lsoerv;Private;223;Buisiness;22 Ude;Eulugre;Private;223;Buisiness;22 Lliave;Ipere;Private;223;Buisiness;22 Elelda;Hushub;Private;223;Buisiness;22 Eyadw;Rsiga;Private;223;Buisiness;22 Peyl;Itana;Private;223;Buisiness;22 Dyaham;Manton;Private;223;Buisiness;22 Emay;Lcerru;Private;223;Buisiness;22 Urer;Insanto;Private;223;Buisiness;22 Senal;Huclora;Private;223;Buisiness;22 Anonci;Gendorn;Private;223;Buisiness;22 Itta;Oudala;Private;223;Buisiness;22 Oru;Nerlor;Private;223;Buisiness;22 Thinse;Sionsa;Private;223;Buisiness;22 Ers;Clugnon;Private;223;Buisiness;22 Ricome;Oflorc;Private;223;Buisiness;22 Con;Ertel;Private;223;Buisiness;22 Innar;Ancalo;Private;223;Buisiness;22 Yni;Rgerol;Private;223;Buisiness;22 Nanror;Emarte;Private;223;Buisiness;22 Ahu;Omalyel;Private;223;Buisiness;22 Iaho;Axter;Private;223;Buisiness;22 Ergin;Emmivio;Private;223;Buisiness;22 Rgele;Tamansa;Private;223;Buisiness;22 Usyeny;Ustokey;Private;223;Buisiness;22 Ans;Thateld;Private;223;Buisiness;22 Rar;Orlob;Private;223;Buisiness;22 Dauti;Olnem;Private;223;Buisiness;22 Heroy;Teeyre;Private;223;Buisiness;22 Aserif;Lackub;Private;223;Buisiness;22 Ngilue;Teylile;Private;223;Buisiness;22 Byery;Skanrop;Private;223;Buisiness;22 Enenez;Erdee;Private;223;Buisiness;22 Hichin;Arringo;Private;223;Buisiness;22 Adet;Eithe;Private;223;Buisiness;22 Renen;Irema;Private;223;Buisiness;22 Ipu;Stariso;Private;223;Buisiness;22 Arde;Ubjop;Private;223;Buisiness;22 Shun;Nefram;Private;223;Buisiness;22 Thalos;Tyanis;Private;223;Buisiness;22 Loch;Echener;Private;223;Buisiness;22 Arigo;Andir;Private;223;Buisiness;22 Iarob;Udezgi;Private;223;Buisiness;22 Rdi;Aedomma;Private;223;Buisiness;22 Loyn;Nemaug;Private;223;Buisiness;22 Aisar;Unnand;Private;223;Buisiness;22 Rex;Elena;Private;223;Buisiness;22 Eroone;Iosen;Private;223;Buisiness;22 Izanne;Urban;Private;223;Buisiness;22 Rle;Delayne;Private;223;Buisiness;22 Osashe;Orone;Private;223;Buisiness;22 Ans;Eriaha;Private;223;Buisiness;22 Tyet;Rutanar;Private;223;Buisiness;22 Waw;Rerrite;Private;223;Buisiness;22 Oopi;Lmomper;Private;223;Buisiness;22 Zijela;Torit;Private;223;Buisiness;22 Lmacka;Grexwo;Private;223;Buisiness;22 Hyarba;Kalwela;Private;223;Buisiness;22 Aruma;Odarl;Private;223;Buisiness;22 Themo;Udooys;Private;223;Buisiness;22 Anrial;Stamory;Private;223;Buisiness;22 Soyre;Llinke;Private;223;Buisiness;22 Icor;Thayaho;Private;223;Buisiness;22 Ixam;Erine;Private;223;Buisiness;22 Ereru;Othanat;Private;223;Buisiness;22 Perute;Epert;Private;223;Buisiness;22 Ain;Ijonc;Private;223;Buisiness;22 Iacen;Awanofo;Private;223;Buisiness;22 Hyemo;Oniser;Private;223;Buisiness;22 Anar;Usarl;Private;223;Buisiness;22 Orendu;Yretho;Private;223;Buisiness;22 Arnext;Ntutay;Private;223;Buisiness;22 Atrobe;Amarfo;Private;223;Buisiness;22 Nne;Waloo;Private;223;Buisiness;22 Ierb;Indemaf;Private;223;Buisiness;22 Rdalo;Adserte;Private;223;Buisiness;22 Cayl;Ntowr;Private;223;Buisiness;22 Llifot;Delnic;Private;223;Buisiness;22 Ysar;Dayle;Private;223;Buisiness;22 Atar;Umemal;Private;223;Buisiness;22 Adore;Ycana;Private;223;Buisiness;22 Adnere;Uyaldac;Private;223;Buisiness;22 Rory;Keburdi;Private;223;Buisiness;22 Eri;Andas;Private;223;Buisiness;22 Sacone;Evanse;Private;223;Buisiness;22 Nerf;Nkavi;Private;223;Buisiness;22 Rrano;Sanyar;Private;223;Buisiness;22 Bed;Ubreys;Private;223;Buisiness;22 Elmoth;Ndilde;Private;223;Buisiness;22 Ive;Enson;Private;223;Buisiness;22 Zerna;Eucerg;Private;223;Buisiness;22 Erc;Eliexte;Private;223;Buisiness;22 Elist;Elenz;Private;223;Buisiness;22 Arwimo;Araruse;Private;223;Buisiness;22 Eyn;Ensal;Private;223;Buisiness;22 Wadase;Ycarr;Private;223;Buisiness;22 Ila;Alleo;Private;223;Buisiness;22 Aner;Aycance;Private;223;Buisiness;22 Oor;Analar;Private;223;Buisiness;22 Amala;Cebuco;Private;223;Buisiness;22 Onco;Opamah;Private;223;Buisiness;22 Nufozo;Owiamon;Private;223;Buisiness;22 Tais;Yanne;Private;223;Buisiness;22 Ryase;Tyart;Private;223;Buisiness;22 Tcanan;Dyewi;Private;223;Buisiness;22 Openen;Eryatoy;Private;223;Buisiness;22 Tacop;Evido;Private;223;Buisiness;22 Siarli;Lludinn;Private;223;Buisiness;22 Lineo;Unsam;Private;223;Buisiness;22 Kelea;Uclusob;Private;223;Buisiness;22 Mabuda;Neorg;Private;223;Buisiness;22 Orine;Hudired;Private;223;Buisiness;22 Rsier;Asenn;Private;223;Buisiness;22 Uceran;Kerel;Private;223;Buisiness;22 Clunen;Tuliel;Private;223;Buisiness;22 gnade-1.6.2.orig/contrib/objects/apps/person_browser.adb0000644000175000017500000001246610561121550023157 0ustar lbrentalbrenta-- ------------------------------------------------------------------------- -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/objects/apps/person_browser.adb,v $ -- Description : Display the information of all persons -- -- Author : Michael Erdmann -- -- Created On : 30-Dec-2006 -- -- Last Modified By: $Author: merdmann $ -- -- Last Modified On: $Date: 2007/02/03 14:59:52 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2006-2007 Michael Erdmann -- -- -- -- GNADE is copyrighted by the persons and institutions enumerated in the -- -- AUTHORS file. This file is located in the root directory of the -- -- GNADE distribution. -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNADE; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- GNADE Ada units, or you link GNADE Ada units or libraries with other -- -- files to produce an executable, these units or libraries do not by -- -- itself cause the resulting executable to be covered by the GNU -- -- General Public License. This exception does not however invalidate -- -- any other reasons why the executable file might be covered by the -- -- GNU Public License. -- -- -- -- ------------------------------------------------------------------------- -- with Ada.Text_IO; use Ada.Text_IO; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Person; use Person; with Ada.Text_IO.Editing; use Ada.Text_IO.Editing; with TAM.Persistent; use TAM.Persistent; with Objects; use Objects; with Person; use Person; with Account; use Account; package body Person_Browser is Version : constant String := "$Id: person_browser.adb,v 1.3 2007/02/03 14:59:52 merdmann Exp $"; ------------- -- Execute -- ------------- procedure Execute( This : in out Object; Instance : in Persistent.Object'Class ) is -- this procedure is called for each person in the data base ----------- -- Field -- ----------- function Field( S : in String; Length : in Positive ) return String is Result : String( 1..Length ) := (others => ' '); J : Positive := Result'First; begin for i in S'Range loop Result(J) := S(i); J := J + 1; exit when not (J in Result'Range); end loop; return Result; end Field; function Field( S : in Unbounded_String; Length : in Positive ) return String is begin return Field( To_String(S), Length ); end Field; ---------------------- -- Display_Accounts -- ---------------------- procedure Display_Accounts is Account_ID : OID_Array_Type( 1..100 ) := (others=>0); Length : Integer := 0; begin Get_Related( OID( Instance ), "Has_Account" , Account_ID, Length ); for i in 1..Length loop declare A : Account.Object; begin Get_Object(A, ID => Account_ID(i)); Put( Field( A.Title,15 ) &":"); Put( Field( Integer'Image(A.Ballance),8 ) ); end ; end loop; end Display_Accounts; P : Person.Object := Person.Object(Instance); begin Put( Field(P.Firstname, 15) & " " & Field(P.Lastname,15) ); Display_Accounts; Put_Line(""); end Execute; ------------- -- Persons -- ------------- procedure Persons is This : Object; Instance : Person.Object; Done : Boolean := False; begin Run( This, Instance, Done ); if not Done then Put_line("Some Lines may missing due to an internal abort"); end if; end Persons; end Person_Browser; gnade-1.6.2.orig/contrib/objects/apps/person_browser.ads0000644000175000017500000000622110547766473023217 0ustar lbrentalbrenta-- ------------------------------------------------------------------------- -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/objects/apps/person_browser.ads,v $ -- Description : Display the information of all persons -- -- Author : Michael Erdmann -- -- Created On : 30-Dec-2006 -- -- Last Modified By: $Author: merdmann $ -- -- Last Modified On: $Date: 2007/01/06 18:40:59 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2006-2007 Michael Erdmann -- -- -- -- GNADE is copyrighted by the persons and institutions enumerated in the -- -- AUTHORS file. This file is located in the root directory of the -- -- GNADE distribution. -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNADE; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- GNADE Ada units, or you link GNADE Ada units or libraries with other -- -- files to produce an executable, these units or libraries do not by -- -- itself cause the resulting executable to be covered by the GNU -- -- General Public License. This exception does not however invalidate -- -- any other reasons why the executable file might be covered by the -- -- GNU Public License. -- -- -- -- ------------------------------------------------------------------------- -- with Persistent; use Persistent; with Class_Procedure; use Class_Procedure; package Person_Browser is type Object is new Class_Procedure.Object with null record; procedure Execute( This : in out Object; Instance : in Persistent.Object'Class ); procedure Persons; end Person_Browser; gnade-1.6.2.orig/contrib/objects/apps/test.inp0000644000175000017500000000030710552251312021114 0ustar lbrentalbrenta# $Source: /cvsroot/gnade/gnade/contrib/objects/apps/test.inp,v $ Michael;Erdmann;Offpeak;123;Private;12 Marina;Massalski;Private;0;Business;20 Dieter;Erdmann;Private;33 Ingeborg;Erdmann;Private;22 gnade-1.6.2.orig/contrib/objects/doc/0000755000175000017500000000000011040716254017233 5ustar lbrentalbrentagnade-1.6.2.orig/contrib/objects/doc/tutorial/0000755000175000017500000000000011040716254021076 5ustar lbrentalbrentagnade-1.6.2.orig/contrib/objects/doc/tutorial/Makefile0000644000175000017500000001304010554624343022542 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/contrib/objects/doc/tutorial/Makefile,v $ ## Description : Top level makefile for the documentation -- ## Author : Michael Erdmann -- ## Created On : 03-Oct-2002 ## Last Modified By: $Author: merdmann $ ## Last Modified On: $Date: 2007/01/21 08:48:35 $ -- ## Status : $State: Exp $ -- ## -- ## Copyright (C) 2002 -- ## -- ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## This makefile builds the various documentation formats. The input ## is SGML docbook. ## ## If the aspell utility is installed on the system, a gobal spell check ## is done which summerizes all missspellings. If the number of ## errors is to large consider the execution of a real spellcheck ## run. ## ## Restrictions ## ============ ## - Spellcheck is based upon the aspell utility. ## ## References ## ========== ## None ## ## include ../../make.conf ## ## Logfiles of the docbuild run ## LOG=docbuild.log DOCBUILDER=../bin/docbuild.sh docdir=../books ## Basename of the document docbase=tutorial parts=$(docbase).sgml gpl.sgml gfdl.sgml images=Datamodel.eps Relations.eps Components.eps uml_path=../uml ## ############################################################################################# ## N O N C U S T I M I Z E D P A R T ## ############################################################################################# ## Targets to be build targets=$(docdir)/html/$(docbase).html $(docdir)/$(docbase).ps $(docdir)/$(docbase).pdf ## images to create gif_images=$(subst .eps,.gif,$(images)) all :: $(images) $(targets) $(MAKE) $(docbase).tex $(targets) $(images): $(gif_images) $(gif_images): $(CP) $(uml_path)/$*.gif . ## ## Targets are the different file formats for the reference guide ## $(docdir)/$(docbase).pdf :: $(docdir)/$(docbase).ps # $(DOCBUILDER) --pdf --log=$(LOG) --target=$@ $(docbase) ps2pdf $(docdir)/$(docbase).ps $(docdir)/$(docbase).pdf $(docdir)/$(docbase).ps :: $(docbase).tex $(DOCBUILDER) --ps --log=$(LOG) --target=$@ $(docbase) $(docdir)/html/$(docbase).html :: $(docbase).tex $(DOCBUILDER) --html --log=$(LOG) $(docbase) rm -rf $(docdir)/html -mkdir -p $(docdir)/html -mv *.html *.htm $(docdir)/html -cp *.gif $(docdir)/html $(docbase).tex :: $(parts) $(DOCBUILDER) --tex $(docbase).sgml ## ## Build the directory for distribution. This target will also be ## executed in the production of the target environment but the ## result file shall never be mentioned in the MANIFEST.local. ## dist :: distclean tar cvf template.tar *.sgml gzip -f template.tar ## ## Install the distribution in the local environment. ## install :: ## ## clean up the directory ## clean :: rm -f *.aux *.log *.tex *.dvi *.out *.pdf *.htm *.html *~ *.bak *.gz rm -f *.jpg *.eps rm -f $(LOG) ## ## ## distclean :: clean rm -f *.dvi *.ps *.pdf *.rtf *.eps *.gif gnade-1.6.2.orig/contrib/objects/doc/tutorial/gfdl.sgml0000644000175000017500000004761710552451075022721 0ustar lbrentalbrenta GNU Free Documentation License Version 1.1, March 2000
Copyright (C) 2000 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
PREAMBLE The purpose of this License is to make a manual, textbook, or other written document "free" in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others. This License is a kind of "copyleft", which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software. We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference. APPLICABILITY AND DEFINITIONS This License applies to any manual or other work that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. The "Document", below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as "you". A "Modified Version" of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language. A "Secondary Section" is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document's overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (For example, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them. The "Invariant Sections" are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. The "Cover Texts" are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License. A "Transparent" copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, whose contents can be viewed and edited directly and straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup has been designed to thwart or discourage subsequent modification by readers is not Transparent. A copy that is not "Transparent" is called "Opaque". Examples of suitable formats for Transparent copies include plain ASCII without markup, Texinfo input format, LaTeX input format, SGML or XML using a publicly available DTD, and standard-conforming simple HTML designed for human modification. Opaque formats include PostScript, PDF, proprietary formats that can be read and edited only by proprietary word processors, SGML or XML for which the DTD and/or processing tools are not generally available, and the machine-generated HTML produced by some word processors for output purposes only. The "Title Page" means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, "Title Page" means the text near the most prominent appearance of the work's title, preceding the beginning of the body of the text. VERBATIM COPYING You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3. You may also lend copies, under the same conditions stated above, and you may publicly display copies. COPYING IN QUANTITY If you publish printed copies of the Document numbering more than 100, and the Document's license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects. If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages. If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a publicly-accessible computer-network location containing a complete Transparent copy of the Document, free of added material, which the general network-using public has access to download anonymously at no charge using public-standard network protocols. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public. It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document. MODIFICATIONS You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version: Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the original publisher of that version gives permission. List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has less than five). State on the Title page the name of the publisher of the Modified Version, as the publisher. Preserve all the copyright notices of the Document. Add an appropriate copyright notice for your modifications adjacent to the other copyright notices. Include, immediately after the copyright notices, a license notice giving the public permission to use the Modified Version under the terms of this License, in the form shown in the Addendum below. Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document's license notice. Include an unaltered copy of this License. Preserve the section entitled "History", and its title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the Title Page. If there is no section entitled "History" in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence. Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the "History" section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission. In any section entitled "Acknowledgements" or "Dedications", preserve the section's title, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein. Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles. Delete any section entitled "Endorsements". Such a section may not be included in the Modified Version. Do not retitle any existing section as "Endorsements" or to conflict in title with any Invariant Section. If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version's license notice. These titles must be distinct from any other section titles. You may add a section entitled "Endorsements", provided it contains nothing but endorsements of your Modified Version by various parties--for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard. You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one. The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version. COMBINING DOCUMENTS You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice. The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work. In the combination, you must combine any sections entitled "History" in the various original documents, forming one section entitled "History"; likewise combine any sections entitled "Acknowledgements", and any sections entitled "Dedications". You must delete all sections entitled "Endorsements." COLLECTIONS OF DOCUMENTS You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects. You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document. AGGREGATION WITH INDEPENDENT WORKS A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, does not as a whole count as a Modified Version of the Document, provided no compilation copyright is claimed for the compilation. Such a compilation is called an "aggregate", and this License does not apply to the other self-contained works thus compiled with the Document, on account of their being thus compiled, if they are not themselves derivative works of the Document. If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one quarter of the entire aggregate, the Document's Cover Texts may be placed on covers that surround only the Document within the aggregate. Otherwise they must appear on covers around the whole aggregate. TRANSLATION Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License provided that you also include the original English version of this License. In case of a disagreement between the translation and the original English version of this License, the original English version will prevail. TERMINATION You may not copy, modify, sublicense, or distribute the Document except as expressly provided for under this License. Any other attempt to copy, modify, sublicense or distribute the Document is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. FUTURE REVISIONS OF THIS LICENSE The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See http://www.gnu.org/copyleft/. Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this License "or any later version" applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation.
gnade-1.6.2.orig/contrib/objects/doc/tutorial/gpl.sgml0000644000175000017500000003564710552451075022567 0ustar lbrentalbrenta GNU Public License (GPL) Version 2 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS gnade-1.6.2.orig/contrib/objects/doc/tutorial/tutorial.sgml0000644000175000017500000004747710554624343023656 0ustar lbrentalbrenta ]> Tutorial (Objects) Simple Accounting System Version 0.0.1 Document Revision $Revision: 1.2 $ $Date: 2007/01/21 08:48:35 $ Michael Erdmann Version 0.1 Michael Erdmann Michael Erdmann
Berlin
Dec. 2006: Initial Revision $Revision: 1.2 $ $Date: 2007/01/21 08:48:35 $ $Author: merdmann $ 2003 M. Erdmann
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with the Front-Cover Texts being "A Object Persistency for Ada 95". A copy of the license is included in the section entitled "GNU Free Documentation License".
Preface This package is part of the GNADE project hosted at http://gnade.sourceforge.net. The coordination of the development work is done by:
Michael Erdmann Michael.Erdmann@snafu.de
The GNU Public License (GPL) applies with the following extension to all software components of this project. As a special exception, if other files instantiate generics from GNADE Ada units, or you link ODB Ada units or libraries with other files to produce an executable, these units or libraries do not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.
Introduction Overview This directory contains a small technology domonstration for the following technical issues: Representing data objects using Ada 95 Usage of an SQL based RDBMS to achieve persistency for Ada 95 instances. Relations between objects The data model used for the demonstration is quite simple.
Datamodel of the demonstration Datamode The figure above shows all business objects which need to be present in a normal business world. A person (identified by a name) may have upto N accounts and member of several groups. In turn each group may be assosicated with an account. An account has a title which is used to categorize the account and a ballance value. This demonstration addresses large information systems which are running algorithms on large databases on a datamodel similar to the one presented here. In the example presented here there are three clients which are intended to represent the typical access patterns to the underlying database. A process which inserts large numbers of instances. A customer care client which is used to interrogate and modify the data base for a small number of subscribers. A billing run, which runs periodically to agregate costs and creates a bill for each person. Representing a data model with Ada95 Implementing an application in Ada 95 which is able to realize the data model as shown in the previous chapter is rather simple, but there some fact of life which make it not so plesant any more: The data has to be made persistent which means when shutting down your application, the computer where the application runs the data will be available for the next run. You can't keep the complete data base in memory because of the number of customers in you database is always larger then the memory you can affort. Typically processes requiring such data will run on different network elements because different users may nned to access the data at different times or in paralel. Availability of the application has to be assured Persistency of data is achived by storing objects on magnetic discs. The only trick is now to combine the life cycle of an Ada 95 object with persistency. The life cycle of an instance of a given type is typically like this: Instanciation. Modifcation Storing Disposal As shown in the example below instanciation is done by means of an declaration of the instance Father which has default values. The object is automatically disposed upon leaving the body of the procedure Demo. Object persistency; how it could look like procedure Demo(Name : in String) is ... Father : Person.Object := Lookup_Person( name ) begin Father.Age := .... ; end Demo; We could imagine a seamless integration by assuming there is a lookup procedure called Lookup_Person which retrieves the instance from the database. The idea looks some what fine, but you have to write for each type a specifc lookup procedure which has to be done anyway. Ada 95 provides the possibility to declare a type as child of Ada.Finalization which has the result that at the instanciation and disposal time procedures are called. These could be used write back the object upon disposal. This idea looks fine on the first glimps, but it has some major drawbacks. Using the lookup_Person, how is the exception catched which is thrown if the oject can't be found. Is seems more favorable to catch this exception in the context of the procedure above. Writing the object back to the data base is also not a good idea because is case of an expection you might not wnat to store the object in the underlying database Persistent objects are not objects with the same lifecycle then normal variables. When an object has to be read and written back has to be under the direct control of the control flow. The example below shows how the actual implementation looks like. Life cycle of an persistent object procedure Demo(Name : in String) is ... Father : Person.Object Key : Key_Type.Object := Lookup_Person( Name ); begin T := Begin_Transaction; Get_Object( Father, Key ); Father.Age := .... ; Put_Object( Father, Key ); Commit(T); exception when xxxx => .. remove side effects Abort(T); end Demo; Each object of the data model is represented by data type which is derived from the type Persistent.Object which implements the basic functionality to serialize/deserialize the data instance into a blob which is stored in a database record. In order to retrieve such an instance a so called object id is used as a retieval key. The key is defined when the objects is instanciated, e.g. in the example below: The example above shows the lifecycle of an persistent object. During declaration of the object the object identifier 1 is assgined to the instance. The method Get_Object is used retrieve the latest version of the object from the data base. Put_Object writes back a new version of the instance Father. Between Get_Object and Put_Object any modification may be done to the object by means of Ada 95 constructs. The objects package provides an versioning concept, which means after creating the first instance the operation Put_Object may create a new version of the instance in the database. Relations between objects Ada 95 provides no means to relate objects to each other except access types. The disadvantage of using pointer are: Pointers can not be stored in a database It is easy to go from A to B but it is not possible to find out what objects are referencing B. Relation between the instances A and B in Objects are expressed by three values: Source object id Target object id A relation name
Modelling Relations between objects Relations Relations
Lets assume there is a person instance. This instance may be associated with upto N account instances. This may be expressed by the relation name Has_Account where the source the account is and the target the person instance.
Ada 95 realisation The demonstration system is implemented in Ada 95 and uses an RDBMS product to store data. The interface between the desmonstration software is implemented via the ODBC interface. Consequently this requieres the GNADE ODBC bindings. Some modules are implemented by using ESQL which is supported by the GNADE esql preprocessor.
Software Components Datamode The picture above shows all software components involved in the demonmstration.
The system is based upon a library called libobjects which contains the interface to the database and all business objects which are to be made persistent. There are three application which make use of the library above: Insert This utility inserts subscriber data sets. This is a batc program which reads in files and creates the given subscribers with there accounts. Billing This application does a billing run, which means for each subscriber the summ of all accounts is created. Demo The application demo is an interactive program which is very much comparable with a customer care center. It implements lifecycle use cases for subscribers, accounts, groups, account types and ballance types. A typical business object are the accounts which are assigned to an owner. Below you find a typical implementation of an package: Specification of the account class with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Persistent; use Persistent; package Account is Not_Existing : exception; type Object is new Persistent.Object with record Title : Unbounded_String := Null_Unbounded_String; Ballance : Integer := 0; end record; procedure Create( Owner : in Persistent.Object'Class; Title : in String; Value : in Integer := 0); procedure Display( Acct : in Object ); procedure Query( This : in out Object; Owner : in Persistent.Object'Class; Title : in Unbounded_String ); end Account; The package specification contains the declaration of the type Object which is an extension of the Persisten.Object type. The attributes are in the public part for simplicity reason. Otherwise getter/setter operations would have been needed. Additionally there are method supporting the basic use cases as e.g. Create, Display and retrieval. The example below shows some of the basic implementation techniques. The account in created and associated with the owner in the procedure create. The method Put_Object (2) creates the instance in the data base with a object id which has been defined during the instanciation at (1). The account is associated with the owner at (3). The method Query return the list of accounts which are associated with the name Has_Account to the given owner object. The account we are looking for is specified by the title contained in the account This. After the call is returning, the account this will be identical with the addressed account. The method Get_Related returns all object ids of the objects which are related to the owner by Has_Account. Implementation of the account class with Objects; use Objects; package body Account is procedure Create( Owner : in Persistent.Object'Class; Title : in String; Value : in Integer := 0) is Acc : Account.Object; <=== (1) begin Acc.Title := To_Unbounded_String( Title ); Acc.Ballance := Value; Put_Object( Acc ); <=== (2) Relate( Owner, Acc, "Has_Account" ); <=== (3) end Create; procedure Query( This : in out Object; Owner : in Persistent.Object'Class; Title : in Unbounded_String ) is Acct : OID_Array_Type( 1..100 ); Length : Integer := 0; Found : Boolean := False; begin Get_Related( OID(Owner), "Has_Account", Acct, Length ); <== (4) for i in 1..Length loop declare A : Account.Object; begin Get_Object(A, ID => Acct(i)); Found := A.Title = Title; if Found then This := A; exit; end if; end ; end loop; if not Found then raise Not_Existing; end if; end Query; procedure Display( Acct : in Object ) is begin Put_Line( To_String( Acct.Title ) & " : " & Integer'Image( Acct.Ballance ) ); end Display; end Account; Restriction The current implementation does not use transaction, e.g. in case of the create method the object created Put_Object should be deleted automatically in case the Relate method fails. The currently implementation leaves an unrelated account in the data base.
Database Presentation Storing Objects in the database Each persistent object is represented in the data base in the following form: Table containing Ada 95 objects TABLE OBJECTS ( ID INT , VERSION INT , HASH VARBINARY ( 17 ) , PRIMARY KEY ( HASH ) , CLASS VARCHAR ( 60 ) , DATA BLOB ( 10000 ) ); RDBMS depency Whether a presenation is efficient depends verry much on the use data base product. It seems with MimerSQL the BLOB is an efficient solution. All persistent objects are childs of the the type Persistent.Object. The image of such objects is stored in the database in a BLOB with the maximum size of 10_000 octets. There are two criterias to identify objects in the database. The so called object id and the so called key fingerprint. The object id is anumber which is calculated when the object is created. The finger print is calculated from an Ada 95 object by calculating the MD5 fingerprint of the image of the object. The finger print (hash) is used to identify the object based on a key object. The key object is build containing only the key information, the MD5 fingerprint is calculated out of it and the object is retierved based on this fingerprint. In case there is not finger print given at creation time, the object is created by calculating the M5 fingerprint from the object identifier. If two instances are identical the finger print is identical. This is used to implement keyed accesses tolocate an object from the database. Storing relation information in the database Relations between Ada 95 instances are modeled by means of the table below: Table containing relations CREATE TABLE RELATIONS ( SOURCE INT , TARGET INT , REFNAME VARCHAR ( 60 ) ); The object is stored in the source field referes to the object with the object id stored in the target. Storing root objects bla bla Limitations &gfdl &gpl Draft versions of this book were produced with the DocBook DSSSL Stylesheets. Final production was performed with LaTex and ps2pdf. The UML diagrams have been produced using ArgoUML (see http://argouml.tigris.org). gnade-1.6.2.orig/contrib/objects/doc/uml/0000755000175000017500000000000011040716254020030 5ustar lbrentalbrentagnade-1.6.2.orig/contrib/objects/doc/uml/persons.zargo0000644000175000017500000002143410554624343022577 0ustar lbrentalbrentaPK¨.6 persons.argo­‘±NÃ0†÷<Åq;I@ ¶;´A µjÃĞ ™ø[ŠíÈqQûö8M+PÅØñÿ¾ÓÒ›lßãpÀ‡¼D ×xe\;‚úåşa&2v·XÎëíªZ›í¦®ŞÇ«¨ÒÈÉœë8>¡È˜òÍŞ’‹2&:’Ää>jœ´$Xñ'LöÜ Êü±dÅ%MNÑĞÓÿvL¢¸2 \/é@24º—Qƒ´ã¸Z/ߪyı¹x]#â–3–ìˆÇ8¬ù—÷­ín$¢Wş"´¢ÇéÆÓr<™tíô#‘ıPK%§zäúPK¨.6persons_Datamodel.pgmlå[[o£F~ϯ VZ)v˜ ²qV»›¤/{I›l¥Uµª`´Ø¸0N6U|sCŒoÙH¶2ÃÌ™ï;ßÌ9Ÿ½ş>´Å~8t@Oïhdâ†Câ :Ÿo¯ºVG{}~töÓŧw·_®/µ©ÇÜ|¹¹½ü u’FoH‡f1¿0$±ùS:¿[y='òÂ3J^Cßñ"gÜ‹©C}÷ï˜F3—Î"Ò›ù½ÏŞ¿ œ8¾XØü×;Õ‹–iv´ùßÄ“Aç¡Î8’ stÎ.œEÄ¥ÎÄ HzıÊ÷ôňïÌ­tğÓ c¤ÿ>úC:JšpÑßÑAA°è¸÷ƒ€Ìn„Ñ  C›¿ôôşÌğÉLÍÔø.pÜoIÿÉü!½(œMóK—?mì.óiû @ëX¦ÎŞ€q¬ÙÆ×©CGú±Á½ÄäU8%‘“|F¼ìg·"¯J#ÿnF ×=Û("÷ƒˆ|›p3ÅOÖãȧù„™*¬óùå³iä?8”¤­®¹èS€08½{<´–­§„Ùµ~6WË%ì¬Gğ«Ì­¥W:ß!:•r@Á‚^>5™°ş†’ˆ„ôiJâwáxêDtL&TdüZ¸»UX Ç*|;OMxĞ$ØRàÊ +€'Â'¨‚0æ]’Ëå+.ó7GódgÚ ä;-:+¸[åYD†Ù  ›&¤Aè-û’‹ı“àKÇŸ_3Ñ'g'É¥2f¢ç1óS&4<1mFG°àc õˆ™Hb¦Í1“¹¥`&–™‰ú[£fâ3[x7 ŸÖĞ+â$+NΟ"s Ãh-Ÿ@ŸÎ3›³qø@h(¡  ‘Ïø“tĨÆF6sYK kÔƒ+Ø`‹3¢·²:ĞU¡Îfï÷‰~ùU;ÕBX z¥{¨Ú=$éëİ»ğãià¨äZ’¸BŒ6‰ˆ7Ù¦I’8`¡¥Äá’8¼Bâ˜[5%‹ìئÄáCâ4J?d…Äá, åkÀ•Å4ñ€iÀ Ή·Bæğ ™¶´VïØÅ÷N…‡¼Î)C<Û)·“éÅfÕ–ğ%©QÁQ¦s.®•)‡ã¹J#Ȥ°7Ğ75ÃR¤ÊÙ穳߸WÙ/ä²ßü)ÂÌaá¾)"lXÏD¸vòËË5ÌÅZ–ú^äÇ=Ü÷¦L—pó”"ò: ™=­¤b&¹·;Ü|Ô4—_N6V›C]i›™›¶Ú\ıèͬ O^\4$(áæ }KK_mºYˆJîŞĞ¼lÖEe|n^R=’7¬ºĞ³'V(åäÅ}ç| í¥ä™†—‹Ú_åk‹`‰p¾ğ´-Ë «EÚ$ àXs´€xN MçWØç»#mìÿ+Röà´x!‹ËÅÖó‘Í<¦x!#Ä ²fÎûõT¶½]›B_ÇàÓß®(ECĞ‚¹¥+D³‚vıÍÒÎ07F;\F;PN;\F;P‡vıƒ WTΈ‘œ¯W¯ëJ–ÍkñÈÚ0.¶Ï£ ù*åQ-ù²ƒGÊMY²Pë‘¡Üc73o,_v3Ú•$×C| ©ø}`×Äİ®eum» º¨ï¸šî):еO»ıûûû1r<á5.¿$³–±³–ÊÙÁN T¹òßD(Í¡aTÑuyãàüèPK£±×®—¤DPK¨.6persons_DeploymentDiagram1.pgmlå›[o›HÇßó)X?ô)v˜—6vµMÚ§¦ÍnÒ•ªUµ"ö„°Å`n“Õ~ø±¹ÌÀ€cb¬µä(ÀÎáü9¿Ã0>û8÷µ4н0ÀHh4˜†3/pǃ/·†Ö@{;99ÿåòóÅí×ë÷ÚÂe;Ü|½¹}¥ øÂh–ÌÌbµaFãiä-’ÕÑÂÈ9‘.™ÿÎ<ÇœùhF~ø4§A2Zz£/W/ó—k“G¯uñcÆàD[}gNǃ‹p¾¶C<8™°-ç&Nàú45øà¹úz—Çñ›Öúÿ§ñÀëz³äa<€ 5{ ûŒ¤§º÷|Ÿ]‘baúaÄö D[}õtÏ8‰Âï47]/¦Æw¾3ıÎן­¼t£p¹(<YP»\7¶~ş„&<Õ 0N5­SÍBßNòğ‡{w>ß;~Lßä'{ˆèıxP¹Ä¹ºıÏ/¡ù†RèµÑOV›Ï‘÷ÃIhºt&-®×)ÒÈ5™¥Z0[zâÙËu‘æ+[“eÔBÙšR\BXº–¦5ÛV‰L ¬d~6iğtï½””fÏó”^—E9Ê}ÜV˜k5Ş$4¢aò´ 1¦%ó•4mÄ¥i2iê\Ÿä›pøuLziRkEdze]5¸Ij"k®¢ºTwu¹ƒ#á\<6*–W4‹å,‡ºQ¬Ë²H±®s}ÈŠˆëÎóÉbIèc"‡JaàRV÷î±…»¬Äû¡[¬åÎÆŞ?\±ùq&¯üä ÿúŞ]äDO¯\¶È¾çgÜ:«+ᦠåó<ÉYãÁBK¾£ômï(}Ó¥±àäóİßLn,8) ¥±ˆ)•T.0÷0×.Ǻÿê¡tšÔ;Mî´ œrí+*ßsL ~ª! s ³?ŞÈ—ı2”€L.¤¹Ë‘Vɯ7ç·3 C Èy¿W Ã=™`À¥ÉşØÖQñVxÌB‘@Æ¢ªğØØÖà †¥(`÷îí„cúH§ËÄa%¬-‘¡Dd!o<^å[êDö‚˜FÉ&C ÇJÅ•‹GOp %—œ&wºÇE³½C`§86wy>~ßO£³ˆ7Í<äó1jÀñ޼ß+Q8†\•G†c´Ç Û{Šc´Ç‚îİ{a£Cä[ê8~ÇÎäî&£CT®=á1jà1$wºÇŨÑ^x ‘=;ğøC?yŒx *C6ªLcs~;ã1nàñ޼ß+q<È<:ãƶÁ@0¯zŒÅ–ŞÅfqOõŠÅDb±ğfnÕÖãRvA5½ÖéíŒÅDbqGŞï•ÅdÏ,üµ1„„¿;f0†GÃbRa1_¯(@6u¬€ñ ŒŸm‘%³ ¥4s@ı~ùîêF»ÂÙrºq—H¤²¥û —ï«€ŠH ’}6îs§Š3oWâÄI¼é_ìt,“ˈ¸ZO'!ŒV|¶0Ym Ö°úµŸ°º<Ó‰ˆ9.^¢gµÂ4Ë9&õ‰™.ùµ–ίG%µ‰çF^ËÛŒoK˜a>9í$ ]ÊÖD,¬Xğmw˘‰?Ö•M\4ZM @ËYUü‘ÁDZ±cğ®§€<µ qæ ¹Üà¼à¬€GÑ ªÓüŠªIŠÍVæDin¶2Çì‘Ji®ö½¥¹è{S¨ è8Kꣷ4¯»ì•ù¿m`¥@ AÑY雺õò$1!9–ƒ5Ë(baøöçÊ›Óèæ·šŸÄËÅ"ŒX/°Ø‹Ç‚½¤ ÌXß‘Œ:H‡{™m¸Œ¦ôšÅÅN/ÿîŠùˆòä¬÷ak>…3ZİGÜîS}©°…ÆŸWW·ÖËNVºxÛgš…¬U?ı`ü|s„kÌ T9#šµA¤f·"5_^¤x‘âmDj³H1©SªjiêÔ"Ê€‘ZİŠÔzy‘¢Dж©uÌ"­ëMÕ2‚Êî±AFv·2²;“©“¨—©“ØFFöQÈBÕ.ߣ~1•µÎh‰LáG4ϰy?sé§Phµ×²x8´¬¡mÁ™Î@cúœÚ¯‡æıı]w%KßAlòN­ÕÀQÈ ‰#¬¹~ª©Zjsş«övrkù3.äæt'7X'7Ò 7X'7²•ÜĞQÈM˜O*è§v§Æ\o¬nl•;÷''ÿPK~µİ\yéDPK¨.6persons_ClassDiagram1.pgmlåZ]o£8}ï¯`ÑjŸŠ Ò6eúñ´ÓVÛÎJ£Õ¨¢Ä!ìÓiWûã×&$`c’’4éFJUìkğõ9×÷\‡óO/£PyÆqDã 4]UğØ‹úÁØï¨_®[ª|êÿry{ñğíîJ™øtÀı·û‡«/ŠÊ.´>é«Ô"íèãÄ‹ƒ IïžæÆ~4¥FìÛ\?vGZB\x ‰§™ÆX›Ú×/¿_„n’\ÎlşÕNõâDZ,õHI?cw„;ê8tÙSõ¨K;Îı8šN²¾ëÀ×ç֛ψŞ%Ñ_s¬Ç:V,óûÄ%Ã?ƒ$x qgà† >‹&8ÍfŞNo„Ï\BâàiJ0×¼˜Ù0ƃ*:ê …Á CŠ wíEawԟÀäw¢ó~à¢é¬%3~ ]ïëê¦İç“8xv ήN¸ËY[Œ=âıVT[¬éKGuœùÅ+},‚ó«ŸAŸ i÷­!ü!騖9o¼ªrjî“Î7d¦ºbßYïIæ‹È-_‘šL˜OpŒ#ò:ÁÉE4š¸1á1ᙿî=sJZ¤`I\«l™Z ¶ ¸*è€VxŸ ÂÄ‚UÉáj%îVy›#y’B™]üBŠîÀj&6K³÷7ˆÆtèöFş¼Í+ şa‘—ï¦[ÆcO»}ú›q~ÂLªÈilFÎÛÅnÃq³M¹Ù¦¼tå¦^&'ØWr"9Û<9ÛV™œHBN]d'Ø;™Ç4 ğN¶˜×Øe §å¯lÂ)ÈQü&Ÿ@Ÿº ›óQôŒI$b `‘/ãl°ÍC(3èÂÉb¼æfÑÑ[$İRtØè£Ã\6:€è0ÿÑA±X7:¸!ÕÑ!¥Ææ&™^¼\–)ßP^´ÔÂôÅĞÎ×ıíÚ™&gƒI2¸ qnï§8œ8§‹R ]‘ pv¢ÎAÃêœçÂáÈsP’çE% î›>œ>ɸıs šèÈdÒÃf ”%…N]áùiK$:ğóEøhA£B…XЪ1¤¶FÍjôY€ t€"ŠôR€ ‰Jß»ù`*½2@P¥L¯ ´±LœL»4ÛNÏÕÄÛu:d'SÀb秺Aÿ{ÛJ=/ÑöJ©CN©Ãül‹•m–#Ğ.–Ⱥtï ÕaÃZ]àÃáˆuXë°x>É£(ÃqßÔ:äÔº@H[o”kë«õùÏ|Ët:lV§Ã¶ÍddÔ¤ 7÷T‡À’P§¾:¤\HR/ËÜ4JäÜM©s(hT£-?bä‡ÔVê°Y¥†hƒ,D¬Ã‘ê°$ÕÅ¡nÕ ëµ:ühZ½*Dk†?¤"’Ügjpv¥åÙP–éêİGÓØÃÊ©Œ¹Ó+©sÆRç ö̹Kœ`œæäššË=ÎyxC'O]»§ÛêØçTͪBr…d•ÃîJÉœgo*%£Qš~ vˆŠØ+8ºNÿq$¥äŠê°—Ób¯ªCÄU‡†]ÄYÄÔ{bälˆ°\¯‹—òʳP Xøqh>hšp(pi\3 ï¢ğuÃÂb%{E\ »tª3[ÏBšÈó ²JÇFˬm™µµ–5†Ü\>ñ5Í 3çô¢ˆ$Ü’Àv”ìÛ[EHzïõ¬«V\Ü7­[+ÎTæ •êTÃæ_HD’#”ı}!å*„÷åu›;rí3”‡a(;†ÍHö„… ±ÏW”ÒúÍ'gÊç#7Q°æk´eè&=Ï‹¦c¢å:eIÏɼN}™$‘¤ÛÉŠ”İî5’‰©m* ï¢˜Ğç‹g²tê¤ØUxëy6¶İD}လ*vdc„˜v\ƒ{êvÜædœd¯åN7¬fe‘tC”¼ç$˜ç;â.™ÛåROdÎN¸6â¨Ã%ó ¸$©ØYf¢ŠäjʸT4¯Å%k=.UÔW}ßDDüÙ©e™­–ã´Úíh¶ëhy§è  ×>mÙƒ¹5º¡jºÁetCUtƒuèf0İ0+ԳܜVÖKèF›üQØ=úPKzF‰A-H5PK¨.6 persons.todo³±¯ÈÍQ(K-*ÎÌÏS°UP2Ô3PRHÍKÎOÉÌK „†¸éZ()ØÛqÙ(ºø;‡D¸*”ä§ä+G‡¸ú*(8z)%)J @% ”ÊÉ,.2õ‘ØE©Åù9e©)ÉE™%™ÉÅ Y,B3PK4í[-mšPK¨.6 persons.xmií]YwÛ¶~ϯÀIÏ©nBIÖî&î¡,¹Ë“Ôv{û–Q°Œ–"ôr}J"Á’,A²©‡ÄÀÌÌ`0Xôş§Ç¹ î¡ØuÀPk@åN±3 Ü\¼ë×ÀOgoŞÿuù+xœc#F~Rãi¶COÿ¸ü(R\23ÜùÌ„œ#êA <³æ_œ{‚îÚwÀoĞÍ6höOÓfœoÀI£Ñ«½@4gÜ!8Eä,şg.¦®åϑà ãü,Ò—9èÑs ãÄ&™¹‚µÿøTHô ± ‚B˜ÿÌIBñ¹ì?¼¯ÇJgUùç‚ü¬aœ4ŒÇxUŞ‚ÅzAusÄ¡p§È+¨>¼åŒ¾•!şğ¶i´ßÖÏVu­ˆ[Vh¹ãí,›àU^†Õã©ÀÜ8mÈŸ~·[¢a‘÷…·è:´0½ö…o±p,òn¡MQm‰¦W®Ë¢dğÁÛX‚9¡Œ@K¢ ‘|} Ç…ûà éØFóñè܆”02L2_÷˜â ¶1{©?±±U «ù²m(U¬jÓbø¥EwÇRXŞ[ó¸Ğ‘à‹œ¥èİfIß:©Õc ÔUZˆ€å bÜ"È|‚2˜0#xâ3TÔ­¨.0¡L|)ï„â#‚\[®T‹n0‹§[wĞ™!U¼J°Q²rÉ ±tg º@ĞkF|‹ƒí‹ÆÜ·ö8Ó¼¡d‘UOJ$E¤Ú̬ B”,Ò â+A[Ôh³l÷Û5aŸkÀ÷¼ÕßõLnêªì¤)SˆÖׇ4§Ø“—ÅBÒ2ä¨ÇÉ(-lsé–”¡ lª’uı+íHáÓÑ¡íJ;v®Ÿ9¦‹‘[ĞıH;~÷yÚ•j`T/QrGÉò á^nJÑ7ŸÏ“Ú鯶qub ѼǮ¬ _r2%¾¬ò‹@ìE Ä«uÊı7ùóv¦RÙ\u yÉx!á2xÃIJœ—F‘²•5– ÊÈÊx/Èûéh6£aêÙ°ωJãyPçİçEV‘û/Q$Vc 2;ï<ê<ì0µÛlHÖÜ}Ö?°xŞ¿ˆ˜ûŞÃ]r—Zq•­wבcÉasGD]?QùUä ‰K×ñ£H"î~àudÚ\®ŒõzK¤Ôyu©÷Ò*WïÈ.®ªxÜü„Ş»xºOÍ+ëİV3¥ÁTĨ,R“*É ¿°8q§OQX \! Ê+¤Í  ¼ çûïšî°uæğ d!Á;mF–lĞq\Y‘!QY ³"HåmÄèÖ ÒünZ–ëÜPØ]´¬Õ‰d¿ÁÌ®b28m ±€V«ŠD¤¬%ņжã¸ÒŸíè¾tíP[ÜñeÍnd›å˜I©kᲨD[r ôk8åîqí#q*v(då„Y$Â1_Å Ìómm¦Ÿøbz&t^¶dŠÈr×Ûw‚oˆûÒp6#Üg[UḲ¡(46™ã7Âsš¡bê6!kà™…¿ ãÄTZİ*:Ú¹Üå¶–E½•]<³qCøâh¬CF•«Æ+P*?sªJQm6)÷^â¤Ün霔-wî¹³c4,m‡DÚÚ‰‚a9¼™¹İ­fæ°„ªé8GÒÎ;GòîUiбLÍeé¶´=ø3q}ïÕ„¥ÛÃXXÙUàMg Ã´ôuÏÍŞÂ¡f`‹³'BÛÏ ¼ņ-ñ“Eğ€Ëá‹ qÿ[°k¿ÚZË5;J|¼ØHz[:ğY(b¥Í8#Ú|~„Ú\…ÑeÖ;İøŠıÍ'B³zÁŞ9©ì‰Šf¤ÓÔ`F:j½±ğÓlÅŞéT+ö°„ªé8íÑÑ~Úãh÷!¯}ÆÒ;£—Kï ª©9QBÕ°ôu–^eXrf~îs"¯afÖqL¤S9¦PzéáøÎXåpüÍS¸zR€/úæc¡R 8?yŒmğà{ <âr½˜©Sû׌sYñ]‰Î…|Ã Úøÿh¯ŞBĤ1-‚«r¼íUH$ƒ*ÑCÍš{İVÖ• ãóäo>^;G÷D~¼‚[â¬r¡ƒ—/íêttóU¼T¼´Ô´´#¥ú/zú*Ä<Ã:ÇÆü¿ò3ת3lL”YÜİNùC=¹­ÜÇM6ŸÓv>ª)¢*—eH­àÇğ1!paåÉæ)WzN”¼Ù¬Ê@«„tõI’´Ëãq¾ĞééJ·Ÿ#ŞÆ“½º»Á½nÒ­W¼·]ñşú“‰ÌvoõÌŞŠÑ ÷-¤L¹²9Ìô¥Ìdµ^á\ŒêMFûH¾ëOÙoÌmH6u!)íØ±m+߯ LA)­íFhîV8n†cOº6v5^^ƒ/Äú–FÎé,µX¯øàÀæ£ÌküÅ-%×’£øÜ®ebdæÉ›9å=›{©ÆD÷ü¹]L5Ğ»š@/•w/ ô€Ş{Õ _è½ÿªAë}°è;pxÊß4În§šc”AùÎ _Ü*îÜ,üBìq\ÀF ÙO‹ Ş.ô¨o‹·ƒD¾Ø½ ã!sgˆ§ğ€Ù]?o³# Ü€n÷òÑ6ènùúQ9¾C|σÇGÔuø?—xÈõïyÉ?Ñïâ±ùé>pÊV…ípRÚ¨ëK‹>r/ÄêŞ¨ A{†m:5¤çÓĞ#²|ì½B ¤í: Ú6Úé+wj D†v»¶}éù°€ö«y˜;+ë¾Øï%¾Á¤Çî®px`"í42a*Dîwı}évãµë“ê]±:ç6øûÚß4yáüë¨ÇX˜S†E+%>¯DG.4èÈ :s0:bJÓø§ê'\âØ˜”þtåĞyÙ|÷×ifÚ';êû:ƒaõ eTBÑt tøí¾ç!Ü4èïü¦ÁÚ4®®ê„%TH‡cjjwLB:»V }^¢5›9‹À£”M­ï[©M1[:lŠöŸd<›rp“²Y½l•PU ®ª. /ö‘bR.?%`~’Na` ¬—)¢_É#º¼+ì5¼û~Æ~ÃàÔ¤3ƒ§ŞEeAÖ®i*iÚ¶:C°H,úE5iŸI$¼¯ÿuù«è)P_ÏŞü PKfpoNl ù€PK¨.6%§zäú persons.argoPK¨.6£±×®—¤Dpersons_Datamodel.pgmlPK¨.6~µİ\yéDùpersons_DeploymentDiagram1.pgmlPK¨.6zF‰A-H5¿persons_ClassDiagram1.pgmlPK¨.64í[-mš 4persons.todoPK¨.6fpoNl ù€ Ûpersons.xmiPK†€!gnade-1.6.2.orig/contrib/objects/tam/0000755000175000017500000000000011040716254017247 5ustar lbrentalbrentagnade-1.6.2.orig/contrib/objects/tam/tam-persistent.adb0000644000175000017500000001107110561121550022672 0ustar lbrentalbrenta-- ------------------------------------------------------------------------- -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/objects/tam/tam-persistent.adb,v $ -- Description : Base class for all persistent objects -- -- Author : Michael Erdmann -- -- Created On : 30-April-2005 -- -- Last Modified By: $Author: merdmann $ -- -- Last Modified On: $Date: 2007/02/03 14:59:52 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2006-2007 Michael Erdmann -- -- -- -- GNADE is copyrighted by the persons and institutions enumerated in the -- -- AUTHORS file. This file is located in the root directory of the -- -- GNADE distribution. -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNADE; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- GNADE Ada units, or you link GNADE Ada units or libraries with other -- -- files to produce an executable, these units or libraries do not by -- -- itself cause the resulting executable to be covered by the GNU -- -- General Public License. This exception does not however invalidate -- -- any other reasons why the executable file might be covered by the -- -- GNU Public License. -- -- -- -- ------------------------------------------------------------------------- -- with Ada.Calendar; use Ada.Calendar; with Ada.Unchecked_Conversion; use Ada; with Util.Trace_Helper; use Util; package body TAM.Persistent is Version : constant String := "$Id: tam-persistent.adb,v 1.2 2007/02/03 14:59:52 merdmann Exp $"; -- Trace facitlity package package Tracer is new Util.Trace_Helper( Module => "Persistent"); use Tracer; ---------------- -- Initialize -- ---------------- procedure Initialize( This : in out Object ) is begin Enter("Initialize"); This.Self := This'Unchecked_Access; Leave("Initialize"); end Initialize; -------------- -- Finalize -- -------------- procedure Finalize( This : in out Object ) is begin Enter("Finalize( " & "ID=" & Integer'Image(This.ID) & ")" ); This.Self := null; Leave("Finalize"); end Finalize; ------------------- -- New_Object_ID -- ------------------- function New_Object_ID return Integer is function To_Object_ID is new Unchecked_Conversion( Source => Time, Target => Integer ); begin return To_Object_ID( clock ); end New_Object_ID; --------- -- OID -- --------- function OID( This : in Object'Class ) return Integer is begin return This.ID; end OID; --------- -- OID -- --------- procedure OID( This : in out Object'Class; ID : in Integer ) is begin This.ID := ID; end OID; ---------- -- Self -- ---------- function Self( This : in Object'Class ) return Handle is begin return This.Self ; end Self; procedure Self( This : in out Object'Class ) is begin This.Self := This'Unchecked_Access; end Self; end TAM.Persistent; gnade-1.6.2.orig/contrib/objects/tam/tam-persistent.ads0000644000175000017500000000732110561121550022716 0ustar lbrentalbrenta--- ------------------------------------------------------------------------ -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/Makefile -- Description : Base class for all persistent objects -- -- Author : Michael Erdmann -- -- Created On : 30-April-2005 -- -- Last Modified By: $Author: merdmann $ -- -- Last Modified On: $Date: 2007/02/03 14:59:52 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2005 Michael Erdmann -- -- -- -- GNADE is copyrighted by the persons and institutions enumerated in the -- -- AUTHORS file. This file is located in the root directory of the -- -- GNADE distribution. -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNADE; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- GNADE Ada units, or you link GNADE Ada units or libraries with other -- -- files to produce an executable, these units or libraries do not by -- -- itself cause the resulting executable to be covered by the GNU -- -- General Public License. This exception does not however invalidate -- -- any other reasons why the executable file might be covered by the -- -- GNU Public License. -- -- -- -- ------------------------------------------------------------------------- -- with Ada.Finalization; use Ada.Finalization; use Ada; package TAM.Persistent is type Object is new Controlled with private; type Handle is access all Object'Class; Null_Handle : constant Handle := null; function OID( This : in Object'Class ) return Integer; procedure OID( This : in out Object'Class; ID : in Integer ); function Self( This : in Object'Class ) return Handle; procedure Self( This : in out Object'Class ); -- ======================================================================= -- private function New_Object_ID return Integer; type Object is new Controlled with record ID : Integer := New_Object_ID; Self : Handle := Null_Handle ; end record; procedure Initialize( This : in out Object ); procedure Finalize( This : in out Object ); end TAM.Persistent; gnade-1.6.2.orig/contrib/objects/tam/tam-transaction.adb0000644000175000017500000003367510561145247023046 0ustar lbrentalbrenta-- ------------------------------------------------------------------------- -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/objects/tam/tam-transaction.adb,v $ -- Description : Transaction Manager for objects -- -- Author : Michael Erdmann -- -- Created On : 27-Jan-2007 -- -- Last Modified By: $Author: merdmann $ -- -- Last Modified On: $Date: 2007/02/03 17:47:19 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2006-2007 Michael Erdmann -- -- -- -- GNADE is copyrighted by the persons and institutions enumerated in the -- -- AUTHORS file. This file is located in the root directory of the -- -- GNADE distribution. -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNADE; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- GNADE Ada units, or you link GNADE Ada units or libraries with other -- -- files to produce an executable, these units or libraries do not by -- -- itself cause the resulting executable to be covered by the GNU -- -- General Public License. This exception does not however invalidate -- -- any other reasons why the executable file might be covered by the -- -- GNU Public License. -- -- -- -- ------------------------------------------------------------------------- -- with Ada.Task_Identification; use Ada.Task_Identification; with Ada.Synchronous_Task_Control; use Ada.Synchronous_Task_Control; with Ada.Streams; use Ada.Streams; with Ada.Streams.Stream_IO; use Ada.Streams.Stream_IO; with Ada.Task_Attributes; with Unchecked_Deallocation; with Util.Lock; use Util.Lock; with Util.CAS; with Util.Trace_Helper; with Util.Thread_Save_List; use Util; with Util.Memory_Streams; use Util.Memory_Streams; package body TAM.Transaction is Version : constant String := "$Id: tam-transaction.adb,v 1.3 2007/02/03 17:47:19 merdmann Exp $" ; -- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- -- ++++++++ P R I V A T E D A T A ++++++++++ -- -- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- -- -- -- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- -------------- -- TCB_Type -- -------------- type Vote_Type is ( Not_Used, Undefined, Failed, Success ); package Save_Vote is new Util.CAS( Object_Type => Vote_Type, Initial_Value => Not_Used ); type Collaboration_Type is record Vote : Save_Vote.Object; Owner : Task_ID; end record; type Collaboration_Array is array( 1..10 ) of Collaboration_Type; type Transaction_Member_Type is record Object_Stream : Stream_Access := null; Instance : Persistent.Handle := null; end record; package Transaction_Member_List is new Util.Thread_Save_List( Element_Type => Transaction_Member_Type ); type TCB_Type is record Current_TID : TID_Type := 0; Pluscode : Natural := 0; Thread : Collaboration_Array; Complete : Suspension_Object; Vote_Lock : Lock.Object; Members : Transaction_Member_List.Object; end record; type TCB_Access is access TCB_Type; package Save_TCB_Access is new Util.CAS( Object_Type => TCB_Access, Initial_Value => null ); TT : array( 1..100 ) of Save_TCB_Access.Object; Pluscode : Natural := 0; -------------------- -- Task_Info_Type -- -------------------- type Task_Info_Type is record State : TCB_Access := null; end record; Default_Task_Info : constant Task_Info_Type := ( State => null ); package Task_Info is new Ada.Task_Attributes( Attribute => Task_Info_Type, Initial_Value => Default_Task_Info ); ------------ -- Tracer -- ------------ package Tracer is new Util.Trace_Helper( Module => "TAM.Transaction", Level=>50 ); use Tracer; -- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- -- ++++++++ P R I V A T E M E T H O D S ++++++++++ -- -- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- -- -- -- -- -- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- -------------- -- Allocate -- -------------- function Allocate return TCB_Access is Result : TCB_Access := new TCB_Type ; Success : Boolean := False; TID : TID_Type := Null_TID; begin Enter("Allocate"); Pluscode := Pluscode + 1; -- select a free transaction control block for i in TT'Range loop if Save_TCB_Access.Get( TT(i) ) = null then Save_TCB_Access.CompareAndSet( TT(i), null, Result, Success ); TID := i; exit when Success; end if; end loop; -- caculate transaction id TID := TID + Pluscode * TT'Length; Result.Pluscode := Pluscode ; Result.Current_TID := TID; Set_False( Result.Complete ); Leave("Allocate returns" & TID_Type'Image(TID) ); return Result; end Allocate; ---------------- -- Deallocate -- ---------------- procedure Deallocate( TID : in out TID_Type ) is Pluscode : Natural := TID / TT'Length; State : TCB_Access := null; Success : Boolean := False; procedure Free is new Unchecked_Deallocation( TCB_Type, TCB_Access); Offset : Natural := TID mod TT'Length; begin Enter("Deallocate(" & TID_Type'Image( TID ) & ")" ); State := Save_TCB_Access.Get( TT( Offset ) ); Save_TCB_Access.CompareAndSet( TT( Offset ), State, null, Success ); Free( State ); Leave("Deallocate"); end Deallocate; --------------------- -- Get_Transaction -- --------------------- function Get_Transaction( TID : in TID_Type ) return TCB_Access is Info : Task_Info_Type := Task_Info.Value; Result : TCB_Access := null; begin Enter("Get_Transaction(" & TID_Type'Image( TID ) & ")" ); if TID = Null_TID then Result := Info.State; else Result := Save_TCB_Access.Get( TT( TID mod TT'Length ) ); end if; if Result = null then raise Invalid_Transaction; end if; Leave("Get_Transaction"); return Result; end Get_Transaction; ---------------------- -- Join_Transaction -- ---------------------- procedure Join_Transaction( TID : in TID_Type ) is State : TCB_Access := Get_Transaction( TID ); Success : Boolean := False; begin for i in State.Thread'Range loop if State.Thread(i).Vote.Get = Not_Used then Save_Vote.CompareAndSet( State.Thread(i).Vote, Not_Used, Undefined, Success ); if Success then State.Thread(i).Owner := Current_Task; end if; end if; end loop; if not Success then raise To_Many_Transactions; end if; end Join_Transaction; -------------- -- Fallback -- -------------- procedure Fallback( TCB : in TCB_Access ) is -- fall back to the original state for all objects stored in the -- transaction member list. use Transaction_Member_List; I : Enumerator_Type := Enumerator( TCB.Members, Master ); begin Enter("Fallback( " & Natural'Image(TCB.Current_TID) & " )" ); while not Is_End_Of_List(I) loop declare Member : Transaction_Member_Type ; begin Get(I, Member ); Member.Instance.all := Persistent.Object'Class'Input( Member.Object_Stream ); Destroy( Member.Object_Stream ); end ; end loop; Leave("Fallback"); end Fallback; ------------- -- Release -- ------------- procedure Release( TCB : in TCB_Access ) is use Transaction_Member_List; I : Enumerator_Type := Enumerator( TCB.Members ); begin while not Is_End_Of_List(I) loop declare Member : Transaction_Member_Type ; begin Get(I, Member ); Destroy( Member.Object_Stream ); end ; end loop; end Release; ---------- -- Vote -- ---------- procedure Vote( TID : in TID_Type; Result : in Vote_Type ) is -- R.1 The processing of votes has to be done strictly in sequence -- R.2 store the vote for the current task. -- R.3 if there are outstanding votes block this task -- else unblock all pending tasks (R.4) -- R.4 if we are the last outstanding task check the vote -- and intiate a fall back if the vote is failed, elese -- release all resources. TCB : TCB_Access := Get_Transaction( TID ); Final : Boolean := True; Okay : Boolean := True; begin Enter("Vote(" & TID_Type'Image(TID) & ", " & Vote_Type'Image(Result) & ")" ); Claim( TCB.Vote_Lock ); -- R.1 for i in TCB.Thread'Range loop if TCB.Thread(i).Owner = Current_Task then -- R.2 declare Done : Boolean; begin Save_Vote.CompareAndSet( TCB.Thread(i).Vote, Save_Vote.Get(TCB.Thread(i).Vote), Result, Done ); end; end if; Final := Final and (Save_Vote.Get(TCB.Thread(i).Vote) /= Undefined); Okay := Okay and (Save_Vote.Get(TCB.Thread(i).Vote) = Success); end loop; Release( TCB.Vote_Lock ); if not Final then -- R.3 Suspend_Until_True( TCB.Complete ); else if Okay then -- R.4 null; else Fallback( TCB ); end if; Set_True( TCB.Complete ); end if; Leave("Vote with" & TID_Type'Image(TID) & ", " & Vote_Type'Image(Result) & ")" ); end Vote; -- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- -- ++++++++ P U B L I C M E T H O D S ++++++++++ -- -- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- -- -- -- -- -- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- ------------------- -- Begin_Or_Join -- ------------------- function Begin_Or_Join( TID : in TID_Type := Null_TID ) return TID_Type is Result : TID_Type := Null_TID; begin Enter( "Begin_Or_Join(" & TID_Type'Image(TID) & ")" ); if TID /= Null_TID then Result := TID ; else declare TCB : TCB_Access := Allocate; Info : Task_Info_Type ; begin Info.State := TCB; Task_Info.Set_Value( Info ); Result := TCB.Current_TID; end; end if; -- add the current task to the transaction block Join_Transaction( Result ); Leave( "Begin_Or_Join returns =" & TID_Type'Image(TID) ); return Result; end Begin_Or_Join; ------------ -- Cancel -- ------------ procedure Cancel( TID : in TID_Type := Null_TID ) is begin Enter( "Cancel(" & TID_Type'Image(TID) & ")" ); Vote( TID, Failed ); Leave("Cancel"); end Cancel; ------------ -- Commit -- ------------ procedure Commit( TID : in TID_Type := Null_TID ) is begin Enter( "Commit(" & TID_Type'Image(TID) & ")" ); Vote( TID, Success ); Leave( "Commit" ); end Commit; --------- -- Add -- --------- procedure Add( Item : in out Persistent.Object'Class; TID : in TID_Type := Null_TID ) is TCB : TCB_Access := Get_Transaction( TID ); Member : Transaction_Member_Type ; begin Member.Object_Stream := Memory_Streams.Stream( 10_000 ); Member.Instance := Item'Unchecked_Access; Persistent.Object'Class'Output(Member.Object_Stream, Item ); Transaction_Member_List.Append( TCB.Members, Member ); end Add; end TAM.Transaction; gnade-1.6.2.orig/contrib/objects/tam/tam-transaction.ads0000644000175000017500000001171310561145247023054 0ustar lbrentalbrenta-- ------------------------------------------------------------------------- -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/objects/tam/tam-transaction.ads,v $ -- Description : Transaction Manager for objects -- -- Author : Michael Erdmann -- -- Created On : 27-Jan-2007 -- -- Last Modified By: $Author: merdmann $ -- -- Last Modified On: $Date: 2007/02/03 17:47:19 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2006-2007 Michael Erdmann -- -- -- -- GNADE is copyrighted by the persons and institutions enumerated in the -- -- AUTHORS file. This file is located in the root directory of the -- -- GNADE distribution. -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNADE; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- GNADE Ada units, or you link GNADE Ada units or libraries with other -- -- files to produce an executable, these units or libraries do not by -- -- itself cause the resulting executable to be covered by the GNU -- -- General Public License. This exception does not however invalidate -- -- any other reasons why the executable file might be covered by the -- -- GNU Public License. -- -- -- -- ------------------------------------------------------------------------- -- with TAM.Persistent; use TAM.Persistent; use TAM; package TAM.Transaction is subtype TID_Type is Integer; Null_TID : constant TID_Type ; --------------------------------------------------------------------------- -- Description: -- Start or join a transaction. -- Preconditions: -- P.1 - If a TID is given it has to exist -- Postconditions: -- The current thread will be a registerd with the given -- transaction id and returns the same TID. -- If no transaction id is given a new transaction id will -- be allocated. -- Exceptions: -- P.1 violated - Wrong_Transaction -- Notes: --------------------------------------------------------------------------- function Begin_Or_Join( TID : in TID_Type := Null_TID ) return TID_Type; --------------------------------------------------------------------------- -- Description: -- Cancel the current transaction -- Preconditions: -- P.1 - If a TID is given it has to exist -- Postconditions: -- The thread blocks till all colaborating thread have voted. -- The rollback of the object will be done after the final vote -- has been executed. -- Exceptions: -- P.1 violated - Wrong_Transaction -- Notes: --------------------------------------------------------------------------- procedure Cancel( TID : in TID_Type := Null_TID ); --------------------------------------------------------------------------- -- Description: -- Commit the current transaction -- Preconditions: -- P.1 - If a TID is given it has to exist. -- Postconditions: -- The thread blocks till all colaborating thread have voted. -- Exceptions: -- P.1 violated - Wrong_Transaction -- Notes: -- If no TID is given the current TID will be used. -------------------------------------------------------------------------- procedure Commit( TID : in TID_Type := Null_TID ); procedure Add( Item : in out Persistent.Object'Class; TID : in TID_Type := Null_TID ); private Null_TID : constant TID_Type := 0; end TAM.Transaction; gnade-1.6.2.orig/contrib/objects/tam/tam.ads0000644000175000017500000000565010560447205020532 0ustar lbrentalbrenta-- ------------------------------------------------------------------------- -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/objects/tam/tam.ads,v $ -- Description : Transaction Manager for objects -- -- Author : Michael Erdmann -- -- Created On : 27-Jan-2007 -- -- Last Modified By: $Author: merdmann $ -- -- Last Modified On: $Date: 2007/02/01 20:33:09 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2006-2007 Michael Erdmann -- -- -- -- GNADE is copyrighted by the persons and institutions enumerated in the -- -- AUTHORS file. This file is located in the root directory of the -- -- GNADE distribution. -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNADE; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- GNADE Ada units, or you link GNADE Ada units or libraries with other -- -- files to produce an executable, these units or libraries do not by -- -- itself cause the resulting executable to be covered by the GNU -- -- General Public License. This exception does not however invalidate -- -- any other reasons why the executable file might be covered by the -- -- GNU Public License. -- -- -- -- ------------------------------------------------------------------------- -- package TAM is Invalid_Transaction : exception; To_Many_Transactions : exception; end TAM; gnade-1.6.2.orig/contrib/objects/tam/tam.gpr0000755000175000017500000000037210637241242020550 0ustar lbrentalbrentawith "../../../../tools/util/util.gpr"; project Tam is for Languages use ("Ada", "Makefile"); for Library_Name use "tam"; for Library_Dir use "../lib"; for Library_Ali_Dir use "../include"; for Library_Kind use "dynamic"; end Tam; gnade-1.6.2.orig/contrib/objects/tam/test/0000755000175000017500000000000011040716254020226 5ustar lbrentalbrentagnade-1.6.2.orig/contrib/objects/tam/test/string_object.adb0000644000175000017500000000236210561145247023542 0ustar lbrentalbrentawith Ada.Text_IO; use Ada.Text_IO; with Util.Trace_Helper; package body String_Object is package Tracer is new Util.Trace_Helper(Module=>"String_Object"); use Tracer; ------------ -- Create -- ------------ function Create( S : in String ) return Object is Result : Object; begin Enter("Create(" & S & ")" ); Result.S := To_Unbounded_String(S); Leave("Create"); return Result; end Create; ----------- -- Print -- ----------- procedure Print( This : in Object ) is begin Enter("Print"); Put_Line( To_String(This.S) ); Leave("Print"); end Print; --------- -- Set -- --------- procedure Set( This : in out Object; S : in String ) is begin Enter("Set(" & S & ")" ); This.S := To_Unbounded_String( S ); Leave("Set"); end Set; ---------------- -- Initialize -- ---------------- procedure Initialize( This : in out Object ) is begin Enter("Initialize"); Leave("Initialize"); end Initialize; -------------- -- Finalize -- -------------- procedure Finalize( This : in out Object ) is begin Enter("Finalize"); Leave("Finalize"); end Finalize; end String_Object; gnade-1.6.2.orig/contrib/objects/tam/test/string_object.ads0000644000175000017500000000077510561145247023571 0ustar lbrentalbrentawith Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with TAM.Persistent; package String_Object is type Object is new TAM.Persistent.Object with record S : Unbounded_String := Null_Unbounded_String; end record; function Create( S : in String ) return Object; procedure Print( This : in Object ); procedure Set( This : in out Object; S : in String ); procedure Initialize( This : in out Object ); procedure Finalize( This : in out Object ); end String_Object; gnade-1.6.2.orig/contrib/objects/tam/test/test.adb0000644000175000017500000000131110561145247021656 0ustar lbrentalbrentawith TAM.Transaction; use TAM.Transaction; use TAM; with Util.Trace; use Util.Trace; with String_Object; use String_Object; procedure Test is T : TID_Type ; S : String_Object.Object := Create("Hallo Welt"); U : String_Object.Object := Create("Ein String"); begin Start_Trace( "test", Level => 99 ); declare S : String_Object.Object := Create("Hallo Welt"); U : String_Object.Object := Create("Ein String"); begin Print(S); T := Transaction.Begin_Or_Join; Add(S); Add(U); Set(S, "Test"); Cancel; Print(S); Print(U); exception when others => Cancel; end; Stop_Trace; end Test; gnade-1.6.2.orig/contrib/objects/tam/test/test.gpr0000644000175000017500000000030710561145247021724 0ustar lbrentalbrentawith "../tam.gpr"; project Test is for Languages use ("Ada", "Makefile", "Project File"); package Ide is for Vcs_Kind use "CVS"; end Ide; for Main use ("test.adb"); end Test; gnade-1.6.2.orig/contrib/objects/util/0000755000175000017500000000000011040716254017443 5ustar lbrentalbrentagnade-1.6.2.orig/contrib/objects/util/util-cas.adb0000644000175000017500000001056510554624343021651 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/objects/util/util-cas.adb,v $ -- Version : $Revision: 1.1 $ -- -- Description : Reseizable Hashtables -- -- Author : Michael Erdmann -- -- Created On : 20-Oct-2006 -- -- -- Last Modified By: $Author: merdmann $ -- -- Last Modified On: $Date: 2007/01/21 08:48:35 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2005 Michael Erdmann -- -- -- -- ADB is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. ODB is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with ADB; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Functional Description -- -- ====================== -- -- -- -- Restrictions -- -- ============ -- -- -- -- References -- -- ========== -- -- None -- -- -- ------------------------------------------------------------------------------- package body Util.CAS is Version : constant String := "$Id: util-cas.adb,v 1.1 2007/01/21 08:48:35 merdmann Exp $"; ------------ -- Object -- ------------ protected body Object is function Get return Object_Type is begin return Value; end Get; procedure CompareAndSet( Expected : in Object_Type; New_Value : in Object_Type; Success : out Boolean ) is begin Success := False; if Value = Expected then Value := New_Value; Success := True; end if; end CompareAndSet; end Object; ------------------- -- CompareAndSet -- ------------------- procedure CompareAndSet( This : in out Object; Expected : in Object_Type ; New_Value : in Object_Type ; Success : out Boolean ) is begin This.CompareAndSet( Expected, New_Value, Success ); end CompareAndSet; --------- -- Get -- --------- function Get( This : in Object ) return Object_Type is begin return This.Get; end Get; end Util.CAS; gnade-1.6.2.orig/contrib/objects/util/util-cas.ads0000644000175000017500000000762310560447205021670 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/objects/util/util-cas.ads,v $ -- Version : $Revision: 1.2 $ -- -- Description : Compare and Set Package -- -- Author : Michael Erdmann -- -- Created On : 20-Oct-2006 -- -- -- Last Modified By: $Author: merdmann $ -- -- Last Modified On: $Date: 2007/02/01 20:33:09 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2005 Michael Erdmann -- -- -- -- ADB is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. ODB is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with ADB; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Functional Description -- -- ====================== -- -- -- -- Restrictions -- -- ============ -- -- -- -- References -- -- ========== -- -- None -- -- -- ------------------------------------------------------------------------------- generic type Object_Type is private; Initial_Value : Object_Type ; package Util.CAS is protected type Object is function Get return Object_Type ; procedure CompareAndSet( Expected : in Object_Type; New_Value : in Object_Type; Success : out Boolean); private Value : Object_Type := Initial_Value; end Object; procedure CompareAndSet( This : in out Object; Expected : in Object_Type ; New_Value : in Object_Type; Success : out Boolean ); function Get( This : in Object ) return Object_Type; end Util.CAS; gnade-1.6.2.orig/contrib/objects/util/util-dynamic_hashtable.adb0000644000175000017500000005640010560447205024535 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/objects/util/util-dynamic_hashtable.adb,v $ -- Version : $Revision: 1.3 $ -- -- Description : Reseizable Hashtables -- -- Author : Michael Erdmann -- -- Created On : 20-Oct-2006 -- -- -- Last Modified By: $Author: merdmann $ -- -- Last Modified On: $Date: 2007/02/01 20:33:09 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2005 Michael Erdmann -- -- -- -- ADB is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. ADB is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with ADB; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Functional Description -- -- ====================== -- -- This algorithm is inspired by [1]. -- -- -- -- Restrictions -- -- ============ -- -- -- -- References -- -- ========== -- -- [1] Ori Shalev, Nir Shavit -- -- Split-Ordered List: Lock-Free Extensiuble Hash Tables -- -- PODC'03 July 13-19, 2003 -- -- -- ------------------------------------------------------------------------------- with Ada.Unchecked_Deallocation; use Ada; with System.Storage_Elements; use System.Storage_Elements; with Util.Types; use Util.Types; with Util.Trace_Helper; with Util.CAS; use Util; package body Util.Dynamic_Hashtable is Version : constant String := "$Id: util-dynamic_hashtable.adb,v 1.3 2007/02/01 20:33:09 merdmann Exp $"; package Tracer is new Trace_Helper( Module => "Util.Dynamic_Hashtable", Level => 70 ); use Tracer; ------------------- -- Key_List_Type -- ------------------- type Key_List_Type ; type Key_List_Access is access all Key_List_Type; type Key_List_Type is record Next : Key_List_Access := null; Prev : Key_List_Access := null; Bucket : Integer := -1; HashKey : Natural := 0; SplitKey : Natural := 0; Key : Key_Access ; Id : Payload_Type ; end record; package Save_Key_Access is new CAS( Object_Type => Key_List_Access, Initial_Value => null ); use Save_Key_Access; ------------------- -- Iterator_Type -- ------------------- protected type Iterator_Type is procedure Reset( First : in Key_List_Access := null ); function First return Key_List_Access; function Has_Next return Boolean; procedure Next( P : out Key_List_Access ); procedure Prev( P : out Key_List_Access ); function Current return Key_List_Access ; procedure Insert( E : in Key_List_Access ); procedure Append( E : in Key_List_Access ); procedure Delete; private Head : Key_List_Access := null; Tail : Key_List_Access := null; Value : Key_List_Access := null; end Iterator_Type; ------------------- -- Iterator_Type -- ------------------- protected body Iterator_Type is -- reset to any element procedure Reset( First : in Key_List_Access := null ) is begin if First /= null then Head := First ; end if; Value := Head; end Reset; function Has_Next return Boolean is begin return Value /= null and then Value.Next /= null; end Has_Next ; -- advance by one step. procedure Next( P : out Key_List_Access ) is begin if Value /= null then Value := Value.Next; P := Value; else P := null; end if; end Next; -- go one step back procedure Prev( P : out Key_List_Access ) is begin if Value /= null then Value := Value.Prev; P := Value; else P := null; end if; end Prev; -- get the first element in the list by traversing to the -- begin of the list. function First return Key_List_Access is begin return Head; end First; -- get the current pointer position function Current return Key_List_Access is begin return Value; end Current; -- -- R.1 insert element after the current value -- -- (P)->Q (P)->E->Q -- | | -- current current -- -- R.2 if reference pointer is null, reference = new element procedure Insert( E : in Key_List_Access ) is Q : Key_List_Access renames Value; P : Key_List_Access := null; begin Enter("Insert"); if Value /= null then P := Value.Prev; end if; E.Next := Q; E.Prev := P; if Value /= null then -- ** R.1 ** if P /= null then P.Next := E ; else Head := E; end if; if Q /= null then Q.Prev := E; else Tail := E; end if; Value := E; else -- ** R.2 ** Info(" First element" ); Value := E; Head := Value; Tail := Value; end if; Leave("Insert"); end Insert; -- -- R.1 if the cursor is already at the end we append directly -- R.2 if the cursor not at the end we line this up. -- procedure Append( E : in Key_List_Access ) is begin Enter("Append"); if Value = null then Value := E; Tail := E; Head := E; elsif Value.Next = null then Value.Next := E; E.Prev := Value; Value := E; Tail := E; else Tail.Next := E; Tail := E; end if; Leave("Append"); end Append; -- -- R.1 - delete the current value -- -- A -> P -> C ===> A -> C; -- | | -- Current Current -- -- R.2 - If this was a single element with out any prev. or next -- element the reference pointer is set to null. -- -- R.3 - If we delete the first element correct the head -- pointer. -- procedure Delete is P : Key_List_Access := Value; begin Enter( "Delete"); Value := null; -- ** R.2 ** if P.Prev /= null then -- ** R.1 ** P.Prev.Next := P.Next; Value := P.Prev; else -- ** R.3 ** Head := P.Next; end if; if P.Next /= null then -- ** R.1 ** P.Next.Prev := P.Prev; Value := P.Next; else Tail := P.Prev; end if; Leave("Delete"); end Delete; end Iterator_Type; ---------- -- Free -- ---------- procedure Free is new Unchecked_Deallocation( Key_List_Type, Key_List_Access ); --------------------- -- Hash_Table_Type -- --------------------- type Bucket_Array is array( Natural range <> ) of Save_Key_Access.Object; type Bucket_Array_Access is access all Bucket_Array ; Final_Bucket : constant Natural := 99999; ---------------------- -- Object_Data_Type -- ---------------------- type Object_Data_Type is record Capacity : Natural := 2; Bucket : Bucket_Array_Access ; Root : Save_Key_Access.Object; Nbr_Hops : Natural := 0; Nbr_Ops : Natural := 0; end record; --- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: --- --- :::::::::::::: S U P P O R T P R O C E D U R E S ::::::::::::::: --- --- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: --- -------------- -- Get_Root -- -------------- function Get_Root( This : in Object ) return Key_List_Access is Data : Object_Data_Access renames This.Data; I : Iterator_Type ; begin I.Reset( Get( Data.Root ) ); return I.First; end Get_Root ; ----------- -- Image -- ----------- function Key_Image( V : in Natural ) return String is Result : String( 1..V'Size ); N : Natural := V; begin for i in 1..V'Size loop if (N mod 2) = 1 then Result(V'Size - (i-1) ) := '1'; else Result(V'Size - (i-1) ) := '0'; end if; N := N / 2; end loop; return " B'" & Result & "'" ; end Key_Image; ---------- -- Dump -- ---------- procedure Dump( Data : Object_Data_Access ) is I : Iterator_Type; P : Key_List_Access := null; begin Enter("Dump, Cpacity=" & Natural'Image( Data.Capacity ) ); I.Reset( Get( Data.Root ) ); P := I.Current; while P /= null loop Info( Key_Image( P.Splitkey ) & ",(" & Natural'Image( P.Splitkey) & "), " & Integer'Image( P.Bucket) ); I.Next(P); end loop; end Dump; ----------------- -- Bit_Reverse -- ----------------- function Bit_Reverse( V : in Natural ) return Natural is Result : Natural := 0; Base : Natural := 2 ** (Natural'Size-1); N : Natural := V; begin for i in reverse 0..(Natural'Size-1) loop if (N mod 2) = 1 then Result := Result + Base; end if; N := N / 2; Base := Base / 2; end loop; return Result; end Bit_Reverse; ---------------- -- Is_Bit_Set -- ---------------- function Is_Bit_Set( V : in Natural; Nbr : in Natural ) return Boolean is N : Natural := V; begin return ( V / (2**Nbr) ) mod 2 = 1; end Is_Bit_Set; ------------------ -- Is_Last_Node -- ------------------ function Is_Last_Node( E : in Key_List_Access ) return Boolean is begin return E /= null and then E.Bucket /= -1; end Is_Last_Node; --- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: --- --- :::::::::::::: I N S T A N C E M A N A G E M E N T ::::::::::::::: --- --- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: --- ---------------- -- Initialize -- ---------------- procedure Initialize( This : in out Object ) is Data : Object_Data_Access := new Object_Data_Type; I : Iterator_Type; Success : Boolean := False; Dummy : Key_List_Access ; begin Enter("Initialize( Capacity=" & Natural'Image( This.Capacity ) & ")" ); Data.Bucket := new Bucket_Array( 0..(This.Capacity-1) ); Data.Capacity := This.Capacity; This.Data := Data; for B in Data.Bucket'Range loop Dummy := new Key_List_Type; Dummy.Bucket := B; I.Append( Dummy ); CompareAndSet( Data.Bucket(B), null, Dummy, Success ); end loop; Dummy := new Key_List_Type; Dummy.Bucket := Final_Bucket; I.Append( Dummy ); CompareAndSet( Data.Root, null, I.First, Success ); Dump(Data); Leave("Initialize"); end Initialize; -------------- -- Finalize -- -------------- procedure Finalize( This : in out Object ) is Data : Object_Data_Access renames This.Data; procedure XFree is new Unchecked_Deallocation( Object_Data_Type, Object_Data_Access ); P : Key_List_Access := Get( Data.Root ); N : Key_List_Access := null; begin Enter("Finalize"); Dump( Data ); while P /= null loop N := P.Next; Free(P); P := N; end loop; XFree( Data ); Leave("Finalize"); end Finalize; --- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: --- --- :::::::::::::: K E Y S / H A S H H A N D L I N G ::::::::::::::: --- --- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: --- ---------- -- Free -- ---------- procedure Free( Key : in out Key_Access ) is procedure XFree is new Ada.Unchecked_Deallocation( Key_Type, Key_Access); begin Enter("Free"); XFree( Key ); end Free; ---------------- -- Create_Key -- ---------------- function Create_Key( Key : in Key_Type ) return Key_Access is Result : Key_Access := new Key_Type( 1..Key'Length ); J : Storage_Offset := Result'First; begin for i in Key'Range loop Result(J) := Key(i); J := J + 1; end loop; return Result; end Create_Key; ---------- -- Hash -- ---------- function Hash( Key : in Key_Type ) return Natural is Result : Natural := 0; Exp : Storage_Offset := 1; begin for i in Key'Range loop Result := Result + Natural(Exp) * ( Natural( Key(i) ) mod 2 ) ; Exp := Exp * 2; end loop; return Result; end Hash; ----------- -- Less -- ----------- function ">"( A, B : in Key_Access ) return Boolean is Result : Boolean := False; begin Enter( ">" ); if A'length > B'Length then Result := True; elsif A'Length = B'Length then Result := True; for i in reverse A'Range loop Result := Result and ( A(i) > B(i) ); exit when Result = False; end loop; else Result := False; end if; Leave("> yields " & Boolean'Image( Result ) ); return Result; end ">"; --- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: --- --- :::::::::::::::::: T A B L E F U N C T I O N S :::::::::::::::::: --- --- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: --- ------------ -- Insert -- ------------ procedure Put( This : in out Object; Key : in Key_Type; Id : in Payload_Type ) is -- -- add a new object id to the hash bucket calculated from the hash function. -- Data : Object_Data_Access renames This.Data; Hashkey : Natural := Hash( Key ); B : Natural := HashKey mod Data.Capacity; Item : Key_List_Access := new Key_List_Type; I : Iterator_Type ; Success : Boolean := False; -- insert the key in the list of the current bucket procedure Insert_Key( E : in Key_List_Access ) is P : Key_List_Access := null; begin I.Reset( Get( Data.Bucket(B) ) ); I.Next(P); -- skip the dummy node while P /= null and (not Is_Last_Node(P)) loop Data.Nbr_Hops := Data.Nbr_Hops + 1; exit when E.Splitkey < P.Splitkey or E.Splitkey = P.Splitkey ; I.Next(P); end loop; I.Insert(E); end Insert_Key; begin Enter("Insert(.., B=" & Natural'Image(B) & ")" ); Data.Nbr_Ops := Data.Nbr_Ops + 1; Item.Key := Create_Key( Key ); Item.Id := Id; Item.Hashkey := Hashkey; Item.Splitkey := Bit_Reverse( HashKey ); Info( " Hashkey=" & Natural'Image( Item.Hashkey ) & Key_Image(Item.Hashkey) ); Insert_Key( Item ); Leave("Insert"); end Put; ------------ -- Delete -- ------------ procedure Delete( This : in out Object; Key : in Key_Type ) is -- add item to the given bucket Data : Object_Data_Access renames This.Data; B : Natural := hash( Key ) mod Data.Capacity; Old : Key_List_Access := Get(Data.Bucket(B)); I : Iterator_Type ; begin Enter( "Delete(.. Hashcode " & Natural'Image(B) & ")" ); I.Reset( Old ); while I.Current /= null loop declare P : Key_List_Access := I.Current; Success : Boolean := False; begin if P.Key /= null and then (Key = P.Key.all) then declare K : Key_Access := P.Key; begin Free( K ); I.Delete; CompareAndSet( Data.Bucket(B), Old, I.First, Success ); return; end; end if; I.Next( P ); end; end loop; raise Key_Not_Found; end Delete; ---------- -- Find -- ---------- procedure Get( This : in Object; Key : in Key_Type; Id : out Payload_Type ) is -- add item to the given bucket Data : Object_Data_Access renames This.Data; B : Natural := Hash( Key ) mod Data.Capacity; I : Iterator_Type ; P : Key_List_Access := null; Success : Boolean := False; begin Enter( "Find(.. Hashcode " & Natural'Image(B) & ")" ); I.Reset( Get(Data.Bucket(B)) ); I.Next(P); while P /= null loop exit when Is_Last_Node( P ); if Key = P.Key.all then Id := P.Id; Success := True; exit; end if; I.Next( P ); end loop; Leave("Find success=" & Boolean'Image( Success ) ); if not Success then raise Key_Not_Found; end if; end Get; -------------------- -- Get_Statistics -- -------------------- function Get_Statistics( This : in Object ) return Statistic_Type is Data : Object_Data_Access renames This.Data; Result : Statistic_Type; begin Result.Nbr_Hops := Data.Nbr_Hops; Result.Nbr_Ops := Data.Nbr_Ops; Result.Capacity := Data.Capacity; return Result; end Get_Statistics; ------------ -- Extend -- ------------ procedure Extend( This : in Object ) is -- extend the buckets by a factor 2 and reorganize the data Data : Object_Data_Access renames This.Data; NB : Bucket_Array_Access := null; Capacity : Natural := Data.Capacity * 2; -- calculate the new bucket position function Calculate_Bucket( P : in Key_List_Access ) return Natural is begin if Is_Bit_Set(P.Splitkey, Natural'Size - Data.Capacity - 1 ) then return (P.Hashkey mod 2**Data.Capacity) + 2**Data.Capacity; else return 0; end if; end Calculate_Bucket; -- split a bucket procedure Split_Bucket( B : Natural ) is I : Iterator_Type; P : Key_List_Access := null; Success : Boolean := False; begin Enter("Split_Bucket(" & Natural'Image(B) & ")" ); I.Reset( Get( Data.Bucket(B) ) ); I.Next(P); while P /= null and (not Is_Last_Node(P)) loop declare Target : Natural := Calculate_Bucket( P ); Dummy : Key_List_Access := null; begin if Target > 0 then Info("Moving " & Key_Image(P.Hashkey) & " to " & Natural'Image( Target ) ); Info("Hashkey points to " & Natural'Image(Hash(P.Key.all) mod (2**Capacity) ) ); Dummy := new Key_List_Type ; Dummy.Bucket := Target; CompareAndSet( NB(Target), null, Dummy, Success ); if Success then I.Insert( Dummy ); else Free( Dummy ); end if; exit; end if; I.Next(P); end ; end loop; CompareAndSet( NB(B) , null, Get(Data.Bucket(B)), Success ); Leave("Split_Bucket"); end Split_Bucket; begin Enter("Extend" & Natural'Image( 2**Data.Capacity ) & " ->" & Natural'Image( 2**Capacity ) ); Dump( Data ); Info("------------ Splitting ------------" ); NB := new Bucket_Array( 0..2**Capacity ); for i in Data.Bucket'Range loop Split_Bucket(I); end loop; Data.Bucket := NB; Data.Capacity := Capacity; Info("------------ done ------------" ); Dump(Data); Leave("Extend"); end Extend; package body Key_Iterator is ---------------------- -- Object_Data_Type -- ---------------------- type Object_Data_Type is record I : Iterator_Type; end record; ---------------- -- Initialize -- ---------------- procedure Initialize( This : in out Object ) is Data : Object_Data_Access := new Object_Data_Type; begin Enter("Key_Iterator.Initialize"); This.Data := Data; Leave("Key_Iterator.Initialize"); end Initialize; -------------- -- Finalize -- -------------- procedure Finalize( This : in out Object ) is procedure XFree is new Unchecked_Deallocation( Object_Data_Type, Object_Data_Access ); begin Enter("Key_Iterator.Finalize"); Xfree( This.Data ); Leave("Key_Iterator.Finalize"); end Finalize; ------------ -- Create -- ------------ procedure Create( This : in out Object; From : in Dynamic_Hashtable.Object ) is -- create a new iterator from a given hash table Data : Object_Data_Access renames This.Data; begin Enter("Create"); Data.I.Reset( Get_Root(From) ) ; Leave("Create"); end Create; ------------- -- Get_Key -- ------------- function Get_Key( This : in Object; Mode : Get_Mode_Type := Next ) return Key_Access is Result : key_Access := null; Data : Object_Data_Access renames This.Data; P : Key_List_Access := null; begin Data.I.Next( P ); Info("Get_Key(..," & Get_Mode_Type'Image( Mode ) & " ) => " & Image( P.Key ) ); return P.Key; end Get_Key; -------------- -- Has_Next -- -------------- function Has_Next( This : in Object ) return Boolean is Data : Object_Data_Access renames This.Data; Result : Boolean := False; begin Result := Data.I.Has_Next; Leave("Has_Next " & Boolean'Image( Result ) ); return Result; end Has_Next; end Key_Iterator; end Util.Dynamic_Hashtable; gnade-1.6.2.orig/contrib/objects/util/util-dynamic_hashtable.ads0000644000175000017500000001501410554624343024555 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/objects/util/util-dynamic_hashtable.ads,v $ -- Version : $Revision: 1.1 $ -- -- Description : Resizeable Hash tables -- -- Author : Michael Erdmann -- -- Created On : 21.10.2005 -- -- Last Modified By: $Author: merdmann $ -- -- Last Modified On: $Date: 2007/01/21 08:48:35 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2005 Michael Erdmann -- -- -- -- ODB is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. ODB is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Functional Description -- -- ====================== -- -- This algorithm is inspired by [1]. -- -- -- -- Restrictions -- -- ============ -- -- -- -- References -- -- ========== -- -- [1] Ori Shalev, Nir Shavit -- -- Split-Ordered List: Lock-Free Extensiuble Hash Tables -- -- PODC'03 July 13-19, 2003 -- -- -- ------------------------------------------------------------------------------- with System.Storage_Elements; use System.Storage_Elements; with Ada.Finalization; use Ada.Finalization; with Util.Types; use Util.Types; generic type Payload_Type is private; package Util.Dynamic_Hashtable is type Object( Capacity : Positive ) is new Controlled with private; --------------------------------------------------------------------------- -- Description: -- Preconditions: -- Postconditions: -- Exceptions: -- Notes: --------------------------------------------------------------------------- procedure Put( This : in out Object; Key : in Key_Type; Id : in Payload_Type ); --------------------------------------------------------------------------- -- Description: -- Preconditions: -- Postconditions: -- Exceptions: -- Notes: --------------------------------------------------------------------------- procedure Get( This : in Object; Key : in Key_Type; Id : out Payload_Type ); --------------------------------------------------------------------------- -- Description: -- Preconditions: -- Postconditions: -- Exceptions: -- Notes: --------------------------------------------------------------------------- procedure Delete( This : in out Object; Key : in Key_Type); --------------------------------------------------------------------------- -- Description: -- Preconditions: -- Postconditions: -- Exceptions: -- Notes: --------------------------------------------------------------------------- procedure Extend( This : in Object ); Key_Not_Found : exception; Key_Already_Exists : exception; Invalid_Argument : exception; type Statistic_Type is record Nbr_Hops : Natural := 0; Nbr_Ops : Natural := 0; Capacity : Natural := 0; end record; function Get_Statistics( This : in Object ) return Statistic_Type ; package Key_Iterator is type Object is new Controlled with private; type Get_Mode_Type is ( First, Next ); function Get_Key( This : in Object; Mode : Get_Mode_Type := Next ) return Key_Access; procedure Create( This : in out Object; From : in Dynamic_Hashtable.Object ); function Has_Next( This : in Object ) return Boolean; private type Object_Data_Type; type Object_Data_Access is access all Object_Data_Type; type Object is new Controlled with record Data : Object_Data_Access := null; end record; procedure Initialize( This : in out Object ); procedure Finalize( This : in out Object ); end Key_Iterator; private type Object_Data_Type; type Object_Data_Access is access all Object_Data_Type; type Object( Capacity : Positive ) is new Controlled with record Data : Object_Data_Access := null; end record; procedure Initialize( This : in out Object ); procedure Finalize( This : in out Object ); end Util.Dynamic_Hashtable; gnade-1.6.2.orig/contrib/objects/util/util-memory_streams.adb0000644000175000017500000001504310560447205024142 0ustar lbrentalbrenta-- ------------------------------------------------------------------------- -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/Makefile -- Description : Memory Stream -- -- Author : Michael Erdmann -- -- Created On : 30-April-2005 -- -- Last Modified By: $Author: merdmann $ -- -- Last Modified On: $Date: 2007/02/01 20:33:09 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2005 Michael Erdmann -- -- -- -- SDB is copyrighted by the persons and institutions enumerated in the -- -- AUTHORS file. This file is located in the root directory of the -- -- SDB distribution. -- -- -- -- SDB is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with SDB; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- SDB Ada units, or you link SDB Ada units or libraries with other -- -- files to produce an executable, these units or libraries do not by -- -- itself cause the resulting executable to be covered by the GNU -- -- General Public License. This exception does not however invalidate -- -- any other reasons why the executable file might be covered by the -- -- GNU Public License. -- -- -- -- ------------------------------------------------------------------------- -- with Ada.Streams; use Ada.Streams; with Ada.Text_IO; use Ada.Text_IO; use Ada; with Unchecked_Deallocation; package body Util.Memory_Streams is Version : constant String := "$Id: util-memory_streams.adb,v 1.1 2007/02/01 20:33:09 merdmann Exp $"; procedure Free is new Unchecked_Deallocation( Stream_Element_Array, Stream_Element_Array_Access); ---------------- -- Initialize -- ---------------- function Initialize( Size : Natural ) return Stream_Element_Array_Access is begin return new Stream_Element_Array(1..Stream_Element_Offset(Size)); end ; ------------ -- Stream -- ------------ function Stream( Size : Natural ) return Stream_Access is Result : Memory_Stream_Access := new Memory_Stream_Type( Size ); begin Result.Read_Next := Result.Data'First; return Stream_Access( Result ); end Stream; ------------- -- Destroy -- ------------- procedure Destroy( Stream : in out Stream_Access ) is procedure Free is new Unchecked_Deallocation( Memory_Stream_Type, Memory_Stream_Access ); begin Free( Memory_Stream_Access( Stream ) ); end Destroy; ---------- -- Read -- ---------- procedure Read( Stream : in out Memory_Stream_Type; Item : out Stream_Element_Array; Last : out Stream_Element_Offset) is begin Last := 0; for I in Item'Range loop exit when Stream.Read_Next > Stream.Write_Next ; Item( I ) := Stream.Data( Stream.Read_Next ); Last := I; Stream.Read_Next := Stream.Read_Next + 1; end loop; end Read; ----------- -- Write -- ----------- procedure Write( Stream : in out Memory_Stream_Type; Item : in Stream_Element_Array) is begin for I in Item'Range loop Stream.Write_Next := Stream.Write_Next + 1; if not ( Stream.Write_Next in Stream.Data'Range ) then declare Tmp : Stream_Element_Array_Access := Stream.Data ; begin Stream.Data := new Stream_Element_Array( 1..Stream.Write_Next + 2000 ); for i in Tmp'Range loop Stream.Data(i) := Tmp(i); end loop; Free( Tmp ); end ; end if; Stream.Data(Stream.Write_Next) := Item(I); end loop; end Write; ------------ -- Length -- ------------ function Length( Stream : in Stream_Access ) return Natural is Mem : Memory_Stream_Access := Memory_Stream_Access( Stream ); begin return Natural( Mem.Write_Next ); end Length; ------------------ -- Get_Contents -- ------------------ procedure Get_Contents( Stream : in Stream_Access; Result : in out Storage_Array; Length : out Natural ) is Mem : Memory_Stream_Access := Memory_Stream_Access( Stream ); Tmp : Stream_Element_Offset := Mem.Data'First; begin Length := 0; for i in Result'Range loop Length := Length + 1; Result(i) := Storage_Element( Mem.Data( Tmp ) ); Tmp := Tmp + 1; exit when Tmp > Mem.Write_Next; end loop; end Get_Contents; ------------------ -- Set_Contents -- ------------------ procedure Set_Contents( Stream : in Stream_Access; Value : in Storage_Array ) is Mem : Memory_Stream_Access := Memory_Stream_Access( Stream ); Tmp : Stream_Element_Offset; begin if Mem.Data /= null then Free( Mem.Data ); end if; Mem.Data := Initialize( Value'Length ); Tmp := Mem.Data'First; for i in Value'Range loop Mem.Data( Tmp ) := Stream_Element( Value(i) ); Tmp := Tmp + 1; end loop; Mem.Write_Next := Value'Length; Mem.Read_Next := Mem.Data'First; end Set_Contents; end Util.Memory_Streams; gnade-1.6.2.orig/contrib/objects/util/util-memory_streams.ads0000644000175000017500000001310510560447205024160 0ustar lbrentalbrenta-- ------------------------------------------------------------------------- -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/Makefile -- Description : Memory Stream -- -- Author : Michael Erdmann -- -- Created On : 30-April-2005 -- -- Last Modified By: $Author: merdmann $ -- -- Last Modified On: $Date: 2007/02/01 20:33:09 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2005 Michael Erdmann -- -- -- -- SDB is copyrighted by the persons and institutions enumerated in the -- -- AUTHORS file. This file is located in the root directory of the -- -- SDB distribution. -- -- -- -- SDB is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with SDB; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- SDB Ada units, or you link SDB Ada units or libraries with other -- -- files to produce an executable, these units or libraries do not by -- -- itself cause the resulting executable to be covered by the GNU -- -- General Public License. This exception does not however invalidate -- -- any other reasons why the executable file might be covered by the -- -- GNU Public License. -- -- -- -- ------------------------------------------------------------------------- -- with Ada.Streams; use Ada.Streams; with Ada.Streams.Stream_IO; use Ada.Streams.Stream_IO; with System.Storage_Elements; use System.Storage_Elements; use System; package Util.Memory_Streams is type Memory_Stream_Type( Size : Natural ) is new Root_Stream_Type with private; --------------------------------------------------------------------------- -- Description: -- Preconditions: -- Postconditions: -- Exceptions: -- Notes: --------------------------------------------------------------------------- function Stream( Size : Natural ) return Stream_Access ; --------------------------------------------------------------------------- -- Description: -- Preconditions: -- Postconditions: -- Exceptions: -- Notes: --------------------------------------------------------------------------- function Length( Stream : Stream_Access ) return Natural; --------------------------------------------------------------------------- -- Description: -- Preconditions: -- Postconditions: -- Exceptions: -- Notes: --------------------------------------------------------------------------- procedure Set_Contents( Stream : in Stream_Access; Value : in Storage_Array ); --------------------------------------------------------------------------- -- Description: -- Preconditions: -- Postconditions: -- Exceptions: -- Notes: --------------------------------------------------------------------------- procedure Get_Contents( Stream : in Stream_Access; Result : in out Storage_Array; Length : out Natural ); --------------------------------------------------------------------------- -- Description: -- Preconditions: -- Postconditions: -- Exceptions: -- Notes: --------------------------------------------------------------------------- procedure Destroy( Stream : in out Stream_Access ); -- ======================================================================== private type Stream_Element_Array_Access is access Stream_Element_Array; function Initialize( Size : Natural ) return Stream_Element_Array_Access; type Memory_Stream_Type( Size : Natural ) is new Root_Stream_Type with record Write_Next : Stream_Element_Offset := 0; Read_Next : Stream_Element_Offset := 0; Data : Stream_Element_Array_Access := Initialize( Size ); end record; type Memory_Stream_Access is access all Memory_Stream_Type; procedure Read( Stream : in out Memory_Stream_Type; Item : out Stream_Element_Array; Last : out Stream_Element_Offset); procedure Write( Stream : in out Memory_Stream_Type; Item : in Stream_Element_Array); end Util.Memory_Streams; gnade-1.6.2.orig/contrib/objects/util/util-stack.adb0000644000175000017500000001236310554624343022206 0ustar lbrentalbrenta-- ------------------------------------------------------------------------- -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/Makefile -- Description : Util base package -- -- Author : Michael Erdmann -- -- Created On : 30-April-2005 -- -- Last Modified By: $Author: merdmann $ -- -- Last Modified On: $Date: 2007/01/21 08:48:35 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2005 Michael Erdmann -- -- -- -- SDB is copyrighted by the persons and institutions enumerated in the -- -- AUTHORS file. This file is located in the root directory of the -- -- SDB distribution. -- -- -- -- SDB is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with SDB; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- SDB Ada units, or you link SDB Ada units or libraries with other -- -- files to produce an executable, these units or libraries do not by -- -- itself cause the resulting executable to be covered by the GNU -- -- General Public License. This exception does not however invalidate -- -- any other reasons why the executable file might be covered by the -- -- GNU Public License. -- -- -- -- ------------------------------------------------------------------------- -- with Unchecked_Deallocation; package body Util.Stack is Version : constant String := "$Id: util-stack.adb,v 1.1 2007/01/21 08:48:35 merdmann Exp $"; --------------- -- Node_Type -- --------------- type Node_Type; type Node_Access is access all Node_Type ; type Node_Type is record Next : Node_Access := null; Value : Element_Type; end record; procedure Free_Element is new Unchecked_Deallocation( Node_Type, Node_Access); ---------------------- -- Object_Data_Type -- ---------------------- type Object_Data_Type is record Head : Node_Access := null; end record; procedure Free is new Unchecked_Deallocation( Object_Data_Type, Object); ------------ -- Create -- ------------ function Create return Object is Result : Object := new Object_Data_Type; begin return Result; end Create; ------------- -- Destroy -- ------------- procedure Destroy( This : in out Object ) is -- destroy the complete stack P : Node_Access := This.Head; begin while P /= null loop declare Tmp : Node_Access := p; begin P := P.Next; Free_Element( Tmp ); end; end loop; Free( This ); end Destroy; ---------- -- Push -- ---------- procedure Push( This : in out Object; Value : in Element_Type ) is Node : Node_Access := new Node_Type; begin Node.Value := Value; Node.Next := This.Head; This.Head := Node; end Push; --------- -- Pop -- --------- procedure Pop( This : in out Object; Value : out Element_Type ) is begin if This.Head /= null then Value := This.Head.Value; This.Head := This.Head.Next; else raise Stack_Empty; end if; end Pop; --------- -- Top -- --------- function Top( This : in Object ) return Element_Type is begin if This.Head /= null then return This.Head.Value; else raise Stack_Empty; end if; end Top; ------------- -- Destroy -- ------------- function Size( This : in Object ) return Natural is -- destroy the complete stack P : Node_Access := This.Head; Result : Natural := 0; begin while P /= null loop Result := Result + 1; P := P.Next; end loop; return Result; end Size; end Util.Stack; gnade-1.6.2.orig/contrib/objects/util/util-stack.ads0000644000175000017500000000673110554624343022231 0ustar lbrentalbrenta-- ------------------------------------------------------------------------- -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/Makefile -- Description : Util base package -- -- Author : Michael Erdmann -- -- Created On : 30-April-2005 -- -- Last Modified By: $Author: merdmann $ -- -- Last Modified On: $Date: 2007/01/21 08:48:35 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2005 Michael Erdmann -- -- -- -- SDB is copyrighted by the persons and institutions enumerated in the -- -- AUTHORS file. This file is located in the root directory of the -- -- SDB distribution. -- -- -- -- SDB is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with SDB; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- SDB Ada units, or you link SDB Ada units or libraries with other -- -- files to produce an executable, these units or libraries do not by -- -- itself cause the resulting executable to be covered by the GNU -- -- General Public License. This exception does not however invalidate -- -- any other reasons why the executable file might be covered by the -- -- GNU Public License. -- -- -- -- ------------------------------------------------------------------------- -- generic type Element_Type is private; package Util.Stack is type Object is private; Null_Object : constant Object; function Create return Object; procedure Destroy( This : in out Object ); Stack_Empty : exception; procedure Push( This : in out Object; Value : in Element_Type ); procedure Pop( This : in out Object; Value : out Element_Type ); function Size( This : in Object ) return Natural; function Top( This : in Object ) return Element_Type; private type Object_Data_Type; type Object is access all Object_Data_Type; Null_Object : constant Object := null; end Util.Stack; gnade-1.6.2.orig/contrib/objects/util/util-thread_save_list.adb0000644000175000017500000002102510561121550024402 0ustar lbrentalbrenta-- ------------------------------------------------------------------------- -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/Makefile -- Description : Util base package -- -- Author : Michael Erdmann -- -- Created On : 30-April-2005 -- -- Last Modified By: $Author: merdmann $ -- -- Last Modified On: $Date: 2007/02/03 14:59:52 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2005,2007 Michael Erdmann -- -- -- -- SDB is copyrighted by the persons and institutions enumerated in the -- -- AUTHORS file. This file is located in the root directory of the -- -- SDB distribution. -- -- -- -- SDB is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with SDB; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- SDB Ada units, or you link SDB Ada units or libraries with other -- -- files to produce an executable, these units or libraries do not by -- -- itself cause the resulting executable to be covered by the GNU -- -- General Public License. This exception does not however invalidate -- -- any other reasons why the executable file might be covered by the -- -- GNU Public License. -- -- -- -- ------------------------------------------------------------------------- -- with Ada.Task_Identification; use Ada.Task_Identification; with Ada.Unchecked_Deallocation; package body Util.Thread_Save_List is Version : constant String := "$Id: util-thread_save_list.adb,v 1.2 2007/02/03 14:59:52 merdmann Exp $"; ---------------------- -- Object_Data_Type -- ---------------------- protected type Object_Data_Type is procedure Append( Item : Element_Type ); function First return Node_Access; procedure First( item : in Node_Access ); function Last return Node_Access; procedure Last( Item : in Node_Access ); entry Claim( Id : in Task_ID ); procedure Release; private Head : Node_Access := null; Tail : Node_Access := null; Owner : Task_ID := Null_Task_ID; end Object_Data_Type; protected body Object_Data_Type is procedure Append( Item : Element_Type ) is Node : Node_Access := new Node_Type; begin Node.Value := Item; if Tail /= null then Tail.Next := Node; Node.Prev := Tail; else Head := Node; end if; Tail := Node; end Append; function First return Node_Access is begin return Head; end; function Last return Node_Access is begin return Tail; end; procedure First( Item : Node_Access ) is begin Head := Item; end First; procedure Last( Item : in Node_Access ) is begin Tail := Item ; end Last; entry Claim( Id : in Task_ID ) when Owner = Null_Task_ID is begin Owner := Id; end Claim; procedure Release is begin Owner := Null_Task_ID; end Release; end Object_Data_Type; ---------- -- Free -- ---------- procedure Free is new Ada.Unchecked_Deallocation( Object_Data_Type, Object_Data_Access ); procedure Free is new Ada.Unchecked_Deallocation( Node_Type, Node_Access ); ---------------- -- Initialize -- ---------------- procedure Initialize( This : in out Object ) is begin This.Data := new Object_Data_Type; end Initialize; -------------- -- Finalize -- -------------- procedure Finalize( This : in out Object ) is Data : Object_Data_Access renames This.Data; P,Q : Node_Access := null; begin P := Data.First; while P /= Data.Last loop exit when P = null; Q := P; P := P.Next; Free( Q ); end loop; Free( This.Data ); end Finalize; ------------ -- Append -- ------------ procedure Append( This : in out Object; Item : in Element_Type ) is Data : Object_Data_Access renames This.Data; begin Data.Append( Item ); end Append; -------------- -- Enumerator -- -------------- function Enumerator( This : in Object; Mode : in Sharing_Mode_Type := Read_Only ) return Enumerator_Type is Result : Enumerator_Type; begin Result.Data := This.Data; Result.Current := This.Data.First; case Mode is when Master => Result.Data.Claim( Current_Task ); when others => null; end case; Result.Mode := Mode; return Result; end Enumerator; ----------- -- First -- ----------- procedure First( I : in out Enumerator_Type ) is Current : Node_Access renames I.Current; begin if I.Mode = Master and then Current /= null then Release( Current.Used ); end if; Current := I.Data.First ; end First; --------- -- Get -- --------- procedure Get( I : in out Enumerator_Type; Item : out Element_Type ) is Current : Node_Access renames I.Current; begin if Current = null then raise End_Of_List; end if; if I.Mode = Master then Claim( Current.Used ); end if; Item := Current.Value; Current := Current.Next; end Get; ------------ -- Delete -- ------------ procedure Delete( I : in out Enumerator_Type ) is Current : Node_Access renames I.Current; TMP : Node_Access := null; begin if I.Mode /= Master then raise Not_Master; end if; if Current = null then raise End_Of_List; end if; TMP := Current; Claim( TMP.Used ); if Current.Prev /= null then Current.Prev.Next := Current.Next; else I.Data.First( Current.Next ); end if; if Current.Next /= null then Current.Next.Prev := Current.Prev; else I.Data.Last( Current.Prev ); end if; -- adjusting the cursor if Current.Next /= null then Current := Current.Next; else Current := Current.Prev; end if; Release( TMP.Used ); Free( TMP ); end Delete; --------- -- Put -- --------- procedure Put( I : in out Enumerator_Type; Item : in Element_Type ) is Current : Node_Access renames I.Current; TMP : Node_Access := new Node_Type; begin if I.Mode /= Master then raise Not_Master; end if; if Current = null then I.Data.Append( Item ); else Claim( Current.Used ); TMP.Prev := Current; TMP.Next := Current.Next; if Current.Next = null then I.Data.Last( TMP ); end if; Current.Next := TMP; Release( Current.Used ); end if; end Put; -------------------- -- Is_End_Of_List -- -------------------- function Is_End_Of_List( I : in Enumerator_Type ) return Boolean is begin return I.Current = null; end Is_End_Of_List; end Util.Thread_Save_List; gnade-1.6.2.orig/contrib/objects/util/util-thread_save_list.ads0000644000175000017500000001201710561121550024424 0ustar lbrentalbrenta-- ------------------------------------------------------------------------- -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/Makefile -- Description : Util base package -- -- Author : Michael Erdmann -- -- Created On : 30-April-2005 -- -- Last Modified By: $Author: merdmann $ -- -- Last Modified On: $Date: 2007/02/03 14:59:52 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2005 Michael Erdmann -- -- -- -- SDB is copyrighted by the persons and institutions enumerated in the -- -- AUTHORS file. This file is located in the root directory of the -- -- SDB distribution. -- -- -- -- SDB is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with SDB; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- SDB Ada units, or you link SDB Ada units or libraries with other -- -- files to produce an executable, these units or libraries do not by -- -- itself cause the resulting executable to be covered by the GNU -- -- General Public License. This exception does not however invalidate -- -- any other reasons why the executable file might be covered by the -- -- GNU Public License. -- -- -- -- ------------------------------------------------------------------------- -- with Ada.Finalization; use Ada.Finalization; with Util.Lock; use Util.Lock; generic type Element_Type is private; package Util.Thread_Save_List is type Object is private; --------------------------------------------------------------------------- -- Description: -- Add an element to the list. -- Preconditions: -- None -- Postconditions: -- Exceptions: -- Notes: --------------------------------------------------------------------------- procedure Append( This : in out Object; Item : in Element_Type ); --------------------------------------------------------------------------- -- Description: -- Preconditions: -- Postconditions: -- Exceptions: -- Notes: --------------------------------------------------------------------------- type Enumerator_Type is private; type Sharing_Mode_Type is ( Read_Only, Master, Dynamic ); Not_Master : exception ; function Enumerator( This : Object; Mode : Sharing_Mode_Type := Read_Only ) return Enumerator_Type; function Is_End_Of_List( I : in Enumerator_Type ) return Boolean; procedure Get( I : in out Enumerator_Type; Item : out Element_Type ); procedure Put( I : in out Enumerator_Type; Item : in Element_Type ); procedure First( I : in out Enumerator_Type ); procedure Delete( I : in out Enumerator_Type ) ; End_Of_List : exception; private type Object_Data_Type; type Object_Data_Access is access Object_Data_Type; type Object is new Controlled with record Data : Object_Data_Access := null; end record; procedure Initialize( This : in out Object ); procedure Finalize( This : in out Object ); --------------- -- Node_Type -- --------------- type Node_Type; type Node_Access is access all Node_Type; type Node_Type is record Next : Node_Access := null; Prev : Node_Access := null; Used : Lock.Object; Value : Element_Type; end record; type Enumerator_Type is record Current : Node_Access := null; Mode : Sharing_Mode_Type; Data : Object_Data_Access := null; end record; end Util.Thread_Save_List; gnade-1.6.2.orig/contrib/objects/util/util-trace.adb0000644000175000017500000001546110554624343022201 0ustar lbrentalbrenta-- ------------------------------------------------------------------------- -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/objects/util/util-trace.adb,v $ -- Description : Util trace package -- -- Author : Michael Erdmann -- -- Created On : 30-April-2005 -- -- Last Modified By: $Author: merdmann $ -- -- Last Modified On: $Date: 2007/01/21 08:48:35 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2005-2007 Michael Erdmann -- -- -- -- SDB is copyrighted by the persons and institutions enumerated in the -- -- AUTHORS file. This file is located in the root directory of the -- -- SDB distribution. -- -- -- -- SDB is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with SDB; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- SDB Ada units, or you link SDB Ada units or libraries with other -- -- files to produce an executable, these units or libraries do not by -- -- itself cause the resulting executable to be covered by the GNU -- -- General Public License. This exception does not however invalidate -- -- any other reasons why the executable file might be covered by the -- -- GNU Public License. -- -- -- -- ------------------------------------------------------------------------- -- with Ada.Text_IO; use Ada.Text_IO; with Ada.Task_Identification; use Ada.Task_Identification; with Ada.Real_Time; use Ada.Real_Time; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; --with Ada.Calendar; use Ada.Calendar; with System; use System; with Interfaces.C; use Interfaces.C; use Interfaces; with Ada.Task_Attributes; package body Util.Trace is Version : constant String := "$Id: util-trace.adb,v 1.1 2007/01/21 08:48:35 merdmann Exp $"; Path : Unbounded_String := Null_Unbounded_String; Global_Level : Level_Type := 0; -------------------------- -- Trace_Attribute_Type -- -------------------------- type Trace_Attribute_Type is record Level : Level_Type := 0; File : File_Type; end record; type Trace_Attribute_Access is access all Trace_Attribute_Type; Null_Trace_Attribute : constant Trace_Attribute_Access := null; package Trace_Attributes is new Ada.Task_Attributes( Attribute => Trace_Attribute_Access, Initial_Value => Null_Trace_Attribute ); use Trace_Attributes; function time( t : Address := Null_Address ) return C.Long; pragma Import (C, time, "time" ); ----------- -- Start -- ----------- procedure Start_Trace( Trace_File : in String; Level : in Level_Type := 0 ) is Handle : Trace_Attribute_Access := Value; begin if Handle = null then Handle := new Trace_Attribute_Type ; Set_Value( Handle ); end if; Create( File => Handle.File, Name => To_String( Path ) & Trace_File & "-" & Image( Current_Task ) & ".log" , Mode => Out_File ); Handle.Level := Level; Put_Line( Handle.File, "Trace started with level" & Level_Type'Image( Level ) ); end Start_Trace; ----------------- -- Trace_Level -- ----------------- procedure Trace_Level( Level : in Level_Type ) is begin Global_Level := Level; LOG( 0, "Trace_Level set to " & Level_Type'Image( Global_Level ) ); end Trace_Level; ----------- -- Flush -- ----------- procedure Flush is Handle : Trace_Attribute_Access := Value; begin if Handle /= null then Flush( Handle.File ); end if; end Flush; ----------- -- Trace -- ----------- procedure Log( Level : in Level_Type := Flow; Text : in String ) is Handle : Trace_Attribute_Access := Value; function Format_Level return String is Result : String( 1..5 ) := (others => ' '); L : String := Level_Type'Image(Level); J : Natural := L'Last; begin for i in reverse Result'range loop Result( I ) := L( J ); J := J - 1; exit when j = 0; end loop; return Result; end Format_Level; function Indent return String is Result : String( 1..80 ) := ( others => ' ' ); Indention : Natural := 1 + Natural(Level) / 10 ; begin return Result( 1..Indention ); end Indent; T : Natural := Natural( time ); begin if Handle /= null then if Handle.Level >= Level or Global_Level >= Level then declare SC : Seconds_Count; TS : Time_Span; begin Split( Clock, SC, TS ); Put_Line( Handle.File, Seconds_Count'Image(SC) & "." & Duration'Image( To_Duration(TS) ) & " " & Format_Level & " : " & Indent & Text ); end; end if; end if; end Log; ---------- -- Stop -- ---------- procedure Stop_Trace is Handle : Trace_Attribute_Access := Value; begin if Handle /= null then Put_Line(Handle.File, "Trace stoped"); Put_Line(Handle.File, "" ); Close( Handle.File ); end if; end Stop_Trace; -------------- -- Location -- -------------- procedure Directory( Trace_Path : in String ) is begin Path := To_Unbounded_String( Trace_Path & "/" ); end Directory; end Util.Trace; gnade-1.6.2.orig/contrib/objects/util/util-trace.ads0000644000175000017500000001360410554624343022217 0ustar lbrentalbrenta-- ------------------------------------------------------------------------- -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/Makefile -- Description : Util base package -- -- Author : Michael Erdmann -- -- Created On : 30-April-2005 -- -- Last Modified By: $Author: merdmann $ -- -- Last Modified On: $Date: 2007/01/21 08:48:35 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2005 Michael Erdmann -- -- -- -- SDB is copyrighted by the persons and institutions enumerated in the -- -- AUTHORS file. This file is located in the root directory of the -- -- SDB distribution. -- -- -- -- SDB is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with SDB; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- SDB Ada units, or you link SDB Ada units or libraries with other -- -- files to produce an executable, these units or libraries do not by -- -- itself cause the resulting executable to be covered by the GNU -- -- General Public License. This exception does not however invalidate -- -- any other reasons why the executable file might be covered by the -- -- GNU Public License. -- -- -- -- ------------------------------------------------------------------------- -- package Util.Trace is type Level_Type is new Natural Range 0..99; Informative : constant Level_Type := 1; Flow : constant Level_Type := 30; Functional : constant Level_Type := 60; --------------------------------------------------------------------------- -- Description: -- Start a trace session for the current task -- Preconditions: -- None -- Postconditions: -- P.1 - Tracefile with name of the current thread created -- Exceptions: -- Notes: --------------------------------------------------------------------------- procedure Start_Trace( Trace_File : in String; Level : in Level_Type := 0 ); --------------------------------------------------------------------------- -- Description: -- Write a trace entry with the given trace level -- Preconditions: -- None -- Postconditions: -- P.1 - If a trace session has been created previously by means -- of Start_Trace the entry is appended to the file -- Exceptions: -- Notes: --------------------------------------------------------------------------- procedure Log( Level : in Level_Type := Flow; Text : in String ) ; --------------------------------------------------------------------------- -- Description: -- Set the directory where the trace files are written. -- Preconditions: -- None -- Postconditions: -- P.1 - Directory is changed. -- Exceptions: -- Notes: --------------------------------------------------------------------------- procedure Directory( Trace_Path : in String ); --------------------------------------------------------------------------- -- Description: -- Set the global trace level. -- Preconditions: -- None -- Postconditions: -- P.1 - All entries written via LOG with a trace level higher then -- the trace level given here is written into the trace. -- Exceptions: -- Notes: --------------------------------------------------------------------------- procedure Trace_Level( Level : in Level_Type ); --------------------------------------------------------------------------- -- Description: -- Stop the current trace. -- Preconditions: -- None -- Postconditions: -- P.1 - The current trace file is closed and no records are written -- into the trace file. -- Exceptions: -- Notes: --------------------------------------------------------------------------- procedure Stop_Trace; --------------------------------------------------------------------------- -- Description: -- Flush the trace -- Preconditions: -- None -- Postconditions: -- P.1 - All records are flushed from the write buffer into the file. -- Exceptions: -- Notes: -- This method should be used for example in the context of exception -- handlers in order to avoid that trace records are getting lost. --------------------------------------------------------------------------- procedure Flush; end Util.Trace; gnade-1.6.2.orig/contrib/objects/util/util-trace_helper.adb0000644000175000017500000000750610554624343023541 0ustar lbrentalbrenta-- ------------------------------------------------------------------------- -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/Makefile -- Description : Util base package -- -- Author : Michael Erdmann -- -- Created On : 30-April-2005 -- -- Last Modified By: $Author: merdmann $ -- -- Last Modified On: $Date: 2007/01/21 08:48:35 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2005 Michael Erdmann -- -- -- -- SDB is copyrighted by the persons and institutions enumerated in the -- -- AUTHORS file. This file is located in the root directory of the -- -- SDB distribution. -- -- -- -- SDB is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with SDB; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- SDB Ada units, or you link SDB Ada units or libraries with other -- -- files to produce an executable, these units or libraries do not by -- -- itself cause the resulting executable to be covered by the GNU -- -- General Public License. This exception does not however invalidate -- -- any other reasons why the executable file might be covered by the -- -- GNU Public License. -- -- -- -- ------------------------------------------------------------------------- -- with Util.Trace; use Util.Trace; package body Util.Trace_Helper is Version : constant String := "$Id: util-trace_helper.adb,v 1.1 2007/01/21 08:48:35 merdmann Exp $"; procedure Enter( S : in String ) is begin LOG( Level, Module & "." & S ); end Enter; procedure Leave( S : in String ) is begin LOG( Level, Module & "." & S & " finished" ); end Leave; procedure Error( S : in String ) is begin LOG( Trace.Flow, Module & "." & S & " *** Error ***" ); end Error; procedure Info( S : in String ) is begin LOG( Level, " " & S ); end Info; ---------------------- -- Report_Excpetion -- ---------------------- procedure Trace_Exception( E : in Exception_Occurrence; Ignore : in Boolean := True ) is begin LOG( Trace.Flow, "Exception *** " & Exception_Name( E ) & ":" & Exception_Message( E ) ); Trace.Flush; if not Ignore then Reraise_Occurrence( E ); end if; end Trace_Exception; end Util.Trace_Helper; gnade-1.6.2.orig/contrib/objects/util/util-trace_helper.ads0000644000175000017500000000724010554624343023555 0ustar lbrentalbrenta-- ------------------------------------------------------------------------- -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/contrib/objects/util/util-trace_helper.ads,v $ -- Description : Trace Helper package -- -- Author : Michael Erdmann -- -- Created On : 30-April-2005 -- -- Last Modified By: $Author: merdmann $ -- -- Last Modified On: $Date: 2007/01/21 08:48:35 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2005 Michael Erdmann -- -- -- -- SDB is copyrighted by the persons and institutions enumerated in the -- -- AUTHORS file. This file is located in the root directory of the -- -- SDB distribution. -- -- -- -- SDB is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with SDB; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- SDB Ada units, or you link SDB Ada units or libraries with other -- -- files to produce an executable, these units or libraries do not by -- -- itself cause the resulting executable to be covered by the GNU -- -- General Public License. This exception does not however invalidate -- -- any other reasons why the executable file might be covered by the -- -- GNU Public License. -- -- -- -- ------------------------------------------------------------------------- -- with Ada.Exceptions; use Ada.Exceptions; with Util.Trace; use Util.Trace; generic Module : String ; Level : Level_Type := Trace.Flow; package Util.Trace_Helper is procedure Enter( S : in String ); procedure Leave( S : in String ); procedure Error( S : in String ); procedure Info( S : in String ); procedure Trace_Exception( E : in Exception_Occurrence; Ignore : Boolean := True ); --------------------------------------------------------------------------- -- Description: -- Start a trace session for the current task -- Preconditions: -- None -- Postconditions: -- P.1 - Tracefile with name of the current thread created -- Exceptions: -- Notes: --------------------------------------------------------------------------- end Util.Trace_Helper; gnade-1.6.2.orig/contrib/objects/util/util-types.adb0000644000175000017500000002051510554624343022243 0ustar lbrentalbrenta-- ------------------------------------------------------------------------- -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/Makefile -- Description : Util base package -- -- Author : Michael Erdmann -- -- Created On : 30-April-2005 -- -- Last Modified By: $Author: merdmann $ -- -- Last Modified On: $Date: 2007/01/21 08:48:35 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2005 Michael Erdmann -- -- -- -- SDB is copyrighted by the persons and institutions enumerated in the -- -- AUTHORS file. This file is located in the root directory of the -- -- SDB distribution. -- -- -- -- SDB is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with SDB; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- SDB Ada units, or you link SDB Ada units or libraries with other -- -- files to produce an executable, these units or libraries do not by -- -- itself cause the resulting executable to be covered by the GNU -- -- General Public License. This exception does not however invalidate -- -- any other reasons why the executable file might be covered by the -- -- GNU Public License. -- -- -- -- ------------------------------------------------------------------------- -- with System.Storage_Elements; use System.Storage_Elements; with System; use System; with System.Address_To_Access_Conversions; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Streams; use Ada.Streams; with Ada.Characters.Latin_1; use Ada.Characters.Latin_1; with Ada.Characters.Handling; use Ada.Characters.Handling; with Ada.Unchecked_Deallocation; with Unchecked_Conversion; with Util.Trace; use Util.Trace; with Util.Trace_Helper; use Util; package body Util.Types is Verson : constant String := "$Id: util-types.adb,v 1.1 2007/01/21 08:48:35 merdmann Exp $"; package Tracer is new Trace_Helper( Module => "Util.Types" ); use Tracer; ---------- -- Free -- ---------- procedure Free( Buffer : in out Buffer_Access ) is procedure XFree is new Ada.Unchecked_Deallocation( Storage_Array, Buffer_Access); begin XFree( Buffer ); end Free; ---------- -- Dump -- ---------- procedure Dump( Data : in Buffer_Access; Length : in Natural; Level : in Level_Type := Trace.Functional ) is ------------ -- Encode -- ------------ function Encode( Value : in Storage_Element ) return String is Hi : Natural := ( Natural(Value) / 16 ) mod 16; Lo : Natural := Natural(Value) mod 16; HexVal : constant String := "0123456789ABCDEF"; begin return HexVal( Hi+1 ) & HexVal( Lo+1 ); end Encode; Hex : Unbounded_String := Null_Unbounded_String; begin LOG( Level, "Buffer Length :" & Natural'Image( Length ) ); if Data = null then LOG( Level, "*** No data available **** "); return; end if; LOG( Level, "Buffer Data :" ); for i in 1..Length loop if Storage_Offset(i) in Data'Range then Hex := Hex & Encode( Data( Storage_Offset(i) ) ) & " "; else Hex := Hex & "**" ; end if; if i > 0 and (i mod 16 = 0) then LOG( Level, " " & To_String(Hex) ); Hex := Null_Unbounded_String; end if; end loop; LOG( Level, " " & To_String(Hex) ); end Dump; ---------- -- Dump -- ---------- procedure Dump( Data : in Stream_Element_Array; Level : in Level_Type := Trace.Functional ) is ------------ -- Encode -- ------------ function Encode( Value : in Stream_Element ) return String is Hi : Natural := ( Natural(Value) / 16 ) mod 16; Lo : Natural := Natural(Value) mod 16; HexVal : constant String := "0123456789ABCDEF"; begin return HexVal( Hi+1 ) & HexVal( Lo+1 ); end Encode; Hex : Unbounded_String := Null_Unbounded_String; Asc : Unbounded_String := Null_Unbounded_String; P : Stream_Element_Offset := Data'First ; A : Address ; begin LOG( Level, "Stream Object Length :" & Natural'Image( Data'Length ) ); LOG( Level, "Stream Object Data :" ); while P in Data'Range loop A := Data(p)'Address; for i in 1..16 loop if P in Data'Range then Hex := Hex & Encode( Data(P) ) & " "; if Is_Graphic( Character'Val(Data(P)) ) then Asc := Asc & Character'Val( Data(p) ) ; else Asc := Asc & "."; end if; P := P + 1; else Hex := Hex & " " ; end if; end loop; LOG( Level, Image( A ) & " " & To_String(Hex) & " | " & To_String( Asc ) ); Hex := Null_Unbounded_String; ASC := Null_Unbounded_String; end loop; LOG( Level, " " & To_String(Hex) ); end Dump; ----------- -- Image -- ----------- function Image( A : in Integer ) return String is T : constant String := "0123456789abcdef" ; R : String( 1..8 ) := ( others => ' ' ); V : Integer := A; J : Natural := R'Last; begin while J in R'Range loop declare H : Natural := V mod 256; HH : Natural := H / 16; HL : Natural := H mod 16; begin R( J ) := T( HL + 1 ); J := J - 1; R( J ) := T( HH + 1 ); J := J - 1; end ; V := V / 256 ; end loop; return "0x" & R; end Image; ----------- -- Image -- ----------- function Image( A : in Address ) return String is function To_Integer is new Unchecked_Conversion( Source => Address, Target => Integer ); begin return Image( To_Integer( A ) ); end Image; ----------- -- Image -- ----------- function Image( A : in Buffer_Access ) return String is package Conversion is new Address_To_Access_Conversions( Object => Storage_Array ); use Conversion; begin return Image( To_Address( Object_Pointer(A) ) ); end Image; ----------- -- Image -- ----------- function Image( Key : in Key_Access ) return String is begin if Key = null then return "** null **"; else declare Result_Length : constant Natural := Key.all'Length * 2; Result : String( 1..Result_Length ) := ( others => ' '); L : Natural := Result'First; HexVal : constant String := "0123456789ABCDEF"; begin for i in Key.all'Range loop Result(L) := HexVal( Natural(Key(i)) / 16 ); Result(L+1) := HexVal( Natural(Key(i)) mod 16 ); L := L + 2; end loop; return Result; end ; end if; end Image; end Util.Types; gnade-1.6.2.orig/contrib/objects/util/util-types.ads0000644000175000017500000000732010554624343022263 0ustar lbrentalbrenta-- ------------------------------------------------------------------------- -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/Makefile -- Description : Util base package -- -- Author : Michael Erdmann -- -- Created On : 30-April-2005 -- -- Last Modified By: $Author: merdmann $ -- -- Last Modified On: $Date: 2007/01/21 08:48:35 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2005 Michael Erdmann -- -- -- -- SDB is copyrighted by the persons and institutions enumerated in the -- -- AUTHORS file. This file is located in the root directory of the -- -- SDB distribution. -- -- -- -- SDB is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with SDB; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- SDB Ada units, or you link SDB Ada units or libraries with other -- -- files to produce an executable, these units or libraries do not by -- -- itself cause the resulting executable to be covered by the GNU -- -- General Public License. This exception does not however invalidate -- -- any other reasons why the executable file might be covered by the -- -- GNU Public License. -- -- -- -- ------------------------------------------------------------------------- -- with System.Storage_Elements; use System.Storage_Elements; with System; use System; with Ada.Streams; use Ada.Streams; with Util.Trace; use Util.Trace; use Util; package Util.Types is type Buffer_Access is access all Storage_Array; procedure Free( Buffer : in out Buffer_Access ); function Image( A : in Address ) return String; function Image( A : in Buffer_Access ) return String; function Image( A : in Integer ) return String; procedure Dump( Data : in Buffer_Access; Length : in Natural; Level : in Level_Type := Trace.Functional ); procedure Dump( Data : in Stream_Element_Array; Level : in Level_Type := Trace.Functional ); subtype Key_Type is Storage_Array; type Key_Access is access Key_Type; function Image( Key : in Key_Access ) return String; Invalid_Parameters : exception; end Util.Types; gnade-1.6.2.orig/contrib/objects/util/util.ads0000644000175000017500000000551010554624344021121 0ustar lbrentalbrenta-- ------------------------------------------------------------------------- -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/Makefile -- Description : Util base package -- -- Author : Michael Erdmann -- -- Created On : 30-April-2005 -- -- Last Modified By: $Author: merdmann $ -- -- Last Modified On: $Date: 2007/01/21 08:48:36 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2005 Michael Erdmann -- -- -- -- SDB is copyrighted by the persons and institutions enumerated in the -- -- AUTHORS file. This file is located in the root directory of the -- -- SDB distribution. -- -- -- -- SDB is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with SDB; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- SDB Ada units, or you link SDB Ada units or libraries with other -- -- files to produce an executable, these units or libraries do not by -- -- itself cause the resulting executable to be covered by the GNU -- -- General Public License. This exception does not however invalidate -- -- any other reasons why the executable file might be covered by the -- -- GNU Public License. -- -- -- -- ------------------------------------------------------------------------- -- package Util is end Util; gnade-1.6.2.orig/contrib/simple/0000755000175000017500000000000011040716254016326 5ustar lbrentalbrentagnade-1.6.2.orig/contrib/simple/Makefile0000644000175000017500000001064707342234170020000 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/contrib/simple/Makefile,v $ ## Description : Makefile for the embedded SQL samples ## Author : Juergen Pfeifer ## Created On : 03-Jan-2001 ## Last Modified By: $Author: me $ ## Last Modified On: $Date: 2001/08/26 17:57:12 $ ## Status : $State: Exp $ ## ## Copyright (C) 2000-2001 ## ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## This makefile builds the sample programs for embedded SQL. ## ## Restrictions ## ============ ## None ## ## References ## ========== ## None ## sinclude ../conf.local sinclude ../../make.conf # ESQLFLAGS = -v -s -debugcode -pedantic -nosqlstate $(FLAGS) # use always the local esql translator ESQL=$(bindir)/$(esql) # all exported executable PROGRAMS=simple # ------------------------------------------------------------------------- # # C O M P I L E R R U L E S # # ------------------------------------------------------------------------- # .SUFFIXES: .adb .adq .gpq # run the ebedded sql translator .adq.adb: $(ESQL) $(ESQLFLAGS) $*.adq # add the connection information dep. on the configured data base .gpq.adq: $(ADAPREP) -DDBUSER=\"$(DBUSER)\" \ -DDBPASSWD=\"$(DBPASSWD)\" \ -DDBSOURCE=\"$(DBSOURCE)\" \ $*.gpq $*.adq # ------------------------------------------------------------------------- # # E X E C U T A B L E S # # ------------------------------------------------------------------------- # all :: $(PROGRAMS) simple.adq: simple.gpq simple: simple.adb $(ADAMAKE) -o simple $(ADAFLAGS) simple.adb -cargs $(CFLAGS) \ $(APP_BIND_FLAGS) $(APP_LINK_FLAGS) -largs # ------------------------------------------------------------------------- # # C L E A N T H E D I R E C T O R Y # # ------------------------------------------------------------------------- # clean: rm -rf $(PROGRAMS) b~*.* *.o *~ *.ali core simple.adb simple.adq distclean :: clean gnade-1.6.2.orig/contrib/simple/simple.gpq0000644000175000017500000001007607342234170020336 0ustar lbrentalbrenta-- SIMPLE : -- 1) Logon to the database -- 2) Prompt user for a name that exists -- in the EMPLOYEES table -- 3) Do a simple SQL join that finds the -- employee's department and location with Ada.Text_Io; use Ada.Text_Io; with Sql_Standard; use Sql_Standard; with Ada.Strings.Fixed; use Ada.Strings.Fixed; with Ada.Strings; use Ada.Strings; -- Note: the Esql Translator "with's" the other required GNADE -- packages. procedure Simple is package Io is new Ada.Text_Io.Integer_Io (Integer); use Io; -- declare host and program variables=20 Exec Sql declare Db01 Database ; Exec Sql begin declare Section end-Exec Ename : Char (1..20); Dept_Name : Char (1..20); Location : Char (1..20); Ename_Ind : Indicator_Type; Exec Sql end declare Section end-Exec Input_Ename : String (1..20); Ename_Len : Integer; Rdbms_Id : constant String := $DBUSER; Sqlcode : Sql_Standard.Sqlcode_Type; -- for ANSI mode=20 Sqlstate : Sql_Standard.Sqlstate_Type; -- ANSI mode=20 Sql_Error : exception; Sql_Warning : exception; -- Check to see if the last database=20 -- operation returned any rows.=20 function Employee_Exists return Boolean is begin return (not(Sqlcode in Sql_Standard.Not_Found)); end Employee_Exists; begin --=20 Exec Sql Whenever Sqlerror raise Sql_Error; -- Check for warnings, such as data truncation, also.=20 -- Exec Sql Whenever Sqlwarning raise Sql_Warning; -- Connect to RDBMS=20 Exec Sql Connect Rdbms_Id Identified By $DBPASSWD By Db01 To $DBSOURCE ; New_Line; Put_Line("Connected to RDBMS as " & Rdbms_Id); New_Line; Put_Line("*** GNADE DEMO ***"); New_Line; loop Put("Enter employee last name (CR to exit): "); Get_Line(Input_Ename, Ename_Len); exit when Ename_Len =0; Input_Ename (Ename_Len+1..Input_Ename'Last) := (others =>' ' ); Move( S => Input_Ename, C => Ename); -- SELECT statements that return one row can use a=20 -- simple SELECT statement. Otherwise, a cursor must be=20 -- declared for the SELECT, and a FETCH statement is used.=20 Ename_ind := Indicator_Type(Ename_Len); Exec Sql at Db01 select Location, DEPARTMENTS.NAME Into :Location, :Dept_Name From EMPLOYEES, DEPARTMENTS Where DEPARTMENTS.DEPTNO = EMPLOYEES.DEPTNO and EMPLOYEES.NAME = :Ename INDICATOR :Ename_Ind; if Employee_Exists then New_Line; Put("Employee "); Put(To_String (Ename(1..Ename_Len))); Put(" works for department " & To_String (Dept_Name)); Put(" in " & To_String(Location)); else Put_Line("Sorry, no such employee (try MARTIN or SCHMIT)" ); New_Line; -- The following lines illustrate the use of SQLSTATE and = SQLCODE Put("The SQLSTATE error code is: "); Put_Line(String(Sqlstate)); Put("The SQLCODE error code is: "); Put(Integer(Sqlcode),1); end if; New_Line; New_Line; end loop; New_Line; Put_Line("Good bye."); -- Disconnect from the database.=20 Exec Sql at Db01 Commit; exception -- Turn off error checking, since we do not want=20 -- to raise an exception when logging out under=20 -- any circumstance.=20 Exec Sql at Db01 Whenever Sqlerror Continue; Exec Sql at Db01 Whenever Sqlwarning Continue; when Sql_Error => Put_Line(" ** RDBMS ERROR OCCURRED **"); New_Line; Put_Line(Trim( Sqlca.Message, Right )); --Exec Sql at Db01 -- Rollback Release; when Sql_Warning => Put_Line(" ** RDBMS WARNING OCCURRED **"); New_Line; --Exec Sql at Db01 -- Rollback Release; end Simple; gnade-1.6.2.orig/contrib/test_n/0000755000175000017500000000000011040716254016331 5ustar lbrentalbrentagnade-1.6.2.orig/contrib/test_n/Makefile0000644000175000017500000001153707276046476020022 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/contrib/test_n/Makefile,v $ ## Description : Makefile for the embedded SQL samples ## Author : Michael Erdmann ## Created On : 27-Jan-2001 ## Last Modified By: $Author: me $ ## Last Modified On: $Date: 2001/05/08 19:47:10 $ ## Status : $State: Exp $ ## ## Copyright (C) 2000-2001 ## ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## This makefile builds the sample programs for embedded SQL. ## ## Restrictions ## ============ ## None ## ## References ## ========== ## None LIBINSTALL=/usr/local/lib/ada ESQLFLAGS = -nodebugcode -pedantic $(FLAGS) ESQL=gesql ADAMAKE=gnatmake ADAINCLUDE=$(LIBINSTALL)/adainclude ADALIB=$(LIBINSTALL)/adalib ADAFLAGS=-a -g -a0. -aI$(ADAINCLUDE) -aL$(ADALIB) -aL$(LIBINSTALL) \ -gnatf -gnatwl -gnatao CFLAGS=-funwind-tables APP_BIND_FLAGS=-bargs -E LD_RPATH_OPTION=-Wl,-rpath,$(LIBINSTALL) APP_LINK_FLAGS=-largs -L$(ADALIB) -L$(LIBINSTALL) $(LD_RPATH_OPTION) # ------------------------------------------------------------------------- # # C O M P I L E R R U L E S # # ------------------------------------------------------------------------- # .SUFFIXES: .adb .adq .adq.adb: $(ESQL) $(ESQLFLAGS) $*.adq PROGRAMS=test_n # all :: installdb.log $(PROGRAMS) # ------------------------------------------------------------------------- # # E X E C U T A B L E S # # ------------------------------------------------------------------------- # test_n: test_n.adb test_n_list.ads test_n_list.adb $(ADAMAKE) -o test_n $(ADAFLAGS) test_n.adb -cargs $(CFLAGS) \ $(APP_BIND_FLAGS) $(APP_LINK_FLAGS) -largs -lodbc installdb.log: test_n.sql psql gnade < test_n.sql > installdb.log # ------------------------------------------------------------------------- # # C L E A N T H E D I R E C T O R Y # # ------------------------------------------------------------------------- # cleandb: -psql gnade -c "drop table NTEST" rm -f installdb.log clean: cleandb # ------------------------------------------------------------------------- # # C L E A N T H E D I R E C T O R Y # # ------------------------------------------------------------------------- # clean: rm -rf $(PROGRAMS) test_n_list.adb b~*.* *.o *.ali core *~ distclean :: clean gnade-1.6.2.orig/contrib/test_n/test_n.adb0000644000175000017500000000011607245307634020305 0ustar lbrentalbrentawith Test_N_List; procedure Test_N is begin Test_N_List.Show; end Test_N; gnade-1.6.2.orig/contrib/test_n/test_n.sql0000644000175000017500000000060407245307634020360 0ustar lbrentalbrentacreate table NTEST ( I2 int2, I4 int4, F4 float4, F8 float8, n1 decimal( 15,3 ), n2 numeric( 20,4 ) ) ; insert into ntest values ( 1, 2, 3.123456789, 84.123456, 12345.123458, 1234567890.112 ); insert into ntest values ( 2, 2, 3.0, 88.889, 123456789.123456, 0.123456768 ); insert into ntest values ( 3, 2, 14.56, 778.123456 ); gnade-1.6.2.orig/contrib/test_n/test_n_list.adq0000644000175000017500000000367207245307634021371 0ustar lbrentalbrentawith Ada.Text_IO.Editing; use Ada.Text_IO.Editing; with Ada.Text_IO; use Ada.Text_IO; with SQL_STANDARD; use SQL_STANDARD; with Ada.Unchecked_Conversion; with GNAT.Float_Control; package body Test_N_List is EXEC SQL DECLARE DB01 DATABASE ; type Euro is delta 0.01 digits 18; package Euro_IO is new Decimal_Output( Num => Euro, Default_Currency => "EU"); procedure Show is package IIO is new Ada.Text_IO.Integer_IO (Integer); EXEC SQL INCLUDE SQLCA; EXEC SQL BEGIN DECLARE SECTION; I2 : SMALLINT; I4 : INT; F4 : REAL := 2.0/3.0; F8 : DOUBLE_PRECISION := 2.0/3.0 ; N1, N2 : DOUBLE_PRECISION := 0.0 ; EXEC SQL END DECLARE SECTION; Float_Var : Float := 2.0/3.0; Result : Euro ; begin GNAT.Float_Control.Reset; Put ("2.0/3.0 as Float, REAL and DOUBLE_PRECISON "); New_Line; Put (Float'Image (Float_Var)); Put (REAL'Image (F4)); Put (DOUBLE_PRECISION'Image (F8)); New_Line; EXEC SQL AT DB01 DECLARE ntest_cursor LOCAL CURSOR FOR SELECT I2, I4, F4, F8, N1, N2 INTO :I2, :I4, :F4, :F8, :N1, :N2 FROM NTEST ; EXEC SQL AT DB01 OPEN ntest_cursor; Put_Line ("From the database"); loop EXEC SQL AT DB01 FETCH FROM ntest_cursor; exit when SQLCODE not in 0 .. 1 ; Put (SMALLINT'Image (I2)); Put (INT'Image (I4)); Put (REAL'Image (F4)); Put (DOUBLE_PRECISION'Image (F8)); Put (DOUBLE_PRECISION'Image (N1)); Put (DOUBLE_PRECISION'Image (N2)); Result := Euro(N2); Put ( Euro'Image (Result) ); New_Line; end loop; EXEC SQL AT DB01 CLOSE ntest_cursor; end Show; begin EXEC SQL CONNECT "gnade" IDENTIFIED BY "gnade" BY DB01 TO "DEMO_DB" ; end Test_N_LIst; gnade-1.6.2.orig/contrib/test_n/test_n_list.ads0000644000175000017500000000007507245307634021365 0ustar lbrentalbrentapackage Test_N_List is procedure Show; end Test_N_List; gnade-1.6.2.orig/contrib/wisconsin/0000755000175000017500000000000011040716254017051 5ustar lbrentalbrentagnade-1.6.2.orig/contrib/wisconsin/Makefile0000644000175000017500000001124407276046476020535 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/contrib/wisconsin/Makefile,v $ ## Description : Makefile for the embedded SQL samples ## Author : Michael Erdmann ## Created On : 27-Jan-2001 ## Last Modified By: $Author: me $ ## Last Modified On: $Date: 2001/05/08 19:47:10 $ ## Status : $State: Exp $ ## ## Copyright (C) 2000-2001 ## ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## This makefile builds the sample programs for embedded SQL. ## ## Restrictions ## ============ ## ## References ## ========== ## include ../../make.conf LIBINSTALL=/usr/local/lib/ada ESQLFLAGS = -pedantic $(FLAGS) ESQL=$(bindir)/gesql #ADAMAKE=gnatmake #ADAINCLUDE=$(LIBINSTALL)/adainclude #ADALIB=$(LIBINSTALL)/adalib #ADAFLAGS=-a -g -a0. -aI$(ADAINCLUDE) -aL$(ADALIB) -aL$(LIBINSTALL) \ -gnatf -gnatwl -gnatao #CFLAGS=-funwind-tables #APP_BIND_FLAGS=-bargs -E #LD_RPATH_OPTION=-Wl,-rpath,$(LIBINSTALL) #APP_LINK_FLAGS=-largs -L$(ADALIB) -L$(LIBINSTALL) $(LD_RPATH_OPTION) # ------------------------------------------------------------------------- # # C O M P I L E R R U L E S # # ------------------------------------------------------------------------- # .SUFFIXES: .adb .adq .adq.adb: $(ESQL) $(ESQLFLAGS) $*.adq PROGRAMS=wisbm # all :: installdb.log $(PROGRAMS) # ------------------------------------------------------------------------- # # E X E C U T A B L E S # # ------------------------------------------------------------------------- # wisbm: wisconsin.adb wisconsin.adq $(ADAMAKE) -o wisbm $(ADAFLAGS) main.adb -cargs $(CFLAGS) \ $(APP_BIND_FLAGS) $(APP_LINK_FLAGS) -largs -lodbc installdb.log: wisconsin.sql psql gnade < wisconsin.sql > installdb.log # ------------------------------------------------------------------------- # # C L E A N T H E D I R E C T O R Y # # ------------------------------------------------------------------------- # cleandb: -psql gnade -c "drop table onek" -psql gnade -c "drop table tenk1" -psql gnade -c "drop table tenk2" -psql gnade -c "drop table Bprime" rm -f installdb.log clean: cleandb rm -rf $(PROGRAMS) wisconsin.adb b~*.* *.o *.ali core *~ distclean :: clean gnade-1.6.2.orig/contrib/wisconsin/README0000644000175000017500000000042007237322675017742 0ustar lbrentalbrentaThis is the wisconsin benchmakr test. The code is based upon i recevied from François Fabien. The program generates the following output on my system: Wisconsin benchmark test ======================== Running actual benchmark Time for wisc_benchmark: 1.727045000 gnade-1.6.2.orig/contrib/wisconsin/main.adb0000644000175000017500000000013207235105510020437 0ustar lbrentalbrentawith Wisconsin; use Wisconsin; procedure Main is begin Benchmark; end Main; gnade-1.6.2.orig/contrib/wisconsin/wisconsin.adb.old0000644000175000017500000002741207235105510022316 0ustar lbrentalbrentawith Text_Io, Db, Calendar; with Ada.Strings.Unbounded; use Text_Io, Db, Calendar; use Ada.Strings.Unbounded; procedure Wisconsin is Opt_Loop_Count : Natural := 10; Pwd : constant String := "c:/mysql/bench"; Start_Time, Loop_Time, End_Time : Time; Row_Count : Integer; Table_Nbr : Natural := 4; Query_Nbr : Natural; Table_Name : array (1 .. Table_Nbr) of Unbounded_String ; Create_Query_Array : array (1 .. Table_Nbr) of Unbounded_String ; Query_Array : array (1 .. 32) of Unbounded_String ; Dbase : Db.Object; Qid : Db.Query_Id; procedure Init_Data is begin --CREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name [(create_definition,...)] -- [table_options] [select_statement] Create_Query_Array (1) :=To_Unbounded_String (Source => "CREATE TABLE IF NOT EXISTS onek " & " (unique1 int(4) NOT NULL, " & "unique2 int(4) NOT NULL, " & "two int(4), " & "four int(4), " & "ten int(4), " & "twenty int(4), " & "hundred int(4) NOT NULL, " & "thousand int(4), " & "twothousand int(4), " & "fivethous int(4), " & "tenthous int(4), " & "odd int(4), " & "even int(4), " & "stringu1 char(16), " & "stringu2 char(16), " & "string4 char(16), " & "UNIQUE (unique1), " & "UNIQUE (unique2), " & "INDEX hundred1 (hundred) )" & " TYPE = ISAM " ); Create_Query_Array (2) :=To_Unbounded_String (Source => "CREATE TABLE IF NOT EXISTS tenk1 " & " ( unique1 int(4) NOT NULL, " & "unique2 int(4) NOT NULL, " & "two int(4), " & "four int(4), " & "ten int(4), " & "twenty int(4), " & "hundred int(4) NOT NULL, " & "thousand int(4), " & "twothousand int(4), " & "fivethous int(4), " & "tenthous int(4), " & "odd int(4), " & "even int(4), " & "stringu1 char(16), " & "stringu2 char(16), " & "string4 char(16), "& "UNIQUE (unique1), " & "UNIQUE (unique2), " & "INDEX hundred2 (hundred) )"& " TYPE = ISAM "); Create_Query_Array (3) :=To_Unbounded_String (Source => "CREATE TABLE IF NOT EXISTS tenk2 " & " (unique1 int(4) NOT NULL, " & "unique2 int(4) NOT NULL, " & "two int(4), " & "four int(4), " & "ten int(4), " & "twenty int(4), " & "hundred int(4) NOT NULL, " & "thousand int(4), " & "twothousand int(4), " & "fivethous int(4), " & "tenthous int(4), " & "odd int(4), " & "even int(4), " & "stringu1 char(16), " & "stringu2 char(16), " & "string4 char(16), " & "UNIQUE (unique1), " & "UNIQUE (unique2), " & "INDEX hundred3 (hundred))"& " TYPE = ISAM "); Create_Query_Array (4) :=To_Unbounded_String (Source => "CREATE TABLE IF NOT EXISTS Bprime " & "(unique1 int(4) NOT NULL, " & "unique2 int(4) NOT NULL, " & "two int(4), " & "four int(4), " & "ten int(4), " & "twenty int(4), " & "hundred int(4) NOT NULL, " & "thousand int(4), " & "twothousand int(4), " & "fivethous int(4), " & "tenthous int(4), " & "odd int(4), " & "even int(4), " & "stringu1 char(16), " & "stringu2 char(16), " & "string4 char(16), " & "UNIQUE (unique1), " & "UNIQUE (unique2), " & "INDEX hundred4 (hundred)) " & " TYPE = ISAM "); Table_Name (1) :=To_Unbounded_String (Source => "onek"); Table_Name (2) :=To_Unbounded_String (Source => "tenk1"); Table_Name (3) :=To_Unbounded_String (Source => "tenk2"); Table_Name (4) :=To_Unbounded_String (Source => "Bprime"); end; procedure Init_Query is begin Query_Nbr := 22; Query_Array (1) :=To_Unbounded_String ( Source => "select * from onek"); Query_Array (2) :=To_Unbounded_String ( Source => "select * from tenk1"); Query_Array (3) :=To_Unbounded_String ( Source => "select * from tenk2"); Query_Array (4) :=To_Unbounded_String ( Source => "select * from Bprime"); Query_Array (5) :=To_Unbounded_String ( Source => "select * from tenk1 where (unique2 > 301) and (unique2 < 402)" ); Query_Array (6) :=To_Unbounded_String ( Source => "select * from tenk1 where (unique1 > 647) and (unique1 < 1648)" ); Query_Array (7) :=To_Unbounded_String ( Source => "select * from tenk1 where unique2 = 2001"); Query_Array (8) :=To_Unbounded_String ( Source => "select * from tenk1 where (unique2 > 301) and (unique2 < 402)" ); Query_Array (9) :=To_Unbounded_String ( Source => "select two, four, ten, twenty, hundred, string4 from tenk1" ); Query_Array (10) :=To_Unbounded_String ( Source => "select MIN(unique2) as x from tenk1"); Query_Array (11) :=To_Unbounded_String ( Source => "insert into tenk1 (unique1, unique2, two, four, ten, twenty," & "hundred, thousand, twothousand, fivethous, tenthous, odd, even,stringu1,stringu2, string4)" & "values (10001, 74001, 0, 2, 0, 10, 50, 688, 1950, 4950, " & "9950, 1, 100, 'ron may choi','jae kwang choi', 'u. c. berkeley')" ); Query_Array (12) :=To_Unbounded_String ( Source => "insert into tenk1 (unique1, unique2, two, four, ten, twenty, " & "hundred, thousand, twothousand, fivethous, tenthous, odd, even,stringu1,stringu2, string4)" & "values (19991, 60001, 0, 2, 0, 10, 50, 688, 1950, 4950, " & " 9950, 1, 100, 'ron may choi','jae kwang choi', 'u. c. berkeley')" ); Query_Array (13) :=To_Unbounded_String ( Source => "delete from tenk1 where tenk1.unique2 = 877" ); Query_Array (14) :=To_Unbounded_String ( Source => "delete from tenk1 where tenk1.unique2 = 876" ); Query_Array (15) :=To_Unbounded_String ( Source => "update tenk1 set unique2 = 10001 where tenk1.unique2 =1491" ); Query_Array (16) :=To_Unbounded_String ( Source => "update tenk1 set unique2 = 10023 where tenk1.unique2 =1480" ); Query_Array (17) :=To_Unbounded_String ( Source => "insert into tenk1 (unique1, unique2, two, four, ten, twenty, " & " hundred, thousand, twothousand, fivethous, tenthous, odd, even, stringu1, stringu2, string4)" & " values (20002, 70002, 0, 2, 0, 10, 50, 688, 1950, 4950, " & " 9950, 1, 100, 'ron may choi', 'jae kwang choi', 'u. c. berkeley')" ); Query_Array (18) :=To_Unbounded_String ( Source => "insert into tenk1 (unique1, unique2, two, four, ten, twenty, " & " hundred, thousand, twothousand, fivethous, tenthous, odd, even, stringu1, stringu2, string4)" & "values (50002, 40002, 0, 2, 0, 10, 50, 688, 1950, 4950, " & "9950, 1, 100, 'ron may choi', 'jae kwang choi', 'u. c. berkeley')" ); Query_Array (19) :=To_Unbounded_String ( Source => "update tenk1 set unique2 = 10088 where tenk1.unique2 =187"); Query_Array (20) :=To_Unbounded_String ( Source => "update tenk1 set unique2 = 10003 where tenk1.unique2 =2000"); Query_Array (21) :=To_Unbounded_String ( Source => "update tenk1 set unique2 = 10020 where tenk1.unique2 =1974"); Query_Array (22) :=To_Unbounded_String ( Source => "update tenk1 set unique2 = 16001 where tenk1.unique2 =1140"); end; begin -- --Connect and start timeing -- Initialize( Dbase ); User( Dbase, ""); Password( Dbase, "" ); Connect( Dbase, "localhost" ); Select_Db( Dbase, "Test" ); Start_Time := Calendar.Clock; -- -- Create needed tables -- Init_Data; Init_Query; Text_Io.Put_Line ("Wisconsin benchmark test"); Text_Io.Put_Line ("========================"); Loop_Time := Calendar.Clock; for Ti in 1..Table_Nbr loop declare My_Table_Name : constant String := To_String (Table_Name ( Ti)); begin --DROP TABLE [IF EXISTS] tbl_name Qid := Db.Query (Dbase, "DROP TABLE IF EXISTS " & My_Table_Name ); Drop_Query( Dbase, Qid ); Text_Io.Put_Line ("Creating table " & My_Table_Name); Qid := Db.Query (Dbase, To_String (Create_Query_Array (Ti ))); Drop_Query( Dbase, Qid ); end; end loop; End_Time := Calendar.Clock; Text_Io.Put_Line ("Time for create tables " & Duration'Image (End_Time -Loop_Time)); -- -- Insert data -- Text_Io.Put_Line ("Inserting data"); Loop_Time := Calendar.Clock; Row_Count := 0; -- LOAD DATA [LOW_PRIORITY] [LOCAL] INFILE 'file_name.txt' -- [REPLACE | IGNORE] -- INTO TABLE tbl_name -- [FIELDS -- [TERMINATED BY '\t'] -- [OPTIONALLY] ENCLOSED BY ''] -- [ESCAPED BY '\\' ]] -- [LINES TERMINATED BY '\n'] -- [IGNORE number LINES] -- [(col_name,...)] Qid := Db.Query (Dbase, "LOAD DATA INFILE " & Ascii.Quotation & Pwd & "/data/wisconsin/onek.data" & Ascii.Quotation & " REPLACE INTO TABLE " & To_String (Table_Name(1)) & " FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'"); Drop_Query( Dbase, Qid ); for I in 2 .. 4 loop Qid := Db.Query (Dbase, "LOAD DATA INFILE " & Ascii.Quotation & Pwd & "/data/wisconsin/tenk.data" & Ascii.Quotation & " REPLACE INTO TABLE " & To_String (Table_Name(I)) & " FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'"); Drop_Query( Dbase, Qid ); end loop; End_Time := Calendar.Clock; Text_Io.Put_Line ("Time to insert into tables " & Duration'Image (End_Time -Loop_Time)); Loop_Time := Calendar.Clock; Text_Io.Put_Line ("Delete from Bprime where unique2 >= 1000 " ) ; Qid := Db.Query (Dbase,"delete from Bprime where Bprime.unique2 >= 1000" ); End_Time := Calendar.Clock; Text_Io.Put_Line ( "Time to delete_big (1): " & Duration'Image (End_Time -Loop_Time)); Drop_Query( Dbase, Qid ); -- -- Running the benchmark -- Text_io.new_line; Text_Io.Put_Line ( "Running actual benchmark"); Loop_Time := Calendar.Clock; for I in 1 .. Query_Nbr loop Text_Io.Put_Line ("Doing query number " & Integer'Image(I)); Qid := Db.Query (Dbase, To_String (Query_Array (I ))); declare My_Query : constant String := To_String (Query_Array (I)); begin if My_query (1..6) = "select" then Text_Io.Put_Line ("Number of records :" & Integer'Image(Nbr_Of_Rows(Dbase,Qid))); end if; end; Drop_Query( Dbase, Qid ); end loop; End_Time := Calendar.Clock; Text_Io.Put_Line ( "Time for wisc_benchmark: " & Duration'Image (End_Time -Loop_Time)); for Ti in 1..Table_Nbr loop declare My_Table_Name : constant String := To_String (Table_Name (Ti)); begin -- DROP TABLE [IF EXISTS] tbl_name Qid := Db.Query (Dbase, ("drop table " & My_Table_Name)); Drop_Query( Dbase, Qid ); end; end loop; Finalize( Dbase ); end;gnade-1.6.2.orig/contrib/wisconsin/wisconsin.adq0000644000175000017500000002000507367056712021566 0ustar lbrentalbrenta-- Translation in Embedded SQL of the Wisconsin Benchmark -- found in the Mysql distribution -- François FABIEN 24/10/2001 -- -- This exemple is specific to the Mysql database due to the -- use of the LOAD DATA INFILE function (for Oracle, this -- code should be rewritten to use a spawn of OLLOAD or SQL*LOAD) -- -- DATA files to load to Database are supposed to be located in directory -- c:\mysql\bench\data\wisconsin\ -- Change as required -- -- Tested on a Pentium MMX at 167 MHz under Windows95 / -- MySQL 3.23.27 with MyODBC 2.50.38 -- Benchmark result is 12.02 sec with Calendar; use Calendar; with Ada.Text_IO; use Ada.Text_IO; with SQL_STANDARD; use SQL_STANDARD; package body Wisconsin is Handling_Error : exception; Table_Number : constant := 4; Table_Name : array (1..Table_Number) of String (1..6) := ("onek ", "tenk1 ", "tenk2 ", "Bprime"); procedure Create_Tables is begin for i in Table_Name'range loop begin ODBC.EXECUTE(GNADE_DB_DEFAULT,SQLCA'Address, Statement => "DROP TABLE " & Table_Name (i)); exception when others => null; end; end loop; exec sql CREATE TABLE onek ( unique1 INT NOT NULL, unique2 INT NOT NULL, two INT, four INT, ten INT, twenty INT, hundred INT NOT NULL, thousand INT, twothousand INT, fivethous INT, tenthous INT, odd INT, even INT, stringu1 char(16), stringu2 char(16), string4 char(16), UNIQUE (unique1), UNIQUE (unique2)); exec sql CREATE TABLE tenk1 ( unique1 INT NOT NULL, unique2 INT NOT NULL, two INT, four INT, ten INT, twenty INT, hundred INT NOT NULL, thousand INT, twothousand INT, fivethous INT, tenthous INT, odd INT, even INT, stringu1 char(16), stringu2 char(16), string4 char(16), UNIQUE (unique1), UNIQUE (unique2) ); exec sql CREATE TABLE tenk2 ( unique1 INT NOT NULL, unique2 INT NOT NULL, two INT, four INT, ten INT, twenty INT, hundred INT NOT NULL, thousand INT, twothousand INT, fivethous INT, tenthous INT, odd INT, even INT, stringu1 char(16), stringu2 char(16), string4 char(16), UNIQUE (unique1), UNIQUE (unique2) ); exec sql CREATE TABLE Bprime ( unique1 INT NOT NULL, unique2 INT NOT NULL, two INT, four INT, ten INT, twenty INT, hundred INT NOT NULL, thousand INT, twothousand INT, fivethous INT, tenthous INT, odd INT, even INT, stringu1 char(16), stringu2 char(16), string4 char(16), UNIQUE (unique1), UNIQUE (unique2) ); exec sql commit; end; procedure Load_Tables is begin -- Loading ONEK.DATA into Table ONEK ODBC.EXECUTE(GNADE_DB_DEFAULT,SQLCA'Address, Statement => "LOAD DATA INFILE " & "'c:\\mysql\\bench\\data\\wisconsin\\onek.data'" & " REPLACE INTO TABLE onek" & " FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\'' " & " LINES TERMINATED BY '\n' "); -- Loading TENK.DATA into tables TENK1, TENK2, Bprime for I in 2 .. 4 loop ODBC.EXECUTE(GNADE_DB_DEFAULT,SQLCA'Address, Statement => "LOAD DATA INFILE " & "'c:\\mysql\\bench\\data\\wisconsin\\tenk.data'" & " REPLACE INTO TABLE " & Table_Name(I) & " FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\'' " & " LINES TERMINATED BY '\n' "); end loop; end; procedure Benchmark is Start_Time, End_Time : Time; begin EXEC SQL WHENEVER SQLERROR RAISE Handling_Error; EXEC SQL CONNECT "gnade" IDENTIFIED BY "gnade" TO "gnade" ; Put_Line ("Wisconsin benchmark test"); Put_Line ("========================"); Start_Time := Calendar.Clock; Create_Tables; End_Time := Calendar.Clock; Put_Line ("Tables created "); Put_Line ("Time for creation: " & Duration'Image(End_Time-Start_Time)); Load_Tables; Put_Line ("Tables loaded "); Put_Line ("Time for load: " & Duration'Image(Calendar.Clock- End_Time)); New_line; Put_Line ( "Running actual benchmark"); begin EXEC SQL select * from onek; EXEC SQL select * from tenk1; EXEC SQL select * from tenk2; EXEC SQL select * from Bprime; EXEC SQL select * from tenk1 where (unique2 > 301) and (unique2 < 402); EXEC SQL select * from tenk1 where (unique1 > 647) and (unique1 < 1648); EXEC SQL select * from tenk1 where unique2 = 2001; EXEC SQL select * from tenk1 where (unique2 > 301) and (unique2 < 402); EXEC SQL select two, four, ten, twenty, hundred, string4 from tenk1; EXEC SQL select MIN(unique2) as x from tenk1; EXEC SQL insert into tenk1 (unique1, unique2, two, four, ten, twenty, hundred, thousand, twothousand, fivethous, tenthous, odd, even,stringu1,stringu2, string4) values ( 10001, 74001, 0, 2, 0, 10, 50, 688, 1950, 4950,9950, 1, 100, 'ron may choi','jae kwang choi', 'u. c. berkeley') ; EXEC SQL insert into tenk1 (unique1, unique2, two, four, ten, twenty, hundred, thousand, twothousand, fivethous, tenthous, odd, even,stringu1,stringu2, string4) values ( 19991, 60001, 0, 2, 0, 10, 50, 688, 1950, 4950, 9950, 1, 100, 'ron may choi','jae kwang choi', 'u. c. berkeley') ; EXEC SQL delete from tenk1 where tenk1.unique2 = 877; EXEC SQL delete from tenk1 where tenk1.unique2 = 876; EXEC SQL update tenk1 set unique2 = 10001 where tenk1.unique2 =1491; EXEC SQL update tenk1 set unique2 = 10023 where tenk1.unique2 =1480; EXEC SQL insert into tenk1 ( unique1, unique2, two, four, ten, twenty, hundred, thousand, twothousand, fivethous, tenthous, odd, even, stringu1, stringu2, string4) values ( 20002, 70002, 0, 2, 0, 10, 50, 688, 1950, 4950,9950, 1, 100, 'ron may choi', 'jae kwang choi', 'u. c. berkeley'); EXEC SQL insert into tenk1 ( unique1, unique2, two, four, ten, twenty, hundred, thousand, twothousand, fivethous, tenthous, odd, even, stringu1, stringu2, string4) values ( 50002, 40002, 0, 2, 0, 10, 50, 688, 1950, 4950, 9950, 1, 100, 'ron may choi', 'jae kwang choi', 'u. c. berkeley'); EXEC SQL update tenk1 set unique2 = 10088 where tenk1.unique2 =187; EXEC SQL update tenk1 set unique2 = 10003 where tenk1.unique2 =2000; EXEC SQL update tenk1 set unique2 = 10020 where tenk1.unique2 =1974; EXEC SQL update tenk1 set unique2 = 16001 where tenk1.unique2 =1140; exception when Others => Put_Line("Aborted by exception" ); raise; end; End_Time := Calendar.Clock; Put_Line ( "Time for Wisconsin benchmark: " & Duration'Image(End_Time-Start_Time)); end Benchmark; end Wisconsin; gnade-1.6.2.orig/contrib/wisconsin/wisconsin.ads0000644000175000017500000000007607235105510021557 0ustar lbrentalbrentapackage Wisconsin is procedure Benchmark; end Wisconsin; gnade-1.6.2.orig/contrib/wisconsin/wisconsin.sql0000644000175000017500000000252707235105510021612 0ustar lbrentalbrenta CREATE TABLE "onek" ( "unique1" int4 NOT NULL, "unique2" int4 NOT NULL, "two" int4, "four" int4, "ten" int4, "twenty" int4, "hundred" int4 NOT NULL, "thousand" int4, "twothousand" int4, "fivethous" int4, "tenthous" int4, "odd" int4, "even" int4, "stringu1" char(16), "stringu2" char(16), "string4" char(16), UNIQUE ("unique1"), UNIQUE ("unique2") -- INDEX "hundred1" ("hundred") ); CREATE TABLE tenk1 ( unique1 int4 NOT NULL, unique2 int4 NOT NULL, two int4, four int4, ten int4, twenty int4, hundred int4 NOT NULL, thousand int4, twothousand int4, fivethous int4, tenthous int4, odd int4, even int4, stringu1 char(16), stringu2 char(16), string4 char(16), UNIQUE (unique1), UNIQUE (unique2) ); CREATE TABLE tenk2 ( unique1 int4 NOT NULL, unique2 int4 NOT NULL, two int4, four int4, ten int4, twenty int4, hundred int4 NOT NULL, thousand int4, twothousand int4, fivethous int4, tenthous int4, odd int4, even int4, stringu1 char(16), stringu2 char(16), string4 char(16), UNIQUE (unique1), UNIQUE (unique2) ); CREATE TABLE Bprime ( unique1 int4 NOT NULL, unique2 int4 NOT NULL, two int4, four int4, ten int4, twenty int4, hundred int4 NOT NULL, thousand int4, twothousand int4, fivethous int4, tenthous int4, odd int4, even int4, stringu1 char(16), stringu2 char(16), string4 char(16), UNIQUE (unique1), UNIQUE (unique2) ); gnade-1.6.2.orig/cygwin/0000755000175000017500000000000011040716254014675 5ustar lbrentalbrentagnade-1.6.2.orig/cygwin/Makefile0000644000175000017500000001126710042751217016343 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/cygwin/Makefile,v $ ## Description : Build RPMS from the distribution -- ## Author : Michael Erdmann -- ## Created On : 1-May-2002 -- ## Last Modified By: $Author: merdmann $ -- ## Last Modified On: $Date: 2004/04/25 15:00:31 $ -- ## Version : $Revision: 1.1 $ ## Status : $State: Exp $ ## -- ## Copyright (C) 2002,2003 -- ## -- ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## This package is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## Contact -- ## ======= -- ## Error reports shall be handled via http://gnade.sourceforge.net -- ## Features and ideas via: gnade-develop@lists.sourceforge.net -- ## -- ## Author contact: -- ## purl:/net/michael.erdmann -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## ## Restrictions ## ============ ## None ## ## References ## ========== ## None ## ## ## include ../make.conf DIST=$(exportdir)/gnade-src-$(VERSION).tar.gz M4FLAGS= --define=VERSION=$(VERSION) \ --define=NATIVE_BINDINGS="$(NATIVE_BINDINGS)" \ --define=BUILD=`cat .version` ## ## Per default do nothing ## ## ## Build the rpms ## package: version tar xvf $(DIST) m4 $(M4FLAGS) gnade.m4 > gnade.spec ( export PATH=/usr/local/bin:/usr/gnat/bin:$$PATH && \ rpmbuild -b$(STAGE) --target=$(ARCH) gnade.spec ) >build.log 2>build.error ## ## count the build number up each time we make an rpm ## version: @if [ ! -f .version ] ; \ then echo 1 > .version ; \ else expr 0`cat .version` + 1 > .version ; \ fi @echo "Package Build : " `cat .version` ## ## ## dep: ## ## Cleanup ## clean: rm -rf *~ *~*~ setup.hint *.log distclean: clean rm .version publish: ncftpput upload.sourceforge.net /incoming $(exportdir)/gnade-$(VERSION)-*.src.rpm ncftpput upload.sourceforge.net /incoming $(exportdir)/gnade-$(VERSION)-*.i686.rpm gnade-1.6.2.orig/cygwin/README0000644000175000017500000000024010042751221015543 0ustar lbrentalbrentaIntroduction ============ This directory provides the procedure to build cygwin packages. Building ======== 1. Change the version in Submitting ========== gnade-1.6.2.orig/cygwin/setup.hint.m40000644000175000017500000000034210042751221017231 0ustar lbrentalbrenta# # # @ package sdesc: "GNU Ada Database Development Environment" ldesc: "GNU Ada Database Development Environment" skip: curr: VERSION-BUILD prev: VERSION category: Database Devel Libs requires: external-source: gnade-src gnade-1.6.2.orig/dbi/0000755000175000017500000000000011040716254014133 5ustar lbrentalbrentagnade-1.6.2.orig/dbi/Makefile0000644000175000017500000000646310056104653015604 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/dbi/Makefile,v $ ## Description : Top level makefile for the various interfaces ## Author : Juergen Pfeifer ## Created On : 03-Jan-2001 ## Last Modified By: $Author: merdmann $ ## Last Modified On: $Date: 2004/05/29 13:01:31 $ ## Status : $State: Exp $ ## ## Copyright (C) 2000-2004 ## ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## This makefile recursively visits subdirectories with various DB interfaces ## and performs the make steps there. ## ## Restrictions ## ============ ## ## References ## ========== ## include ../make.conf # .PHONY: odbc mysql postgres sqlite oci all :: $(BINDINGS) $(BINDINGS): $(MAKE) -C./$@ EXPORT=$(EXPORT) distclean clean: $(MAKE) -C./odbc $@ $(MAKE) -C./mysql $@ $(MAKE) -C./postgres $@ $(MAKE) -C./sqlite $@ $(MAKE) -C./oci $@ gnade-1.6.2.orig/dbi/adbc/0000755000175000017500000000000011040716276015030 5ustar lbrentalbrentagnade-1.6.2.orig/dbi/adbc/MANIFEST0000644000175000017500000000072707433021103016154 0ustar lbrentalbrentaMANIFEST Makefile README client.adb gnu-db-adbc-connection.adb gnu-db-adbc-connection.ads gnu-db-adbc-driver-mysql.adb gnu-db-adbc-driver-mysql.ads gnu-db-adbc-driver.ads gnu-db-adbc-hostvariable-types.adb gnu-db-adbc-hostvariable-types.ads gnu-db-adbc-hostvariable.adb gnu-db-adbc-hostvariable.ads gnu-db-adbc-resultset.adb gnu-db-adbc-resultset.ads gnu-db-adbc-row.adb gnu-db-adbc-row.ads gnu-db-adbc-statement.adb gnu-db-adbc-statement.ads gnu-db-adbc.ads libadbc.adb gnade-1.6.2.orig/dbi/adbc/Makefile0000644000175000017500000001347507500615103016473 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## Ada Database Objects (ADO) - Makefile -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/dbi/adbc/Makefile,v $ ## Description : Top level Makefile of object store ## Author : Michael Erdmann ## Created On : 31.12.2001 ## Last Modified By: $Author: merdmann $ ## Last Modified On: $Date: 2002/06/09 09:05:07 $ ## Version : $Revision: 1.8 $ ## Status : $State: Exp $ ## -- ## Copyright (C) 2000-2001 -- ## -- ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## This package is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## Contact -- ## ======= -- ## Error reports shall be handled via http://gnade.sourceforge.net -- ## Features and ideas via: gnade-develop@lists.sourceforge.net -- ## -- ## Author contact: -- ## purl:/net/michael.erdmann -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## ## Restrictions ## ============ ## None ## ## References ## ========== ## None ## ## ## include ../../make.conf VERS=0.2 DISTNAME=ado-source-$(VERS) SO_MAJOR=$(GNADE_MAJOR) SO_MINOR=$(GNADE_MINOR) BASE=adbc LIBNAME=libgnade$(BASE) MYSQL_LIBS=-L/usr/lib/mysql #DEBUGFLAGS = -funwind-tables -gnata ADAFLAGS = $(DEBUGFLAGS) -gnatf -a -I$(ADAINCLUDE) -g all: \ $(ADALIB)/$(LIBNAME).a \ $(ADALIB)/$(LIBNAME).so client: gnu-db-adbc.ads \ gnu-db-adbc-connection.ads gnu-db-adbc-connection.adb \ gnu-db-adbc-statement.ads gnu-db-adbc-statement.adb \ gnu-db-adbc-resultset.ads gnu-db-adbc-resultset.adb \ gnu-db-adbc-hostvariable.ads gnu-db-adbc-hostvariable.adb \ gnu-db-adbc-hostvariable-types.ads gnu-db-adbc-hostvariable-types.adb \ gnu-db-adbc-driver.ads \ gnu-db-adbc-driver-mysql.ads gnu-db-adbc-driver-mysql.adb \ gnu-db-adbc-driver-pgsql.ads gnu-db-adbc-driver-pgsql.adb \ gnu-db-adbc-sql_helper.ads gnu-db-adbc-sql_helper.adb \ gnu-db-adbc-row.ads \ client.adb gnatmake client.adb -o client $(ADAFLAGS) $(MYSQL_LIBS) # # Build common modules library # $(ADALIB)/$(LIBNAME).a: $(MKSTATIC) \ --target=$(ADALIB) \ --include=$(ADAINCLUDE) \ --units \ --packages=gnu-db-adbc \ gnadeadbc $(ADALIB)/$(LIBNAME).so : @rm -f $(ADAINCLUDE)/$(BASE)*.ad[bs] @rm -f $(ADALIB)/$(BASE)*.ali $(MKSHARED) \ --target=$(ADALIB) \ --include=$(ADAINCLUDE) \ --units \ --packages=gnu-db-adbc \ gnadeadbc clean: rm -f *.o *.ali core b~*.ad? *~ *.bak log rm -rf Client $(MKSHARED) --target=$(ADALIB) --clean gnadeadbc $(MKSTATIC) --target=$(ADALIB) --clean gnadeadbc distclean:: clean dist:: gnade-1.6.2.orig/dbi/adbc/README0000644000175000017500000000033707475446336015731 0ustar lbrentalbrentaThis directory contains the first draft of the ADO implementation of the GNADE project. This code uses the test database gnade as it is created by the gnade installation. Restrictions ============ R.1 - Not task prove gnade-1.6.2.orig/dbi/adbc/gnade-adbc.gpr0000644000175000017500000000153110670447772017521 0ustar lbrentalbrenta-- $Id: gnade-adbc.gpr,v 1.1 2007/09/08 07:32:10 persan Exp $ with "../../gnade"; with "../../support/gnade-support.gpr"; project Gnade.adbc is for Languages use ("Ada"); for Source_Dirs use ("."); for Object_Dir use "lib-obj"; for library_name use "gnadeadbc"; for Library_Kind use "static"; for Library_dir use project'Object_Dir & "/lib"; package Compiler is for Default_Switches ("Ada") use Gnade.Compiler'Default_Switches ("Ada"); end Compiler; package Builder is for Default_Switches ("Ada") use Gnade.Builder'Default_Switches ("Ada"); end Builder; package Binder is for Default_Switches ("Ada") use Gnade.Binder'Default_Switches ("Ada"); end Binder; package Linker is for Default_Switches ("Ada") use Gnade.Builder'Default_Switches ("Ada"); end Linker; end Gnade.adbc; gnade-1.6.2.orig/dbi/adbc/gnu-db-adbc-connection.adb0000644000175000017500000003241507435254377021721 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/dbi/adbc/gnu-db-adbc-connection.adb,v $ -- Description : Ada Database Objects - Connection object -- -- Author : Michael Erdmann -- -- Created : 18.1.2002 -- -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2002/02/21 20:30:55 $ -- Status : $State: Exp $ -- -- -- Copyright (C) 2002 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- This software is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- This package implements the connection object features. -- -- -- -- -- -- -- -- Restrictions -- -- ============ -- -- Only Linux -- -- -- -- Contact -- -- ======= -- -- Error reports shall be handled via http://gnade.sourceforge.net -- -- Features and ideas via: gnade-develop@lists.sourceforge.net -- -- -- -- Author contact: -- -- purl:/net/michael.erdmann -- -- -- ------------------------------------------------------------------------------- with Unchecked_Deallocation; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Exceptions; use Ada.Exceptions; with GNU.DB.ADBC.Statement; use GNU.DB.ADBC.Statement; with GNU.DB.ADBC.Resultset; use GNU.DB.ADBC.Resultset; with GNU.DB.ADBC.Driver; use GNU.DB.ADBC.Driver; with GNU.DB.ADBC; use GNU.DB.ADBC; use GNU.DB; package body GNU.DB.ADBC.Connection is Version : constant String := "$Id: gnu-db-adbc-connection.adb,v 1.3 2002/02/21 20:30:55 merdmann Exp $"; subtype Connection_Index is Connection_ID range Null_ID+1 .. Connection_ID'Last; CT : array( Connection_Index ) of Handle := (others => null ); ---====================================================================--- ---=== O B J E C T D A T A ===--- ---=== ===--- ---=== This section contains all declarations of data structures ===--- ---=== to implement one instance of the connection object ===--- ---=== ===--- ---====================================================================--- type Statement_Table is array( Statement_ID'Range ) of Boolean; ----------------- -- Object_Data -- ----------------- type Object_Data is record Self : Handle := null; Stmt : Statement_Table := (others => False); Is_Connected : Boolean := False; Connection : Connection_ID; Name : Unbounded_String := Null_Unbounded_String; Password : Unbounded_String := Null_Unbounded_String; Database : Unbounded_String := Null_Unbounded_String; end record; ---=====================================================================--- ---=== L O C A L S U P P O R T P R O C E D U R E S ===--- ---=== ===--- ---=====================================================================--- -------------------- -- Drop_Resources -- -------------------- procedure Drop_Resources( This : in out Object ) is -- drop all resources from the connection Data : Object_Data_Access renames This.Data; begin for I in Data.Stmt'Range loop if Data.Stmt(I) then Statement.Deallocate( I ); Data.Stmt(I) := False; end if; end loop; end Drop_Resources; ---------------------- -- Create_Exception -- ---------------------- procedure Create_Exception( This : in Object; Id : in Exception_Id; Info : in String ) is Data : Object_Data_Access renames This.Data; Q : Unbounded_String := Null_Unbounded_String; begin Q := Data.Name & "/" & Data.Database ; Raise_Exception( Id, Info & ":" & To_String(Q) ); end Create_Exception; ---------------------- -- Create_Exception -- ---------------------- procedure Create_Exception( this : in Object; theError : in Exception_Occurrence; info : in String ) is begin Create_Exception( This, Exception_Identity(TheError), Info ); end Create_Exception; ---======================================================================--- ---=== C O M P O N E N T I N T E R F A C E ===--- ---======================================================================--- ---------------- -- Initialize -- ---------------- procedure Initialize( This : in out Object ) is begin This.Data := new Object_Data; This.Data.Self := This'Unchecked_Access; for I in CT'Range loop if CT(I) = null then CT(I) := This.Data.Self; This.Data.Connection := I; exit; end if; end loop; end Initialize; -------------- -- Finalize -- -------------- procedure Finalize( This : in out Object ) is Data : Object_Data_Access renames This.Data; procedure Free is new Unchecked_Deallocation( Object_Data, Object_Data_Access); begin Drop_Resources( This ); Free( This.Data ); end Finalize; ---=====================================================================--- ---=== A T T R I B U T E F U N C T I O N S ===--- ---=====================================================================--- ---------- -- Self -- ---------- function Self( This : in Object ) return Handle is begin return This.Data.Self; end Self; ------------------- -- Driver_Handle -- ------------------- function Driver_Handle( This : in Object ) return Driver.Handle is begin return This.Db; end Driver_Handle; ------------------- -- Driver_Handle -- ------------------- function Driver_Handle( Id : in Connection_ID ) return Driver.Handle is begin return CT(Id).Db; end Driver_Handle; ---=====================================================================--- ---=== M E T H O D S ===--- ---=====================================================================--- ------------- -- Connect -- ------------- procedure Connect( This : in out Object; Name : in String; Password : in String := Default_Password; Database : in String := Default_Database; Parameters : in String := "" ) is Data : Object_Data_Access renames This.Data; begin Data.Name := To_Unbounded_String(Name); if Password /= Default_Password then Data.Password := To_Unbounded_String(Password); end if; if Database /= Default_Database then Data.Database := To_Unbounded_String(Database); end if; Connect( This.Db.all, Name, Password, Database); Data.Is_Connected := True; end Connect; ---------------- -- Disconnect -- ---------------- procedure Disconnect( This : in out Object ) is Data : Object_Data_Access renames This.Data; begin Drop_Resources( This ); -- driver disconnect Disconnect( This.Db.all ); Data.Is_Connected := False; end Disconnect; ------------------- -- Add_Statement -- ------------------- procedure Add_Statement( Con : in Connection_ID; Stmt : in Statement_ID ) is Data : Object_Data_Access renames CT(Con).Data; begin Data.Stmt(Stmt) := True; end Add_Statement; ---------------------- -- Delete_Statement -- ---------------------- procedure Delete_Statement( Con : in Connection_ID; Stmt : in Statement_ID ) is Data : Object_Data_Access renames CT(Con).Data; begin Data.Stmt(Stmt) := False; end Delete_Statement; ------------- -- Prepare -- ------------- function Prepare( This : in Object; Statement : in String ) return Statement_ID is -- prepare a statement for processing. This is split into two -- parts. -- -- 1. Parse the statement according to ADO rules -- 2. Pass the statement to the data base driver as a statement -- object for further processing -- Data : Object_Data_Access renames This.Data; S : Statement_ID; begin if not Data.Is_Connected then Create_Exception( This, Not_Connected'Identity, "prepare statement"); end if; S := Create_Statement(This.Db.all, Data.Connection); -- create a statement ADBC.Statement.Prepare( S, Statement ); -- parse the statement Prepare(This.Db.all, S ); return S; end Prepare; ------------- -- Execute -- ------------- function Execute( This : in Object; Stmt : in Statement_ID ) return Resultset_ID is -- execute a prepared statement Data : Object_Data_Access renames This.Data; Result : Resultset_ID; begin if not Data.Is_Connected then Create_Exception( This, Not_Connected'Identity, "execute statement"); end if; Result := Create_Resultset(This.Db.all, Stmt); Bind_Host_Variables( Stmt ); Execute_Statement( This.Db.all, Result, Stmt ); Retrive_Host_Variables( Stmt, null ); return Result; exception when The_Error: others => Create_Exception( This, The_Error, "execute statement" ); raise; end Execute; ------------- -- Execute -- ------------- function Execute( This : in Object; Statement : in String ) return Resultset_ID is -- execute a direct SQL command Data : Object_Data_Access renames This.Data; Result : Resultset_ID; Stmt : Statement_ID; begin if not Data.Is_Connected then Create_Exception( This, Not_Connected'Identity, "execute statement"); end if; Stmt := Prepare( This, Statement ); Result := Create_Resultset(This.Db.all, Stmt); Execute_Statement( This.Db.all, Result, Stmt ); Delete_Resultset( Stmt, Result ); Deallocate( Stmt ); return Result; exception when The_Error : others => Create_Exception( This, The_Error, Statement ); raise; end Execute; end GNU.DB.ADBC.Connection; gnade-1.6.2.orig/dbi/adbc/gnu-db-adbc-connection.ads0000644000175000017500000002126407433554161021732 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/dbi/adbc/gnu-db-adbc-connection.ads,v $ -- Description : Ada Database Objects - Connection object -- -- Author : Michael Erdmann -- -- Created : 18.1.2002 -- -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2002/02/16 22:08:49 $ -- Version : $Revision: 1.2 $ -- Status : $State: Exp $ -- -- -- Copyright (C) 2002 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- This software is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- This is the connection object. The connection object combines all -- -- objects such as statements and the underlying driver. -- -- -- -- -- -- Restrictions -- -- ============ -- -- None -- -- -- -- Contact -- -- ======= -- -- Error reports shall be handled via http://gnade.sourceforge.net -- -- Features and ideas via: gnade-develop@lists.sourceforge.net -- -- -- -- Author contact: -- -- purl:/net/michael.erdmann -- -- -- ------------------------------------------------------------------------------- with Ada.Finalization; use Ada.Finalization; --* ADO with GNU.DB.ADBC.Driver; use GNU.DB.ADBC.Driver; use GNU.DB.ADBC; package GNU.DB.ADBC.Connection is type Object( Db : Driver.Handle ) is new Controlled with private; type Handle is access all Object; Null_ID : constant Connection_ID := Connection_ID'First; --------------------------------------------------------------------------- --# Description : --# Connect to the data base as is described by the data base object --# This method will invoke the finaly the Execute_Connect of the --# underlying data base. --# Preconditions : --# R.1 - All data required by the underlying dbcs are set. --# Postconditions : --# P.1 - Connection to the data base established and the connection s --# tatus has been updated --# P.2 - The connection status is updated according to the connection --# result. --# Exceptions : --# Exceptions are gnerated by the implementation based upon the --# database behaviour. --# Note : --------------------------------------------------------------------------- procedure Connect( This : in out Object; Name : in String; Password : in String := Default_Password; Database : in String := Default_Database; Parameters : in String := "" ); Not_Connected : exception; function Driver_Handle( This : in Object ) return Driver.Handle; --------------------------------------------------------------------------- --# Description : --# Disconnect from the data base --# Preconditions : --# R.1 - The data base is connected --# Postconditions : --# P.1 - The connection status not_defined --# Exceptions : --# R.1 violated - Usage_Error --# Note : --------------------------------------------------------------------------- procedure Disconnect( This : in out Object ); --------------------------------------------------------------------------- --# Description : --# Prepare a statement for the data base. --# Foe example ths statement --# select * from employees where empno = :my_empno --# --# is split into a usable set of strings. --# --# Preconditions : --# R.1 - The data base is connected --# Postconditions : --# P.1 - A statement id is allocated to the statement. --# Exceptions : --# R.1 violated - Usage_Error --# Note : --------------------------------------------------------------------------- function Prepare( This : in Object; Statement : in String ) return Statement_ID; Overflow : exception; --------------------------------------------------------------------------- --# Description : --# This method executes a prepared statement. --# Preconditions : --# R.1 - The data base is connected --# R.2 - the statement has been prepared unless a direct SQL statement --# Postconditions : --# P.1 - A statement id is allocated to the statement. --# Exceptions : --# R.1 violated - Usage_Error --# Note : --------------------------------------------------------------------------- function Execute( This : in Object; Stmt : in Statement_ID ) return Resultset_ID; --------------------------------------------------------------------------- --# Description : --# This method executes a prepared statement. --# Preconditions : --# R.1 - The data base is connected --# R.2 - the statement has been prepared unless a direct SQL statement --# Postconditions : --# P.1 - A statement id is allocated to the statement. --# Exceptions : --# R.1 violated - Usage_Error --# Note : --------------------------------------------------------------------------- function Execute( This : in Object; Statement : in String ) return Resultset_ID; function Driver_Handle( Id : Connection_ID ) return Driver.Handle; procedure Add_Statement( Con : in Connection_ID; Stmt : in Statement_ID ); procedure Delete_Statement( Con : in Connection_ID; Stmt : in Statement_ID ); ---=====================================================================--- private type Object_Data; type Object_Data_Access is access Object_Data; type Object( Db : Driver.Handle ) is new Controlled with record Data : Object_Data_Access := null; end record; procedure Initialize( This : in out Object ); procedure Finalize( This : in out Object ); function Self( This : in Object ) return Handle; end GNU.DB.ADBC.Connection; gnade-1.6.2.orig/dbi/adbc/gnu-db-adbc-driver-mysql.adb0000644000175000017500000007722107446271540022215 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/dbi/adbc/gnu-db-adbc-driver-mysql.adb,v $ -- Description : Ada Database Object - Driver for MySQL -- -- Author : Michael Erdmann -- -- Created : 18.1.2002 -- -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2002/03/21 05:45:04 $ -- Status : $State: Exp $ -- -- -- Copyright (C) 2002 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- This software is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- This is the driver for MySQL bindings. The driver implements the -- -- following classes: -- -- -- -- ADBC.Statement -- -- ADBC.Row -- -- ADBC.Resultset -- -- -- -- Additionally it implements the ADBC.Driver interface. -- -- -- -- Restrictions -- -- ============ -- -- Only Linux -- -- -- -- Contact -- -- ======= -- -- Error reports shall be handled via http://gnade.sourceforge.net -- -- Features and ideas via: gnade-develop@lists.sourceforge.net -- -- -- -- Author contact: -- -- purl:/net/michael.erdmann -- -- -- ------------------------------------------------------------------------------- --* Ada with System; use System; with System.Storage_Elements; use System.Storage_Elements; with System.Address_To_Access_Conversions; with Ada.Exceptions; use Ada.Exceptions; with Ada.Tags; use Ada.Tags; with Ada.Characters.Latin_1; use Ada.Characters; with Ada.Calendar; use Ada.Calendar; with Ada.Strings.Fixed; use Ada.Strings.Fixed; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Unchecked_Conversion; with Ada.Text_IO; use Ada.Text_IO; with Interfaces.C.Strings; use Interfaces.C.Strings; with Interfaces.C; use Interfaces.C; use Interfaces; with Unchecked_Deallocation; with GNU.DB.ADBC.Statement; use GNU.DB.ADBC.Statement; with GNU.DB.ADBC.Resultset; use GNU.DB.ADBC.Resultset; with GNU.DB.ADBC.Connection; use GNU.DB.ADBC.Connection; with GNU.DB.ADBC.Hostvariable; use GNU.DB.ADBC.Hostvariable; with GNU.DB.ADBC.Hostvariable.Types; use GNU.DB.ADBC.Hostvariable.Types; with GNU.DB.ADBC.Row; use GNU.DB.ADBC.Row; package body GNU.DB.ADBC.Driver.MySQL is pragma Linker_Options ("-lmysqlclient"); Version : constant String := "$Id: gnu-db-adbc-driver-mysql.adb,v 1.4 2002/03/21 05:45:04 merdmann Exp $"; --- ******************************************************************** --- --- *** L O W L E V E L I N T E R F A C E T O M Y S Q L *** --- --- ******************************************************************** --- --- Interface to the MYSQL Library. Some of the data types are simply --- Addresses because the internals of these structured do not have --- to be known here. subtype MYSQL_SERVER is System.Address; subtype MYSQL_ROW is System.Address; subtype MYSQL_RES is System.Address; subtype MYSQL_FNO is C.unsigned; type MYSQL_RES_Record is -- mysql.h:89 record row_count : c.unsigned; -- mysql.h:90 field_count : c.unsigned; -- mysql.h:91 current_field: c.unsigned; -- mysql.h:91 fields : Address; -- mysql.h:92 data : Address; -- mysql.h:93 data_cursor : Address; -- mysql.h:94 field_alloc : Address; -- mysql.h:95 row : MYSQL_ROW; -- mysql.h:96 current_row : MYSQL_ROW; -- mysql.h:97 lengths : Address; -- mysql.h:98 handle : Address; -- mysql.h:99 eof : C.char; -- mysql.h:100 end record; pragma Convention(C, MYSQL_RES_Record ); function mysql_connect( mysql : MYSQL_SERVER; host : Strings.chars_ptr; user : Strings.chars_ptr; passwd: Strings.chars_ptr) return MYSQL_SERVER; pragma Import (C, mysql_connect, "mysql_connect"); procedure mysql_close(sock: MYSQL_SERVER); pragma Import (C, mysql_close, "mysql_close"); function mysql_select_db(mysql: MYSQL_SERVER; db : Strings.chars_ptr) return c.int; pragma Import (C, mysql_select_db, "mysql_select_db"); function mysql_query(mysql: MYSQL_SERVER; q : Strings.chars_ptr) return c.int; pragma Import (C, mysql_query, "mysql_query"); function mysql_fetch_row(mysql: MYSQL_RES) return MYSQL_ROW; pragma Import (C, mysql_fetch_row, "mysql_fetch_row"); function mysql_field_seek(mysql : MYSQL_RES; offset: MYSQL_FNO) return MYSQL_FNO; pragma Import (C, mysql_field_seek, "mysql_field_seek"); -- mysql.h:166 type MYSQL_field_types is ( -- mysql_com.h:64 FIELD_TYPE_DECIMAL, -- mysql_com.h:64 FIELD_TYPE_TINY, -- mysql_com.h:64 FIELD_TYPE_SHORT, -- mysql_com.h:65 FIELD_TYPE_LONG, -- mysql_com.h:65 FIELD_TYPE_FLOAT, -- mysql_com.h:66 FIELD_TYPE_DOUBLE, -- mysql_com.h:66 FIELD_TYPE_NULL, -- mysql_com.h:67 FIELD_TYPE_TIMESTAMP, -- mysql_com.h:67 FIELD_TYPE_LONGLONG, -- mysql_com.h:68 FIELD_TYPE_INT24, -- mysql_com.h:68 FIELD_TYPE_DATE, -- mysql_com.h:69 FIELD_TYPE_TIME, -- mysql_com.h:69 FIELD_TYPE_DATETIME, -- mysql_com.h:70 FIELD_TYPE_YEAR, -- mysql_com.h:70 FIELD_TYPE_NEWDATE, -- mysql_com.h:71 FIELD_TYPE_ENUM, -- mysql_com.h:72 FIELD_TYPE_SET, -- mysql_com.h:73 FIELD_TYPE_TINY_BLOB, -- mysql_com.h:74 FIELD_TYPE_MEDIUM_BLOB, -- mysql_com.h:75 FIELD_TYPE_LONG_BLOB, -- mysql_com.h:76 FIELD_TYPE_BLOB, -- mysql_com.h:77 FIELD_TYPE_VAR_STRING, -- mysql_com.h:78 FIELD_TYPE_STRING -- mysql_com.h:80 ); for MYSQL_field_types use ( -- mysql_com.h:64 FIELD_TYPE_DECIMAL => 0, -- mysql_com.h:64 FIELD_TYPE_TINY => 1, -- mysql_com.h:64 FIELD_TYPE_SHORT => 2, -- mysql_com.h:65 FIELD_TYPE_LONG => 3, -- mysql_com.h:65 FIELD_TYPE_FLOAT => 4, -- mysql_com.h:66 FIELD_TYPE_DOUBLE => 5, -- mysql_com.h:66 FIELD_TYPE_NULL => 6, -- mysql_com.h:67 FIELD_TYPE_TIMESTAMP => 7, -- mysql_com.h:67 FIELD_TYPE_LONGLONG => 8, -- mysql_com.h:68 FIELD_TYPE_INT24 => 9, -- mysql_com.h:68 FIELD_TYPE_DATE => 10, -- mysql_com.h:69 FIELD_TYPE_TIME => 11, -- mysql_com.h:69 FIELD_TYPE_DATETIME => 12, -- mysql_com.h:70 FIELD_TYPE_YEAR => 13, -- mysql_com.h:70 FIELD_TYPE_NEWDATE => 14, -- mysql_com.h:71 FIELD_TYPE_ENUM => 247, -- mysql_com.h:72 FIELD_TYPE_SET => 248, -- mysql_com.h:73 FIELD_TYPE_TINY_BLOB => 249, -- mysql_com.h:74 FIELD_TYPE_MEDIUM_BLOB => 250, -- mysql_com.h:75 FIELD_TYPE_LONG_BLOB => 251, -- mysql_com.h:76 FIELD_TYPE_BLOB => 252, -- mysql_com.h:77 FIELD_TYPE_VAR_STRING => 253, -- mysql_com.h:78 FIELD_TYPE_STRING => 254 -- mysql_com.h:80 ); for MYSQL_field_types'size use 32; type st_mysql_field is -- mysql.h:39 record name : Strings.chars_ptr; -- mysql.h:40 table : Strings.chars_ptr; -- mysql.h:41 def : Strings.chars_ptr; -- mysql.h:42 c_type : MYSQL_field_types; -- mysql.h:43 length : c.unsigned; -- mysql.h:44 max_length: c.unsigned; -- mysql.h:45 flags : c.unsigned; -- mysql.h:46 decimals : c.unsigned; -- mysql.h:47 end record; pragma Convention(C, st_mysql_field); -- mysql.h:39 type MYSQL_Field is access all st_mysql_field; type enum_mysql_status is ( -- mysql.h:67 MYSQL_STATUS_READY, -- mysql.h:67 MYSQL_STATUS_GET_RESULT, -- mysql.h:67 MYSQL_STATUS_USE_RESULT -- mysql.h:68 ); for enum_mysql_status'size use 32; -- mysql.h:67 type struct_st_net is record fd : c.int; -- mysql_com.h:54 fcntl : c.int; -- mysql_com.h:55 buff : Strings.chars_ptr; -- mysql_com.h:56 buff_end : Strings.chars_ptr; -- mysql_com.h:56 write_pos : Strings.chars_ptr; -- mysql_com.h:56 last_error : C.char_Array(0..199); -- mysql_com.h:57 last_errno : c.unsigned; -- mysql_com.h:58 max_packet : c.unsigned; -- mysql_com.h:58 timeout : c.unsigned; -- mysql_com.h:58 pkt_nr : c.unsigned; -- mysql_com.h:58 error : c.signed_char; -- mysql_com.h:59 return_errno: c.signed_char; -- mysql_com.h:59 end record; pragma Convention(C, struct_st_net); -- mysql_com.h:53 subtype NET is struct_st_net; type A_MYSQL_FIELD_T is access all st_mysql_field; -- mysql.h:82 type st_mem_root is -- mysql.h:18 record free : Address; -- mysql.h:19 used : Address; -- mysql.h:20 min_malloc : c.unsigned; -- mysql.h:21 block_size : c.unsigned; -- mysql.h:22 error_handler: Address ; -- mysql.h:23 end record; pragma Convention(C, st_mem_root); -- mysql.h:18 subtype MEM_ROOT is st_mem_root; -- mysql.h:24 type st_mysql is record The_net : NET; -- mysql.h:71 host : Strings.chars_ptr; -- mysql.h:72 user : Strings.chars_ptr; -- mysql.h:72 passwd : Strings.chars_ptr; -- mysql.h:72 unix_socket : Strings.chars_ptr; -- mysql.h:72 server_version : Strings.chars_ptr; -- mysql.h:72 host_info : Strings.chars_ptr; -- mysql.h:72 info : Strings.chars_ptr; -- mysql.h:73 db : Strings.chars_ptr; -- mysql.h:73 port : c.unsigned; -- mysql.h:74 client_flag : c.unsigned; -- mysql.h:74 server_capabilities: c.unsigned; -- mysql.h:74 protocol_version : c.unsigned; -- mysql.h:75 field_count : c.unsigned; -- mysql.h:76 thread_id : c.unsigned; -- mysql.h:77 affected_rows : c.unsigned; -- mysql.h:78 insert_id : c.unsigned; -- mysql.h:79 extra_info : c.unsigned; -- mysql.h:80 status : enum_mysql_status; -- mysql.h:81 fields : A_MYSQL_FIELD_T; -- mysql.h:82 field_alloc : MEM_ROOT; -- mysql.h:83 free_me : c.signed_char; -- mysql.h:84 reconnect : c.signed_char; -- mysql.h:85 end record; pragma Convention(C, St_mysql); -- mysql.h:89 function mysql_init( mysql : MYSQL_SERVER ) return MYSQL_SERVER; pragma Import (C, mysql_init, "mysql_init"); -- mysql.h:89 function mysql_fetch_field( handle: MYSQL_RES) return MYSQL_FIELD; pragma Import (C, mysql_fetch_field, "mysql_fetch_field"); function mysql_store_result( mysql: MYSQL_SERVER) return MYSQL_RES; -- mysql.h:161 pragma Import (C, mysql_store_result, "mysql_store_result"); function mysql_use_result( mysql: MYSQL_SERVER) return MYSQL_RES; -- mysql.h:162 pragma Import (C, mysql_use_result, "mysql_use_result"); procedure mysql_free_result( result: MYSQL_RES); -- mysql.h:163 pragma Import (C, mysql_free_result, "mysql_free_result"); ----------------- -- Get_Address -- ----------------- function Get_Address( Row : in MYSQL_ROW; Pos : in Positive ) return Address is -- Retrieve the address from an array fo addresses Result : array( Positive ) of Address ; for Result'Address use Row; begin return Result( Pos ); end Get_Address; ----------------- -- Copy_String -- ----------------- procedure Copy_String ( Addr : in Address; Value : out String ) is -- Copy a string from the memory address. This code is not nice but -- is works. byte : Character; Src : String( 1..Value'Length ); for Src'Address use Addr; J : Integer := Value'First; begin Value := (others => ' '); for I in Value'Range loop Byte := Src(I); exit when Byte = Latin_1.NUL; Value(J) := Byte; J := J + 1; end loop; end Copy_String; -------------- -- Num_Rows -- -------------- function NumRows( result : in Address ) return Integer is -- Return the number of rows found during a selection Res : MYSQL_RES_Record; for Res'Address use Result; begin if result = Null_Address then return 0; end if; return Integer(Res.Row_Count); end NumRows; ------------------ -- Num_Affected -- ------------------ function Num_Affected( Server : in Address ) return Integer is -- return the number of affected rows package P is new Address_To_Access_Conversions( Object => St_Mysql ); use P; begin return Integer(To_Pointer(Server).Affected_Rows); end Num_Affected; ----------------- -- Object_Data -- ----------------- type Object_Data is record Self : Driver.Handle; Connection_Handle : MYSQL_Server := Null_Address; end record; --- ****************************************************************** --- --- ***** S T A T E M E N T H A N D L I N G ****** --- --- ****************************************************************** --- ------------------ -- My_Statement -- ------------------ type My_Statement is new Statement.Object with record null; end record; type My_Stmt_Access is access all My_Statement; Statement_Table : array( Statement_ID ) of My_Stmt_Access; ---------------------- -- Create_Statement -- ---------------------- function Create_Statement( This : in Object; Con : in Connection_ID ) return Statement_ID is -- this does more or less nothing, because the interface -- of mysql does not requiere any explicit prepare actions Result : My_Stmt_Access := new My_Statement( Con ); Id : Statement_ID := Statement.Allocate( Statement.Handle(Result) ); begin Statement_Table(Id) := Result; return Id; end Create_Statement; ---------------------- -- Delete_Statement -- ---------------------- procedure Delete_Statement( This : in Object; Stmt : in Statement_ID ) is procedure Free is new Unchecked_Deallocation( My_Statement, My_Stmt_Access); begin pragma Debug (Put_Line("DRIVER: delete statement " & Statement_ID'Image(Stmt) )); Free( Statement_Table(Stmt) ); end Delete_Statement; --- ****************************************************************** --- --- **** R O W H A N D L I N G **** --- --- ****************************************************************** --- type My_Row is new Row.Object with record RowHandle : MYSQL_ROW := Null_Address; Set : Resultset_ID; end record; --------- -- Get -- --------- procedure Get( Row : in My_Row; Pos : in Positive; Result : out String; Length : out Natural ); type My_Row_Access is access My_Row; --- ****************************************************************** --- --- ***** R E S U L T S E T H A N D L I N G ****** --- --- ****************************************************************** --- type Field_Info_Array is array( Positive range 1..Max_Number_Of_Attributes ) of St_MySql_Field; -------------------- -- My_Resultset -- -------------------- type My_Resultset is new Resultset.Object with record ResultHandle : MYSQL_RES; Affected_Rows : Natural := 0; -- here we store information about the attrviutes of a resultset -- which is not needed in the result set clas. Next_Field : Positive := Field_Info_Array'First; Fieldinfo : Field_Info_Array; end record; type My_Resultset_Access is access all My_Resultset; Result_Table : array( Resultset_ID ) of My_Resultset_Access; ----------- -- Fetch -- ----------- procedure Fetch( This : in out My_Resultset; Result : out Row.Handle; Mode : in Fetch_Mode_Type := Next ) is Row : My_Row_Access; begin Row := new My_Row( This.Next_Field ); Row.Set := ID(This); Row.RowHandle := Mysql_Fetch_Row( This.Resulthandle ); if Row.RowHandle = Null_Address then raise End_Of_Resultset; end if; Result := GNU.DB.ADBC.Row.Handle(Row); end Fetch; ---------------------- -- Create_Resultset -- ---------------------- function Create_Resultset( This : in Object; Stmt : in Statement_ID ) return Resultset_ID is Result : My_Resultset_Access := new My_Resultset(Stmt) ; Id : Resultset_ID; begin pragma Debug( Put_Line("DRIVER: create_resultset for " & Statement_ID'Image(Stmt) ) ); Result.Resulthandle := Null_Address; Id := Resultset.Allocate( Resultset.Handle(Result) ); Result_Table(Id) := Result; return Id; end Create_Resultset; ---------------------- -- Delete_Resultset -- ---------------------- procedure Delete_Resultset( This : in Object; Result : in Resultset_ID ) is procedure Free is new Unchecked_Deallocation( My_Resultset, My_Resultset_Access); begin Free( Result_Table(Result) ); pragma Debug(Put_Line("DRIVER: delete resultset " & Resultset_ID'Image(Result))); end Delete_Resultset; --------- -- Get -- --------- procedure Get( Row : in My_Row; Pos : in Positive; Result : out String; Length : out Natural ) is -- get a field from the resultset. The format is expected to be -- a string. Set : My_Resultset renames My_Resultset_Access( Resultset.Get_Handle( Row.Set ) ).all; P : Address; begin Length := Natural( Set.FieldInfo(Pos).Length ); P := Get_Address( Row.RowHandle, Pos); if P /= Null_Address then Copy_String( P, Result(1..Length)); else Length := 0; end if; end Get; --- ****************************************************************** --- --- ***** C O N N E C T I O N H A N D L I N G ****** --- --- ****************************************************************** --- ------------- -- Connect -- ------------- procedure Connect( This : in out Object; User : in String; Password : in String; Database : in String) is -- connecting to an actual database server Data : Object_Data_Access renames This.Data; RC : C.Int := 0; begin if Data = null then Data := new Object_Data; end if; Data.Connection_Handle := MYSQL_Connect( Null_Address, New_String( "localhost" ), New_String( User ), New_String( Password ) ); if Data.Connection_Handle = Null_Address then raise Connection_Failure; end if; RC := mysql_select_db( Data.Connection_Handle, New_String(Database) ); if not ( RC = 0 ) then raise Wrong_Database_Name; end if; pragma Debug( Put_Line("DRIVER:[MySQL] connect to database complete")); end Connect; ---------------- -- Disconnect -- ---------------- procedure Disconnect( This : in out Object ) is -- diconnect from the data base Data : Object_Data_Access renames This.Data; begin mysql_close( Data.Connection_Handle ); pragma Debug(Put_Line("DRIVER: disconnect")); end Disconnect; --- ****************************************************************** --- --- ***** C O N N E C T I O N H A N D L I N G ****** --- --- ****************************************************************** --- ------------- -- Prepare -- ------------- procedure Prepare( This : in out Object; Stmt : in Statement_ID ) is -- there is no functionaltiy for MySQL required since it does -- not support the preperation of statement. St : My_Statement renames My_Stmt_Access( Get_Handle(Stmt) ).all; begin null; pragma Debug( Put_Line("DRIVER: prepare does nothing") ); end Prepare; ------------ -- Expand -- ------------ function Expand( This : in Object; -- This procedure returns the SQL ASCII representation of the host -- variable for an SQL statement. -- In case of ODBC this procedure returns allways a '?' character -- and the Bind method below does the trick of connecting variables -- with the data base. -- In all other cases the ascii string will be returned. V : in Hostvariable.Handle ) return String is begin if V.all'Tag = SQL_String'Tag then return '"' & Value( SQL_String(V.all) ) & '"'; elsif V.all'Tag = SQL_Integer'Tag then return Integer'Image( Value(SQL_Integer(V.all)) ); else return "?"; end if; end Expand; ---------- -- Bind -- ---------- procedure Bind_Host_Variable( This : in Object; Stmt : in Statement_ID; V : in Hostvariable.Handle) is -- This procedure will be called before the statement is executed. The -- main application is the allocation of defered buffers as for example -- used by the ODBC interface. -- Since MySQL does not use defered buffers this procedure does -- more or less nothing, but it provides the skeleton. -- The mapping between ADBC and DBCS specific representation is done at -- this point. procedure Bind_SQL_String( S : in String ) is begin pragma Debug( Put_Line("DRIVER: Bind SQL_String does nothing, value='" & S & "'" ) ); null; end Bind_SQL_String; procedure Bind_SQL_Integer( S : in Integer ) is begin pragma Debug( Put_Line("DRIVER: Bind SQL_Integer does nothing, value =" & Integer'Image(S)) ); null; end Bind_SQL_Integer; begin if V.all'Tag = SQL_String'Tag then Bind_SQL_String( Value( SQL_String(V.all) ) ); elsif V.all'Tag = SQL_Integer'Tag then Bind_SQL_Integer( Value( SQL_Integer(V.all) ) ); end if; end Bind_Host_Variable; -------------------- -- Get_Host_Value -- -------------------- procedure Get_Host_Value( This : in Object; Stmt : in Statement_ID; V : in Hostvariable.Handle) is -- get the contents of a host variable from the database begin pragma Debug(Put_Line("DRIVER:Get_Value does nothing")); null; end Get_Host_Value; ------------- -- Execute -- ------------- procedure Execute_Statement( This : in Object; Result : in Resultset_ID; Stmt : in Statement_ID ) is -- execute a statement: -- S.1 - Resolve unbounde variables -- S.2 - Execute the actuial query -- S.3 - Fetch the field information -- S.4 - Fetch the number of affected rows if the query has -- not created any result set. Data : Object_Data_Access renames This.Data; Set : My_Resultset renames My_Resultset_Access( Resultset.Get_Handle( Result ) ).all; Q : constant String := Query(Stmt); RES_Address: MYSQL_RES; RC : C.int := 0; Field : MYSQL_Field; begin RC := mysql_query( Data.Connection_Handle, New_String(Q)); if RC /= 0 then raise Empty_Resultset; end if; -- fetch the result set *** S.3 *** RES_Address := mysql_store_result( Data.Connection_Handle ); if RES_Address /= Null_Address then if NumRows( RES_Address ) < 1 then raise Empty_Resultset; end if; Number_Of_Records( Result, NumRows(RES_Address) ); Set.ResultHandle := RES_Address; Field := mysql_fetch_field( Set.ResultHandle ); while Field /= null loop Attribute( Result, Value( Field.Name ) ); Set.Fieldinfo( Set.Next_Field ) := Field.all; Set.Next_Field := Set.Next_Field + 1; exit when not ( Set.Next_Field in Set.Fieldinfo'Range ); Field := mysql_fetch_field( Set.ResultHandle ); end loop; else -- *** S.4 *** Set.Affected_Rows := Num_Affected( Data.Connection_Handle ); end if; end Execute_Statement; ------------ -- Create -- ------------ type Mysql_Access is access all Object; function Create return Driver.Handle is Db : Mysql_Access := new Object; Data : Object_Data_Access := new Object_Data; begin Data.Self := Driver.Handle(Db); Db.Data := Data; return Driver.Handle(Db); end Create; end GNU.DB.ADBC.Driver.MySQL; gnade-1.6.2.orig/dbi/adbc/gnu-db-adbc-driver-mysql.ads0000644000175000017500000001262707433021103022215 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/dbi/adbc/gnu-db-adbc-driver-mysql.ads,v $ -- Description : Ada Database Object - Driver Interface -- -- Author : Michael Erdmann -- -- Created : 18.1.2002 -- -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2002/02/14 20:46:59 $ -- Version : $Revision: 1.1 $ -- Status : $State: Exp $ -- -- -- Copyright (C) 2002 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- This software is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- This is the test driver for the ADO interface. It is some kind of -- -- stub which simulates the requested funtions. -- -- -- -- -- -- Restrictions -- -- ============ -- -- Only Linux -- -- -- -- Contact -- -- ======= -- -- Error reports shall be handled via http://gnade.sourceforge.net -- -- Features and ideas via: gnade-develop@lists.sourceforge.net -- -- -- -- Author contact: -- -- purl:/net/michael.erdmann -- -- -- ------------------------------------------------------------------------------- package GNU.DB.ADBC.Driver.MySQL is type Object is new Driver.Object with private; function Create return Driver.Handle ; private type Object_Data; type Object_Data_Access is access Object_Data; type Object is new Driver.Object with record Data : Object_Data_Access; end record; procedure Prepare( This : in out Object; Stmt : in Statement_ID); procedure Execute_Statement( This : in Object; Result : in Resultset_ID; Stmt : in Statement_ID ); function Create_Statement( This : in Object; Con : in Connection_ID ) return Statement_ID; procedure Delete_Statement( This : in Object; Stmt : in Statement_ID ); function Create_Resultset( This : in Object; Stmt : in Statement_ID ) return Resultset_ID; procedure Delete_Resultset( This : in Object; Result : in Resultset_ID ); procedure Connect( This : in out Object; User : in String; Password : in String; Database : in String); procedure Disconnect( This : in out Object ); function Expand( This : in Object; V : in Hostvariable.Handle ) return String; procedure Bind_Host_Variable( This : in Object; Stmt : in Statement_ID; V : in Hostvariable.Handle); procedure Get_Host_Value( This : in Object; Stmt : in Statement_ID; V : in Hostvariable.Handle); end GNU.DB.ADBC.Driver.MySQL; gnade-1.6.2.orig/dbi/adbc/gnu-db-adbc-driver-pgsql.adb0000644000175000017500000005440307436515160022171 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/dbi/adbc/gnu-db-adbc-driver-pgsql.adb,v $ -- Description : Ada Database Object - Driver for MySQL -- -- Author : Michael Erdmann -- -- Created : 18.1.2002 -- -- Last Modified By: $Author: jukano $ -- Last Modified On: $Date: 2002/02/25 20:11:28 $ -- Status : $State: Exp $ -- -- -- Copyright (C) 2002 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- This software is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- This is the test driver for the ADO interface. It is some kind of -- -- stub which simulates the requested funtions. -- -- -- -- -- -- Restrictions -- -- ============ -- -- Only Linux -- -- -- -- Contact -- -- ======= -- -- Error reports shall be handled via http://gnade.sourceforge.net -- -- Features and ideas via: gnade-develop@lists.sourceforge.net -- -- -- -- Author contact: -- -- purl:/net/michael.erdmann -- -- -- ------------------------------------------------------------------------------- --* Ada with System; use System; with System.Storage_Elements; use System.Storage_Elements; with System.Address_To_Access_Conversions; with Ada.Exceptions; use Ada.Exceptions; with Ada.Tags; use Ada.Tags; with Ada.Characters.Latin_1; use Ada.Characters; with Ada.Calendar; use Ada.Calendar; with Ada.Strings.Fixed; use Ada.Strings.Fixed; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Unchecked_Conversion; with Ada.Text_IO; use Ada.Text_IO; with Interfaces.C.Strings; use Interfaces.C.Strings; with Interfaces.C; use Interfaces.C; use Interfaces; with Unchecked_Deallocation; with GNU.DB.ADBC.Statement; use GNU.DB.ADBC.Statement; with GNU.DB.ADBC.Resultset; use GNU.DB.ADBC.Resultset; with GNU.DB.ADBC.Connection; use GNU.DB.ADBC.Connection; with GNU.DB.ADBC.Hostvariable; use GNU.DB.ADBC.Hostvariable; with GNU.DB.ADBC.Hostvariable.Types; use GNU.DB.ADBC.Hostvariable.Types; with GNU.DB.ADBC.Row; use GNU.DB.ADBC.Row; package body GNU.DB.ADBC.Driver.PgSQL is pragma Linker_Options ("-lpq"); Version : constant String := "$Id: gnu-db-adbc-driver-pgsql.adb,v 1.3 2002/02/25 20:11:28 jukano Exp $"; --- ******************************************************************** --- --- *** L O W L E V E L I N T E R F A C E T O P G S Q L *** --- --- ******************************************************************** --- --- Interface to the PGSQL Library. Some of the data types are simply --- Addresses because the internals of these structured do not have --- to be known here. subtype PGConn is Address; subtype PGResult is Address; function PQConnectdb(Conninfo: Strings.Chars_Ptr) return PGConn; pragma Import (C, PQConnectdb, "PQconnectdb"); type ConnStatusType is ( CONNECTION_OK, CONNECTION_BAD ); for ConnStatusType use ( CONNECTION_OK => 0, CONNECTION_BAD => 1 ); function PQstatus (Conn: PGConn) return ConnStatusType; pragma Import (C, PQstatus, "PQstatus"); procedure PQFinish (Conn: PGConn); pragma Import (C, PQFinish, "PQfinish"); function PQExec (Conn: PGConn; Query: Strings.Chars_Ptr) return PGResult; pragma Import (C, PQExec, "PQexec"); type ExecStatusType is ( PGRES_EMPTY_QUERY, -- libpq-fe.h: 68 PGRES_COMMAND_OK, -- libpq-fe.h: 69 PGRES_TUPLES_OK, -- libpq-fe.h: 72 PGRES_COPY_OUT, -- libpq-fe.h: 75 PGRES_COPY_IN, -- libpq-fe.h: 76 PGRES_BAD_RESPONSE, -- libpq-fe.h: 77 PGRES_NONFATAL_ERROR, -- libpq-fe.h: 79 PGRES_FATAL_ERROR -- libpq-fe.h: 80 ); for ExecStatusType use ( PGRES_EMPTY_QUERY => 0, -- libpq-fe.h: 68 PGRES_COMMAND_OK => 1, -- libpq-fe.h: 69 PGRES_TUPLES_OK => 2, -- libpq-fe.h: 72 PGRES_COPY_OUT => 3, -- libpq-fe.h: 75 PGRES_COPY_IN => 4, -- libpq-fe.h: 76 PGRES_BAD_RESPONSE => 5, -- libpq-fe.h: 77 PGRES_NONFATAL_ERROR => 6, -- libpq-fe.h: 79 PGRES_FATAL_ERROR => 7 -- libpq-fe.h: 80 ); function PQResultStatus (Result: PGResult) return ExecStatusType; pragma Import (C, PQResultStatus, "PQresultStatus"); function PQntuples (Result: PGResult) return C.Int; pragma Import (C, PQntuples, "PQntuples"); function PQnfields (Result: PGResult) return C.Int; pragma Import (C, PQnfields, "PQnfields"); function PQfname (Result: PGResult; Field_Index: C.int) return Strings.Chars_Ptr; pragma Import (C, PQfname, "PQfname"); function PQfsize (Result: PGResult; Field_Index: C.int) return C.Int; pragma Import (C, PQfsize, "PQfsize"); function PQgetvalue (Result: PGResult; Tup_Num : C.Int; Field_Num: C.Int) return Strings.Chars_Ptr; pragma Import (C, PQgetvalue, "PQgetvalue"); function PQgetlength (Result: PGResult; Tup_Num : C.Int; Field_Num: C.Int) return C.Int; pragma Import (C, PQgetlength, "PQgetlength"); function PQcmdTuples (Result: PGResult) return Strings.Chars_Ptr; pragma Import (C, PQcmdTuples, "PQcmdTuples"); type PgSQL_Field is record null; end record; -------------- -- Num_Rows -- -------------- function NumRows(Result: PGResult) return Integer is begin return Integer(PQntuples(Result)); end NumRows; --------------- -- NumFields -- --------------- function NumFields(Result: PGResult) return Integer is begin return Integer(PQnfields(Result)); end NumFields; ----------------- -- FieldLength -- ----------------- function FieldLength(Result: PGresult; Row, Field: Integer) return Natural is begin return Natural(Pqgetlength(Result, C.Int(Row), C.Int(Field))); end FieldLength; ---------------- -- FieldValue -- ---------------- function FieldValue(Result: PGresult; Row, Field: Integer) return String is begin return Value(Pqgetvalue(Result, C.Int(Row), C.Int(Field))); end Fieldvalue; ----------------- -- Object_Data -- ----------------- type Object_Data is record Self : Driver.Handle; Connection_Handle : PGConn := Null_Address; end record; --- ****************************************************************** --- --- ***** S T A T E M E N T H A N D L I N G ****** --- --- ****************************************************************** --- ------------------ -- My_Statement -- ------------------ type My_Statement is new Statement.Object with record null; end record; type My_Stmt_Access is access all My_Statement; ---------------------- -- Create_Statement -- ---------------------- function Create_Statement( This : in Object; Con : in Connection_ID ) return Statement_ID is -- this does more or less nothing, because the interface -- of mysql does not requiere any explicit prepare actions Result : My_Stmt_Access := new My_Statement( Con ); begin return Statement.Allocate( Statement.Handle(Result) ); end Create_Statement; ---------------------- -- Delete_Statement -- ---------------------- procedure Delete_Statement( This : in Object; Stmt : in Statement_ID ) is begin Pragma Debug(Put_Line("DRIVER: delete statement " & Statement_ID'Image(Stmt) )); Statement.Deallocate( Stmt ); end Delete_Statement; --- ****************************************************************** --- --- **** R O W H A N D L I N G **** --- --- ****************************************************************** --- type Field_List is array (Natural range <>) of String_access; type Field_List_Access is access all Field_List; type My_Row is new Row.Object with record RowHandle : Field_List_access; Number : Natural := 0; Set : Resultset_ID; end record; --------- -- Get -- --------- procedure Get( Row : in My_Row; Pos : in Positive; Result : out String; Length : out Natural ); type My_Row_Access is access My_Row; --- ****************************************************************** --- --- ***** R E S U L T S E T H A N D L I N G ****** --- --- ****************************************************************** --- type Field_Info_Array is array( Positive range 1..Max_Number_Of_Attributes ) of PgSQL_Field; -------------------- -- My_Resultset -- -------------------- type My_Resultset is new Resultset.Object with record ResultHandle : PGResult; Actual_Row : Natural := 0; Affected_Rows : Natural := 0; -- here we store information about the attributes of a resultset -- which is not needed in the result set class. Next_Field : Positive := Field_Info_Array'First; Fieldinfo : Field_Info_Array; end record; type My_Resultset_Access is access all My_Resultset; Result_Table : array( Resultset_ID ) of My_Resultset_Access; ----------- -- Fetch -- ----------- procedure Fetch( This : in out My_Resultset; Result : out Row.Handle; Mode : in Fetch_Mode_Type := Next ) is Row : My_Row_Access; begin Row := new My_Row( This.Next_Field ); Row.Set := ID(This); Row.Rowhandle := new Field_List(1..NumFields(This.Resulthandle)); case Mode is when Next => if This.Actual_Row >= Number_Of_Records( ID (This) ) then This.Actual_Row := Number_Of_Records( ID (This) ); raise End_Of_Resultset; else This.Actual_Row := This.Actual_Row + 1; end if; when First => This.Actual_Row := 0; when Last => This.Actual_Row := Number_Of_Records(ID(This)) -1; when Previous => if This.Actual_Row > 0 then This.Actual_Row := This.Actual_Row - 1; -- throw begin_of_resultset? end if; end case; Row.Number := This.Actual_Row; Result := GNU.DB.ADBC.Row.Handle(Row); end Fetch; ---------------------- -- Create_Resultset -- ---------------------- function Create_Resultset( This : in Object; Stmt : in Statement_ID ) return Resultset_ID is Result : My_Resultset_Access := new My_Resultset(Stmt) ; Id : Resultset_ID; begin Result.Resulthandle := Null_Address; Id := Resultset.Allocate( Resultset.Handle(Result) ); Result_Table(Id) := Result; return Id; end Create_Resultset; ---------------------- -- Delete_Resultset -- ---------------------- procedure Delete_Resultset( This : in Object; Result : in Resultset_ID ) is begin Pragma Debug(Put_Line("DRIVER: delete resultset " & Resultset_ID'Image(Result) )); null; end Delete_Resultset; --------- -- Get -- --------- procedure Get( Row : in My_Row; Pos : in Positive; Result : out String; Length : out Natural ) is -- get a field from the resultset Set : My_Resultset renames My_Resultset_Access( Resultset.Get_Handle( Row.Set ) ).all; -- index fixing - positions in PostgreSQL start at 0 DPos : constant Integer := -1; DRow : constant Integer := 0; begin Length := Natural(FieldLength(Set.ResultHandle, Row.Number + DRow, Pos + DPos)); if Length /= 0 then declare Str : String(1..Length); begin Str := FieldValue(Set.ResultHandle, Row.Number + DRow, Pos + DPos); Result(1..Length) := Str(1..Length); end; end if; end Get; --- ****************************************************************** --- --- ***** C O N N E C T I O N H A N D L I N G ****** --- --- ****************************************************************** --- ------------- -- Connect -- ------------- procedure Connect( This : in out Object; User : in String; Password : in String; Database : in String) is -- connecting to an actual database server Data : Object_Data_Access renames This.Data; Conn_Str : Unbounded_String; RC : ConnStatusType; begin if Data = null then Data := new Object_Data; end if; Conn_Str := To_Unbounded_String("host="&"localhost"); Conn_Str := Conn_Str & " user="&User; if Database /= Default_Database then Conn_Str := Conn_Str & " dbname=" & Database; end if; if Password /= Default_Password then Conn_Str := Conn_Str & " password=" & Password; end if; Data.Connection_Handle := PQConnectdb (New_String(To_String(Conn_str))); RC := PQstatus(Data.Connection_Handle); if Data.Connection_Handle = Null_Address or RC = CONNECTION_BAD then raise Connection_Failure; end if; Pragma Debug(Put_Line("DRIVER:[PgSQL] connect to database complete")); end Connect; ---------------- -- Disconnect -- ---------------- procedure Disconnect( This : in out Object ) is -- diconnect from the data base Data : Object_Data_Access renames This.Data; begin Pqfinish (Data.Connection_Handle); Pragma Debug(Put_Line("DRIVER: disconnect")); end Disconnect; --- ****************************************************************** --- --- ***** C O N N E C T I O N H A N D L I N G ****** --- --- ****************************************************************** --- ------------- -- Prepare -- ------------- procedure Prepare( This : in out Object; Stmt : in Statement_ID ) is -- there is no functionaltiy for MySQL required since it does -- not support the preperation of statement. St : My_Statement renames My_Stmt_Access( Get_Handle(Stmt) ).all; begin Pragma Debug(Put_Line("DRIVER: prepare does nothing")); null; end Prepare; ------------ -- Expand -- ------------ function Expand( This : in Object; -- This procedure returns the SQL ASCII representation of the host -- variable for an SQL statement. -- In case of ODBC this procedure returns allways a '?' character -- and the Bind method below does the trick of connecting variables -- with the data base. -- In all other cases the ascii string will be returned. V : in Hostvariable.Handle ) return String is begin if V.all'Tag = SQL_String'Tag then return "'" & Value( SQL_String(V.all) ) & "'"; elsif V.all'Tag = SQL_Integer'Tag then return Integer'Image( Value(SQL_Integer(V.all)) ); else return "?"; end if; end Expand; ---------- -- Bind -- ---------- procedure Bind_Host_Variable( This : in Object; Stmt : in Statement_ID; V : in Hostvariable.Handle) is -- This procedure will be called before the statement is executed. The -- main application is the allocation of defered buffers as for example -- used by the ODBC interface. -- The mapping between Ado and DBCS specific representation is done at -- this point. procedure Bind_SQL_String( S : in String ) is begin Pragma Debug(Put_Line("DRIVER: Bind SQL_String does nothing, value='" & S & "'" )); null; end Bind_SQL_String; procedure Bind_SQL_Integer( S : in Integer ) is begin Pragma Debug(Put_Line("DRIVER: Bind SQL_Integer does nothing, value =" & Integer'Image(S))); null; end Bind_SQL_Integer; begin if V.all'Tag = SQL_String'Tag then Bind_SQL_String( Value( SQL_String(V.all) ) ); elsif V.all'Tag = SQL_Integer'Tag then Bind_SQL_Integer( Value( SQL_Integer(V.all) ) ); end if; end Bind_Host_Variable; -------------------- -- Get_Host_Value -- -------------------- procedure Get_Host_Value( This : in Object; Stmt : in Statement_ID; V : in Hostvariable.Handle) is begin Pragma Debug(Put_Line("DRIVER:Get_Value does nothing")); null; end Get_Host_Value; function Error_Msg (Result: PGResult) return Chars_Ptr; pragma Import (C, Error_Msg, "PQresultErrorMessage"); ------------- -- Execute -- ------------- procedure Execute_Statement( This : in Object; Result : in Resultset_ID; Stmt : in Statement_ID ) is -- execute a statement: -- S.1 - Resolve unbounde variables -- S.2 - Execute the actuial query -- S.3 - Fetch the field information -- S.4 - Fetch the number of affected rows if the query has -- not created any result set. Data : Object_Data_Access renames This.Data; Set : My_Resultset renames My_Resultset_Access( Resultset.Get_Handle( Result ) ).all; Q : constant String := Query(Stmt); Res : PGResult; RC : ExecStatusType; Field : PgSQL_Field; begin Res := PQExec( Data.Connection_Handle, New_String(Q)); RC := PQResultStatus(Res); if RC = PGRES_EMPTY_QUERY then raise Empty_Resultset; end if; if RC = PGRES_FATAL_ERROR or RC = PGRES_NONFATAL_ERROR then Pragma Debug(Put_Line(Value(Error_Msg(Res)))); raise Empty_Resultset; -- should return an error exception end if; -- fetch the result set *** S.3 *** if RC = PGRES_TUPLES_OK then if NumRows( RES ) < 1 then raise Empty_Resultset; end if; Number_Of_Records( Result, NumRows(RES)); Set.ResultHandle := Res; for I in 0..PQnfields(Set.ResultHandle)-1 loop Attribute( Result, Value( PQfname( Set.ResultHandle, I))); Set.Fieldinfo( Set.Next_Field ) := Field; Set.Next_Field := Set.Next_Field + 1; exit when not ( Set.Next_Field in Set.Fieldinfo'Range ); end loop; elsif RC = PGRES_COMMAND_OK then -- *** S.4 *** Set.Affected_Rows := Natural'Value(Value (PQcmdTuples( Set.ResultHandle ))); else null; -- return error end if; end Execute_Statement; ------------ -- Create -- ------------ type PgSQL_Access is access all Object; function Create return Driver.Handle is Db : PgSQL_Access := new Object; Data : Object_Data_Access := new Object_Data; begin Data.Self := Driver.Handle(Db); Db.Data := Data; return Driver.Handle(Db); end Create; end GNU.DB.ADBC.Driver.PgSQL; gnade-1.6.2.orig/dbi/adbc/gnu-db-adbc-driver-pgsql.ads0000644000175000017500000001262707435254377022225 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/dbi/adbc/gnu-db-adbc-driver-pgsql.ads,v $ -- Description : Ada Database Object - PostgreSQL Driver -- -- Author : Michael Erdmann -- -- Created : 18.2.2002 -- -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2002/02/21 20:30:55 $ -- Version : $Revision: 1.2 $ -- Status : $State: Exp $ -- -- -- Copyright (C) 2002 Julio Cano -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- This software is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- This is the test driver for the ADO interface. It is some kind of -- -- stub which simulates the requested funtions. -- -- -- -- -- -- Restrictions -- -- ============ -- -- Only Linux -- -- -- -- Contact -- -- ======= -- -- Error reports shall be handled via http://gnade.sourceforge.net -- -- Features and ideas via: gnade-develop@lists.sourceforge.net -- -- -- -- Author contact: -- -- julius_bib@yahoo.com -- -- -- ------------------------------------------------------------------------------- package GNU.DB.ADBC.Driver.PgSQL is type Object is new Driver.Object with private; function Create return Driver.Handle ; private type Object_Data; type Object_Data_Access is access Object_Data; type Object is new Driver.Object with record Data : Object_Data_Access; end record; procedure Prepare( This : in out Object; Stmt : in Statement_ID); procedure Execute_Statement( This : in Object; Result : in Resultset_ID; Stmt : in Statement_ID ); function Create_Statement( This : in Object; Con : in Connection_ID ) return Statement_ID; procedure Delete_Statement( This : in Object; Stmt : in Statement_ID ); function Create_Resultset( This : in Object; Stmt : in Statement_ID ) return Resultset_ID; procedure Delete_Resultset( This : in Object; Result : in Resultset_ID ); procedure Connect( This : in out Object; User : in String; Password : in String; Database : in String); procedure Disconnect( This : in out Object ); function Expand( This : in Object; V : in Hostvariable.Handle ) return String; procedure Bind_Host_Variable( This : in Object; Stmt : in Statement_ID; V : in Hostvariable.Handle); procedure Get_Host_Value( This : in Object; Stmt : in Statement_ID; V : in Hostvariable.Handle); end GNU.DB.ADBC.Driver.PgSQL; gnade-1.6.2.orig/dbi/adbc/gnu-db-adbc-driver.ads0000644000175000017500000002445607433021103021055 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/dbi/adbc/gnu-db-adbc-driver.ads,v $ -- Description : Ada Database Object - Driver Interface -- -- Author : Michael Erdmann -- -- Created : 18.1.2002 -- -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2002/02/14 20:46:59 $ -- Version : $Revision: 1.1 $ -- Status : $State: Exp $ -- -- -- Copyright (C) 2002 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- This software is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- This is the abstract driver interface for the ADO package. Any -- -- implmentation of this interface provides interfaces for the following -- -- packages: -- -- -- -- -- -- +----------------+ +---------------+ +---------------+ -- -- | Ado.Connection | | Ado.Statement | | Ado.Resultset | -- -- +----------------+ +---------------+ +---------------+ -- -- -- -- +----------------------------------------------------+ -- -- | Ado.Driver | -- -- +----------------------------------------------------+ -- -- -- -- As a general rule the resource management is always implemented in the -- -- Ado packages. -- -- -- -- -- -- Restrictions -- -- ============ -- -- None -- -- -- -- Contact -- -- ======= -- -- Error reports shall be handled via http://gnade.sourceforge.net -- -- Features and ideas via: gnade-develop@lists.sourceforge.net -- -- -- -- Author contact: -- -- purl:/net/michael.erdmann -- -- -- ------------------------------------------------------------------------------- with GNU.DB.ADBC.Hostvariable; use GNU.DB.ADBC.Hostvariable; package GNU.DB.ADBC.Driver is type Object is abstract tagged null record; type Handle is access all Object'Class; Null_Driver_Handle : constant Handle := null; Connection_Failure : exception; Wrong_Database_Name : exception; Empty_Resultset : exception; End_Of_Resultset : exception; --------------------------------------------------------------------------- --# Description : --# Connect to the data base. user and password may be used to --# authorize the user in the RDBMS. --# The data base name may be used to select the correct data base --# instance. --# Preconditions : --# R.1 - Database not connected --# Postconditions : --# P.1 - All data base related insdtances are created by the driver --# implementation. --# Exceptions : --# Note : --------------------------------------------------------------------------- procedure Connect( This : in out Object; User : in String; Password : in String; Database : in String) is abstract; --------------------------------------------------------------------------- --# Description : --# Disconnect from the data base. --# Preconditions : --# R.1 - The data base is connected --# Postconditions : --# P.1 - All driver internal resources related to the connection are --# released. --# Exceptions : --# Note : --------------------------------------------------------------------------- procedure Disconnect( This : in out Object ) is abstract; --------------------------------------------------------------------------- --# Description : --# This procedure is intended to prepare the actual statement. The --# query syntax is expected to be pared by the connection module. --# Preconditions : --# R.1 - The data base is connected --# Postconditions : --# P.1 - A statement id is allocated to the statement. --# Exceptions : --# R.1 violated - Usage_Error --# Note : --------------------------------------------------------------------------- procedure Prepare( This : in out Object; stmt : in Statement_ID ) is abstract; --------------------------------------------------------------------------- --# Description : --# Execute the referenced statement and store the result set information --# in the referenced result set. --# Preconditions : --# R.1 - The data base is connected --# Postconditions : --# Exceptions : --# Note : --------------------------------------------------------------------------- procedure Execute_Statement( This : in Object; Result : in Resultset_ID; Stmt : in Statement_ID ) is abstract; --------------------------------------------------------------------------- --# Description : --# Create/delete an instance of the statement implementation --# Preconditions : --# R.1 - The data base is connected --# Postconditions : --# Exceptions : --# Note : --------------------------------------------------------------------------- function Create_Statement( This : in Object; Con : in Connection_ID ) return Statement_ID is abstract; procedure Delete_Statement( This : in Object; Stmt : in Statement_ID ) is abstract; --------------------------------------------------------------------------- --# Description : --# Create/Delete an instance of the implementation of an result set. --# Preconditions : --# R.1 - The data base is connected --# Postconditions : --# Exceptions : --# Note : --------------------------------------------------------------------------- function Create_Resultset( This : in Object; Stmt : in Statement_ID ) return Resultset_ID is abstract; procedure Delete_Resultset( This : in Object; Result : in Resultset_ID ) is abstract; --------------------------------------------------------------------------- --# Description : --# Expand the host variable into a SQL compatiable represenation --# Preconditions : --# R.1 - The data base is connected --# Postconditions : --# Exceptions : --# Note : --------------------------------------------------------------------------- function Expand( This : in Object; V : in Hostvariable.Handle ) return String is abstract; --------------------------------------------------------------------------- --# Description : --# Bind the host variable with the statement. The method is used in --# order to comply to the ODBC protocol which allowes the usage of --# deferred buffers. --# Preconditions : --# R.1 - The data base is connected --# Postconditions : --# Exceptions : --# Note : --------------------------------------------------------------------------- procedure Bind_Host_Variable( This : in Object; Stmt : in Statement_ID; V : in Hostvariable.Handle ) is abstract; procedure Get_Host_Value( This : in Object; Stmt : in Statement_ID; V : in Hostvariable.Handle) is abstract; end GNU.DB.ADBC.Driver; gnade-1.6.2.orig/dbi/adbc/gnu-db-adbc-hostvariable-types.adb0000644000175000017500000001310207453122471023364 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/dbi/adbc/gnu-db-adbc-hostvariable-types.adb,v $ -- Description : Ada Database Objects - Hostvariable -- -- Author : Michael Erdmann -- -- Created : 29.1.2002 -- -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2002/04/04 19:10:49 $ -- Status : $State: Exp $ -- -- -- Copyright (C) 2002 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- This software is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- -- -- -- -- Restrictions -- -- ============ -- -- Only Linux -- -- -- -- Contact -- -- ======= -- -- Error reports shall be handled via http://gnade.sourceforge.net -- -- Features and ideas via: gnade-develop@lists.sourceforge.net -- -- -- -- Author contact: -- -- purl:/net/michael.erdmann -- -- -- ------------------------------------------------------------------------------- with Ada.Text_IO; use Ada.Text_IO; with System.Address_To_Access_Conversions; package body GNU.DB.ADBC.Hostvariable.Types is ----------- -- Value -- ----------- procedure Value( This : in out SQL_String; V : in String ) is -- store the string into the object store begin This.Str := To_Unbounded_String(V); end Value; ----------- -- Value -- ----------- function Value( This : in SQL_String) return String is begin return To_String(This.Str); end Value; ----------- -- Value -- ----------- procedure Value( This : in out SQL_Integer; V : in Integer ) is -- store the string into the object store T : Integer; for T'Address use Allocate( This, V'Size ); begin T := V; end Value; ----------- -- Value -- ----------- function Value( This : in SQL_Integer) return Integer is package Integer_Access is new System.Address_To_Access_Conversions( Object => Integer ); use Integer_Access; Result : Object_Pointer := To_Pointer(Hostdata(This)); begin return Result.all; end Value; ----------- -- Value -- ----------- procedure Value( This : in out SQL_Float; V : in Float ) is -- store the string into the object store T : Float; for T'Address use Allocate( This, V'Size ); begin T := V; end Value; ----------- -- Value -- ----------- function Value( This : in SQL_Float) return Float is package Float_Access is new System.Address_To_Access_Conversions( Object => Float ); use Float_Access; Result : Object_Pointer := To_Pointer(Hostdata(This)); begin return Result.all; end Value; end GNU.DB.ADBC.Hostvariable.Types ; gnade-1.6.2.orig/dbi/adbc/gnu-db-adbc-hostvariable-types.ads0000644000175000017500000001234107433021103023375 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/dbi/adbc/gnu-db-adbc-hostvariable-types.ads,v $ -- Description : Ada Database Objects - Hostvariable -- -- Author : Michael Erdmann -- -- Created : 29.1.2002 -- -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2002/02/14 20:46:59 $ -- Status : $State: Exp $ -- Version : $Revision: 1.1 $ -- -- -- Copyright (C) 2002 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- This software is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- This package contains all data types for the interface between the DBCS -- -- and the application. Each type is derived from the host variable type -- -- in order to privide the is_null indicator. -- -- -- -- Restrictions -- -- ============ -- -- None -- -- -- -- Contact -- -- ======= -- -- Error reports shall be handled via http://gnade.sourceforge.net -- -- Features and ideas via: gnade-develop@lists.sourceforge.net -- -- -- -- Author contact: -- -- purl:/net/michael.erdmann -- -- -- ------------------------------------------------------------------------------- with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; --* ADO with GNU.DB.ADBC.Driver; use GNU.DB.ADBC; use GNU.DB; package GNU.DB.ADBC.Hostvariable.Types is --**************** -- --** SQL_String ** -- --**************** -- type SQL_String is new ADBC.Hostvariable.Object with private; procedure Value( This : in out SQL_String; V : in String ); function Value( This : in SQL_String ) return String; --***************** -- --** SQL_Integer ** -- --***************** -- type SQL_Integer is new ADBC.Hostvariable.Object with null record; procedure Value( This : in out SQL_Integer; V : in Integer ); function Value( This : in SQL_Integer ) return Integer; --*************** -- --** SQL_Float ** -- --*************** -- type SQL_Float is new ADBC.Hostvariable.Object with null record; procedure Value( This : in out SQL_Float; V : in Float ); function Value( This : in SQL_Float ) return Float; -- ========================================================================= -- private type SQL_String is new ADBC.Hostvariable.Object with record Str : Unbounded_String := Null_Unbounded_String; end record; end GNU.DB.ADBC.Hostvariable.Types ; gnade-1.6.2.orig/dbi/adbc/gnu-db-adbc-hostvariable.adb0000644000175000017500000001553707433021103022224 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/dbi/adbc/gnu-db-adbc-hostvariable.adb,v $ -- Description : Ada Database Objects - Hostvariable -- -- Author : Michael Erdmann -- -- Created : 29.1.2002 -- -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2002/02/14 20:46:59 $ -- Status : $State: Exp $ -- -- -- Copyright (C) 2002 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- This software is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- This package implements the kernel features of hostvariables -- -- -- -- Restrictions -- -- ============ -- -- None -- -- -- -- Contact -- -- ======= -- -- Error reports shall be handled via http://gnade.sourceforge.net -- -- Features and ideas via: gnade-develop@lists.sourceforge.net -- -- -- -- Author contact: -- -- purl:/net/michael.erdmann -- -- -- ------------------------------------------------------------------------------- with System; use System; with System.Storage_Elements; use System.Storage_Elements; with Unchecked_Deallocation; package body GNU.DB.ADBC.Hostvariable is Version : constant String := "$Id: gnu-db-adbc-hostvariable.adb,v 1.1 2002/02/14 20:46:59 merdmann Exp $"; type Storage_Access is access Storage_Array; type Object_Data is record Is_Null : Boolean := False; Self : Handle := null; Length : Natural := 0; Hostdata : Storage_Access := null; Stmt : Statement_ID; end record; ---------------- -- Initialize -- ---------------- procedure Initialize( This : in out Object ) is Data : Object_Data_Access := new Object_Data; begin Data.Is_Null := False; Data.Self := This'Unrestricted_Access; This.Data := Data; end Initialize; -------------- -- Finalize -- -------------- procedure Finalize( This : in out Object ) is procedure Free is new Unchecked_Deallocation( Object_Data, Object_Data_Access); begin if This.Data /= null then Deallocate( This ); Free( This.Data ); end if; end Finalize; ------------- -- Is_Null -- ------------- function Is_Null( This : in Object'Class ) return Boolean is Data : Object_Data_Access := This.Data; begin return Data.Is_Null; end Is_Null; ---------- -- Self -- ---------- function Self( This : in Object'Class ) return Handle is begin return This.Data.Self; end Self; -------------- -- Allocate -- -------------- function Allocate( This : in Object'Class; Size : in Natural ) return System.Address is -- allocate a piece of memory Data : Object_Data_Access renames This.Data; Length : Natural := Size / Storage_Unit; Result : Storage_Access := new Storage_Array( 1..Storage_Offset(Length) ); begin if Data.Hostdata /= null then Deallocate( This ); end if; Data.Hostdata := Result; Data.Length := Length; return Result(1)'Address; end Allocate; ---------------- -- Deallocate -- ---------------- procedure Deallocate( This : in Object'Class ) is procedure Free is new Unchecked_Deallocation( Storage_Array, Storage_Access); begin Free( This.Data.Hostdata ); end Deallocate; -------------- -- Hostdata -- -------------- function Hostdata( This : in Object'Class ) return System.Address is begin return This.Data.Hostdata(1)'Address; end Hostdata; ------------ -- Length -- ------------ function Length( This : in Object'Class ) return Natural is begin return This.Data.Length ; end Length; ------------------------- -- Assign_To_Statement -- ------------------------- procedure Assign_To_Statement( This : in Object'Class; Stmt : in Statement_ID ) is begin This.Data.Stmt := Stmt; end Assign_To_Statement; end GNU.DB.ADBC.Hostvariable ; gnade-1.6.2.orig/dbi/adbc/gnu-db-adbc-hostvariable.ads0000644000175000017500000001413707433021103022240 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/dbi/adbc/gnu-db-adbc-hostvariable.ads,v $ -- Description : Ada Database Objects - Hostvariable -- -- Author : Michael Erdmann -- -- Created : 29.1.2002 -- -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2002/02/14 20:46:59 $ -- Version : $Revision: 1.1 $ -- Status : $State: Exp $ -- -- -- Copyright (C) 2002 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- This software is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- A host variable has three aspects: -- -- - The Ada 95 representation -- -- - The SQL aspect -- -- - For the driver an storage area which is used to interface with -- -- the underlying data base. -- -- -- -- The Ada 95 -- -- -- -- -- -- -- -- -- -- Restrictions -- -- ============ -- -- Only Linux -- -- -- -- Contact -- -- ======= -- -- Error reports shall be handled via http://gnade.sourceforge.net -- -- Features and ideas via: gnade-develop@lists.sourceforge.net -- -- -- -- Author contact: -- -- purl:/net/michael.erdmann -- -- -- ------------------------------------------------------------------------------- with System; use System; with Ada.Finalization; use Ada.Finalization; package GNU.DB.ADBC.Hostvariable is type Object is new Controlled with private; type Handle is access all Object'Class; --------------------------------------------------------------------------- --# Description : --# This is the base class of all host variables. --# Preconditions : --# --# Postconditions : --# --# Exceptions : --# --# Note : --------------------------------------------------------------------------- function Is_Null( This : in Object'Class ) return Boolean; function Self( This : in Object'Class ) return Handle; function Length( This : in Object'Class ) return Natural; -- procedure Assign_To_Statement( -- This : in Object'Class; -- Stmt : in Statement_ID ); -- These procedures are only for child packages procedure Deallocate( This : in Object'Class ); function Allocate( This : in Object'Class; Size : in Natural ) return System.Address; function Hostdata( This : in Object'Class ) return System.Address; private -- ======================================================================== -- type Object_Data; type Object_Data_Access is access Object_Data; type Object is new Controlled with record Data : Object_Data_Access; end record; -- requiered by the controlled type base type procedure Initialize( This : in out Object ); procedure Finalize( This : in out Object ); end GNU.DB.ADBC.Hostvariable ; gnade-1.6.2.orig/dbi/adbc/gnu-db-adbc-resultset.adb0000644000175000017500000004354007440751311021577 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/dbi/adbc/gnu-db-adbc-resultset.adb,v $ -- Description : Ada Database Objects - Result Object -- -- Author : Michael Erdmann -- -- Created : 18.1.2002 -- -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2002/03/04 20:02:17 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2002 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- This software is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- -- -- Restrictions -- -- ============ -- -- Only Linux / MySQL -- -- -- -- Contact -- -- ======= -- -- Error reports shall be handled via http://gnade.sourceforge.net -- -- Features and ideas via: gnade-develop@lists.sourceforge.net -- -- -- -- Author contact: -- -- purl:/net/michael.erdmann -- -- -- ------------------------------------------------------------------------------- with Unchecked_Deallocation; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Text_IO; use Ada.Text_IO; with GNU.DB.ADBC.Row; use GNU.DB.ADBC.Row; with GNU.DB.ADBC.Driver; use GNU.DB.ADBC.Driver; package body GNU.DB.ADBC.Resultset is Version : constant String := "$Id: gnu-db-adbc-resultset.adb,v 1.6 2002/03/04 20:02:17 merdmann Exp $"; subtype ST_Index is Resultset_ID range Null_ID+1..Resultset_ID'Last; ST : array( ST_Index ) of Handle := (others => Null_Handle); ---====================================================================--- ---=== O B J E C T D A T A ===--- ---=== ===--- ---=== This section contains all declarations of data structures ===--- ---=== to implement one instance of the connection object ===--- ---=== ===--- ---====================================================================--- type Row_List_Element; type Row_List_Element_Access is access Row_List_Element; type Row_List_Element is record Data : Row.Handle := null; Next : Row_List_Element_Access := null; Previous : Row_List_Element_Access := null; end record; type Attribute_Array is array( Positive range 1..Max_Number_Of_Attributes ) of Unbounded_String; procedure Free is new Unchecked_Deallocation( Row_List_Element, Row_List_Element_Access); ----------------- -- Object_Data -- ----------------- type Object_Data is record Id : Resultset_ID := Null_ID; Nbr_Of_Records : Natural := 0; Mode : Fetch_Mode_Type := Next; Read_Position : Natural := 0; Attribute_Next : Positive := Attribute_Array'First; Attribute_Name : Attribute_Array := (others => Null_Unbounded_String); Result_Data : Row_List_Element_Access := null; Result_Last : Row_List_Element_Access := null; Next_Read : Row_List_Element_Access := null; end record; ---=====================================================================--- ---=== L O C A L S U P P O R T P R O C E D U R E S ===--- ---=== ===--- ---=====================================================================--- ---=====================================================================--- ---=== C O M P O N E N T I N T E R F A C E ===--- ---=====================================================================--- ---=====================================================================--- ---=== A T T R I B U T E F U N C T I O N S ===--- ---=====================================================================--- ---------- -- Mode -- ---------- procedure Mode( This : in Resultset_ID; Value : in Fetch_Mode_Type ) is Data : Object_Data_Access renames ST(This).Data; begin Data.Mode := Value; end Mode; ---------- -- Mode -- ---------- function Mode( This : in Resultset_ID ) return Fetch_Mode_Type is Data : Object_Data_Access renames ST(This).Data; begin return Data.Mode; end Mode; ---------------------- -- Number_Of_Record -- ---------------------- procedure Number_Of_Records( This : in Resultset_ID; Value : in Natural ) is Data : Object_Data_Access renames ST(This).Data; begin Data.Nbr_Of_Records := Value; end Number_Of_Records; ---------------------- -- Number_Of_Record -- ---------------------- function Number_Of_Records( This : in Resultset_ID ) return Natural is Data : Object_Data_Access renames ST(This).Data; begin return Data.Nbr_Of_Records; end Number_Of_Records; -------- -- ID -- -------- function ID( This : in Object'Class ) return Resultset_ID is begin return This.Data.Id; end ID; --------------- -- Attribute -- --------------- procedure Attribute( This : in Resultset_ID; Name : in String ) is Data : Object_Data_Access renames ST(This).Data; Next : Positive renames Data.Attribute_Next; begin if Next in Data.Attribute_Name'Range then Data.Attribute_Name( Next ) := To_Unbounded_String(Name); Next := Next + 1; else raise Attribute_Overflow; end if; end Attribute; --------------- -- Attribute -- --------------- function Attribute( This : in Resultset_ID; Nbr : in Positive ) return String is Data : Object_Data_Access renames ST(This).Data; begin if Nbr in Data.Attribute_Name'Range then return To_String( Data.Attribute_Name( Nbr ) ); else raise Attribute_Not_Existing; end if; end Attribute; ------------------------ -- Attrbiute_Position -- ------------------------ function Attribute_Position( This : in Resultset_ID; Name : in String ) return Natural is Data : Object_Data_Access renames ST(This).Data; begin for I in 1..Data.Attribute_Next loop if To_String(Data.Attribute_Name(I)) = Name then return I; end if; end loop; raise Attribute_Not_Existing; end Attribute_Position; ------------------- -- Driver_Handle -- ------------------- function Driver_Handle( This : in Resultset_ID ) return Driver.Handle is begin return Driver_Handle( ST(This).Stmt ); end Driver_Handle; ---=====================================================================--- ---=== M E T H O D S ===--- ---=====================================================================--- -------------- -- Allocate -- -------------- function Allocate( Set : in Handle ) return Resultset_ID is -- store a handle in the statement table. This will be called by the -- driver to insert. begin for I in ST'Range loop if ST(I) = Null_Handle then ST(I) := Set; if Set.Data = null then Set.Data := new Object_Data; Set.Data.Id := I; Set.Data.Result_Data := null; Set.Data.Result_Last := null; Set.Data.Next_Read := null; end if; Add_Resultset( Set.Stmt, I ); return I; end if; end loop; raise Resultset_Table_Overflow; end Allocate; ---------------- -- Deallocate -- ---------------- procedure Deallocate( Id : in Resultset_ID ) is -- deallocate the id from the resulset table procedure Free is new Unchecked_Deallocation( Object_Data, Object_Data_Access); Data : Object_Data_Access ; P : Row_List_Element_Access; begin pragma Assert( Id in ST'Range ); if ST(Id) /= null then Data := ST(Id).Data; if Data /= null then P := Data.Result_Data; while P /= null loop declare Q : Row_List_Element_Access := P; begin P := P.Next; Free(Q); end; end loop; Statement.Delete_Resultset( ST(Id).Stmt, Id ); if Driver_Handle( St(Id).Stmt ) /= null then Delete_Resultset( Driver_Handle( ST(Id).Stmt).all, Id ); end if; ST(Id) := null; Free( Data ); end if; end if; end Deallocate; ---------------- -- Get_Handle -- ---------------- function Get_Handle( Id : in Resultset_ID ) return Handle is -- return the handle for a given resultset_ID; begin return ST(Id); end Get_Handle; ----------- -- Fetch -- ----------- procedure Fetch( This : in Resultset_ID; Mode : in Fetch_Mode_Type := Next ) is -- -- fetch next element in result set. If there is no next -- element in the rwo cache load the entry from the data base. -- -- R.1 - If a new fetchmode is give store it. -- R.2 - depending on the current fetchmode select the first, the -- next, previous or last position. -- R.3 - If no records have been loaded we assume a first time -- read and the head of the list is set -- R.4 - if the current resport has no next record, we assume -- that a record has to be fetched in sequence. -- R.5 - if the record has already been loaded take it from the -- memory. -- Data : Object_Data_Access renames ST(This).Data; Readpos : Row_List_Element_Access renames Data.Next_Read ; function Fetch_Record( Mode : in Fetch_Mode_Type ) return Row_List_Element_Access is P : Row_List_Element_Access := new Row_List_Element; Current : Row.Handle := null; begin pragma Debug( Put_Line("Fetching, mode =" & Fetch_Mode_Type'Image(Mode))); Fetch( ST(This).all, Current, Mode ); Retrive_Host_Variables(ST(This).Stmt, Current ); P.Data := Current; P.Next := null; P.Previous := null; return P; end Fetch_Record; begin if Mode /= Next and then Mode /= Data.Mode then -- R.1 Data.Mode := Mode; end if; case Data.Mode is -- R.2 when First => if Data.Result_Data = null then -- R.3 declare P : Row_List_Element_Access := Fetch_Record(First); begin Readpos := P; Data.Result_Last := P; end ; else Readpos := Data.Result_Data; end if; when Next => if End_Of_Result( This ) then raise End_Of_Resultset_Exception; end if; if Data.Result_Data = null then -- R.3 declare P : Row_List_Element_Access := Fetch_Record(First); begin Data.Result_Last := P; Data.Result_Data := P; P.Next := null; Readpos := P; end ; elsif Readpos.Next = null then -- R.4 declare P : Row_List_Element_Access := Fetch_Record(Next); begin -- link into the list of loaded rows P.Previous := Readpos; Readpos.Next := P; Data.Result_Last := P; Readpos := P; end ; else -- R.5 Readpos := Readpos.Next ; end if; Data.Read_Position := Data.Read_Position + 1; when Previous => if Begin_Of_Result( This ) then raise Begin_Of_Resultset_Exception; end if; Readpos := Readpos.Previous; Data.Read_Position := Data.Read_Position - 1; when Last => Readpos := Data.Result_Last; Data.Read_Position := Data.Nbr_Of_Records; end case; end Fetch; ------------------- -- End_Of_Result -- ------------------- function End_Of_Result( This : in Resultset_ID ) return Boolean is Data : Object_Data_Access renames ST(This).Data; begin return Data.Read_Position = Data.Nbr_Of_Records; end End_Of_Result; --------------------- -- Begin_Of_Result -- --------------------- function Begin_Of_Result( This : in Resultset_ID ) return Boolean is Data : Object_Data_Access renames ST(This).Data; begin return Data.Read_Position = 1; end Begin_Of_Result; ------------ -- Domain -- ------------ package body String_Domain is Domain_Number : constant Natural := Attribute_Position(Result,Name); Is_Null_Indicator : Boolean := False; ----------- -- Value -- ----------- function Value( Trim : in Boolean := False ) return String is -- retrieve the value of the specified domain by dispatching -- into the GNU.DB.ADBC.Row package. Length : Natural ; V : String( 1..Size ) := (others =>' '); Row : ADBC.Row.Handle renames ST(Result).Data.Next_Read.Data; begin Get( Row.all, Domain_Number, V, Length); if Length > 0 then Is_Null_Indicator := False; else Is_Null_Indicator := True; end if; return V; end Value; --------- -- Set -- --------- procedure Set( Value : in String ) is begin null; end Set; ------------- -- Is_Null -- ------------- function Is_Null return Boolean is begin return Is_Null_Indicator; end Is_Null; end String_Domain; -------------------- -- Numeric_Domain -- -------------------- package body Integer_Domain is Domain_Number : constant Natural := Attribute_Position(Result, Name); Is_Null_Indicator : Boolean := False; ----------- -- Value -- ----------- function Value return Number_Type is -- retrieve the value of the specified domain Row : ADBC.Row.Handle renames ST(Result).Data.Next_Read.Data; Value : Integer := Get( Row.all, Domain_Number ); begin return Number_Type( Value ); end Value; --------- -- Set -- --------- procedure Set( Value : in Number_Type ) is begin null; end Set; ------------- -- Is_Null -- ------------- function Is_Null return Boolean is begin return Is_Null_Indicator; end Is_Null; end Integer_Domain; end GNU.DB.ADBC.Resultset; gnade-1.6.2.orig/dbi/adbc/gnu-db-adbc-resultset.ads0000644000175000017500000003176407436647371021644 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/dbi/adbc/gnu-db-adbc-resultset.ads,v $ -- Description : Ada Database Objects - Resultset object -- -- Author : Michael Erdmann -- -- Created : 18.1.2002 -- -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2002/02/26 09:01:45 $ -- Version : $Revision: 1.4 $ -- Status : $State: Exp $ -- -- -- Copyright (C) 2002 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- This software is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- A result set is the collection of all records created by a query. The -- -- contents of a result set is accessable by a cursor which defines the -- -- the location of the current record in the result set. -- -- -- -- -- -- -- -- -- -- -- -- -- -- Restrictions -- -- ============ -- -- None -- -- -- -- Contact -- -- ======= -- -- Error reports shall be handled via http://gnade.sourceforge.net -- -- Features and ideas via: gnade-develop@lists.sourceforge.net -- -- -- -- Author contact: -- -- purl:/net/michael.erdmann -- -- -- ------------------------------------------------------------------------------- with GNU.DB.ADBC.Statement; use GNU.DB.ADBC.Statement; with GNU.DB.ADBC.Row; use GNU.DB.ADBC.Row; with GNU.DB.ADBC.Driver; package GNU.DB.ADBC.Resultset is type Object( Stmt : Statement_ID ) is abstract tagged private; type Handle is access all Object'Class; Null_Handle : constant Handle := null; Null_ID : constant Resultset_ID := Resultset_ID'First; --------------------------------------------------------------------------- --# Description : --# allocate a resultset. This function is normally used by the drvier --# in order to store his result set handle in the resultset manager. --# Preconditions : --# none --# Postconditions : --# --# Exceptions : --# Result_Table_Overflow - No id can be assigned to the handle --# Note : --------------------------------------------------------------------------- function Allocate( Set : in Handle ) return Resultset_ID ; --------------------------------------------------------------------------- --# Description : --# Remove the identified handle from the result set table. --# Preconditions : --# none --# Postconditions : --# P.1 - Resultset handle removed from table --# Exceptions : --# None --# Note : --------------------------------------------------------------------------- procedure Deallocate( Id : in Resultset_ID ); --------------------------------------------------------------------------- --# Description : --# Return the object handle for the given resultset id. --# Preconditions : --# none --# Postconditions : --# unchanged --# Exceptions : --# None --# Note : --------------------------------------------------------------------------- function Get_Handle( Id : in Resultset_ID ) return Handle; --------------------------------------------------------------------------- --# Description : --# Get the result set id of a given result set object --# Preconditions : --# none --# Postconditions : --# unchanged --# Exceptions : --# None --# Note : --------------------------------------------------------------------------- function ID( This : in Resultset.Object'Class ) return Resultset_ID; Resultset_Table_Overflow : exception; --------------------------------------------------------------------------- --# Description : --# Readmode handling --# Preconditions : --# None --# Postconditions : --# --# Exceptions : --# R.1 violated - Usage_Error --# Note : --------------------------------------------------------------------------- type Fetch_Mode_Type is ( Previous, Next, First, Last ); procedure Mode( This : in Resultset_ID; Value : in Fetch_Mode_Type ) ; function Mode( This : in Resultset_ID ) return Fetch_Mode_Type; --------------------------------------------------------------------------- --# Description : --# get the number of records in the result set --# Preconditions : --# None --# Postconditions : --# --# Exceptions : --# R.1 violated - Usage_Error --# Note : --------------------------------------------------------------------------- procedure Number_Of_Records( This : in Resultset_ID; Value : in Natural ); function Number_Of_Records( This : in Resultset_ID ) return Natural; --------------------------------------------------------------------------- --# Description : --# add an attribute for a result set --# Preconditions : --# R.1 - valid resultset --# Postconditions : --# --# Exceptions : --# R.1 violated - Usage_Error --# Note : --------------------------------------------------------------------------- Max_Number_Of_Attributes : constant Positive := 50; procedure Attribute( This : in Resultset_ID; Name : in String ); function Attribute( This : in Resultset_ID; Nbr : in Positive ) return String; Attribute_Overflow : exception; Attribute_Not_Existing : exception; --------------------------------------------------------------------------- --# Description : --# Destroy the statement object --# Preconditions : --# R.1 - the object has been created --# Postconditions : --# P.1 - The statement object is destroyed all references to it are --# not valid any more. --# Exceptions : --# R.1 violated - Usage_Error --# Note : --------------------------------------------------------------------------- -- procedure Destroy( -- This : in out Handle ) ; --------------------------------------------------------------------------- --# Description : --# Fetch next element from result set --# Preconditions : --# R.1 - handle is valid --# Postconditions : --# P.1 - The fetch pointer is moved to next valid element --# Exceptions : --# R.1 violated - Usage_Error --# Note : --------------------------------------------------------------------------- procedure Fetch( This : in Resultset_ID; Mode : in Fetch_Mode_Type := Next ) ; End_Of_Resultset_Exception : exception; Begin_Of_Resultset_Exception : exception; --------------------------------------------------------------------------- --# Description : --# End_Of --# Preconditions : --# R.1 - handle is valid --# Postconditions : --# P.1 - False if there is s record left in the result set. --# Exceptions : --# R.1 violated - Usage_Error --# Note : --------------------------------------------------------------------------- function End_Of_Result( This : in Resultset_ID ) return Boolean; --------------------------------------------------------------------------- --# Description : --# Begin_Of_Result --# Preconditions : --# R.1 - handle is valid --# Postconditions : --# P.1 - False if we have reached the begin of the result set --# Exceptions : --# R.1 violated - Usage_Error --# Note : --------------------------------------------------------------------------- function Begin_Of_result( This : in Resultset_ID ) return Boolean; --------------------------------------------------------------------------- --# Description : --# Domain accessor --# Preconditions : --# R.1 - --# Postconditions : --# P.1 - --# Exceptions : --# R.1 violated - Usage_Error --# Note : --------------------------------------------------------------------------- ------------------- -- String_Domain -- ------------------- generic Result : Resultset_ID; -- resultset id Name : String; -- fieldname Size : Positive; package String_Domain is function Is_Null return Boolean; function Value( Trim : Boolean := False ) return String; procedure Set( Value : in String ); end String_Domain; -------------------- -- Numeric_Domain -- -------------------- generic Result : Resultset_ID; -- resultset id Name : String; -- fieldname type Number_Type is range <>; -- Number type package Integer_Domain is function Is_Null return Boolean; function Value return Number_Type; procedure Set( Value : in Number_Type ); end Integer_Domain; --------------------------------------------------------------------------- --# Description : --# Domain accessor --# Preconditions : --# R.1 - --# Postconditions : --# P.1 - --# Exceptions : --# R.1 violated - Usage_Error --# Note : --------------------------------------------------------------------------- procedure Fetch( This : in out Object; Result : out Row.Handle; Mode : in Fetch_Mode_Type := Next ) is abstract; function Driver_Handle( This : in Resultset_ID ) return Driver.Handle ; -- procedure Driver_Handle( -- This : in Resultset_ID; -- Db : in Driver.Handle ); ---=====================================================================--- private type Object_Data; type Object_Data_Access is access Object_Data; type Object( Stmt : Statement_ID ) is abstract tagged record Data : Object_Data_Access := null; end record; end GNU.DB.ADBC.Resultset; gnade-1.6.2.orig/dbi/adbc/gnu-db-adbc-row.adb0000644000175000017500000001275707444732153020371 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/dbi/adbc/gnu-db-adbc-row.adb,v $ -- Description : Ada Database Objects - Row object -- -- Author : Michael Erdmann -- -- Created : 18.1.2002 -- -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2002/03/16 21:08:59 $ -- Status : $State: Exp $ -- -- -- Copyright (C) 2002 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- This software is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- This package is a place holder for a row in the result set. Each row -- -- contains several field. The procedures in this package provide access -- -- to these fields by means of an abstract interface which is in fact -- -- implemented in the driver package. -- -- -- -- This package is not intended as a programmer interface but as an -- -- internal interface since the row object is not available to the -- -- end user (programmer). -- -- -- -- Restrictions -- -- ============ -- -- Only Linux -- -- -- -- Contact -- -- ======= -- -- Error reports shall be handled via http://gnade.sourceforge.net -- -- Features and ideas via: gnade-develop@lists.sourceforge.net -- -- -- -- Author contact: -- -- purl:/net/michael.erdmann -- -- -- ------------------------------------------------------------------------------- with Ada.Text_IO; use Ada.Text_Io; package body GNU.DB.ADBC.Row is Version : constant String := "$Id: gnu-db-adbc-row.adb,v 1.5 2002/03/16 21:08:59 merdmann Exp $"; --------- -- Get -- --------- function Get( This : in Object'Class; Pos : in Positive ) return Integer is -- get the integer value of the column addressed by pos. V : String(1..50); Length : Positive; begin Get( This, Pos, V, Length ); -- dispatch into driver module return Integer'Value(V(1..Length)); end; --------- -- Get -- --------- function Get( This : in Object'Class; Pos : in Positive ) return Float is V : String(1..50); Length : Positive; begin Get( This, Pos, V, Length ); -- dispatch into driver module return Float'Value(V(1..Length)); end Get; --------- -- Get -- --------- procedure Get( This : in Object'Class; Pos : in Positive; Length : out Positive; V : out String ) is -- get the string begin V := (others => ' '); Get( This, Pos, V, Length ); -- dispatch into driver end Get; end GNU.DB.ADBC.Row ; gnade-1.6.2.orig/dbi/adbc/gnu-db-adbc-row.ads0000644000175000017500000001212107436010745020370 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/dbi/adbc/gnu-db-adbc-row.ads,v $ -- Description : Ada Database Objects - Row object -- -- Author : Michael Erdmann -- -- Created : 18.1.2002 -- -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2002/02/23 22:04:21 $ -- Version : $Revision: 1.2 $ -- Status : $State: Exp $ -- -- -- Copyright (C) 2002 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- This software is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- -- -- -- -- Restrictions -- -- ============ -- -- Only Linux -- -- -- -- Contact -- -- ======= -- -- Error reports shall be handled via http://gnade.sourceforge.net -- -- Features and ideas via: gnade-develop@lists.sourceforge.net -- -- -- -- Author contact: -- -- purl:/net/michael.erdmann -- -- -- ------------------------------------------------------------------------------- package GNU.DB.ADBC.Row is type Object( Size : Positive) is abstract tagged private; type Handle is access all Object'Class; Null_Handle : constant Handle := null; --------------------------------------------------------------------------- --# Description : --# --# Preconditions : --# --# Postconditions : --# --# Exceptions : --# --# Note : --------------------------------------------------------------------------- function Get( This : in Object'Class; Pos : in Positive ) return Integer; function Get( This : in Object'Class; Pos : in Positive ) return Float; --------------------------------------------------------------------------- --# Description : --# Return the contents of a certain columns in a row --# Preconditions : --# --# Postconditions : --# --# Exceptions : --# --# Note : --------------------------------------------------------------------------- procedure Get( This : in Object; Pos : in Positive; Value : out String; Length : out Natural) is abstract; ---=====================================================================--- private type Object( Size : Positive ) is abstract tagged null record; end GNU.DB.ADBC.Row ; gnade-1.6.2.orig/dbi/adbc/gnu-db-adbc-sql_helper.adb0000644000175000017500000001457307446715270021721 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/dbi/adbc/gnu-db-adbc-sql_helper.adb,v $ -- Description : ADBC SQL Helper package -- -- Author : Michael Erdmann -- -- Created : 18.1.2002 -- -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2002/03/22 20:57:28 $ -- Version : $Revision: 1.4 $ -- Status : $State: Exp $ -- -- -- Copyright (C) 2001 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- This software is implemented to work with GNAT, the GNU Ada compiler. -- --

-- -- Functional Description -- -- ====================== -- -- This is the top level package of the ADO objects. It contains the basic -- -- reference types for connections, statements and resultsets.

-- -- -- -- -- -- -- -- Restrictions -- -- ============ -- -- Only Linux -- -- -- -- Contact -- -- ======= -- -- Error reports shall be handled via http://gnade.sourceforge.net -- -- Features and ideas via: gnade-develop@lists.sourceforge.net -- -- -- -- Author contact: -- -- purl:/net/michael.erdmann -- -- -- ------------------------------------------------------------------------------- with Unchecked_Deallocation; with Ada.Text_IO; use Ada.Text_IO; with GNU.DB.Support.List.Strings; use GNU.DB.Support.List.Strings; package body GNU.DB.ADBC.SQL_Helper is Version : constant String := "$Id: gnu-db-adbc-sql_helper.adb,v 1.4 2002/03/22 20:57:28 merdmann Exp $"; --- ***************************************************************** --- --- **** **** --- --- **** L I S T O F R E L A T I O N S **** --- --- **** **** --- --- ***************************************************************** --- ------------------- -- To_Table_Name -- ------------------- function To_Table_Name( Name : in String ) return List_Element_Access is begin return To_String_List_Element('"' & Name & '"'); end To_Table_Name; ------------------- -- To_Domain_Name -- ------------------- function To_Domain_Name( Name : in String ) return List_Element_Access is begin return To_String_List_Element('"' & Name & '"'); end To_Domain_Name; --- ***************************************************************** --- --- **** **** --- --- **** S Q L H E L P E R F U N C T I O N S **** --- --- **** **** --- --- ***************************************************************** --- ---------------- -- SQL_Select -- ---------------- function SQL_Select( Table : in List_Element_Access; Fields : in String := "*"; Condition : in String := "" ) return String is SQL_Query : constant String := "SELECT " & Fields & " FROM " & List.Strings.To_String(Table); begin Destroy( Table ); if Condition /= "" then return SQL_Query & " WHERE " & Condition; end if; return SQL_Query; end SQL_Select; ---------------- -- SQL_Insert -- ---------------- function SQL_Insert( Table : in String := ""; Fields : in List_Element_Access := null; Data : in List_Element_Access := null ) return String is begin return ""; end SQL_Insert; end GNU.DB.ADBC.SQL_Helper; gnade-1.6.2.orig/dbi/adbc/gnu-db-adbc-sql_helper.ads0000644000175000017500000001145707446715270021740 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/dbi/adbc/gnu-db-adbc-sql_helper.ads,v $ -- Description : ADBC SQL Helper package -- -- Author : Michael Erdmann -- -- Created : 18.1.2002 -- -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2002/03/22 20:57:28 $ -- Version : $Revision: 1.3 $ -- Status : $State: Exp $ -- -- -- Copyright (C) 2001 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- This software is implemented to work with GNAT, the GNU Ada compiler. -- --

-- -- Functional Description -- -- ====================== -- -- This apckage contains a set of helper funtions which are translating -- -- procedure calls, functions etc into the SQL 92 representation which -- -- can be processed by the ADBC API. -- --

-- -- -- -- -- -- -- -- Restrictions -- -- ============ -- -- Only Linux -- -- -- -- Contact -- -- ======= -- -- Error reports shall be handled via http://gnade.sourceforge.net -- -- Features and ideas via: gnade-develop@lists.sourceforge.net -- -- -- -- Author contact: -- -- purl:/net/michael.erdmann -- -- -- ------------------------------------------------------------------------------- with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with GNU.DB.Support.List; use GNU.DB.Support.List; use GNU.DB.Support; package GNU.DB.ADBC.SQL_Helper is subtype Table_Name is List_Element_Access; subtype Domain_Name is List_Element_Access; function SQL_Select( Table : in List_Element_Access; Fields : in String := "*"; Condition : in String := "" ) return String; function To_Table_Name( Name : in String ) return List_Element_Access; function To_Domain_Name( Name : in String ) return List_Element_Access; end GNU.DB.ADBC.SQL_Helper; gnade-1.6.2.orig/dbi/adbc/gnu-db-adbc-statement.adb0000644000175000017500000004260607436010745021557 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/dbi/adbc/gnu-db-adbc-statement.adb,v $ -- Description : Ada Database Objects - Statement Object -- -- Author : Michael Erdmann -- -- Created : 18.1.2002 -- -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2002/02/23 22:04:21 $ -- Version : $Revision: 1.3 $ -- Status : $State: Exp $ -- -- -- Copyright (C) 2001 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- This software is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- The statement object contains all informations about argument and -- -- parsed chunks of a statement. -- -- -- -- Restrictions -- -- ============ -- -- Only Linux -- -- -- -- Contact -- -- ======= -- -- Error reports shall be handled via http://gnade.sourceforge.net -- -- Features and ideas via: gnade-develop@lists.sourceforge.net -- -- -- -- Author contact: -- -- purl:/net/michael.erdmann -- -- -- ------------------------------------------------------------------------------- --* ADA with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Exceptions; use Ada.Exceptions; with Ada.Tags; use Ada.Tags; with Ada.Text_IO; use Ada.Text_IO; with Unchecked_Deallocation; --* ADO with GNU.DB.ADBC.Driver; use GNU.DB.ADBC.Driver; with GNU.DB.ADBC.Hostvariable; use GNU.DB.ADBC.Hostvariable; with GNU.DB.ADBC.Hostvariable.Types; use GNU.DB.ADBC.Hostvariable.Types; with GNU.DB.ADBC.Connection; use GNU.DB.ADBC.Connection; with GNU.DB.ADBC.Resultset; use GNU.DB.ADBC.Resultset; package body GNU.DB.ADBC.Statement is Version : constant String := "$Id: gnu-db-adbc-statement.adb,v 1.3 2002/02/23 22:04:21 merdmann Exp $"; Host_Variable_Prefix : constant Character := ':'; --------------------- -- Statement Table -- --------------------- subtype ST_Index is Statement_ID range Null_ID+1..Statement_ID'Last; ST : array( ST_Index ) of Handle := (others => Null_Handle ); ---====================================================================--- ---=== O B J E C T D A T A ===--- ---=== ===--- ---=== This section contains all declarations of data structures ===--- ---=== to implement one instance of the connection object ===--- ---=== ===--- ---====================================================================--- type Parser_Index is new Positive range 1..256; ------------------ -- Parse_record -- ------------------ type Parse_Record is record Cmd : Unbounded_String := Null_Unbounded_String; Arg : Unbounded_String := Null_Unbounded_String; end record; type Parse_Table is array( Parser_Index ) of Parse_Record; ----------------- -- Bind_Record -- ----------------- type Bind_Record is record Name : Unbounded_String := Null_Unbounded_String; Var : Hostvariable.Handle := null; end record; type Bind_Table is array( 1..50 ) of Bind_Record; type Result_Table is array( Resultset_ID ) of Boolean; ----------------- -- Object_Data -- ----------------- type Object_Data is record PT : Parse_Table; BT : Bind_Table; Query : Unbounded_String := Null_Unbounded_String; RT : Result_Table; end record; ---=====================================================================--- ---=== L O C A L S U P P O R T P R O C E D U R E S ===--- ---=== ===--- ---=====================================================================--- ---------------- -- Copy_Query -- ---------------- procedure Copy_Query( S : in String; Next : in out Positive; Result : out String; Length : out Positive ) is -- copy parts of the string till the begin of a host variable J : Positive := Result'First; begin for I in S'Range loop Next := I; exit when S(Next) = Host_Variable_Prefix; Result(J) := S(I); Length := J; J := J + 1; exit when not ( J in Result'Range ); end loop; end Copy_Query; ----------------------- -- Copy_Hostvariable -- ----------------------- procedure Copy_Hostvariable( S : in String; Next : in out Positive; Result : out String; Length : out Positive ) is -- copy parts of the string till the begin of a host variable J : Positive := Result'First; begin for I in S'Range loop Next := I; exit when S(Next) = ' '; Result(J) := S(I); Length := J; J := J + 1; exit when not ( J in Result'Range ); end loop; end Copy_Hostvariable; ----------- -- Parse -- ----------- procedure Parse( P : in out Parse_Table; Stmt : in String ) is -- prepare a statement, which means that the SQL statement is broken up -- into fixed strings and variable parts. Next : Positive := Stmt'First; Length : Natural := 0; Result : String( 1..1024 ); begin for I in P'Range loop Copy_Query( Stmt(Next..Stmt'Last), Next, Result, Length ); P(I).Cmd := To_Unbounded_String( Result( 1..Length) ); if Stmt(Next) = Host_Variable_Prefix then Next := Next + 1; Copy_Hostvariable( Stmt(Next..Stmt'Last), Next, Result, Length ); P(I).Arg := To_Unbounded_String( Result( 1..Length) ); exit when Next = Stmt'Last; else exit; end if; end loop; end Parse; -------------------- -- Variable_Useed -- -------------------- function Variable_Used( P : in Parse_Table; Name : in String ) return Boolean is begin for I in P'Range loop if P(I).Arg /= Null_Unbounded_String and then P(I).Arg = Name then return True; end if; end loop; return False; end Variable_Used; ---------------------- -- Create_Exception -- ---------------------- procedure Create_Exception( Stmt : in Statement_ID; Id : in Exception_Id; -- create an exception and provide some additional information -- which might be interesting for debugging. Info : in String ) is Data : Object_Data_Access := ST(Stmt).Data; Q : Unbounded_String; begin for I in Data.PT'Range loop exit when Data.PT(I).Cmd = Null_Unbounded_String; Q := Q & Data.PT(I).Cmd; if Data.Pt(I).Arg /= Null_Unbounded_String then Q := Q & ":" & Data.Pt(I).Arg; end if; end loop; Raise_Exception( Id, Info & " in " & To_String(Q) ); end Create_Exception; ------------ -- Parent -- ------------ function Parent( Stmt : in Statement_ID ) return Driver.Handle is -- derive the parent driver from the statement id. begin if ST(Stmt) /= null then return Connection.Driver_Handle( ST(Stmt).Con ) ; else return null; end if; end Parent; -------------------- -- Drop_Resources -- -------------------- procedure Drop_Resources( Stmt : in Statement_ID ) is -- drop all resources from the connection Data : Object_Data_Access renames ST(Stmt).Data; begin for I in Data.RT'Range loop if Data.RT(I) = True then if St(Stmt) /= null then Resultset.Deallocate( I ); end if; Data.RT(I) := False; end if; end loop; end Drop_Resources; ---======================================================================--- ---=== C O M P O N E N T I N T E R F A C E ===--- ---======================================================================--- ---=====================================================================--- ---=== A T T R I B U T E F U N C T I O N S ===--- ---=====================================================================--- ---------------- -- Get_Handle -- ---------------- function Get_Handle( Stmt : in Statement_ID ) return Handle is begin return ST(Stmt); end Get_Handle; ------------------- -- Driver_Handle -- ------------------- function Driver_Handle( Stmt : in Statement_ID ) return Driver.Handle is begin return Parent( Stmt ); end Driver_Handle; ---=====================================================================--- ---=== M E T H O D S ===--- ---=====================================================================--- -------------- -- Allocate -- -------------- function Allocate( Stmt : in Handle ) return Statement_ID is -- store a handle in the statement table. This will be called by the -- driver to insert. begin if Stmt = Null_Handle then raise Usage_Error; end if; for I in ST'Range loop if ST(I) = Null_Handle then ST(I) := stmt; if Stmt.Data = null then Stmt.Data := new Object_Data; end if; Add_Statement( Stmt.Con, I ); return I; end if; end loop; raise Statement_Table_Overflow; end Allocate; ---------------- -- Deallocate -- ---------------- procedure Deallocate( Id : in Statement_ID ) is -- deallocate the id from the resulset table Db : Driver.Handle renames Parent(Id); procedure Free is new Unchecked_Deallocation( Object_Data, Object_Data_Access); begin if ST(Id) /= null then if ST(Id).Data /= null then Drop_Resources( Id ); Delete_Statement( ST(Id).Con, Id ); Free( ST(Id).Data ); Delete_Statement( Db.all, Id ); end if; end if; ST(Id) := null; end Deallocate; ------------------- -- Add_Resultset -- ------------------- procedure Add_Resultset( Stmt : in Statement_ID; Result : in Resultset_ID ) is Data : Object_Data_Access renames ST(Stmt).Data; begin Data.RT( Result ) := True; end Add_Resultset; ---------------------- -- Delete_Resultset -- ---------------------- procedure Delete_Resultset( Stmt : in Statement_ID; Result : in Resultset_ID ) is -- remove a resultset from a statement begin pragma Assert( Stmt in ST'Range ); if ST(Stmt) /= null then ST(Stmt).Data.RT( Result ) := False; end if; end Delete_Resultset; -------------- -- Prepare -- -------------- procedure Prepare( Stmt : in Statement_ID; Statement : in String ) is S : Handle renames ST(Stmt); begin for I in Parser_Index loop S.Data.PT(I).Cmd := Null_Unbounded_String; S.Data.PT(I).Arg := Null_Unbounded_String; end loop; Parse( S.Data.PT, Statement ); end Prepare; ---------- -- Bind -- ---------- procedure Bind( Stmt : in Statement_ID; Name : in String; Var : Hostvariable.Object'Class ) is -- bind a hostvariable name to a variable S : Handle renames ST(Stmt); begin if not Variable_Used( S.Data.PT, Name ) then Create_Exception( Stmt, Unused_Host_Variable'Identity, Name ); end if; for I in S.Data.BT'Range loop if S.Data.BT(I).Var = null then S.Data.BT(I).Var := Self( Var ); S.Data.BT(I).Name := To_Unbounded_String(Name); return; end if; end loop; raise Bind_Table_Overflow; end Bind; -------------- -- Variable -- -------------- function Variable( Stmt : in Statement_ID; Name : in String ) return Hostvariable.Handle is -- return the handle S : Handle renames ST(Stmt); begin for I in S.Data.BT'Range loop if To_String(S.Data.BT(I).Name) = Name then return S.Data.BT(I).Var; end if; end loop; Create_Exception( Stmt, Host_Variable_Not_Found'Identity, Name ); return null; end Variable; ---------- -- Bind -- ---------- procedure Bind_Host_Variables( Stmt : in Statement_ID ) is -- bind a hostvariables of a statement to the database interface Db : Driver.Handle renames Parent( Stmt ); Data : Object_Data_Access renames ST(Stmt).Data ; begin for I in Data.BT'Range loop if Data.BT(I).Var /= null then Bind_Host_Variable( Db.all, Stmt, Data.BT(I).Var ); end if; end loop; end Bind_Host_Variables; ---------------------------- -- Retrieve_Host_Variable -- ---------------------------- procedure Retrive_Host_Variables( Stmt : in Statement_ID; Result : in Row.Handle ) is -- copy the contents of the bound hostvariables into the ada95 -- presentation. Db : Driver.Handle renames Parent( Stmt ); Data : Object_Data_Access renames ST(Stmt).Data ; begin for I in Data.BT'Range loop if Data.BT(I).Var /= null then Get_Host_Value( Db.all, Stmt, Data.BT(I).Var ); end if; end loop; end Retrive_Host_Variables; ----------- -- Query -- ----------- function Query( Stmt : in Statement_ID) return String is -- S : Handle renames ST(Stmt); PT : Parse_Table renames S.Data.PT; Q : Unbounded_String := Null_Unbounded_String; function Variable( Name : in Unbounded_String ) return Hostvariable.Handle is begin for I in S.Data.BT'Range loop if S.Data.BT(I).Name = Name then return S.Data.BT(I).Var; end if; end loop; Create_Exception( Stmt, Host_Variable_Not_Found'Identity, To_String(Name) ); return null; end Variable; V : Hostvariable.Handle := null; Db : Driver.Handle renames Parent(Stmt) ; begin for I in Parser_Index'Range loop exit when PT(I).Cmd = Null_Unbounded_String; Q := Q & PT(I).Cmd ; if Pt(I).Arg /= Null_Unbounded_String then V := Variable(PT(I).Arg); Q := Q & Expand( Db.all, V); end if; end loop; return To_String(Q); end Query; end GNU.DB.ADBC.Statement; gnade-1.6.2.orig/dbi/adbc/gnu-db-adbc-statement.ads0000644000175000017500000002522507435750736021610 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/dbi/adbc/gnu-db-adbc-statement.ads,v $ -- Description : Ada Database Objects Toplevel package -- -- Author : Michael Erdmann -- -- Created : 18.1.2002 -- -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2002/02/23 17:31:10 $ -- Version : $Revision: 1.3 $ -- Status : $State: Exp $ -- -- -- Copyright (C) 2001 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- This software is implemented to work with GNAT, the GNU Ada compiler. -- --

-- -- Functional Description -- -- ====================== -- -- This is the statement object. The statement object is used to hold the -- -- information about a SQL statement. A statement object is not connected -- -- to any data base connection. It is a container for the syntactical -- -- elements of an SQL statement. -- -- -- -- A statement like: -- -- -- -- select * from employees where name = :myname and empno = :id -- -- -- -- is stored in the object in such a way, that the driver is able to -- -- build a correct query by substituting the named hast variables with the -- -- correct representations e.g. by adding an '?'. -- -- The command is broken up into chunks and arguments as shown below: -- -- -- -- chunk 1 - select * from employees where name = -- -- arg. 1 - myname -- -- chunk 2 - and empno = -- -- arg. 2 - id -- -- -- -- In order to access these elements, the class provides the operations -- -- Get_Chunk and Argument. -- --

-- -- Restrictions -- -- ============ -- -- Only Linux -- -- -- -- Contact -- -- ======= -- -- Error reports shall be handled via http://gnade.sourceforge.net -- -- Features and ideas via: gnade-develop@lists.sourceforge.net -- -- -- -- Author contact: -- -- purl:/net/michael.erdmann -- -- -- ------------------------------------------------------------------------------- with GNU.DB.ADBC.Connection; with GNU.DB.ADBC.Hostvariable; with GNU.DB.ADBC.Driver; with GNU.DB.ADBC.Row; use GNU.DB.ADBC; package GNU.DB.ADBC.Statement is type Object( Con : Connection_ID ) is tagged private; type Handle is access all Object'Class; Null_Handle : constant Handle := null; Null_ID : constant Statement_ID := Statement_ID'First; --------------------------------------------------------------------------- --# Description : --# Create a stement from the given statement. --# Preconditions : --# None --# Postconditions : --# --# Exceptions : --# R.1 violated - Usage_Error --# Note : --------------------------------------------------------------------------- procedure Prepare( Stmt : in Statement_ID; Statement : in String ); --------------------------------------------------------------------------- --# Description : --# Bind a host variable to a named used in the statement. The actual --# value subsitution is done at execution time of the execute --# method. --# Preconditions : --# R.1 the statement has been prepared --# R.2 the name where the host variable is bound to is contained --# in the command. --# Postconditions : --# P.1 - A statement id is allocated to the statement. --# Exceptions : --# Unused_Host_Variable - R.2 violated --# Bind_table_Overflow - P.1 is not possible --# Note : --------------------------------------------------------------------------- procedure Bind( Stmt : in Statement_ID; Name : in String; Var : Hostvariable.Object'Class ); Bind_Table_Overflow : exception; Unused_Host_Variable : exception; Host_Variable_Not_Found : exception; --------------------------------------------------------------------------- --# Description : --# Preconditions : --# Postconditions : --# Exceptions : --# Note : --------------------------------------------------------------------------- procedure Deallocate( Id : in Statement_ID ); --------------------------------------------------------------------------- --# Description : --# Preconditions : --# Postconditions : --# Exceptions : --# Note : --# *** ONLY FOR DRIVER INTERFACE *** --------------------------------------------------------------------------- procedure Bind_Host_Variables( Stmt : in Statement_ID ); procedure Retrive_Host_Variables( Stmt : in Statement_ID; result : in Row.handle ); function Query( Stmt : in Statement_ID ) return String; --------------------------------------------------------------------------- --# Description : --# The given object handle is stored in a slot of the object table. The --# actual allocation of memory has to be done by the driver. --# This function is intended for usage by the driver implementations. --# Preconditions : --# R.1 - Handle is not a null handle --# Postconditions : --# P.1 - Function returns the so called statement id. --# Exceptions : --# Statement_Table_Overflow - P.1 not possible --# Usage_Error - R.1 --# Note : --# *** ONLY FOR DRIVER INTERFACE *** --------------------------------------------------------------------------- function Allocate( Stmt : in Handle ) return Statement_ID ; Statement_Table_Overflow : exception; Usage_Error : exception; --------------------------------------------------------------------------- --# Description : --# Add or delete a result set to/from the statement --# Preconditions : --# Postconditions : --# Exceptions : --# Note : --------------------------------------------------------------------------- procedure Delete_Resultset( Stmt : in Statement_ID; Result : in Resultset_ID ); procedure Add_Resultset( Stmt : in Statement_ID; Result : in Resultset_ID ); --------------------------------------------------------------------------- --# Description : --# Preconditions : --# Postconditions : --# Exceptions : --# Note : --------------------------------------------------------------------------- function Get_Handle( Stmt : in Statement_ID ) return Handle; function Driver_Handle( Stmt : in Statement_ID ) return Driver.Handle; --------------------------------------------------------------------------- --# Description : --# Destroy the statement object --# Preconditions : --# R.1 - the object has been created --# Postconditions : --# P.1 - The statement object is destroyed all references to it are --# not valid any more. --# Exceptions : --# R.1 violated - Usage_Error --# Note : --------------------------------------------------------------------------- ---=====================================================================--- private type Object_Data; type Object_Data_Access is access Object_Data; type Object( Con : Connection_ID ) is tagged record Data : Object_Data_Access := null; end record; end GNU.DB.ADBC.Statement; gnade-1.6.2.orig/dbi/adbc/gnu-db-adbc.ads0000644000175000017500000001102407435750736017576 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/dbi/adbc/gnu-db-adbc.ads,v $ -- Description : Ada Database Objects Toplevel package -- -- Author : Michael Erdmann -- -- Created : 18.1.2002 -- -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2002/02/23 17:31:10 $ -- Version : $Revision: 1.2 $ -- Status : $State: Exp $ -- -- -- Copyright (C) 2001 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- This software is implemented to work with GNAT, the GNU Ada compiler. -- --

-- -- Functional Description -- -- ====================== -- -- This is the top level package of the ADO objects. It contains the basic -- -- reference types for connections, statements and resultsets.

-- -- -- -- -- -- -- -- Restrictions -- -- ============ -- -- Only Linux -- -- -- -- Contact -- -- ======= -- -- Error reports shall be handled via http://gnade.sourceforge.net -- -- Features and ideas via: gnade-develop@lists.sourceforge.net -- -- -- -- Author contact: -- -- purl:/net/michael.erdmann -- -- -- ------------------------------------------------------------------------------- package GNU.DB.ADBC is Default_Database : constant String := ""; Default_Password : constant String := ""; Null_ID_Value : constant Natural := 0; type Connection_ID is new Natural range Null_ID_Value..20; type Statement_ID is new Natural range Null_ID_Value..256; type Resultset_ID is new Natural range Null_ID_Value..256; --This is a common exception used by all modules if some kind of -- missue in the interface has taken place. Usage_Error : exception ; end GNU.DB.ADBC; gnade-1.6.2.orig/dbi/adbc/libadbc.adb0000644000175000017500000001014507440757515017073 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/dbi/adbc/libadbc.adb,v $ -- Description : Ada Database Objects - Objects -- -- Author : Michael Erdmann -- -- Created : 18.1.2002 -- -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2002/03/04 20:55:41 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2002 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- This software is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- This package is only used to build the objects library -- -- -- -- Restrictions -- -- ============ -- -- Only Linux -- -- -- -- Contact -- -- ======= -- -- Error reports shall be handled via http://gnade.sourceforge.net -- -- Features and ideas via: gnade-develop@lists.sourceforge.net -- -- -- -- Author contact: -- -- purl:/net/michael.erdmann -- -- -- ------------------------------------------------------------------------------- with GNU.DB.ADBC; with GNU.DB.ADBC.Connection; with GNU.DB.ADBC.Driver; with GNU.DB.ADBC.Resultset; with GNU.DB.ADBC.Row; with GNU.DB.ADBC.Statement; with GNU.DB.ADBC.Hostvariable; with GNU.DB.ADBC.Driver.MySQL; with GNU.DB.ADBC.Driver.PgSQL; with GNU.DB.ADBC.SQL_Helper; procedure Libadbc is begin null; end Libadbc; gnade-1.6.2.orig/dbi/mysql/0000755000175000017500000000000011040716276015304 5ustar lbrentalbrentagnade-1.6.2.orig/dbi/mysql/Changes0000644000175000017500000000035710016606500016572 0ustar lbrentalbrenta3.11.2001 - Interface to blob rewritten - performace for query creation enhanced. 19.4.2003 - Changes by Mr. Denis Chalon included. 23.2.2004 - Changes by M.Erdmann for a simplified build environment added gnade-1.6.2.orig/dbi/mysql/Makefile0000644000175000017500000001065510103417434016744 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/dbi/mysql/Makefile,v $ ## Description : Makefile for the direct mySQL binding -- ## Author : Michael Erdmann -- ## Created On : 10-Apr-2002 -- ## Last Modified By: $Author: deverne $ ## Last Modified On: $Date: 2004/08/02 11:01:48 $ -- ## Status : $State: Exp $ -- ## -- ## Copyright (C) 2000-2004 M.Erdmann -- ## -- ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## This makefile builds the direct binding to the MySQL database and ## stores the package and object files in the proper include resp. lib ## directories. ## ## Restrictions ## ============ ## None ## ## References ## ========== ## include ../../make.conf # LIBID=gnademysql libname=lib$(LIBID).a PREPFLAGS=-DCALLCONVENTION=C -DLIBID=\"-l$(LIBID)\" -DMYSQL_VERSION=$(MYSQL_VERSION) PREPROCESSED_SOURCES = gnu-db-mysql.adb objects=$(wildcard gnu-db-mysql*.ad[bs]) targetdir=$(subst /,$(PATHSEP),$(includedir)) ## ## compile the software in this directory. If the export flag is set ## copy the compilation results into the gnade include file. ## all build:: $(PREPROCESSED_SOURCES) $(ADAMAKE) -d -Pmysql.gpr -u ifneq ($(EXPORT),) $(MAKE) install endif ## ## install the result files in the gnade global include directory ## install :: $(ADAINSTALL) $(targetdir) $(objects) $(MKSTATIC) $(libdir) $(libname) $(MKSHARED) $(libdir) $(MINOR) $(MAJOR) $(libname).so ## ## clean the local directory. If the export flag has been set, the clean also ## the include directory of the gnade project. ## clean: ifneq ($(EXPORT),) $(ADAUINSTALL) $(targetdir) $(objects) endif $(RM) *.o *.ali core b~*.ad* *~ *.a gnade-1.6.2.orig/dbi/mysql/Makefile.mysql0000644000175000017500000000673310027000434020103 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/dbi/mysql/Makefile.mysql,v $ ## Description : Makefile for the direct mySQL binding -- ## Author : Michael Erdmann -- ## Created On : 10-Apr-2002 -- ## Last Modified By: $Author: merdmann $ ## Last Modified On: $Date: 2004/03/20 08:30:20 $ -- ## Status : $State: Exp $ -- ## -- ## Copyright (C) 2000-2003 -- ## -- ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## This makefile builds the direct binding to the MySQL database and ## stores the package and object files in the proper include resp. lib ## directories. ## ## Restrictions ## ============ ## None ## ## References ## ========== ## all build: $(MAKE) -C./ $@ gnade-1.6.2.orig/dbi/mysql/gnade-mysql.gpr0000644000175000017500000000153510670447772020255 0ustar lbrentalbrenta-- $Id: gnade-mysql.gpr,v 1.1 2007/09/08 07:32:10 persan Exp $ with "../../gnade"; with "../../support/gnade-support.gpr"; project Gnade.mysql is for Languages use ("Ada"); for Source_Dirs use ("."); for Object_Dir use "lib-obj"; for library_name use "gnademysql"; for Library_Kind use "static"; for Library_dir use project'Object_Dir & "/lib"; package Compiler is for Default_Switches ("Ada") use Gnade.Compiler'Default_Switches ("Ada"); end Compiler; package Builder is for Default_Switches ("Ada") use Gnade.Builder'Default_Switches ("Ada"); end Builder; package Binder is for Default_Switches ("Ada") use Gnade.Binder'Default_Switches ("Ada"); end Binder; package Linker is for Default_Switches ("Ada") use Gnade.Builder'Default_Switches ("Ada"); end Linker; end Gnade.mysql; gnade-1.6.2.orig/dbi/mysql/gnu-db-mysql.adb0000644000175000017500000013203110663625727020305 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/dbi/mysql/gnu-db-mysql.adb,v $ -- Description : Ada Database Objects - Test client -- -- Author : Michael Erdmann -- -- Created : 18.1.2002 -- -- Last Modified By: $Author: merdmann $ -- -- Last Modified On: $Date: 2007/08/24 19:04:55 $ -- -- Version : $Revision: 1.5 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2003 Stephen Leake -- -- Copyright (C) 2001 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- This software is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- -- -- -- -- Functional Description -- -- ====================== -- -- This components implements a thick binding to the MySQL product -- -- which is available for the Linux Plattform. -- -- -- -- -- -- Restrictions -- -- ============ -- -- Only 100 fields per query -- -- Number of Queries per connection is 10. -- -- -- -- Restrictions -- -- ============ -- -- -- -- R1. The into clause in case of FETCH seems not to work with ODBC. The -- -- translator will raise an syntax error if such an clause has been -- -- found. -- -- -- Contact -- -- ======= -- -- Error reports shall be handled via http://gnade.sourceforge.net -- -- Features and ideas via: gnade-develop@lists.sourceforge.net -- -- -- -- Author contact: -- -- purl:/net/michael.erdmann -- -- Bertrand Carlier -- -- -- ------------------------------------------------------------------------------- -- Generation for MySQL4 --* Ada with System; use System; with System.Storage_Elements; use System.Storage_Elements; with Ada.Unchecked_Deallocation; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Text_IO; use Ada.Text_IO; with Ada.Characters.Latin_1; use Ada.Characters; with Ada.Calendar; use Ada.Calendar; with Ada.Strings.Fixed; use Ada.Strings.Fixed; with Interfaces.C; use Interfaces.C; use Interfaces; with Interfaces.C.Strings; use Interfaces.C.Strings; with Interfaces.C.Pointers; with Unchecked_Deallocation; package body GNU.DB.MySQL is Version : constant String := "$Id: gnu-db-mysql.adb,v 1.5 2007/08/24 19:04:55 merdmann Exp $"; pragma Unreferenced (Version); -- -- Interface to the MYSQL Library. Some of the data types are simply -- Addresses because the internals of these strictured do not have -- to be known here. -- subtype MYSQL_SERVER is System.Address; subtype MYSQL_ROW is System.Address; subtype MYSQL_RES is System.Address; type MYSQL_RES_Record is -- mysql.h:178 record row_count : long_long_integer; -- mysql.h:179 field_count : c.unsigned; -- mysql.h:180 current_field: c.unsigned; -- mysql.h:180 fields : Address; -- mysql.h:181 data : Address; -- mysql.h:182 data_cursor : Address; -- mysql.h:183 field_alloc : Address; -- mysql.h:184 row : MYSQL_ROW; -- mysql.h:185 current_row : MYSQL_ROW; -- mysql.h:186 lengths : Address; -- mysql.h:187 handle : Address; -- mysql.h:188 eof : C.char; -- mysql.h:189 end record; pragma Convention(C, MYSQL_RES_Record); type Unsigned_Long_Array is array(Natural range <> ) of aliased C.Unsigned_Long; Unsigned_Long_Null : aliased C.Unsigned_Long := 0; package Unsigned_Long_Ptr is new Interfaces.C.Pointers(Index => Natural, Element => C.Unsigned_Long, Element_Array=> Unsigned_Long_Array, Default_Terminator => Unsigned_Long_Null); function mysql_real_connect(mysql : MYSQL_SERVER; Host : Strings.Chars_Ptr; User : Strings.Chars_Ptr; Passwd : Strings.Chars_Ptr; Db : Strings.Chars_Ptr; Port : Unsigned; Unix_Socket : Strings.Chars_Ptr; Clientflag : Unsigned) return MYSQL_SERVER; pragma Import(C, mysql_real_connect, "mysql_real_connect"); procedure mysql_close(sock: MYSQL_SERVER); pragma Import (C, mysql_close, "mysql_close"); function mysql_select_db(mysql: MYSQL_SERVER; db : Strings.chars_ptr) return c.int; pragma Import (C, mysql_select_db, "mysql_select_db"); function mysql_query(mysql: MYSQL_SERVER; q : Strings.chars_ptr) return c.int; pragma Import (C, mysql_query, "mysql_query"); function mysql_fetch_row(mysql: MYSQL_RES) return MYSQL_ROW; pragma Import (C, mysql_fetch_row, "mysql_fetch_row"); -- For retrieving blob lengths function Mysql_Fetch_Lengths (Mysql : MYSQL_RES) return Unsigned_Long_Ptr.pointer; pragma Import(C, Mysql_Fetch_Lengths, "mysql_fetch_lengths"); type MYSQL_field_types is ( -- mysql_com.h:136 FIELD_TYPE_DECIMAL, -- mysql_com.h:136 FIELD_TYPE_TINY, -- mysql_com.h:136 FIELD_TYPE_SHORT, -- mysql_com.h:137 FIELD_TYPE_LONG, -- mysql_com.h:65 FIELD_TYPE_FLOAT, -- mysql_com.h:66 FIELD_TYPE_DOUBLE, -- mysql_com.h:66 FIELD_TYPE_NULL, -- mysql_com.h:67 FIELD_TYPE_TIMESTAMP, -- mysql_com.h:67 FIELD_TYPE_LONGLONG, -- mysql_com.h:68 FIELD_TYPE_INT24, -- mysql_com.h:68 FIELD_TYPE_DATE, -- mysql_com.h:69 FIELD_TYPE_TIME, -- mysql_com.h:69 FIELD_TYPE_DATETIME, -- mysql_com.h:70 FIELD_TYPE_YEAR, -- mysql_com.h:70 FIELD_TYPE_NEWDATE, -- mysql_com.h:71 FIELD_TYPE_ENUM, -- mysql_com.h:72 FIELD_TYPE_SET, -- mysql_com.h:73 FIELD_TYPE_TINY_BLOB, -- mysql_com.h:74 FIELD_TYPE_MEDIUM_BLOB, -- mysql_com.h:75 FIELD_TYPE_LONG_BLOB, -- mysql_com.h:76 FIELD_TYPE_BLOB, -- mysql_com.h:77 FIELD_TYPE_VAR_STRING, -- mysql_com.h:78 FIELD_TYPE_STRING -- mysql_com.h:80 ); for MYSQL_field_types use ( FIELD_TYPE_DECIMAL => 0, FIELD_TYPE_TINY => 1, FIELD_TYPE_SHORT => 2, FIELD_TYPE_LONG => 3, FIELD_TYPE_FLOAT => 4, FIELD_TYPE_DOUBLE => 5, FIELD_TYPE_NULL => 6, FIELD_TYPE_TIMESTAMP => 7, FIELD_TYPE_LONGLONG => 8, FIELD_TYPE_INT24 => 9, FIELD_TYPE_DATE => 10, FIELD_TYPE_TIME => 11, FIELD_TYPE_DATETIME => 12, FIELD_TYPE_YEAR => 13, FIELD_TYPE_NEWDATE => 14, FIELD_TYPE_ENUM => 247, FIELD_TYPE_SET => 248, FIELD_TYPE_TINY_BLOB => 249, FIELD_TYPE_MEDIUM_BLOB => 250, FIELD_TYPE_LONG_BLOB => 251, FIELD_TYPE_BLOB => 252, FIELD_TYPE_VAR_STRING => 253, FIELD_TYPE_STRING => 254 ); for MYSQL_field_types'size use 32; type st_mysql_field is -- mysql.h:92 record name : Strings.chars_ptr; -- mysql.h:93 table : Strings.chars_ptr; -- mysql.h:94 def : Strings.chars_ptr; -- mysql.h:95 c_type : MYSQL_field_types; -- mysql.h:96 length : c.unsigned; -- mysql.h:97 max_length: c.unsigned; -- mysql.h:98 flags : c.unsigned; -- mysql.h:99 decimals : c.unsigned; -- mysql.h:100 end record; pragma Convention(C, st_mysql_field); type MYSQL_Field is access all st_mysql_field; type enum_mysql_status is -- mysql.h:149 ( MYSQL_STATUS_READY, -- mysql.h:149 MYSQL_STATUS_GET_RESULT, -- mysql.h:149 MYSQL_STATUS_USE_RESULT -- mysql.h:149 ); for enum_mysql_status'size use 32; type struct_st_net is record Vio : System.Address; -- mysql_com.h:116 fd : c.int; -- mysql_com.h:117 fcntl : c.int; -- mysql_com.h:118 buff : Strings.chars_ptr; -- mysql_com.h:119 buff_end : Strings.chars_ptr; -- mysql_com.h:119 write_pos : Strings.chars_ptr; -- mysql_com.h:119 Read_Pos : Strings.Chars_Ptr; -- mysql_com.h:119 last_error : C.char_Array(0..199); -- mysql_com.h:120 last_errno : c.unsigned; -- mysql_com.h:121 max_packet : c.unsigned; -- mysql_com.h:121 timeout : c.unsigned; -- mysql_com.h:121 pkt_nr : c.unsigned; -- mysql_com.h:121 error : c.signed_char; -- mysql_com.h:122 Return_Errno : c.signed_char; -- mysql_com.h:123 Compress : C.Signed_Char; -- mysql_com.h:123 No_Send_Ok : C.Signed_Char; -- mysql_com.h:124 Remain_In_Buf : C.Unsigned_Long; -- mysql_com.h:128 Length : C.Unsigned_Long; -- mysql_com.h:128 Buf_Length : C.Unsigned_Long; -- mysql_com.h:128 Where_B : C.Unsigned_Long; -- mysql_com.h:128 Return_Status : C.Unsigned; -- mysql_com.h:129 Reading_Or_Writing: C.Unsigned_Char; -- mysql_com.h:130 Save_Char : C.Signed_Char; -- mysql_com.h:131 end record; pragma Convention(C, struct_st_net); subtype NET is struct_st_net; type A_MYSQL_FIELD_T is access all st_mysql_field; type st_mem_root is -- mysql.h:60 record free : Address; -- mysql.h:61 used : Address; -- mysql.h:62 Pre_Alloc : Address; -- mysql.h:63 min_malloc : c.unsigned; -- mysql.h:64 block_size : c.unsigned; -- mysql.h:65 error_handler: Address ; -- mysql.h:67 end record; pragma Convention(C, st_mem_root); subtype MEM_ROOT is st_mem_root; -- mysql.h:24 type St_Mysql_Options is record Connect_Timeout : C.Unsigned; -- mysql.h:130 Client_Flag : C.Unsigned; -- mysql.h:130 Compress : C.Signed_Char; -- mysql.h:131 Named_Pipe : C.Signed_Char; -- mysql.h:131 Port : C.Unsigned; -- mysql.h:132 Host : Strings.Chars_Ptr; -- mysql.h:133 Init_Command : Strings.Chars_Ptr; -- mysql.h:133 User : Strings.Chars_Ptr; -- mysql.h:133 Password : Strings.Chars_Ptr; -- mysql.h:133 Unix_Socket : Strings.Chars_Ptr; -- mysql.h:133 Db : Strings.Chars_Ptr; -- mysql.h:133 My_Cnf_File : Strings.Chars_Ptr; -- mysql.h:134 My_Cnf_Group : Strings.Chars_Ptr; -- mysql.h:134 Charset_Dir : Strings.Chars_Ptr; -- mysql.h:134 Charset_Name : Strings.Chars_Ptr; -- mysql.h:134 Use_Ssl : C.Signed_Char; -- mysql.h:135 Ssl_Key : Strings.Chars_Ptr; -- mysql.h:136 Ssl_Cert : Strings.Chars_Ptr; -- mysql.h:137 Ssl_Ca : Strings.Chars_Ptr; -- mysql.h:138 Ssl_Capath : Strings.Chars_Ptr; -- mysql.h:139 end record; type st_mysql is record The_net : NET; -- mysql.h:153 Connector_Fd : System.Address; -- mysql.h:154 host : Strings.chars_ptr; -- mysql.h:155 user : Strings.chars_ptr; -- mysql.h:155 passwd : Strings.chars_ptr; -- mysql.h:155 unix_socket : Strings.chars_ptr; -- mysql.h:155 server_version : Strings.chars_ptr; -- mysql.h:155 host_info : Strings.chars_ptr; -- mysql.h:155 info : Strings.chars_ptr; -- mysql.h:156 db : Strings.chars_ptr; -- mysql.h:156 port : c.unsigned; -- mysql.h:157 client_flag : c.unsigned; -- mysql.h:157 server_capabilities: c.unsigned; -- mysql.h:157 protocol_version : c.unsigned; -- mysql.h:158 field_count : c.unsigned; -- mysql.h:159 Server_Status : C.Unsigned; -- mysql.h:160 thread_id : c.unsigned; -- mysql.h:161 affected_rows : c.unsigned; -- mysql.h:162 insert_id : c.unsigned; -- mysql.h:163 extra_info : c.unsigned; -- mysql.h:164 Packet_Length : C.Unsigned_Long; -- mysql.h:165 status : enum_mysql_status; -- mysql.h:166 fields : A_MYSQL_FIELD_T; -- mysql.h:167 field_alloc : MEM_ROOT; -- mysql.h:168 free_me : c.signed_char; -- mysql.h:169 reconnect : c.signed_char; -- mysql.h:170 Options : ST_MYSQL_OPTIONS; -- mysql.h:171 Scramble_Buff : C.char_Array(0..8); -- mysql.h:172 Charset : System.Address; -- mysql.h:173 Server_Language : C.Unsigned; -- mysql.h:174 end record; -- mysql.h:213 function mysql_init(mysql : MYSQL_SERVER ) return MYSQL_SERVER; pragma Import (C, mysql_init, "mysql_init"); -- mysql.h:200 function mysql_fetch_field(handle: MYSQL_RES) return MYSQL_FIELD; pragma Import (C, mysql_fetch_field, "mysql_fetch_field"); -- mysql.h:267 function mysql_store_result(mysql: MYSQL_SERVER) return MYSQL_RES; pragma Import (C, mysql_store_result, "mysql_store_result"); -- mysql.h:271 procedure mysql_free_result(result: MYSQL_RES); -- mysql.h:163 pragma Import (C, mysql_free_result, "mysql_free_result"); -- mysql.h:282 function Mysql_Real_Escape_String( Mysql: MYSQL_SERVER; To : Strings.Chars_Ptr; From : System.Address ; Length : C.unsigned) return C.Unsigned; pragma Import(C, Mysql_Real_Escape_String, "mysql_real_escape_string"); type Ulonglong is new natural; for Ulonglong'Size use 64; -- mysql.h:206 function Mysql_Insert_Id(Mysql: MYSQL_SERVER) return ulonglong; pragma Import(C, Mysql_Insert_Id , "mysql_insert_id"); ---====================================================================--- ---=== O B J E C T D A T A ===--- ---====================================================================--- type Field_Info_Array is array( Field_Number ) of St_MySql_Field; --| --| This is the instance of the component internal data. --| type Query_Context is record In_Use : Boolean := False; Result : MYSQL_RES := Null_Address; Row : MYSQL_ROW := Null_Address; Field : Field_Info_Array; Affected_Rows : Integer := 0; Lengths : Unsigned_Long_Ptr.Pointer; Next : Query_ID := Query_ID'First; end record; type Query_Table is array( 1..Query_ID'Last ) of Query_Context; type Object_Data is record Server_Name : Unbounded_String := Null_Unbounded_String; Login_Name : Unbounded_String := Null_Unbounded_String; Password : Unbounded_String := Null_Unbounded_String; Connected : Boolean := False; Server : MYSQL_Server := Null_Address; Next_Free : Query_ID := Query_Table'First; Query : Query_Table; end record; ---=====================================================================--- ---=== L O C A L S U P P O R T P R O C E D U R E S ===--- ---=====================================================================--- -------------- -- Instance -- -------------- function Instance (this : in Object; info : in String) return Object_Data_Access is pragma Unreferenced (info); -- Get pointer to object data begin if this.Data = null then raise Not_Initialized; end if; return this.Data; end Instance; ----------------- -- Get_Address -- ----------------- function Get_Address( Row : in MYSQL_ROW; Pos : in Field_Number ) return Address is -- Retrieve the address from an array fo addresses Result : array( Field_Number ) of Address ; for Result'Address use Row; begin return Result( Pos ); end Get_Address; ----------------- -- Copy_String -- ----------------- function Copy_String ( Addr : in Address; Len : in Integer ) return String is -- Copy a string from the memory address. This code is not nice but -- is works. Result : String( 1..len ) := ( others => ' ' ); byte : Character; Src : String( 1..Len ); for Src'Address use Addr; begin for i in 1..Len loop Byte := Src(I); exit when Byte = Latin_1.NUL; Result(I) := Byte; end loop; return Result; end Copy_String; ------------ -- Escape -- ------------ -- -- Escape a string for setting a blob value in an insert or update statement -- function Escape( Obj : Object ; Str : in String) return Unbounded_String is procedure Free is new Ada.Unchecked_Deallocation(Char_Array,Char_Array_Access); Data : Object_Data_Access := Instance( Obj , "escape"); -- allocating buffer for encoding the buffer Buffer : Char_Array_access := new Char_Array(1..Str'Length*2+1); begin declare Buffer_Ptr : Strings.Chars_Ptr := Strings.To_Chars_ptr(Buffer) ; olen : C.unsigned := Mysql_Real_Escape_String( Data.Server , Buffer_Ptr, Str'address , C.Unsigned(Str'Length) ); S : Unbounded_string := To_Unbounded_string(Strings.Value(Buffer_Ptr)); begin Free(Buffer); return S; end; exception when others => Free(Buffer); raise; end; -------------- -- Validate -- -------------- procedure Validate( data : in Object_Data_Access; id : in Query_ID ) is -- Verify if data and query are valid informations. begin if not Data.Query(id).In_Use then raise Usage_Error; end if; end Validate; -------------- -- Num_Rows -- -------------- function NumRows( result : in Address ) return Integer is -- Return the number of rows found during a selection Res : MYSQL_RES_Record; for Res'Address use Result; begin if result = Null_Address then return 0; end if; return Integer(Res.Row_Count); end NumRows; ------------------ -- Num_Affected -- ------------------ function Num_Affected( Server : in Address ) return Integer is -- return the number of affected rows S : st_mysql; pragma Import (Ada, S); for S'Address use Server; begin return Integer(S.Affected_Rows); end Num_Affected; ----------------------- -- Allocate_Query_ID -- ----------------------- function Allocate_Query_Id( Data : in Object_Data_Access ) return Query_ID is Result : Query_ID := Query_ID'First; begin if Data.Next_Free = Null_Query_ID then raise Out_Of_Resources; end if; Result := Data.Next_Free; Data.Next_Free := Data.Query( Result ).Next; Data.Query( Result ).Next := Null_Query_ID; Data.Query( Result ).In_Use := True; return Result; end Allocate_Query_Id; ------------------- -- Free_Query_ID -- ------------------- procedure Free_Query_ID( Data : in Object_Data_Access; Id : in Query_ID ) is begin Data.Query( Id ).Next := Data.Next_Free; Data.Query( Id ).In_Use := False; Data.Next_Free := Id; end Free_Query_ID; ---======================================================================--- ---=== C O M P O N E N T I N T E R F A C E ===--- ---======================================================================--- ---------------- -- Initialize -- ---------------- procedure Initialize( this : in out Object ) is -- Intialize the Object data and call the Initalization -- procedure of the extention. begin if This.Data /= null then raise Usage_Error; end if; This.Data := new Object_Data; for I in Query_Table'Range loop if I < Query_Table'Last then This.Data.Query(I).Next := I+1; end if; end loop; end Initialize; -------------- -- Finalize -- -------------- procedure Finalize( this : in out Object ) is -- Finalize the instance by releasing the object resources Data : Object_Data_Access renames this.data; procedure Free is new Unchecked_Deallocation( Object_Data, Object_Data_Access); begin if Data = null then raise Not_Initialized; end if; if Data.Connected = True then Disconnect( This ); end if; for I in Query_Table'Range loop if Data.Query(I).Result /= Null_Address then Drop_Query( This, I ); end if; end loop; Free( Data ); This.Data := null; end Finalize; ---=====================================================================--- ---=== A T T R I B U T E F U N C T I O N S ===--- ---=====================================================================--- ---------- -- User -- ---------- procedure User( This : in out Object; Name : in String ) is -- Set the user Name for a server connection Data : Object_Data_Access := Instance( this, "User"); begin Data.Login_Name := To_Unbounded_String( Name ); end User; -------------- -- Password -- -------------- procedure Password( This : in out Object; pwd : in String ) is Data : Object_Data_Access := Instance( this, "Password" ); begin Data.Password := To_Unbounded_String( pwd ); end Password; ---=====================================================================--- ---=== M E T H O D S ===--- ---=====================================================================--- ------------- -- Connect -- ------------- procedure Connect( this : in out Object; Server : in String; DB : in String := ""; Port : in Natural := 0; Socket : in String := ""; Flag : in Natural := 0) is -- Connect to the server specified by the Object. data : Object_Data_Access := Instance( this, "Connect" ); DB_Ptr : Strings.chars_ptr; Socket_Ptr : Strings.chars_ptr; begin Data.Server_Name := To_Unbounded_String( Server ); if DB = "" then DB_Ptr := Null_Ptr; else DB_Ptr := New_String(DB); end if; if Socket = "" then Socket_Ptr := Null_Ptr; else Socket_Ptr := New_String(Socket); end if; Data.Server := MYSQL_Init( Null_Address); Data.Server := MYSQL_Real_Connect ( Data.Server, New_String( To_String( data.Server_Name) ), New_String( To_String(data.Login_Name) ), New_String( To_String(data.Password) ), DB_Ptr, Unsigned(Port), Socket_Ptr, Unsigned(Flag) ); if Data.Server = Null_Address then raise Connect_Failure; end if; Data.Connected := True; end Connect; ---------------- -- Disconnect -- ---------------- procedure Disconnect( this : in out Object ) is -- Disconnect from a server. data : Object_Data_Access := Instance( this, "Disconnect"); begin mysql_close( data.Server ); data.Connected := False; end Disconnect; --------------- -- Select_DB -- --------------- procedure Select_DB( this : in out Object; name : in String ) is -- Select a data base from the server. data : constant Object_Data_Access := Instance( this, "Select_DB" ); RC : C.Int := 0; begin RC := mysql_select_db( data.Server, New_String( name )); if not ( RC = 0 ) then raise DB_Name_Failure; end if; end Select_DB; -------------------- -- Number_Of_Rows -- -------------------- function Nbr_Of_Rows( this : in Object; id : in Query_ID ) return Integer is -- Return the number of rows found during a selection Data : constant Object_Data_Access := Instance( this, "Nbr_Of_Rows"); begin return NumRows(Data.Query(id).Result ); end Nbr_Of_Rows; ----------- -- Query -- ----------- function Query( This : in Object; Query : in String ) return Query_ID is -- Perform a query on the server and retrieve the result -- context. The function returns the id of the query context. Data : Object_Data_Access := Instance( this, "Query"); Result : Query_ID := 1; RC : C.int := 0; RES_Address: MYSQL_RES; begin -- perform the query declare Query_Str : Chars_ptr := New_String( Query); begin RC := mysql_query( data.Server, Query_Str); Free(Query_Str); end; if RC /= 0 then raise Error_During_Query; else Result := Allocate_Query_ID(Data); end if; -- get the information about the result set. declare Q : Query_Context renames Data.Query(Result); begin RES_Address := mysql_store_result( data.Server ); if RES_Address /= Null_Address then if NumRows( RES_Address ) < 1 then -- Free the resource, and raise error Free_Query_Id( Data, Result ); raise No_Query_Result; end if; if NumRows( RES_Address ) > 0 then Q.Result := RES_Address; Q.Row := mysql_fetch_row(Q.Result); -- Get All the Columns Lengths Q.Lengths := Mysql_Fetch_Lengths(Q.Result); for I in Field_Number loop declare Field : constant MYSQL_Field := mysql_fetch_field( Q.Result ); begin exit when Field = null; Q.Field(i) := Field.all; end; end loop; else Free_Query_Id(Data,Result); raise No_Query_result; end if; else Q.Affected_Rows := Num_Affected( Data.Server ); end if; end; return Result; end Query; ---------------- -- Drop_Query -- ---------------- procedure Drop_Query( this : in out Object; id : in Query_ID ) is -- Release the query context Data : Object_Data_Access := Instance( this, "Drop_Query" ); Q : Query_Context renames Data.Query(id); procedure C_Free(P : Unsigned_Long_Ptr.Pointer); pragma Import(C,C_Free, "free"); use Unsigned_Long_Ptr; begin if Q.In_Use then if Q.Result /= Null_Address then mysql_free_result( Q.Result); end if; Q.Result := Null_Address; Q.In_Use := False; -- Free Lengths if Q.Lengths /= null then -- C_Free(Q.Lengths); -- got RTLRuntimeException in the debugger ??? on win32 platform Q.Lengths := null; end if; end if; Free_Query_ID( Data, Id ); end Drop_Query; ---------- -- Next -- ---------- procedure Next( this : in out Object; query : in Query_ID ) is -- Get the next matching tuple for the given query Data : Object_Data_Access := Instance( this, ".Next"); Q : Query_Context renames Data.Query(query); begin Validate( data, query ); if Q.Result /= Null_Address then Q.Row := mysql_fetch_row( Q.Result ); -- Get All the Columns Lengths Q.Lengths := Mysql_Fetch_Lengths(Q.Result); if Q.Row = Null_Address then raise No_More_Rows; end if; else raise Usage_Error; end if; end Next; -------------------- -- Get_Field_Type -- -------------------- function Get_Field_Type( This : in Object; Id : in Query_ID; FNumber: in Field_Number ) return Field_Type is Data : constant Object_Data_Access := Instance( this, "Get_Field_Type"); Q : Query_Context renames data.Query(id); begin Validate( data, id ); case Q.Field(FNumber).C_Type is when FIELD_TYPE_VAR_STRING | FIELD_TYPE_STRING => return String_Type; when FIELD_TYPE_DATE => return Date_Type; when FIELD_TYPE_TINY_BLOB | FIELD_TYPE_MEDIUM_BLOB | FIELD_TYPE_LONG_BLOB | FIELD_TYPE_BLOB => return Blob_Type; when FIELD_TYPE_TINY | FIELD_TYPE_SHORT | FIELD_TYPE_LONG => return Integer_Type; when FIELD_TYPE_FLOAT | FIELD_TYPE_DOUBLE => return Float_Type; when others => return Unsupported_Type; end case; --FIELD_TYPE_NULL, -- mysql_com.h:67 --FIELD_TYPE_TIMESTAMP, -- mysql_com.h:67 --FIELD_TYPE_LONGLONG, -- mysql_com.h:68 --FIELD_TYPE_INT24, -- mysql_com.h:68 --FIELD_TYPE_TIME, -- mysql_com.h:69 --FIELD_TYPE_DATETIME, -- mysql_com.h:70 --FIELD_TYPE_YEAR, -- mysql_com.h:70 --FIELD_TYPE_NEWDATE, -- mysql_com.h:71 --FIELD_TYPE_ENUM, -- mysql_com.h:72 --FIELD_TYPE_SET, -- mysql_com.h:73 end Get_Field_Type; function Get_Field_Type( This : in Object; Id : in Query_ID; Name : in String ) return Field_Type is begin return Get_Field_Type(This, Id, Get_Field_Number( this, id, name )); end Get_Field_Type; ---------------------- -- Get_Field_Number -- ---------------------- function Get_Field_Number( this : in Object; id : in Query_ID; name : in String) return Field_Number is -- Translate the name into a field number. data : constant Object_Data_Access := Instance( this, "Get_Field_Number" ); begin Validate( data, id ); for i in Field_Number loop if Value(Data.Query(id).Field(i).Name) = name then return i; end if; end loop; raise Unknown_Field; end Get_Field_Number; -------------------- -- Get_Field_Name -- -------------------- function Get_Field_Name ( This : in Object; Id : in Query_Id; FNumber : in Field_Number ) return String is data : constant Object_Data_Access := Instance( this, "Get_Field_Number" ); begin Validate( data, id ); return Value (Data.Query(id).Field(FNumber).Name); end Get_Field_Name; ---------------------- -- Get_Field_Length -- ---------------------- function Get_Field_Length ( This : in Object; Id : in Query_Id; FNumber : in Field_Number ) return Natural is Data : constant Object_Data_Access := Instance( this, "Get_Field_Length" ); Q : Query_Context renames Data.Query(id); Length : Natural; begin Validate( data, id ); declare Lengths : Unsigned_Long_Array := Unsigned_Long_Ptr.Value(Q.Lengths, C.Ptrdiff_T( Q.Field'Length )); begin length := Positive( lengths(Fnumber-Field_Number'first) ); return Length; end; end Get_Field_Length; ---------------------- -- Get_Field_Length -- ---------------------- function Get_Field_Length ( This : in Object; Id : in Query_Id; Name : in String ) return Natural is begin return Get_Field_Length( this, id, Get_Field_Number( this, id, name ) ); end Get_Field_Length; ------------------ -- String_Field -- ------------------ function String_Field( This : in Object; Id : in Query_ID; FNumber : in Field_Number ) return Unbounded_String is -- Get String field identified by the field number Data : constant Object_Data_Access := Instance( this, "String_Field"); Length : Integer := 0; Q : Query_Context renames data.Query(id); begin Validate( data, id ); Length := Integer( Q.Field(fNumber).Length ); if Length = -1 then return To_Unbounded_String(""); end if; if Get_Field_Type(This, Id, FNumber) = String_Type then return To_Unbounded_String( Copy_String( Get_Address( Q.Row, FNumber ), Length )); else Put_Line(Q.Field(fNumber).c_type'Img & " is not a supported string type."); raise Field_Type_Error; end if ; end String_Field; ------------------ -- String_Field -- ------------------ function String_Field( this : in Object; id : in Query_ID; name : in String ) return Unbounded_String is -- Get the named string field begin return String_Field( this, id, Get_Field_Number( this, id, name ) ); end String_Field; ---------------- -- Date_Field -- ---------------- function Date_Field( this : in Object; id : in Query_ID; fNumber : in Field_Number ) return Time is -- Get String field identifird by the field number data : constant Object_Data_Access := Instance( this, "Date_Field"); Length : Integer := 0; Q : Query_Context renames Data.Query(id); begin Validate( data, id ); Length := Integer( Q.Field(fNumber).Length ); if Length = -1 then raise Field_Is_Null; end if; if Get_Field_Type( This, Id, fNumber) = Date_Type then declare Time_String : String(1..length); Year : Year_Number; Month : Month_Number; Day : Day_Number; tmp : String(1..5); next : Positive := 1; -- copy a date element into the tmp string and return the start offset procedure Copy_Element( Str : String ) is begin tmp := (others => ' '); for i in 1..tmp'Length loop if Str(next) = '-' then next := next + 1; exit; end if; tmp(i) := Str(next); exit when next = length; next := next + 1; end loop; exception when Others => put_line("Error in Copy_Element : " & Str & " at " & Integer'Image(next) ); raise; end Copy_Element; begin Move( Source => Copy_String( Get_Address( data.Query(id).Row, fNumber ), length ), Target => Time_String); Copy_Element( Time_String ); Year := Year_Number'Value( tmp ); Copy_Element( Time_String ); Month := Month_Number'Value( tmp ); Copy_Element( Time_String ); Day := Day_Number'Value( tmp ); return Time_Of( Year, Month, Day ); exception when others => Put_Line(Q.Field(fNumber).c_type'Img & " is not a supported date type. Error..."); raise Field_Parse_Error; end; else Put_Line(Q.Field(fNumber).c_type'Img & " is not a supported date type."); raise Field_Type_Error; end if; end Date_Field; ---------------- -- Date_Field -- ---------------- function Date_Field( this : in Object; id : in Query_ID; name : in String ) return Time is -- Get the named string field begin return Date_Field( this, id, Get_Field_Number( this, id, name )); end Date_Field; ---------------- -- Blob_Field -- ---------------- function Blob_Field ( This : in Object; Id : in Query_ID; fNumber : in Field_Number) return Byte_Array_access is Data : constant Object_Data_Access := Instance( this, "Blob_Field"); Length : Positive; Q : Query_Context renames Data.Query(id); begin Validate( data, id ); Length := Get_Field_Length( This, Id, FNumber); if Get_Field_Type( This, Id, FNumber) = Blob_Type then declare Ar : Byte_Array_access := new Byte_Array(0..Length-1); T : Byte_Array(0..Length-1) ; for T'Address use Get_Address(Q.Row,FNumber); begin Ar(0..Length-1) := T(0..Length-1); return Ar; end; else Put_Line(Q.Field(fNumber).c_type'Img & " is not a supported blob type."); raise Field_Type_Error; end if; exception when others => Put_Line("Blob_Field: Exception while retrieving blob field: " & FNumber'img); return null; end Blob_Field; ---------------- -- Blob_Field -- ---------------- function Blob_Field ( this : in Object; id : in Query_ID; name : in String ) return Byte_Array_Access is fNumber : constant Field_Number := Get_Field_Number( this, id, name ); begin return Blob_Field( This, Id, FNumber); end Blob_Field; ------------------- -- Integer_Field -- ------------------- function Integer_Field( This : in Object; Id : in Query_ID; fNumber : in Field_Number ) return Integer is -- return a number field as an integer. Data : constant Object_Data_Access := Instance( this, "Integer_Field"); Length : Positive; Q : Query_Context renames Data.Query(id); begin Validate( Data, id ); Length := Positive( Data.Query(id).Field(fNumber).length ); if Q.Field(fNumber).c_type = FIELD_TYPE_TINY or Q.Field(fNumber).c_type = FIELD_TYPE_SHORT or Q.Field(fNumber).c_type = FIELD_TYPE_LONG then return Integer'Value( Copy_String( Get_Address(Data.Query(id).Row, fNumber),Length)); else Put_Line(Get_Field_Type(This, Id, Fnumber)'Img & " is not a supported integer type."); raise Field_Type_Error; end if; end Integer_Field; ------------------- -- Integer_Field -- ------------------- function Integer_Field( This : in Object; Id : in Query_ID; Name : in String ) return Integer is -- return the number field by name begin return Integer_Field( this, id, Get_Field_Number( this, id, name ) ); end Integer_Field; ----------------- -- Float_Field -- ----------------- function Float_Field( This : in Object; Id : in Query_ID; fNumber : in Field_Number ) return Float is -- return a float field Data : constant Object_Data_Access := Instance( this, ".Float_Field"); Length : Positive; Q : Query_Context renames Data.Query(id); begin Validate( Data, Id ); Length := Positive( Q.Field(FNumber).Length ); if Q.Field(fNumber).c_type = FIELD_TYPE_FLOAT or Q.Field(fNumber).c_type = FIELD_TYPE_DOUBLE then return Float'Value( Copy_String( Get_Address(data.Query(id).Row, fNumber),length)); else Put_Line(Get_Field_Type(This, Id, Fnumber)'Img & " is not a supported float type."); raise Field_Type_Error; end if; end Float_Field; ----------------- -- Float_Field -- ----------------- function Float_Field( This : in Object; Id : in Query_ID; Name : in String ) return Float is -- return the number field by name begin return Float_Field( this, id, Get_Field_Number( this, id, name ) ); end Float_Field; --------------- -- Insert_ID -- --------------- -- -- return the Inserted ID for the last command -- function Insert_ID(This : in object) return Natural is data : Object_Data_Access := Instance( this, ".Insert_ID"); begin return Natural(Mysql_Insert_Id(Data.Server)); end; end GNU.DB.MySQL; gnade-1.6.2.orig/dbi/mysql/gnu-db-mysql.ads0000644000175000017500000004216310056110057020311 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/dbi/mysql/gnu-db-mysql.ads,v $ -- Description : Ada Database Objects - Test client -- -- Author : Michael Erdmann -- -- Created : 18.1.2002 -- -- Last Modified By: $Author: merdmann $ -- -- Last Modified On: $Date: 2004/05/29 13:29:19 $ -- -- Version : $Revision: 1.10 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2002-2004 Denis Chalon, M.Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- This software is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- -- -- Functional Description -- -- ====================== -- -- This component implements a thick binding to MySQL, which is -- -- available for Linix. This interface allows Ada 95 clients to communicate -- -- with the MYSQL server at any host. -- -- -- -- Queries are sent to the server a sql strings. The result of a query -- -- may be processes by the client row by row. Eeach query receives a -- -- Query id which allows to use multiple queries at the same time. -- -- -- -- The protocol between client and server is the following one: -- -- -- -- Set User Id -- -- Connect to Server -- -- Select a data base -- -- -- -- while Application is active -- -- Issue a query -- -- while rows available -- -- process data; -- -- drop Query -- -- -- -- disconnect -- -- -- -- -- -- Component Data -- -- ============== -- -- User - Name of the User logged in -- -- -- -- Query_ID - Id of a query. This resource is allocated by the Query -- -- command and can be released by the Drop_Query. -- -- Field_Number - The colum number of a field in the query result. -- -- -- -- Operations on the component data -- -- ================================ -- -- see component specification below and documentation. -- -- -- -- Error Handling -- -- ============== -- -- Error handling is done by exceptions. See documentattion. -- -- -- -- -- -- Extension -- -- ========= -- -- None -- -- -- -- Restrictions -- -- ============ -- -- Only 100 fields per query -- -- Number of Queries per connection is 10. -- -- -- -- -- -- Contact -- -- ======= -- -- Error reports shall be handled via http://gnade.sourceforge.net -- -- Features and ideas via: gnade-develop@lists.sourceforge.net -- -- -- -- Author contact: -- -- purl:/net/michael.erdmann -- -- -- ------------------------------------------------------------------------------- with Unchecked_Deallocation ; with System.Storage_Elements; use System; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Calendar; use Ada.Calendar; package GNU.DB.MySQL is ---=====================================================================--- ---=== C O M P O N E N T I N T E R F A C E ===--- ---=====================================================================--- type Object is private; type Handle is access Object; procedure Initialize( this : in out Object); procedure Finalize( this : in out Object ); Usage_Error : exception; Not_Initialized : exception; Out_Of_Resources : exception; type Query_ID is new Natural range 0..10; Null_Query_ID : constant Query_ID := Query_ID'First; type Field_Type is (String_Type, Date_Type, Blob_Type, Integer_Type, Float_Type, Unsupported_Type); subtype Field_Number is Integer range 1..100; type Byte is range 0..255; for Byte'Size use 8; type Byte_Array is array(Natural range <>) of Byte; type Byte_Array_Access is access all Byte_Array; procedure Free is new Unchecked_Deallocation( Byte_Array, Byte_Array_Access ); DB_Name_Failure : exception; Field_Is_Null : exception; ---=====================================================================--- ---=== A T T R I B U T E S ===--- ---=====================================================================--- procedure User( This : in out Object; Name : in String ); procedure Password( this : in out Object; Pwd : in String ); ---=====================================================================--- ---=== M E T H O D S ===--- ---=====================================================================--- --------------------------------------------------------------------------- --| Description : Connect to the given server, use the user name which --| has been set by the User Attribute. --| Preconditions : none. --| Postconditions : Server is connected --| Exceptions : --| Note : --------------------------------------------------------------------------- procedure Connect( this : in out Object; Server : in String; DB : in String := ""; Port : in Natural := 0; Socket : in String := ""; Flag : in Natural := 0); Connect_Failure : exception; --------------------------------------------------------------------------- --| Description : Disconnect from the server. --| Preconditions : connected to the server --| Postconditions : disconnected from the server --| Exceptions : None --| Note : - --------------------------------------------------------------------------- procedure Disconnect( this : in out Object ); --------------------------------------------------------------------------- --| Description : Select a database at the server --| Preconditions : Connected to a server --| Postconditions : --| Exceptions : --| Note : --------------------------------------------------------------------------- procedure Select_DB( this : in out Object; Name : in String ); --------------------------------------------------------------------------- --| Description : Perform an sql query. Input is a normal mysql query --| string. --| Preconditions : --| Postconditions : --| Exceptions : --| Note : --------------------------------------------------------------------------- function Query( This : in Object; Query : in String ) return Query_ID; Error_During_Query : exception; No_Query_Result : exception; function Nbr_Of_Rows( This : in Object; Id : in Query_ID ) return Integer; --------------------------------------------------------------------------- --| Description : get last insert ID --| Preconditions : --| Postconditions : --| Exceptions : --| Note : --------------------------------------------------------------------------- function Insert_ID(This : in object) return Natural; --------------------------------------------------------------------------- --| Description : Drop the query --| Preconditions : --| Postconditions : --| Exceptions : --| Note : --------------------------------------------------------------------------- procedure Drop_Query( This : in out Object; Id : in Query_ID ); --------------------------------------------------------------------------- --| Description : Perform an sql query. --| Preconditions : --| Postconditions : --| Exceptions : --| Note : --------------------------------------------------------------------------- procedure Next( This : in out Object; Query : in Query_ID); No_More_Rows : exception; --------------------------------------------------------------------------- --| Description : Get the field number --| Preconditions : --| Postconditions : --| Exceptions : --| Note : --------------------------------------------------------------------------- function Get_Field_Number( This : in Object; Id : in Query_ID; Name : in String ) return Field_Number; --------------------------------------------------------------------------- --| Description : Escape a string for Mysql, this permit to store datas with --| special caracters as '/ \0 ... useful for blobs --| Preconditions : --| Postconditions : --| Exceptions : --| Note : --------------------------------------------------------------------------- function Escape( Obj : Object ; Str : in String) return Unbounded_String; --------------------------------------------------------------------------- --| Description : Get the field of the current colume and return the --| specified data type. Access via field number or a --| field name is provided for all data types --| Preconditions : --| Postconditions : --| Exceptions : --| Note : --------------------------------------------------------------------------- function Get_Field_Length ( This : in Object; Id : in Query_Id; FNumber : in Field_Number ) return Natural; function Get_Field_Length ( This : in Object; Id : in Query_Id; Name : in String ) return Natural; function Get_Field_Type( This : in Object; Id : in Query_ID; Name : in String ) return Field_Type; function Get_Field_Type( This : in Object; Id : in Query_ID; FNumber: in Field_Number ) return Field_Type; --------------------------------------------------------------------------- --| Description : Get the type of the field specified by name or by --| field number --| Preconditions : --| Postconditions : --| Exceptions : --| Note : --------------------------------------------------------------------------- function Get_Field_Name ( This : in Object; Id : in Query_Id; FNumber : in Field_Number ) return String; --------------------------------------------------------------------------- --| Description : Get the name of the field specified by --| field number --| Preconditions : --| Postconditions : --| Exceptions : --| Note : --------------------------------------------------------------------------- Unknown_Field : exception; Field_Type_Error : exception; Field_Parse_Error : exception; function String_Field( This : in Object; Id : in Query_ID; name : in String ) return Unbounded_String; function String_Field( This : in Object; Id : in Query_ID; fNumber : in Field_Number ) return Unbounded_String; function Date_Field( This : in Object; Id : in Query_ID; Fnumber : in Field_Number ) return Time; function Date_Field( This : in Object; Id : in Query_ID; Name : in String ) return Time; function Blob_Field ( this : in Object; id : in Query_ID; fNumber : in Field_Number ) return Byte_Array_access; function Blob_Field ( this : in Object; id : in Query_ID; name : in String ) return Byte_Array_access; function Integer_Field( This : in Object; Id : in Query_ID; Fnumber : in Field_Number ) return Integer; function Integer_Field( This : in Object; Id : in Query_ID; Name : in String ) return Integer; function Float_Field( this : in Object; id : in Query_ID; fNumber : in Field_Number ) return Float; function Float_Field( This : in Object; Id : in Query_ID; Name : in String ) return Float; ---=====================================================================--- ---=== E X T E N S I O N ===--- ---=====================================================================--- ---=====================================================================--- private type Object_Data; type Object_Data_Access is access Object_Data; type Object is record Data : Object_Data_Access := null; end record; end GNU.DB.MySQL; gnade-1.6.2.orig/dbi/mysql/mysql.gpr0000644000175000017500000000120610027000434017144 0ustar lbrentalbrenta-- $Id: mysql.gpr,v 1.5 2004/03/20 08:30:20 merdmann Exp $ with "../../gnade" ; project MySQL is for Languages use ("Ada"); for Source_Dirs use ("."); for Object_Dir use "."; package Compiler is for Default_Switches ("Ada") use ( "-g", GNADE.IncludeOpt); end Compiler; package Builder is for Default_Switches ("Ada") use ("-s", "-m", "-g", "-gnatQ", GNADE.IncludeOpt); end Builder; package Binder is for Default_Switches ("Ada") use ("-static"); end Binder; package Linker is for Default_Switches ("Ada") use ("-g"); end Linker; end MySQL; gnade-1.6.2.orig/dbi/oci/0000755000175000017500000000000011040716276014711 5ustar lbrentalbrentagnade-1.6.2.orig/dbi/oci/oci-thick-strings.adb0000644000175000017500000004522711033070070020717 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Ada95 Interface to Oracle RDBMS -- -- Copyright (C) 2000-2006 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-thick-strings.adb,v 1.27 2008/07/03 06:22:48 vagul Exp $ with Ada.Exceptions; with Ada.Text_IO; with Ada.Unchecked_Deallocation; with OCI.Lib; with OCI.Thread; with System; package body OCI.Thick.Strings is use type Sb2; Debug_Mode : constant Boolean := False; First_Block_Length : constant := 64; Next_Block_Length : constant := 1024; type Access_Size_T is access all size_t; subtype Buffer_Access is System.Address; Null_Buffer : constant Buffer_Access := System.Null_Address; type A_A_Ub2 is access A_Ub2; type A_A_Sb2 is access A_Sb2; -- Type_Id : constant := OCI.Lib.SQLT_LNG; -- For 8.1.7 -- ??? Do not use OCI.Lib.SQLT_LNG type code becouse dynamic define -- under Oracle 9.x.x do not work correctly with it. -- Type_Id : constant := OCI.Lib.SQLT_CHR; -- For 9.xxx. -- ??? Do not use OCI.Lib.SQLT_CHR type code under Oracle 8.1.x becouse -- dynamic define do not work correctly with it. Type_Id : constant := OCI.Lib.SQLT_STR; -- Looks like both 8i and 9i oracle working reasonably with it. Nul_Terminated : constant Boolean := Type_Id = OCI.Lib.SQLT_STR; String_Max_Size : constant := 32767; procedure Debug_Print (Str : String); pragma Inline (Debug_Print); procedure Print_Error (Str : String); procedure Free is new Ada.Unchecked_Deallocation (char_array, Char_Array_Access); procedure Bind_Dynamic (Value : in out Var_Type); pragma Inline (Bind_Dynamic); procedure Complete (Item : in Var_Type); procedure Debug_Print (Prefix : in String; alenp : in Access_Size_T; piece : in Ub1; indp : in A_Sb2; rcodep : in A_Ub2); pragma Inline (Debug_Print); function Callback_In_Bind (ictxp : in Value_Access; bindp : in OCIBind; iter : in Ub4; index : in Ub4; bufpp : access Buffer_Access; alenp : in Access_Size_T; piecep : in A_Ub1; indpp : in A_A_Sb2) return SWord; pragma Convention (C, Callback_In_Bind); function Callback_Out_Bind (octxp : in Value_Access; bindp : in OCIBind; iter : in Ub4; index : in Ub4; bufpp : access Buffer_Access; alenpp : access Access_Size_T; piecep : in A_Ub1; indpp : in A_A_Sb2; rcodepp : in A_A_Ub2) return SWord; pragma Convention (C, Callback_Out_Bind); procedure Callback_Out (Value : in Value_Access; bufp : in out Buffer_Access; alenp : in out Access_Size_T; piece : in Ub1; indp : in out A_Sb2; rcodep : in out A_Ub2; Result : out SWord); function Callback_Define (octxp : in Value_Access; defnp : in OCIDefine; iter : in Ub4; bufpp : access Buffer_Access; alenpp : access Access_Size_T; piecep : in A_Ub1; indpp : in A_A_Sb2; rcodepp : in A_A_Ub2) return SWord; pragma Convention (C, Callback_Define); use type Sb4; ---------- -- Bind -- ---------- procedure Bind (Stmt : in Statement'Class; Value : in out Var_Type; Name : in String; Exist : out Boolean) is RC : constant SWord := OCIBindByName (Stmtp => OCIStmt (Handle (Stmt)), Bindpp => Value.Bind'Access, Errhp => OCI.Thread.Error, Placeholder => C.To_C (Name), Placeh_Len => Name'Length, Valuep => System.Null_Address, Value_Sz => String_Max_Size, Dty => Type_Id, Indp => null, Mode => OCI_DATA_AT_EXEC); begin Exist := not (RC = OCI_ERROR and then Last_Error_Code = 1036); if Exist then Check_Error (RC); Bind_Dynamic (Value); end if; if Debug_Mode then Value.Name := To_Unbounded_String (Name); end if; end Bind; procedure Bind (Stmt : in Statement'Class; Value : in out Var_Type; Name : in String) is begin Check_Error (OCIBindByName (Stmtp => OCIStmt (Handle (Stmt)), Bindpp => Value.Bind'Access, Errhp => OCI.Thread.Error, Placeholder => C.To_C (Name), Placeh_Len => Name'Length, Valuep => System.Null_Address, Value_Sz => String_Max_Size, Dty => Type_Id, Indp => null, Mode => OCI_DATA_AT_EXEC)); Bind_Dynamic (Value); if Debug_Mode then Value.Name := To_Unbounded_String (Name); end if; end Bind; procedure Bind (Stmt : in Statement'Class; Value : in out Var_Type; Position : in Positive) is begin Check_Error (OCIBindByPos (Stmtp => OCIStmt (Handle (Stmt)), Bindpp => Value.Bind'Access, Errhp => OCI.Thread.Error, Position => Ub4 (Position), Valuep => System.Null_Address, Value_Sz => String_Max_Size, Dty => Type_Id, Indp => null, Mode => OCI_DATA_AT_EXEC)); Bind_Dynamic (Value); end Bind; ------------------ -- Bind_Dynamic -- ------------------ procedure Bind_Dynamic (Value : in out Var_Type) is begin Check_Error (OCIBindDynamic (Bindp => Value.Bind, Errhp => OCI.Thread.Error, Ictxp => Value'Address, Icbfp => Callback_In_Bind'Address, Octxp => Value'Address, Ocbfp => Callback_Out_Bind'Address)); end Bind_Dynamic; --------------------- -- Callback_Define -- --------------------- function Callback_Define (octxp : in Value_Access; defnp : in OCIDefine; iter : in Ub4; bufpp : access Buffer_Access; alenpp : access Access_Size_T; piecep : in A_Ub1; indpp : in A_A_Sb2; rcodepp : in A_A_Ub2) return SWord is pragma Unreferenced (defnp, iter); Result : SWord; begin Callback_Out (Value => octxp, bufp => bufpp.all, alenp => alenpp.all, piece => piecep.all, indp => indpp.all, rcodep => rcodepp.all, Result => Result); return Result; end Callback_Define; ---------------------- -- Callback_In_Bind -- ---------------------- function Callback_In_Bind (ictxp : in Value_Access; bindp : in OCIBind; iter : in Ub4; index : in Ub4; bufpp : access Buffer_Access; alenp : in Access_Size_T; piecep : in A_Ub1; indpp : in A_A_Sb2) return SWord is Item : Value_Access renames ictxp; pragma Unreferenced (bindp, iter, index); begin Complete (Item.all); Debug_Print (Prefix => "in_ " & To_String (Item.Name), alenp => alenp, piece => piecep.all, indp => indpp.all, rcodep => null); indpp.all := Item.Indicator'Access; piecep.all := OCI_ONE_PIECE; if Item.Indicator = Null_Indicator then alenp.all := 0; bufpp.all := Null_Buffer; else if Nul_Terminated and then Item.Value /= null and then Item.Value (Item.alen - 1) /= nul then if Item.Value'Length > Item.alen then Item.Value (Item.alen) := nul; elsif Item.Value'Length = Item.alen then declare Ptr : constant Char_Array_Access := new char_array'(Item.Value.all & nul); begin Free (Item.Value); Item.Value := Ptr; end; else Print_Error ("In bind variable length error."); return OCI_ERROR; end if; Item.alen := Item.alen + 1; end if; alenp.all := Item.alen; bufpp.all := Item.Value.all'Address; end if; Debug_Print (Prefix => "_in " & To_String (Item.Name), alenp => alenp, piece => piecep.all, indp => indpp.all, rcodep => null); return OCI_CONTINUE; exception when E : others => Print_Error (Ada.Exceptions.Exception_Information (E)); return OCI_ERROR; end Callback_In_Bind; ------------------ -- Callback_Out -- ------------------ procedure Callback_Out (Value : in Value_Access; bufp : in out Buffer_Access; alenp : in out Access_Size_T; piece : in Ub1; indp : in out A_Sb2; rcodep : in out A_Ub2; Result : out SWord) is begin Debug_Print (Prefix => "out_ " & To_String (Value.Name), alenp => alenp, piece => piece, indp => indp, rcodep => rcodep); alenp := Value.alen'Access; indp := Value.Indicator'Access; rcodep := Value.rcode'Access; case piece is when OCI_ONE_PIECE | OCI_FIRST_PIECE => Value.Self := Value; if Value.Value = null then Value.Value := new char_array (0 .. First_Block_Length - 1); -- ??? For new allocated array put first byte to zero. -- Try to detect unwrited buffer. Value.Value (0) := nul; end if; -- To be sure that it was a first time. Free (Value.Next); bufp := Value.Value.all'Address; Value.alen := Value.Value'Length; when OCI_NEXT_PIECE => if Value.Next = null then Value.Next := new char_array (0 .. Next_Block_Length - 1); else declare Ptr : constant Char_Array_Access := new char_array'(Value.Value.all & Value.Next.all); begin Free (Value.Value); Value.Value := Ptr; end; end if; Value.alen := Value.Next'Length; bufp := Value.Next.all'Address; when OCI_LAST_PIECE => Complete (Value.all); when others => Print_Error ("piece = " & Ub1'Image (piece)); Result := OCI_ERROR; end case; Debug_Print (Prefix => "_out " & To_String (Value.Name), alenp => alenp, piece => piece, indp => indp, rcodep => rcodep); Result := OCI_CONTINUE; exception when E : others => Print_Error ("In callback " & Ada.Exceptions.Exception_Information (E)); Result := OCI_ERROR; end Callback_Out; ----------------------- -- Callback_Out_Bind -- ----------------------- function Callback_Out_Bind (octxp : in Value_Access; bindp : in OCIBind; iter : in Ub4; index : in Ub4; bufpp : access Buffer_Access; alenpp : access Access_Size_T; piecep : in A_Ub1; indpp : in A_A_Sb2; rcodepp : in A_A_Ub2) return SWord is pragma Unreferenced (bindp, iter, index); Result : SWord; begin Callback_Out (Value => octxp, bufp => bufpp.all, alenp => alenpp.all, piece => piecep.all, indp => indpp.all, rcodep => rcodepp.all, Result => Result); return Result; end Callback_Out_Bind; ----------------- -- Clear_Value -- ----------------- procedure Clear_Value (Var : in out Var_Type) is begin Var.alen := 0; Free (Var.Value); Free (Var.Next); Clear_Value (Inherited (Var)); end Clear_Value; -------------- -- Complete -- -------------- procedure Complete (Item : in Var_Type) is begin if Item.Self = null then return; end if; Debug_Print (Prefix => "end_ " & To_String (Item.Name), alenp => Item.Self.alen'Access, piece => 100, indp => Item.Self.Indicator'Access, rcodep => Item.Self.rcode'Access); if Item.Next /= null then declare Ptr : Char_Array_Access; begin if Nul_Terminated and Item.Next (Item.alen - 1) /= nul then Ptr := new char_array'(Item.Value.all & Item.Next (0 .. Item.alen - 1) & nul); Debug_Print ("Result was not null terminated."); else Ptr := new char_array'(Item.Value.all & Item.Next (0 .. Item.alen - 1)); end if; Free (Item.Self.Value); Free (Item.Self.Next); Item.Self.Value := Ptr; Item.Self.alen := Ptr'Length; end; elsif Item.alen = 0 then Free (Item.Self.Value); if Item.Indicator /= Null_Indicator then Debug_Print ("wrong null indicator" & Item.Indicator'Img); Item.Self.Indicator := Null_Indicator; end if; elsif Item.Value (0) = nul and then Item.Indicator = Null_Indicator then Free (Item.Self.Value); Item.Self.alen := 0; end if; if Item.alen /= 0 and then Item.Indicator = Null_Indicator then Debug_Print ("wrong not null indicator" & Item.Indicator'Img); Item.Self.Indicator := Not_Null_Indicator; end if; Debug_Print (Prefix => "_end " & To_String (Item.Name), alenp => Item.Self.alen'Access, piece => 100, indp => Item.Self.Indicator'Access, rcodep => Item.Self.rcode'Access); Item.Self.Self := null; end Complete; ----------------- -- Debug_Print -- ----------------- procedure Debug_Print (Str : String) is begin if Debug_Mode then Ada.Text_IO.Put_Line ("# " & Str); end if; end Debug_Print; procedure Debug_Print (Prefix : in String; alenp : in Access_Size_T; piece : in Ub1; indp : in A_Sb2; rcodep : in A_Ub2) is use Ada.Text_IO; use ASCII; begin if not Debug_Mode then return; end if; Put ("# " & Prefix & HT); if alenp = null then Put ("(null)"); else Put (alenp.all'Img); end if; Put (HT); case piece is when OCI_ONE_PIECE => Put ("ONE"); when OCI_FIRST_PIECE => Put ("FIRST"); when OCI_NEXT_PIECE => Put ("NEXT"); when OCI_LAST_PIECE => Put ("LAST"); when others => Put (piece'Img); end case; Put (HT); if indp = null then Put ("(null)"); else case indp.all is when Null_Indicator => Put ("Null"); when Not_Null_Indicator => Put ("Full"); when others => Put (indp.all'Img); end case; end if; Put (HT); if rcodep = null then Put ("(null)"); else Put (rcodep.all'Img); end if; New_Line; end Debug_Print; ------------ -- Define -- ------------ procedure Define (Stmt : in Statement'Class; Value : in out Var_Type; Position : in Positive) is Rc : SWord := OCIDefineByPos (Stmtp => OCIStmt (Handle (Stmt)), Defnpp => Value.Define'Access, Errhp => OCI.Thread.Error, Position => Ub4 (Position), Value => System.Null_Address, Value_Sz => String_Max_Size, Dty => Type_Id, Indp => null, Mode => OCI_DYNAMIC_FETCH); begin Check_Error (Rc); Rc := OCIDefineDynamic (Defnp => Value.Define, Errhp => OCI.Thread.Error, Octxp => Value'Address, Ocbfp => Callback_Define'Address); Check_Error (Rc); end Define; -------------- -- Finalize -- -------------- procedure Finalize (Object : in out Var_Type) is use type System.Address; begin Free (Object.Value); Free (Object.Next); OCI.Thick.Finalize (Limited_Variable (Object)); end Finalize; --------------- -- Get_Value -- --------------- function Get_Value (Var : Var_Type) return Unbounded_String is begin return To_Unbounded_String (Get_Value (Var)); end Get_Value; function Get_Value (Var : in Var_Type; Default : in String; Mode : in Default_Mode := Instead_Any) return String is begin Complete (Var); if not Is_Attached (Var) then if Mode = Instead_Not_Attached or Mode = Instead_Any then return Default; else raise Not_Attached; end if; elsif Is_Null (Var) then if Mode = Instead_Null or Mode = Instead_Any then return Default; else raise Null_Value; end if; else return To_Ada (Var.Value (0 .. Var.alen - 1) & nul); end if; end Get_Value; function Get_Value (Var : Var_Type) return String is begin Complete (Var); if Is_Null (Var) then raise Null_Value; end if; return To_Ada (Var.Value (0 .. Var.alen - 1) & nul); end Get_Value; ------------- -- Is_Null -- ------------- function Is_Null (Var : Var_Type) return Boolean is begin Complete (Var); return Is_Null (Inherited (Var)); end Is_Null; ----------------- -- Print_Error -- ----------------- procedure Print_Error (Str : String) is use Ada.Text_IO; begin Put_Line (Current_Error, Str); end Print_Error; --------------- -- Set_Value -- --------------- procedure Set_Value (Var : in out Var_Type; Value : Unbounded_String) is begin Set_Value (Var, To_String (Value)); end Set_Value; procedure Set_Value (Var : in out Var_Type; Value : String) is begin Free (Var.Value); Free (Var.Next); if Value = "" then Clear_Value (Var); else Var.Indicator := Not_Null_Indicator; Var.Value := new char_array' (To_C (Value, Append_Nul => Nul_Terminated)); Var.alen := Var.Value'Length; end if; end Set_Value; end OCI.Thick.Strings; gnade-1.6.2.orig/dbi/oci/oci-thick-strings.ads0000644000175000017500000000613010537157463020752 0ustar lbrentalbrenta----------------------------------------------------------------------------- -- Thin Ada95 binding to OCI™ (Oracle® Call Interface™) -- -- Copyright (C) 2000-2006 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-thick-strings.ads,v 1.16 2006/12/11 04:31:47 vagul Exp $ with Ada.Strings.Unbounded; with Interfaces.C; with OCI.Thick.Statements; package OCI.Thick.Strings is use OCI.Thick.Statements; use Ada.Strings.Unbounded; subtype Default_Mode is Thick.Default_Mode; type Var_Type is new Limited_Variable with private; subtype Variable is Var_Type; procedure Bind (Stmt : in Statement'Class; Value : in out Var_Type; Name : in String); procedure Bind (Stmt : in Statement'Class; Value : in out Var_Type; Name : in String; Exist : out Boolean); -- Exist would be set to True if the bind variable exist. -- otherwise the bind would not be done. procedure Bind (Stmt : in Statement'Class; Value : in out Var_Type; Position : in Positive); procedure Define (Stmt : in Statement'Class; Value : in out Var_Type; Position : in Positive); procedure Set_Value (Var : in out Var_Type; Value : String); procedure Set_Value (Var : in out Var_Type; Value : Unbounded_String); function Get_Value (Var : Var_Type) return Unbounded_String; function Get_Value (Var : Var_Type) return String; -- Raise exception in case of NULL data. function Get_Value (Var : in Var_Type; Default : in String; Mode : in Default_Mode := Instead_Any) return String; -- Returns Default string in case of Null or/else not attached data. function Is_Null (Var : Var_Type) return Boolean; procedure Clear_Value (Var : in out Var_Type); function Value (Var : Var_Type) return String renames Get_Value; function Value (Var : Var_Type) return Unbounded_String renames Get_Value; function Value (Var : in Var_Type; Default : in String; Mode : in Default_Mode := Instead_Any) return String renames Get_Value; function String_Value (Var : Var_Type) return String renames Get_Value; function Unbounded_String_Value (Var : Var_Type) return Unbounded_String renames Get_Value; private use Interfaces.C; type Char_Array_Access is access all char_array; type Value_Access is access all Var_Type; subtype Inherited is Limited_Variable; type Var_Type is new Inherited with record Name : Unbounded_String; -- Only for debug purpose. Value : Char_Array_Access; Next : Char_Array_Access; rcode : aliased Ub2 := 0; alen : aliased size_t := 0; Self : Value_Access; -- Only for complete. end record; procedure Finalize (Object : in out Var_Type); end OCI.Thick.Strings; gnade-1.6.2.orig/dbi/oci/ChangeLog0000644000175000017500000001546610537157463016506 0ustar lbrentalbrenta2005-11-29 Dmitriy Anisimkov * oci-thick-connections.ads, oci-thick-connections.adb: (User_Name): New routine. 2004-08-23 Dmitriy Anisimkov * oci-thick-date.ads, oci-thick-date.adb: (To_Ada): New routine. (To_OCI): New routine. 2004-06-28 Dmitriy Anisimkov * oci-thick-gen_ocinumber.ads: Add pragma inline. * oci-envcreate80.adb, oci-envcreate80.ads, oci-environments.adb, oci-environments.ads, oci-lib.ads, oci-reference_finalization.adb, oci-reference_finalization.ads, oci-thick-binds-lob.adb, oci-thick-binds-lob.ads, oci-thick-binds.adb, oci-thick-binds.ads, oci-thick-connections.ads, oci-thick-date.ads, oci-thick-debug_allocation.ads, oci-thick-gen_ocinumber.ads, oci-thick-integer_var.ads, oci-thick-lobs.adb, oci-thick-lobs.ads, oci-thick-long_float_var.ads, oci-thick-notifications.adb, oci-thick-notifications.ads, oci-thick-number_functions.adb, oci-thick-number_functions.ads, oci-thick-ocidate_var.ads, oci-thick-ocihandle_var.ads, oci-thick-ocinumber_var.ads, oci-thick-parameters.adb, oci-thick-parameters.ads, oci-thick-servers.adb, oci-thick-servers.ads, oci-thick-statements.adb, oci-thick-statements.ads, oci-thick-string_bounded.ads, oci-thick-string_var.adb, oci-thick-string_var.ads, oci-thick-strings.adb, oci-thick-strings.ads, oci-thick-var.ads, oci-thick-variable.adb, oci-thick-variable.ads, oci-thick.adb, oci-thick.ads, oci-thread.adb, oci-thread.ads, oci.ads: Fix style, end of line at end of file. Update copyright notice. 2004-04-20 Dmitriy Anisimkov * oci-thick-connections.adb: Reorder routines in alphabetical order. * oci-thick-strings.ads: (Default_Mode): Moved to oci-thick.ads. * oci-thick.ads: (Default_Mode): Moved from oci-thick-strings.ads. * oci-thick-string_bounded.ads, oci-thick-string_bounded.adb: (Get_Value): New routine with default value. 2004-03-16 Dmitriy Anisimkov * oci-envcreate80.adb, oci-envcreate80.ads, oci-environments.adb, oci-reference_finalization.adb, oci-reference_finalization.ads, oci-thick-binds.adb, oci-thick-connections.adb, oci-thick-date.adb, oci-thick-debug_allocation.adb, oci-thick-debug_allocation.ads, oci-thick-gen_ocinumber.adb, oci-thick-notifications.adb, oci-thick-notifications.ads, oci-thick-servers.adb, oci-thick-string_bounded.adb, oci-thick-string_bounded.ads, oci-thick.adb, oci-thread.adb, oci-thread.ads, oci.ads: GNAT style check -gnaty conformance. 2003-12-11 Dmitriy Anisimkov * oci-lib.ads: New constants. * oci-thick-parameters.ads, oci-thick-parameters.adb: Fix the getting of parameter type. 2003-11-24 Dmitriy Anisimkov * oci-thick-lobs.ads, * oci-thick-lobs.adb: (Is_Temporary): New routine. New Ind field in Lob type for multiply bind. * oci-thick-binds-lob.ads, oci-thick-binds-lob.adb: Move Indicator to the LOB type. 2003-09-16 Dmitriy Anisimkov * oci-lib.ads, oci-thread.ads, oci-thick-strings.ads, oci-thick-strings.adb, oci-thick-statements.adb, oci-thick-string_bounded.adb, oci-thick-variable.adb: Previous dynamic binding/defining implementation had an error and was not working with 9.2.0.3. 2003-09-03 Dmitriy Anisimkov * oci-thick-strings.ads, oci-thick-strings.adb: (Get_Value): New routine with possibility to get default value instead of null or in case of not attached variable. 2003-08-30 Dmitriy Anisimkov * oci-thick-variable.ads, oci-thick-variable.adb: (Get_Value): New routine with possibility to get default value instead of null or in case of not attached variable. 2003-07-25 Dmitriy Anisimkov * oci-thick-strings.ads, oci-thick-strings.adb: (Bind): New routine with Exist out parameter. 2003-07-01 Dmitriy Anisimkov * oci-thick.ads, oci-thick.adb, oci-thick-servers.ads, oci-thick-servers.adb, oci-thick-connections.ads, oci-thick-connections.adb, oci-thick-statements.ads, oci-thick-statements.adb: Add non-blocking mode. 2003-05-13 Dmitriy Anisimkov * oci-thick-statements.ads: Add undokumented Unknown statement type. * oci-thick-statements.adb: Minor reformatting. 2003-04-30 Dmitriy Anisimkov * oci-thick-strings.ads, oci-thick-strings.adb: (Get_Value): New routine with Default parameter. Minor reformatting. * oci-thick.ads, oci-thick.adb: (Attached): New routine. Minor reformatting. 2003-04-29 Dmitriy Anisimkov * oci-thick-statements.adb: (Prepare): Fix memory leak on prepare error. 2003-04-23 Dmitriy Anisimkov * oci-thick-notifications.adb: Auto set OCI_EVENT environment flag on elaboration. Minor reformatting. 2003-04-15 Dmitriy Anisimkov * oci-reference_finalization.ads: (Counter): Change initial counter to 1. (Controlled_Reference): Remove inital null for Refer, Ada would do it. * oci-reference_finalization.adb: Alphabetical routines reorder. * oci-thick-debug_allocation.adb: Add counters for descriptors. * oci-thick-parameters.ads, oci-thick-parameters.adb: Minor reformat. And some optimization for controlled types. 2003-04-01 Dmitriy Anisimkov * oci-thick-date.ads, oci-thick-date.adb, oci-thick-number_functions.ads, oci-thick-number_functions.adb: Automatically initialize environment in the Object mode if necessary. Minor reformatting. 2003-03-18 Dmitriy Anisimkov * oci-envcreate80.ads, oci-envcreate80.adb: (OCIEnvCreate): Remove default values. 2003-02-10 Dmitriy Anisimkov * oci-environments.ads, oci-environments.adb: (Set_Create_Mode_Flag): New routine. * oci-lib.ads: New constants from OCI. (OCIDateFromText): New routine bind. (OCIDateCompare): New routine bind. (OCISubscriptionRegister): New routine bind. (OCISubscriptionUnRegister): New routine bind. (OCISubscriptionEnable): New routine bind. (OCISubscriptionDisable): New routine bind. (OCISubscriptionPost): New routine bind. * oci-thick-strings.adb: Some improvements and fixing logic. * oci-thick-var.ads: Remove unnecessary routine renames. * oci-thick.ads, oci-thick.adb: (Set_Events_Support): New routine. (Set_Objects_Support): New routine. (To_String): Moved to the oci-thick-data.ads. (SysDate): Moved to the oci-thick-data.ads. (Init_OCIDate): Constant moved to the oci-thick-data.ads. * oci-thick-date.ads, oci-thick-date.adb: New package for the OCIDate operations. * oci-reference_finalization.ads, oci-reference_finalization.adb: New package instead of old reference_finalization.ad?. * oci-thick-notifications.ads, oci-thick-notifications.adb: New package for the Oracle Subscribe/Notification functionality.gnade-1.6.2.orig/dbi/oci/MANIFEST0000644000175000017500000000214407432011401016027 0ustar lbrentalbrentaMANIFEST Makefile liboci.adb oci-envcreate80.adb oci-envcreate80.ads oci-environments.adb oci-environments.ads oci-lib.ads oci-thick-binds-lob.adb oci-thick-binds-lob.ads oci-thick-binds.adb oci-thick-binds.ads oci-thick-connections.adb oci-thick-connections.ads oci-thick-debug_allocation.adb oci-thick-debug_allocation.ads oci-thick-description.adb oci-thick-gen_ocinumber.adb oci-thick-gen_ocinumber.ads oci-thick-integer_var.ads oci-thick-lobs.adb oci-thick-lobs.ads oci-thick-long_float_var.ads oci-thick-number_functions.adb oci-thick-number_functions.ads oci-thick-ocidate_var.ads oci-thick-ocihandle_var.ads oci-thick-ocinumber_var.ads oci-thick-parameters.adb oci-thick-parameters.ads oci-thick-servers.adb oci-thick-servers.ads oci-thick-statements.adb oci-thick-statements.ads oci-thick-string_bounded.adb oci-thick-string_bounded.ads oci-thick-string_var.adb oci-thick-string_var.ads oci-thick-strings.adb oci-thick-strings.ads oci-thick-var.ads oci-thick-variable.adb oci-thick-variable.ads oci-thick.adb oci-thick.ads oci-thread.adb oci-thread.ads oci.ads reference_finalization.adb reference_finalization.ads gnade-1.6.2.orig/dbi/oci/Makefile0000644000175000017500000001070710027400162016342 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## Ada Database Objects (ADO) - Makefile -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/dbi/oci/Makefile,v $ ## Description : Makefile for OCI bindings ## Author : Michael Erdmann ## Created On : 31.12.2001 ## Last Modified By: $Author: merdmann $ ## Last Modified On: $Date: 2004/03/21 20:52:02 $ ## Version : $Revision: 1.11 $ ## Status : $State: Exp $ ## -- ## Copyright (C) 2000-2001 -- ## -- ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## This package is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## Contact -- ## ======= -- ## Error reports shall be handled via http://gnade.sourceforge.net -- ## Features and ideas via: gnade-develop@lists.sourceforge.net -- ## -- ## Author contact: -- ## purl:/net/michael.erdmann -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## ## Restrictions ## ============ ## None ## ## References ## ========== ## None ## ## ## include ../../make.conf #DEBUGFLAGS = -funwind-tables -gnata ADAFLAGS = $(DEBUGFLAGS) -gnatf -a -I$(ADAINCLUDE) -g libname=libgnadeoci ## ## ## all:: $(PREPROCESSED_SOURCES) $(ADAMAKE) -d -Poci.gpr -XINCLUDE=$(includedir) -u ifneq ($(EXPORT),) $(MAKE) install endif ## ## ## install:: $(ADAINSTALL) $(includedir) $(wildcard oci-*.ad* oci-*.ali) $(MKSTATIC) $(libdir) $(libname).a $(MKSHARED) $(libdir) $(MINOR) $(MAJOR) $(libname).so ## ## ## clean :: ifeq ($(EXPORT),) $(ADAUINSTALL) $(includedir) $(wildcard $(includedir)/oci-*.ad* $(includedir)/oci-*.ali) endif $(RM) *.o *.ali core b~*.ad* *.ali *~ *.bak gnade-1.6.2.orig/dbi/oci/oci-thick-var.ads0000644000175000017500000000132110537157463020046 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Thin Ada95 binding to OCI™ (Oracle® Call Interface™) -- -- Copyright (C) 2000-2006 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-thick-var.ads,v 1.7 2006/12/11 04:31:47 vagul Exp $ with OCI.Thick.Variable; generic type Variable_Type is private; Type_Id : in Ub2; package OCI.Thick.Var is package V is new OCI.Thick.Variable (Variable_Type); type Variable is new V.Var_Type (Type_Id) with null record; end OCI.Thick.Var; gnade-1.6.2.orig/dbi/oci/Makefile.oci0000644000175000017500000000752410027000434017114 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## Ada Database Objects (ADO) - Makefile -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/dbi/oci/Makefile.oci,v $ ## Description : Makefile for OCI bindings ## Author : Michael Erdmann ## Created On : 31.12.2001 ## Last Modified By: $Author: merdmann $ ## Last Modified On: $Date: 2004/03/20 08:30:20 $ ## Version : $Revision: 1.1 $ ## Status : $State: Exp $ ## -- ## Copyright (C) 2000-2001 -- ## -- ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## This package is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## Contact -- ## ======= -- ## Error reports shall be handled via http://gnade.sourceforge.net -- ## Features and ideas via: gnade-develop@lists.sourceforge.net -- ## -- ## Author contact: -- ## purl:/net/michael.erdmann -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## ## Restrictions ## ============ ## None ## ## References ## ========== ## None ## ## ## build all: $(MAKE) -C./ $@ gnade-1.6.2.orig/dbi/oci/oci-thick.adb0000644000175000017500000002776111033070070017233 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Thin Ada95 binding to OCI™ (Oracle® Call Interface™) -- -- Copyright (C) 2000-2006 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-thick.adb,v 1.25 2008/07/03 06:22:48 vagul Exp $ with Ada.Exceptions, Ada.Text_IO, OCI.Thread, OCI.Environments; package body OCI.Thick is use type SWord; use type Ub4; use type OCIHandle; procedure Print_Error (Msg : String); procedure Check_Error (Code : in SWord; Handle : in OCIError; Htype : in Integer; Raise_Error : in Boolean); ---------------------- -- Alloc_Descriptor -- ---------------------- function Alloc_Descriptor (Parent : in OCIEnv; Htype : in Ub4) return OCIHandle is Result : aliased OCIHandle := Empty_Handle; begin if OCIDescriptorAlloc (Parenth => Parent, Descpp => Result'Access, Htype => Htype) /= OCI_SUCCESS then raise Invalid_Handle; end if; return Result; end Alloc_Descriptor; ------------------ -- Alloc_Handle -- ------------------ function Alloc_Handle (Parent : in OCIEnv; Htype : in Ub4) return OCIHandle is Result : aliased OCIHandle := Empty_Handle; begin if OCIHandleAlloc (Parenth => OCIHandle (Parent), Hndlpp => Result'Access, Htype => Htype) /= OCI_SUCCESS then raise Invalid_Handle; end if; return Result; end Alloc_Handle; ----------------- -- Check_Error -- ----------------- procedure Check_Error (Code : in SWord; Handle : in OCIError; Htype : in Integer; Raise_Error : in Boolean) is use Ada.Exceptions; Bufp : aliased C.char_array := (0 .. 2047 => C.nul); Errcodep : aliased Sb4 := 0; Rc : SWord; procedure Error (Except : Exception_Id; Msg : String); ----------- -- Error -- ----------- procedure Error (Except : Exception_Id; Msg : String) is begin if Raise_Error then Raise_Exception (Except, Msg); else Print_Error (Msg); end if; end Error; begin case Code is when OCI_ERROR | OCI_NO_DATA | OCI_SUCCESS_WITH_INFO => Rc := OCIErrorGet (Hndlp => Handle, Errcodep => Errcodep'Access, Bufp => CStr.To_Chars_Ptr (Bufp'Unchecked_Access), Bufsiz => Bufp'Length - 1, Htype => Ub4 (Htype)); if Rc = OCI_SUCCESS then Error (Lib_Error'Identity, C.To_Ada (Bufp)); else Error (Lib_Error'Identity, "Error code:" & SWord'Image (Code) & ASCII.LF & "Return error code:" & SWord'Image (Rc) & ASCII.LF & "Output error code:" & Sb4'Image (Errcodep) & ASCII.LF & "Message:" & C.To_Ada (Bufp)); end if; when OCI_INVALID_HANDLE => Error (Invalid_Handle'Identity, "Invalid handle"); when OCI_SUCCESS => null; when others => Error (Constraint_Error'Identity, "Error code" & SWord'Image (Code)); end case; end Check_Error; procedure Check_Error (Code : in SWord; Raise_Exception : in Boolean := True) is begin Check_Error (Code, Thread.Error, OCI_HTYPE_ERROR, Raise_Exception); end Check_Error; ----------------- -- Clear_Value -- ----------------- procedure Clear_Value (Var : in out Limited_Variable) is begin Var.Indicator := Null_Indicator; end Clear_Value; -------------------- -- Client_Version -- -------------------- function Client_Version return String is Major_Version : aliased SWord; Minor_Version : aliased SWord; Update_Num : aliased SWord; Patch_Num : aliased SWord; Port_Update_Num : aliased SWord; function Image (Item : in SWord) return String; function Image (Item : in SWord) return String is Img : constant String := SWord'Image (Item); begin if Img (1) = ' ' then return Img (2 .. Img'Last); else return Img; end if; end Image; begin OCIClientVersion (Major_Version => Major_Version'Access, Minor_Version => Minor_Version'Access, Update_Num => Update_Num'Access, Patch_Num => Patch_Num'Access, Port_Update_Num => Port_Update_Num'Access); return Image (Major_Version) & '.' & Image (Minor_Version) & '.' & Image (Update_Num) & '.' & Image (Patch_Num) & '.' & Image (Port_Update_Num); end Client_Version; ---------- -- Free -- ---------- procedure Free (H : in out OCIHandle; HType : Ub4) is Rc : SWord; begin if H = Empty_Handle then return; end if; Rc := OCIHandleFree (H, HType); H := Empty_Handle; Check_Error (Rc, Raise_Exception => False); end Free; -------------- -- Get_Attr -- -------------- function Get_Attr (Param : in OCIHandle; HType : in Ub4; Attr : in Ub4) return String is Buff : aliased CStr.chars_ptr; Rsize : aliased Ub4; begin Check_Error (Lib.OCIAttrGet (Trgthndlp => Param, Trghndltyp => HType, Attributep => Buff'Access, Sizep => Rsize'Access, Attrtype => Attr, Errhp => Thread.Error)); if CStr."=" (Buff, CStr.Null_Ptr) then return ""; else return C.To_Ada (CStr.Value (Buff, C.size_t (Rsize)), False); end if; end Get_Attr; function Get_Attr_G (H : in OCIHandle; HType : in Ub4; Attr : in Ub4) return Result_Type is Result : aliased Result_Type; Size : aliased Ub4 := Result_Type'Size / Ub1'Size; begin Check_Error (OCIAttrGet (Trgthndlp => H, Trghndltyp => HType, Attributep => Result'Address, Sizep => Size'Unchecked_Access, Attrtype => Attr, Errhp => Thread.Error)); -- Looks like Oracle does not get/set the attribute sizes for scalar, -- but anyway we use to check. So we do everithing possible for -- safety programming. if Size /= Result_Type'Size / Ub1'Size then raise Program_Error with "Attribute size" & Ub4'Image (Size) & " /=" & Ub4'Image (Result_Type'Size / Ub1'Size); end if; return Result; end Get_Attr_G; ------------ -- Handle -- ------------ function Handle (Ref : Handle_Reference'Class) return OCIHandle is begin return Ref.Handle; end Handle; ------------------ -- Ignore_Error -- ------------------ procedure Ignore_Error (Code : in SWord) is pragma Unreferenced (Code); begin null; end Ignore_Error; ----------------- -- Is_Attached -- ----------------- function Is_Attached (Var : Limited_Variable) return Boolean is begin return Is_Binded (Var) or Is_Defined (Var); end Is_Attached; --------------- -- Is_Binded -- --------------- function Is_Binded (Var : in Limited_Variable) return Boolean is begin return Var.Bind /= OCIBind (Empty_Handle); end Is_Binded; ---------------- -- Is_Defined -- ---------------- function Is_Defined (Var : in Limited_Variable) return Boolean is begin return Var.Define /= OCIDefine (Empty_Handle); end Is_Defined; ------------- -- Is_Null -- ------------- function Is_Null (Var : Limited_Variable) return Boolean is use type Sb2; begin if not Is_Attached (Var) then raise Not_Attached; end if; return Var.Indicator = Null_Indicator; end Is_Null; ------------------------ -- Is_Objects_Support -- ------------------------ function Is_Objects_Support return Boolean is begin return Environments.Is_Objects; end Is_Objects_Support; --------------------- -- Last_Error_Code -- --------------------- function Last_Error_Code return Integer is Errcodep : aliased Sb4 := 0; begin if OCIErrorGet (Hndlp => Thread.Error, Errcodep => Errcodep'Access, Bufp => CStr.Null_Ptr, Bufsiz => 0, Htype => OCI_HTYPE_ERROR) /= OCI_SUCCESS then null; -- ??? end if; return Integer (Errcodep); end Last_Error_Code; ------------------------ -- Last_Error_Message -- ------------------------ function Last_Error_Message (Record_No : in Integer := 1) return String is Errcodep : aliased Sb4 := 0; Bufp : aliased C.char_array := (0 .. 4095 => C.nul); begin if Lib.OCIErrorGet (Hndlp => Thread.Error, Errcodep => Errcodep'Access, Recordno => Ub4 (Record_No), Bufp => CStr.To_Chars_Ptr (Bufp'Unchecked_Access), Bufsiz => Bufp'Length - 1, Htype => OCI_HTYPE_ERROR) /= OCI_SUCCESS then null; -- ??? end if; return C.To_Ada (Bufp); end Last_Error_Message; ----------------------- -- Last_Error_Offset -- ----------------------- function Last_Error_Offset return Natural is function Get_Attrib is new Get_Attr_G (Ub4); begin return Natural (Get_Attrib (OCIHandle (Thread.Error), OCI_HTYPE_ERROR, OCI_ATTR_DML_ROW_OFFSET)); end Last_Error_Offset; ----------------- -- Print_Error -- ----------------- procedure Print_Error (Msg : String) is use Ada.Text_IO; begin Put_Line (Current_Error, Msg); end Print_Error; -------------- -- Set_Attr -- -------------- procedure Set_Attr (H : in OCIHandle; HType : in Ub4; Attr : in Ub4; Value : in String) is begin Check_Error (OCIAttrSet (Trgthndlp => H, Trghndltyp => HType, Attributep => C.To_C (Value), Size => Value'Length, Attrtype => Attr, Errhp => Thread.Error)); end Set_Attr; procedure Set_Attr (H : in OCIHandle; HType : in Ub4; Attr : in Ub4; Value : in OCIHandle) is begin Check_Error (OCIAttrSet (Trgthndlp => H, Trghndltyp => HType, Attributep => Value, Size => 0, Attrtype => Attr, Errhp => Thread.Error)); end Set_Attr; ------------------------ -- Set_Events_Support -- ------------------------ procedure Set_Events_Support is begin OCI.Environments.Set_Create_Mode_Flag (OCI_EVENTS); end Set_Events_Support; ------------------------- -- Set_Objects_Support -- ------------------------- procedure Set_Objects_Support is begin OCI.Environments.Set_Create_Mode_Flag (OCI_OBJECT); end Set_Objects_Support; -------------------------------- -- Task_Dedicated_Environment -- -------------------------------- procedure Task_Dedicated_Environment is begin if not Thread.Synch.Task_Dedicated_Environment then raise Too_Late_For_Dedicated_Environment; end if; end Task_Dedicated_Environment; --------------- -- Task_Done -- --------------- procedure Task_Done (T : Task_Id := Current_Task) is begin Thread.Attributes.Reinitialize (T); end Task_Done; end OCI.Thick; gnade-1.6.2.orig/dbi/oci/gnade-oci.gpr0000644000175000017500000000152510670447772017266 0ustar lbrentalbrenta-- $Id: gnade-oci.gpr,v 1.1 2007/09/08 07:32:10 persan Exp $ with "../../gnade"; with "../../support/gnade-support.gpr"; project Gnade.oci is for Languages use ("Ada"); for Source_Dirs use ("."); for Object_Dir use "lib-obj"; for library_name use "gnadeoci"; for Library_Kind use "static"; for Library_dir use project'Object_Dir & "/lib"; package Compiler is for Default_Switches ("Ada") use Gnade.Compiler'Default_Switches ("Ada"); end Compiler; package Builder is for Default_Switches ("Ada") use Gnade.Builder'Default_Switches ("Ada"); end Builder; package Binder is for Default_Switches ("Ada") use Gnade.Binder'Default_Switches ("Ada"); end Binder; package Linker is for Default_Switches ("Ada") use Gnade.Builder'Default_Switches ("Ada"); end Linker; end Gnade.oci; gnade-1.6.2.orig/dbi/oci/oci-thick.ads0000644000175000017500000000754110721036456017263 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Ada95 Interface to Oracle RDBMS -- -- Copyright (C) 2000-2006 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-thick.ads,v 1.24 2007/11/21 14:14:06 vagul Exp $ with Ada.Finalization, Ada.Strings.Bounded, Ada.Task_Identification, System, OCI.Lib, OCI.Reference_Finalization; package OCI.Thick is package RF renames Reference_Finalization; use Lib; use Ada.Task_Identification; package Bind_Names is new Ada.Strings.Bounded.Generic_Bounded_Length (30); subtype OCINumber is Lib.OCINumber; type Default_Mode is (Instead_Null, Instead_Not_Attached, Instead_Any); type Limited_Variable is tagged limited private; procedure Clear_Value (Var : in out Limited_Variable); function Is_Attached (Var : in Limited_Variable) return Boolean; pragma Inline (Is_Attached); function Is_Binded (Var : in Limited_Variable) return Boolean; pragma Inline (Is_Binded); function Is_Defined (Var : in Limited_Variable) return Boolean; pragma Inline (Is_Defined); function Is_Null (Var : in Limited_Variable) return Boolean; Invalid_Handle : exception; Lib_Error : exception; Null_Value : exception; Not_Attached : exception; -- trying get not attached variable Too_Late_For_Dedicated_Environment : exception; function Last_Error_Code return Integer; function Last_Error_Message (Record_No : Integer := 1) return String; function Last_Error_Offset return Natural; -- Return position of last error in the DML statement. type Handle_Reference is abstract new RF.Controlled_Reference with private; procedure Check_Error (Code : SWord; Raise_Exception : Boolean := True); pragma Inline (Check_Error); procedure Ignore_Error (Code : SWord); pragma Inline (Ignore_Error); procedure Task_Dedicated_Environment; procedure Task_Done (T : Task_Id := Current_Task); -- Call it, when you are sure about using the task is done. procedure Set_Events_Support; -- Set the Event support. -- Should call before first OCI call. procedure Set_Objects_Support; -- Set the object support. -- Should call before first OCI call. function Is_Objects_Support return Boolean; pragma Inline (Is_Objects_Support); function Client_Version return String; private function Handle (Ref : Handle_Reference'Class) return System.Address; pragma Inline (Handle); type Handle_Reference is abstract new RF.Controlled_Reference with record Handle : aliased OCIHandle := Empty_Handle; end record; package AF renames Ada.Finalization; type Limited_Variable is new AF.Limited_Controlled with record Indicator : aliased Sb2 := Null_Indicator; Bind : aliased OCIBind := OCIBind (Empty_Handle); Define : aliased OCIDefine := OCIDefine (Empty_Handle); end record; procedure Free (H : in out OCIHandle; HType : in Ub4); function Alloc_Handle (Parent : in OCIEnv; Htype : in Ub4) return OCIHandle; function Alloc_Descriptor (Parent : in OCIEnv; Htype : in Ub4) return OCIHandle; function Get_Attr (Param : in OCIHandle; HType : in Ub4; Attr : in Ub4) return String; generic type Result_Type is private; function Get_Attr_G (H : in OCIHandle; HType : in Ub4; Attr : in Ub4) return Result_Type; pragma Inline (Get_Attr_G); procedure Set_Attr (H : in OCIHandle; HType : in Ub4; Attr : in Ub4; Value : in String); procedure Set_Attr (H : in OCIHandle; HType : in Ub4; Attr : in Ub4; Value : in OCIHandle); end OCI.Thick; gnade-1.6.2.orig/dbi/oci/oci-envcreate80.adb0000644000175000017500000000453411033070070020246 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Thin Ada95 binding to OCI™ (Oracle® Call Interface™) -- -- Copyright (C) 2000-2006 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-envcreate80.adb,v 1.11 2008/07/03 06:22:48 vagul Exp $ package body OCI.EnvCreate80 is Flag : Boolean := False; ----------------------- -- Not_Implemented_2 -- ----------------------- function Not_Implemented_2 return SWord is begin raise Not_Implemented_In_This_Version; return OCI_ERROR; end Not_Implemented_2; ------------------ -- OCIEnvCreate -- ------------------ function OCIEnvCreate (Envh : access OCIEnv; Mode : in Ub4; Ctxp : in DVoid; Malocfp : in DVoid; Ralocfp : in DVoid; Mfreefp : in DVoid; Xtramemsz : in C.size_t; Usrmempp : in Undefined) return SWord is use type Ub4; use type SWord; Init_Mode : Ub4 := 0; Rc : SWord; begin if not Flag then Rc := OCIInitialize (Mode => Mode and (OCI_THREADED + OCI_OBJECT + OCI_EVENTS + OCI_SHARED), Ctxp => Ctxp, Malocfp => Malocfp, Ralocfp => Ralocfp, Mfreefp => Mfreefp); if Rc = OCI_SUCCESS then Flag := True; else return Rc; end if; end if; if (Mode and OCI_NO_UCB) /= 0 then Init_Mode := OCI_ENV_NO_UCB; end if; if (Mode and OCI_NO_MUTEX) /= 0 then Init_Mode := Init_Mode or OCI_ENV_NO_MUTEX; end if; return OCIEnvInit (Envh, Init_Mode, Xtramemsz, Usrmempp); end OCIEnvCreate; function OCILobCreateTemporary (svchp : OCISvcCtx; errhp : OCIError; locp : OCILobLocator; csid : Ub2; csfrm : Ub1; lobtype : Ub1; cache : C.int; duration : OCIDuration) return SWord is begin raise Not_Implemented_In_This_Version; return OCI_ERROR; end OCILobCreateTemporary; end OCI.EnvCreate80; gnade-1.6.2.orig/dbi/oci/oci-thread.adb0000644000175000017500000001017610562562417017411 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Ada95 Interface to Oracle RDBMS -- -- Copyright (C) 2000-2006 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-thread.adb,v 1.13 2007/02/08 08:53:35 vagul Exp $ with Interfaces.C; package body OCI.Thread is Global_Env : Thread_Environment := Init_Environment; procedure Create (Error : in out Error_Type); procedure Ignore_Error (Code : in SWord); pragma Inline (Ignore_Error); ------------ -- Create -- ------------ procedure Create (Error : in out Error_Type) is HErr : aliased OCIHandle := Empty_Handle; Error_Handle_Creation_Error : exception; Environment_Should_Be_Created_First : exception; use type Interfaces.C.int; begin if Error.Environment.Handle = OCIEnv (Empty_Handle) then raise Environment_Should_Be_Created_First; end if; if Error.Handle /= OCIError (Empty_Handle) then Ignore_Error (OCIHandleFree (OCIHandle (Error.Handle), OCI_HTYPE_ERROR)); end if; if OCIHandleAlloc (Parenth => OCIHandle (Error.Environment.Handle), Hndlpp => HErr'Access, Htype => OCI_HTYPE_ERROR) /= OCI_SUCCESS then raise Error_Handle_Creation_Error; end if; Error.Handle := OCIError (HErr); end Create; ----------------- -- Environment -- ----------------- function Environment return OCIEnv is Env : constant OCIEnv := Attributes.Reference.Environment.Handle; begin if Env = OCIEnv (Empty_Handle) then return Synch.Environment.Handle; else return Env; end if; end Environment; ----------- -- Error -- ----------- function Error return OCIError is Ptr : constant Attributes.Attribute_Handle := Attributes.Reference; Dummy : OCIEnv; pragma Warnings (Off, Dummy); begin if Ptr.Handle = OCIError (Empty_Handle) then Dummy := Environment; Create (Ptr.all); end if; return Ptr.Handle; end Error; -------------- -- Finalize -- -------------- procedure Finalize (Object : in out Error_Type) is begin if Object.Handle /= OCIError (Empty_Handle) then Ignore_Error (OCIHandleFree (OCIHandle (Object.Handle), OCI_HTYPE_ERROR)); end if; end Finalize; ------------------ -- Ignore_Error -- ------------------ procedure Ignore_Error (Code : in SWord) is pragma Unreferenced (Code); begin null; end Ignore_Error; ----------- -- Synch -- ----------- protected body Synch is ----------------- -- Environment -- ----------------- function Environment return Thread_Environment is Envr : OCIEnv renames Thread.Attributes.Reference.Environment.Handle; begin if Envr = OCIEnv (Empty_Handle) then if Global_Env.Handle = OCIEnv (Empty_Handle) then Global_Env := Create; end if; Attributes.Reference.Environment := Global_Env; end if; return Attributes.Reference.Environment; end Environment; -------------------------------- -- Task_Dedicated_Environment -- -------------------------------- function Task_Dedicated_Environment return Boolean is begin if Thread.Attributes.Reference.Environment.Handle /= OCIEnv (Empty_Handle) then return False; else Attributes.Reference.Environment := Create; return True; end if; end Task_Dedicated_Environment; end Synch; --------------- -- Set_Error -- --------------- procedure Set_Error (Env : OCIEnv; Err : OCIError) is begin Attributes.Reference.Environment := (RF.Controlled_Reference with Handle => Env); Attributes.Reference.Handle := Err; end Set_Error; end OCI.Thread; gnade-1.6.2.orig/dbi/oci/oci-envcreate80.ads0000644000175000017500000000312010747250504020272 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Ada95 Interface to Oracle RDBMS -- -- Copyright (C) 2000-2006 Dmitriy Anisimkov. -- -- License text and authors contact information are in the file oci.ads -- ------------------------------------------------------------------------------ -- Do not with this module to the application by the regular way. -- This package only for the Oracle 8.0.x, and could be compiled separately, -- and object file should be linked to the application as a just an -- object file. -- $Id: oci-envcreate80.ads,v 1.11 2008/01/28 03:51:32 vagul Exp $ with OCI.Lib; package OCI.EnvCreate80 is use OCI.Lib; function OCIEnvCreate (Envh : access OCIEnv; Mode : in Ub4; Ctxp : in DVoid; Malocfp : in DVoid; Ralocfp : in DVoid; Mfreefp : in DVoid; Xtramemsz : in C.size_t; Usrmempp : in Undefined) return SWord; pragma Export (C, OCIEnvCreate, "OCIEnvCreate"); Not_Implemented_In_This_Version : exception; function OCILobCreateTemporary (svchp : OCISvcCtx; errhp : OCIError; locp : OCILobLocator; csid : Ub2; csfrm : Ub1; lobtype : Ub1; cache : C.int; duration : OCIDuration) return SWord; function Not_Implemented_2 return SWord; pragma Export (C, OCILobCreateTemporary, "OCILobCreateTemporary"); pragma Export (C, Not_Implemented_2, "OCILobFreeTemporary"); end OCI.EnvCreate80; gnade-1.6.2.orig/dbi/oci/oci-thread.ads0000644000175000017500000000325010537157463017430 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Thin Ada95 binding to OCI™ (Oracle® Call Interface™) -- -- Copyright (C) 2000-2006 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-thread.ads,v 1.10 2006/12/11 04:31:47 vagul Exp $ with Ada.Finalization, Ada.Task_Attributes, OCI.Lib, OCI.Environments; use OCI.Environments, OCI.Lib; private package OCI.Thread is function Error return OCIError; function Environment return OCIEnv; protected Synch is function Environment return Thread_Environment; -- Returun Environment of current task -- every task has the same environment by default. function Task_Dedicated_Environment return Boolean; -- Creates environment for current task only -- Should be called before first call to the library -- in this thread or never. end Synch; procedure Set_Error (Env : OCIEnv; Err : OCIError); -- for initalize from Extproc Context type Error_Type is new Ada.Finalization.Controlled with record Handle : OCIError := OCIError (Empty_Handle); Environment : Thread_Environment; end record; procedure Finalize (Object : in out Error_Type); Init_Error : constant Error_Type := (Ada.Finalization.Controlled with Handle => OCIError (Empty_Handle), Environment => Init_Environment); package Attributes is new Ada.Task_Attributes (Error_Type, Init_Error); end OCI.Thread; gnade-1.6.2.orig/dbi/oci/oci-environments.adb0000644000175000017500000001177210613624255020670 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Thin Ada95 binding to OCI™ (Oracle® Call Interface™) -- -- Copyright (C) 2000-2006 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-environments.adb,v 1.12 2007/04/25 10:08:45 vagul Exp $ with Ada.Text_IO; with System; package body OCI.Environments is use type SWord, Ub4, OCIHandle; Create_Mode : Ub4 := OCI_THREADED; Memory_Fill_Byte : Integer := -1; pragma Atomic (Memory_Fill_Byte); Counter_Value : Integer := 0; pragma Atomic (Counter_Value); procedure Counter_Add (It : Integer); pragma Inline (Counter_Add); function Alloc_Memory (ctxp : in System.Address; Size : in Integer) return System.Address; pragma Convention (C, Alloc_Memory); function Realloc_Memory (ctxp : in System.Address; Memptr : in System.Address; Size : in Integer) return System.Address; pragma Convention (C, Realloc_Memory); procedure Free_Memory (ctxp : in System.Address; Memptr : in System.Address); pragma Convention (C, Free_Memory); function Malloc (Size : in Integer) return System.Address; pragma Import (C, Malloc, "__gnat_malloc"); procedure Free (Address : in System.Address); pragma Import (C, Free, "__gnat_free"); function Realloc (Ptr : in System.Address; Size : in Integer) return System.Address; pragma Import (C, Realloc, "__gnat_realloc"); function memset (S : System.Address; C : Integer; N : Integer) return System.Address; pragma Import (C, memset, "memset"); ------------------ -- Alloc_Memory -- ------------------ function Alloc_Memory (ctxp : in System.Address; Size : in Integer) return System.Address is pragma Unreferenced (ctxp); begin Counter_Add (1); Last_Size := Size; if Memory_Fill_Byte >= 0 then return memset (Malloc (Size), Memory_Fill_Byte, Size); else return Malloc (Size); end if; end Alloc_Memory; ------------- -- Counter -- ------------- package body Counter is ----------- -- Value -- ----------- function Value return Integer is begin return Counter_Value; end Value; end Counter; ----------------- -- Counter_Add -- ----------------- procedure Counter_Add (It : Integer) is begin Counter_Value := Counter_Value + It; end Counter_Add; ------------ -- Create -- ------------ function Create return Thread_Environment is Env : aliased OCIEnv := OCIEnv (Empty_Handle); Rc : SWord; Environment : Thread_Environment; begin Rc := OCIEnvCreate (Env'Access, Create_Mode, Malocfp => Alloc_Memory'Address, Ralocfp => Realloc_Memory'Address, Mfreefp => Free_Memory'Address); if Rc /= OCI_SUCCESS then raise Environment_Creation_Error; end if; Environment.Handle := Env; return Environment; end Create; ------------- -- Destroy -- ------------- procedure Destroy (Object : in out Thread_Environment) is Rc : SWord; use Ada.Text_IO; begin if Object.Handle /= OCIEnv (Empty_Handle) then Rc := OCIHandleFree (OCIHandle (Object.Handle), OCI_HTYPE_ENV); Object.Handle := OCIEnv (Empty_Handle); if Rc /= OCI_SUCCESS then Put_Line (Current_Error, "Warning: Return code on free environment " & SWord'Image (Rc)); end if; end if; end Destroy; ----------------- -- Free_Memory -- ----------------- procedure Free_Memory (ctxp : in System.Address; Memptr : in System.Address) is pragma Unreferenced (ctxp); begin Counter_Add (-1); Free (Memptr); end Free_Memory; ---------------- -- Is_Objects -- ---------------- function Is_Objects return Boolean is begin return (Create_Mode and OCI_OBJECT) /= 0; end Is_Objects; -------------------- -- Realloc_Memory -- -------------------- function Realloc_Memory (ctxp : in System.Address; Memptr : in System.Address; Size : in Integer) return System.Address is pragma Unreferenced (ctxp); begin if Size = 0 then Counter_Add (-1); end if; return Realloc (Memptr, Size); end Realloc_Memory; -------------------------- -- Set_Create_Mode_Flag -- -------------------------- procedure Set_Create_Mode_Flag (Flag : in Ub4) is begin Create_Mode := Create_Mode or Flag; end Set_Create_Mode_Flag; -------------------------- -- Set_Memory_Fill_Byte -- -------------------------- procedure Set_Memory_Fill_Byte (Byte : Memory_Byte) is begin Memory_Fill_Byte := Integer (Byte); end Set_Memory_Fill_Byte; end OCI.Environments; gnade-1.6.2.orig/dbi/oci/oci.ads0000644000175000017500000000476410537157463016176 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Ada95 Interface to Oracle® RDBMS™ -- -- -- -- Copyright (C) 2000-2006 -- -- Dmitriy Anisimkov -- -- anisimkov@ada-ru.org -- -- -- -- This library is free software; you can redistribute it and/or modify -- -- it under the terms of the GNU General Public License as published by -- -- the Free Software Foundation; either version 2 of the License, or (at -- -- your option) any later version. -- -- -- -- This library is distributed in the hope that it will be useful, but -- -- WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- -- General Public License for more details. -- -- -- -- You should have received a copy of the GNU General Public License -- -- along with this library; if not, write to the Free Software Foundation, -- -- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- ------------------------------------------------------------------------------ -- Oracle® RDBMS™, Oracle® Call Interfase™ are Trademarks of -- -- Oracle Corporation -- ------------------------------------------------------------------------------ -- $Id: oci.ads,v 1.7 2006/12/11 04:31:47 vagul Exp $ package OCI is pragma Pure; end OCI; gnade-1.6.2.orig/dbi/oci/oci-environments.ads0000644000175000017500000000262310613624256020705 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Ada95 Interface to Oracle RDBMS -- -- Copyright (C) 2000-2006 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-environments.ads,v 1.10 2007/04/25 10:08:46 vagul Exp $ with OCI.Lib, OCI.Reference_Finalization; package OCI.Environments is use OCI.Lib; package RF renames Reference_Finalization; subtype Memory_Byte is Ub1; type Thread_Environment is new RF.Controlled_Reference with record Handle : OCIEnv := OCIEnv (Empty_Handle); end record; function Create return Thread_Environment; Init_Environment : constant Thread_Environment; procedure Set_Create_Mode_Flag (Flag : in Ub4); procedure Set_Memory_Fill_Byte (Byte : in Memory_Byte); function Is_Objects return Boolean; package Counter is function Value return Integer; pragma Inline (Value); end Counter; Last_Size : Integer := 0; private procedure Destroy (Object : in out Thread_Environment); Init_Environment : constant Thread_Environment := (RF.Controlled_Reference with Handle => OCIEnv (Empty_Handle)); Environment_Creation_Error : exception; end OCI.Environments; gnade-1.6.2.orig/dbi/oci/oci.gpr0000644000175000017500000000137310607576127016210 0ustar lbrentalbrenta-- $Id: oci.gpr,v 1.6 2007/04/13 03:43:19 vagul Exp $ project OCI is Target := external( "TARGET", "." ) ; Include := external( "INCLUDE", "../../win32-include" ); for Languages use ("Ada"); package Ide is for Vcs_Kind use "CVS"; end Ide; for Source_Dirs use (".", "../../support" ); for Object_Dir use Target; package Compiler is for Default_Switches ("Ada") use ("-g", "-gnat05", "-gnaty"); end Compiler; package Builder is for Default_Switches ("Ada") use ("-g", "-gnatQ"); end Builder; package Binder is for Default_Switches ("Ada") use ("-static"); end Binder; package Linker is for Default_Switches ("Ada") use ("-g"); end Linker; end OCI; gnade-1.6.2.orig/dbi/oci/oci-lib.ads0000644000175000017500000020076511033070070016715 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Ada95 Interface to Oracle RDBMS -- -- Copyright (C) 2000-2006 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-lib.ads,v 1.42 2008/07/03 06:22:48 vagul Exp $ with System, Interfaces.C.Pointers, Interfaces.C.Strings; package OCI.Lib is package C renames Interfaces.C; package CStr renames C.Strings; subtype Text_Ptr is CStr.chars_ptr; subtype Text is C.char_array; subtype OraText is Text_Ptr; subtype Ub1 is Interfaces.Unsigned_8; subtype Sb1 is Interfaces.Integer_8; subtype Ub2 is Interfaces.Unsigned_16; subtype Sb2 is Interfaces.Integer_16; subtype Ub4 is Interfaces.Unsigned_32; subtype Sb4 is Interfaces.Integer_32; subtype UWord is C.unsigned; subtype Bool is C.int; subtype DVoid is System.Address; type A_Int is access all C.int; type A_Sb4 is access all Sb4; type A_Sb2 is access all Sb2; type A_Ub4 is access all Ub4; type A_Ub2 is access all Ub2; type A_Ub1 is access all Ub1; type OCITypeCode is new Ub2; subtype Function_Pointer is DVoid; subtype OCIHandle is System.Address; Empty_Handle : constant OCIHandle := System.Null_Address; type OCIEnv is new OCIHandle; type OCIError is new OCIHandle; type OCISvcCtx is new OCIHandle; type OCIStmt is new OCIHandle; type OCIBind is new OCIHandle; type OCIDefine is new OCIHandle; type OCIDescribe is new OCIHandle; type OCIServer is new OCIHandle; type OCISession is new OCIHandle; type OCIComplexObject is new OCIHandle; type OCITrans is new OCIHandle; type OCISecurity is new OCIHandle; type OCISubscription is new OCIHandle; type OCIThreadId is new OCIHandle; type OCIThreadHandle is new OCIHandle; type OCIThreadMutex is new OCIHandle; subtype OCIType is OCIHandle; type OCISnapshot is new OCIHandle; type OCIResult is new OCIHandle; type OCILobLocator is new OCIHandle; type OCIParam is new OCIHandle; type OCIComplexObjectComp is new OCIHandle; type OCIRowid is new OCIHandle; type OCIDateTime is new OCIHandle; type OCIInterval is new OCIHandle; type OCIColl is new OCIHandle; type OCIExtProcContext is new OCIHandle; type OCIAQEnqOptions is new OCIHandle; type OCIAQDeqOptions is new OCIHandle; type OCIAQMsgProperties is new OCIHandle; type OCIAQAgent is new OCIHandle; type OCIAQNfyDescriptor is new OCIHandle; subtype SWord is C.int; subtype EWord is C.int; type OCITypeGetOpt is (OCI_TYPEGET_HEADER, OCI_TYPEGET_ALL); pragma Convention (C, OCITypeGetOpt); type Vector_Of_Ub1 is array (Integer range <>) of aliased Ub1; type Vector_Of_Ub4 is array (Integer range <>) of aliased Ub4; type Vector_Of_OraText is array (Integer range <>) of aliased OraText; type Vector_Of_OCIBind is array (Integer range <>) of aliased OCIBind; package Ub1_Ptr is new Interfaces.C.Pointers (Integer, Ub1, Vector_Of_Ub1, 0); subtype A_Vector_Of_Ub1 is Ub1_Ptr.Pointer; package OraText_Ptr is new Interfaces.C.Pointers (Integer, OraText, Vector_Of_OraText, CStr.Null_Ptr); subtype A_Vector_Of_OraText is OraText_Ptr.Pointer; package OCIBind_Ptr is new Interfaces.C.Pointers (Integer, OCIBind, Vector_Of_OCIBind, OCIBind (Empty_Handle)); subtype A_Vector_Of_OCIBind is OCIBind_Ptr.Pointer; subtype Undefined is System.Address; Empty_Undefined : constant Undefined := System.Null_Address; OCI_SUCCESS : constant := 0; OCI_SUCCESS_WITH_INFO : constant := 1; OCI_NO_DATA : constant := 100; OCI_ERROR : constant := -1; OCI_INVALID_HANDLE : constant := -2; OCI_NEED_DATA : constant := 99; OCI_STILL_EXECUTING : constant := -3123; OCI_CONTINUE : constant := -24200; OCI_FETCH_NEXT : constant := 2; OCI_FETCH_FIRST : constant := 16#04#; OCI_FETCH_LAST : constant := 16#08#; OCI_FETCH_PRIOR : constant := 16#10#; OCI_FETCH_ABSOLUTE : constant := 16#20#; OCI_FETCH_RELATIVE : constant := 16#40#; OCI_FETCH_RESERVED_1 : constant := 16#80#; OCI_V7_SYNTAX : constant := 2; OCI_V8_SYNTAX : constant := 3; OCI_NTV_SYNTAX : constant := 1; OCI_OTYPE_NAME : constant := 1; OCI_OTYPE_REF : constant := 2; OCI_OTYPE_PTR : constant := 3; OCI_PTYPE_UNK : constant := 0; OCI_PTYPE_TABLE : constant := 1; OCI_PTYPE_VIEW : constant := 2; OCI_PTYPE_PROC : constant := 3; OCI_PTYPE_FUNC : constant := 4; OCI_PTYPE_PKG : constant := 5; OCI_PTYPE_TYPE : constant := 6; OCI_PTYPE_SYN : constant := 7; OCI_PTYPE_SEQ : constant := 8; OCI_PTYPE_COL : constant := 9; OCI_PTYPE_ARG : constant := 10; OCI_PTYPE_LIST : constant := 11; OCI_PTYPE_TYPE_ATTR : constant := 12; OCI_PTYPE_TYPE_COLL : constant := 13; OCI_PTYPE_TYPE_METHOD : constant := 14; OCI_PTYPE_TYPE_ARG : constant := 15; OCI_PTYPE_TYPE_RESULT : constant := 16; OCI_PTYPE_SCHEMA : constant := 17; OCI_PTYPE_DATABASE : constant := 18; OCI_LTYPE_UNK : constant := 0; OCI_LTYPE_COLUMN : constant := 1; OCI_LTYPE_ARG_PROC : constant := 2; OCI_LTYPE_ARG_FUNC : constant := 3; OCI_LTYPE_SUBPRG : constant := 4; OCI_LTYPE_TYPE_ATTR : constant := 5; OCI_LTYPE_TYPE_METHOD : constant := 6; OCI_LTYPE_TYPE_ARG_PROC : constant := 7; OCI_LTYPE_TYPE_ARG_FUNC : constant := 8; OCI_LTYPE_SCH_OBJ : constant := 9; OCI_LTYPE_DB_SCH : constant := 10; OCI_MEMORY_CLEARED : constant := 1; OCI_ATTR_FNCODE : constant := 1; OCI_ATTR_OBJECT : constant := 2; OCI_ATTR_NONBLOCKING_MODE : constant := 3; OCI_ATTR_SQLCODE : constant := 4; OCI_ATTR_ENV : constant := 5; OCI_ATTR_SERVER : constant := 6; OCI_ATTR_SESSION : constant := 7; OCI_ATTR_TRANS : constant := 8; OCI_ATTR_ROW_COUNT : constant := 9; OCI_ATTR_SQLFNCODE : constant := 10; OCI_ATTR_PREFETCH_ROWS : constant := 11; OCI_ATTR_NESTED_PREFETCH_ROWS : constant := 12; OCI_ATTR_PREFETCH_MEMORY : constant := 13; OCI_ATTR_NESTED_PREFETCH_MEMORY : constant := 14; OCI_ATTR_CHAR_COUNT : constant := 15; OCI_ATTR_PDSCL : constant := 16; OCI_ATTR_PDFMT : constant := 17; OCI_ATTR_PARAM_COUNT : constant := 18; OCI_ATTR_ROWID : constant := 19; OCI_ATTR_CHARSET : constant := 20; OCI_ATTR_NCHAR : constant := 21; OCI_ATTR_USERNAME : constant := 22; OCI_ATTR_PASSWORD : constant := 23; OCI_ATTR_STMT_TYPE : constant := 24; OCI_ATTR_INTERNAL_NAME : constant := 25; OCI_ATTR_EXTERNAL_NAME : constant := 26; OCI_ATTR_XID : constant := 27; OCI_ATTR_TRANS_LOCK : constant := 28; OCI_ATTR_TRANS_NAME : constant := 29; OCI_ATTR_HEAPALLOC : constant := 30; OCI_ATTR_CHARSET_ID : constant := 31; OCI_ATTR_CHARSET_FORM : constant := 32; OCI_ATTR_MAXDATA_SIZE : constant := 33; OCI_ATTR_CACHE_OPT_SIZE : constant := 34; OCI_ATTR_CACHE_MAX_SIZE : constant := 35; OCI_ATTR_PINOPTION : constant := 36; OCI_ATTR_ALLOC_DURATION : constant := 37; OCI_ATTR_PIN_DURATION : constant := 38; OCI_ATTR_FDO : constant := 39; OCI_ATTR_POSTPROCESSING_CALLBACK : constant := 40; OCI_ATTR_POSTPROCESSING_CONTEXT : constant := 41; OCI_ATTR_ROWS_RETURNED : constant := 42; OCI_ATTR_FOCBK : constant := 43; OCI_ATTR_IN_V8_MODE : constant := 44; OCI_ATTR_LOBEMPTY : constant := 45; OCI_ATTR_SESSLANG : constant := 46; OCI_ATTR_NUM_DML_ERRORS : constant := 73; OCI_ATTR_DML_ROW_OFFSET : constant := 74; OCI_ATTR_PARSE_ERROR_OFFSET : constant := 129; OCI_ATTR_DATA_SIZE : constant := 1; OCI_ATTR_DATA_TYPE : constant := 2; OCI_ATTR_DISP_SIZE : constant := 3; OCI_ATTR_NAME : constant := 4; OCI_ATTR_PRECISION : constant := 5; OCI_ATTR_SCALE : constant := 6; OCI_ATTR_IS_NULL : constant := 7; OCI_ATTR_TYPE_NAME : constant := 8; OCI_ATTR_SCHEMA_NAME : constant := 9; OCI_ATTR_SUB_NAME : constant := 10; OCI_ATTR_POSITION : constant := 11; -- complex object retrieval parameter attributes OCI_ATTR_COMPLEXOBJECTCOMP_TYPE : constant := 50; OCI_ATTR_COMPLEXOBJECTCOMP_TYPE_LEVEL : constant := 51; OCI_ATTR_COMPLEXOBJECT_LEVEL : constant := 52; OCI_ATTR_COMPLEXOBJECT_COLL_OUTOFLINE : constant := 53; OCI_ATTR_NOCACHE : constant := 87; -- Temporary LOBs -- Strange. I think it is wrong attribute description -^. OCI_ATTR_SUBSCR_NAME : constant := 94; -- name of subscription OCI_ATTR_SUBSCR_CALLBACK : constant := 95; -- associated callback OCI_ATTR_SUBSCR_CTX : constant := 96; -- associated callback context OCI_ATTR_SUBSCR_PAYLOAD : constant := 97; -- associated payload OCI_ATTR_SUBSCR_NAMESPACE : constant := 98; -- associated namespace OCI_ATTR_CONSUMER_NAME : constant := 50; -- consumer name OCI_ATTR_DEQ_MODE : constant := 51; -- dequeue mode OCI_ATTR_NAVIGATION : constant := 52; -- navigation OCI_ATTR_WAIT : constant := 53; -- wait OCI_ATTR_DEQ_MSGID : constant := 54; -- dequeue message id OCI_ATTR_QUEUE_NAME : constant := 70; -- queue name OCI_ATTR_NFY_MSGID : constant := 71; -- message id OCI_ATTR_MSG_PROP : constant := 72; -- message properties -- only named type attributes OCI_ATTR_TYPECODE : constant := 216; -- object or collection OCI_ATTR_COLLECTION_TYPECODE : constant := 217; -- varray or nested table OCI_ATTR_VERSION : constant := 218; -- user assigned version OCI_ATTR_IS_INCOMPLETE_TYPE : constant := 219; OCI_ATTR_IS_SYSTEM_TYPE : constant := 220; -- a system type OCI_ATTR_IS_PREDEFINED_TYPE : constant := 221; -- a predefined type OCI_ATTR_IS_TRANSIENT_TYPE : constant := 222; -- a transient type OCI_ATTR_IS_SYSTEM_GENERATED_TYPE : constant := 223; OCI_ATTR_HAS_NESTED_TABLE : constant := 224; OCI_ATTR_HAS_LOB : constant := 225; -- has a lob attribute OCI_ATTR_HAS_FILE : constant := 226; -- has a file attribute OCI_ATTR_COLLECTION_ELEMENT : constant := 227; OCI_ATTR_NUM_TYPE_ATTRS : constant := 228; -- number of attribute types OCI_ATTR_LIST_TYPE_ATTRS : constant := 229; -- list of type attributes OCI_ATTR_NUM_TYPE_METHODS : constant := 230; -- number of type methods OCI_ATTR_LIST_TYPE_METHODS : constant := 231; -- list of type methods OCI_ATTR_MAP_METHOD : constant := 232; -- map method of type OCI_ATTR_ORDER_METHOD : constant := 233; -- order method of type OCI_ATTR_CHNF_TABLENAMES : constant := 401; -- array of table names OCI_ATTR_CHNF_ROWIDS : constant := 402; -- rowids needed OCI_ATTR_CHNF_OPERATIONS : constant := 403; -- notif. operation filter OCI_ATTR_CHNF_CHANGELAG : constant := 404; -- transaction lag OCI_ATTR_CHDES_DBNAME : constant := 405; -- source database OCI_ATTR_CHDES_NFYTYPE : constant := 406; -- notification type flags OCI_ATTR_CHDES_XID : constant := 407; -- XID of the transaction OCI_ATTR_CHDES_TABLE_CHANGES : constant := 408; -- array of table chg descr OCI_ATTR_CHDES_TABLE_NAME : constant := 409; -- table name OCI_ATTR_CHDES_TABLE_OPFLAGS : constant := 410; -- table operation flags OCI_ATTR_CHDES_TABLE_ROW_CHANGES : constant := 411; -- changed rows OCI_ATTR_CHDES_ROW_ROWID : constant := 412; -- rowid of changed row OCI_ATTR_CHDES_ROW_OPFLAGS : constant := 413; -- row operation flags OCI_ATTR_CHNF_REGHANDLE : constant := 414; -- subscription handle OCI_DTYPE_FIRST : constant := 50; OCI_DTYPE_LOB : constant := 50; OCI_DTYPE_SNAP : constant := 51; OCI_DTYPE_RSET : constant := 52; OCI_DTYPE_PARAM : constant := 53; OCI_DTYPE_ROWID : constant := 54; OCI_DTYPE_COMPLEXOBJECTCOMP : constant := 55; OCI_DTYPE_FILE : constant := 56; OCI_DTYPE_AQENQ_OPTIONS : constant := 57; OCI_DTYPE_AQDEQ_OPTIONS : constant := 58; OCI_DTYPE_AQMSG_PROPERTIES : constant := 59; OCI_DTYPE_AQAGENT : constant := 60; OCI_DTYPE_LOCATOR : constant := 61; OCI_DTYPE_DATETIME : constant := 62; OCI_DTYPE_INTERVAL : constant := 63; OCI_DTYPE_AQNFY_DESCRIPTOR : constant := 64; OCI_DTYPE_CHDES : constant := 77; OCI_DTYPE_TABLE_CHDES : constant := 78; OCI_DTYPE_ROW_CHDES : constant := 79; OCI_DTYPE_LAST : constant := 79; OCI_BATCH_MODE : constant := 16#01#; OCI_EXACT_FETCH : constant := 16#02#; OCI_KEEP_FETCH_STATE : constant := 16#04#; OCI_SCROLLABLE_CURSOR : constant := 16#08#; OCI_DESCRIBE_ONLY : constant := 16#10#; OCI_COMMIT_ON_SUCCESS : constant := 16#20#; OCI_NON_BLOCKING : constant := 16#40#; OCI_BATCH_ERRORS : constant := 16#80#; OCI_PARSE_ONLY : constant := 16#100#; OCI_EXACT_FETCH_RESERVED_1 : constant := 16#200#; ------------------------- Supported Namespaces --------------------------- OCI_SUBSCR_NAMESPACE_ANONYMOUS : constant := 0; -- Anonymous Namespace OCI_SUBSCR_NAMESPACE_AQ : constant := 1; -- Advanced Queues OCI_SUBSCR_NAMESPACE_DBCHANGE : constant := 2; -- DB change notification OCI_SUBSCR_NAMESPACE_MAX : constant := 3; -- Max Name Space Number -- input data types SQLT_CHR : constant := 1; -- (ORANET TYPE) character string SQLT_NUM : constant := 2; -- (ORANET TYPE) oracle numeric SQLT_INT : constant := 3; -- (ORANET TYPE) integer SQLT_FLT : constant := 4; -- (ORANET TYPE) Floating point number SQLT_STR : constant := 5; -- zero terminated string SQLT_VNU : constant := 6; -- NUM with preceding length byte SQLT_PDN : constant := 7; -- (ORANET TYPE) Packed Decimal Numeric SQLT_LNG : constant := 8; -- long SQLT_VCS : constant := 9; -- Variable character string SQLT_NON : constant := 10; -- Null/empty PCC Descriptor entry SQLT_RID : constant := 11; -- rowid SQLT_DAT : constant := 12; -- date in oracle format SQLT_VBI : constant := 15; -- binary in VCS format SQLT_BFLOAT : constant := 21; -- Native binary float SQLT_BDOUBLE : constant := 22; -- Native binary double SQLT_BIN : constant := 23; -- binary data (DTYBIN) SQLT_LBI : constant := 24; -- long binary SQLT_UIN : constant := 68; -- unsigned integer SQLT_SLS : constant := 91; -- Display sign leading separate SQLT_LVC : constant := 94; -- Longer longs (char) SQLT_LVB : constant := 95; -- Longer long binary SQLT_AFC : constant := 96; -- Ansi fixed char SQLT_AVC : constant := 97; -- Ansi Var char SQLT_IBFLOAT : constant := 100; -- binary float canonical SQLT_IBDOUBLE : constant := 101; -- binary double canonical SQLT_CUR : constant := 102; -- cursor type SQLT_RDD : constant := 104; -- rowid descriptor SQLT_LAB : constant := 105; -- label type SQLT_OSL : constant := 106; -- oslabel type SQLT_NTY : constant := 108; -- named object type SQLT_REF : constant := 110; -- ref type SQLT_CLOB : constant := 112; -- character lob SQLT_BLOB : constant := 113; -- binary lob SQLT_BFILEE : constant := 114; -- binary file lob SQLT_CFILEE : constant := 115; -- character file lob SQLT_RSET : constant := 116; -- result set type SQLT_NCO : constant := 122; -- named collection (varray or nested table) SQLT_VST : constant := 155; -- OCIString type SQLT_ODT : constant := 156; -- OCIDate type -- datetimes and intervals SQLT_DATE : constant := 184; -- ANSI Date SQLT_TIME : constant := 185; -- TIME SQLT_TIME_TZ : constant := 186; -- TIME WITH TIME ZONE SQLT_TIMESTAMP : constant := 187; -- TIMESTAMP SQLT_TIMESTAMP_TZ : constant := 188; -- TIMESTAMP WITH TIME ZONE SQLT_INTERVAL_YM : constant := 189; -- INTERVAL YEAR TO MONTH SQLT_INTERVAL_DS : constant := 190; -- INTERVAL DAY TO SECOND SQLT_TIMESTAMP_LTZ : constant := 232; -- TIMESTAMP WITH LOCAL TZ SQLT_PNTY : constant := 241; -- pl/sql representation of named types SQLT_FILE : constant := SQLT_BFILEE; SQLT_CFILE : constant := SQLT_CFILEE; SQLT_BFILE : constant := SQLT_BFILEE; OCI_TYPECODE_REF : constant := SQLT_REF; OCI_TYPECODE_DATE : constant := SQLT_DAT; OCI_TYPECODE_SIGNED8 : constant := 27; OCI_TYPECODE_SIGNED16 : constant := 28; OCI_TYPECODE_SIGNED32 : constant := 29; OCI_TYPECODE_REAL : constant := 21; OCI_TYPECODE_DOUBLE : constant := 22; OCI_TYPECODE_FLOAT : constant := SQLT_FLT; OCI_TYPECODE_NUMBER : constant := SQLT_NUM; OCI_TYPECODE_DECIMAL : constant := SQLT_PDN; OCI_TYPECODE_UNSIGNED8 : constant := SQLT_BIN; OCI_TYPECODE_UNSIGNED16 : constant := 25; OCI_TYPECODE_UNSIGNED32 : constant := 26; OCI_TYPECODE_OCTET : constant := 245; OCI_TYPECODE_SMALLINT : constant := 246; OCI_TYPECODE_INTEGER : constant := SQLT_INT; OCI_TYPECODE_RAW : constant := SQLT_LVB; OCI_TYPECODE_PTR : constant := 32; OCI_TYPECODE_VARCHAR2 : constant := SQLT_VCS; OCI_TYPECODE_CHAR : constant := SQLT_AFC; OCI_TYPECODE_VARCHAR : constant := SQLT_CHR; OCI_TYPECODE_MLSLABEL : constant := SQLT_LAB; OCI_TYPECODE_VARRAY : constant := 247; OCI_TYPECODE_TABLE : constant := 248; OCI_TYPECODE_OBJECT : constant := SQLT_NTY; OCI_TYPECODE_OPAQUE : constant := 58; OCI_TYPECODE_NAMEDCOLLECTION : constant := SQLT_NCO; OCI_TYPECODE_BLOB : constant := SQLT_BLOB; OCI_TYPECODE_BFILE : constant := SQLT_BFILE; OCI_TYPECODE_CLOB : constant := SQLT_CLOB; OCI_TYPECODE_CFILE : constant := SQLT_CFILE; -- the following are ANSI datetime datatypes added in 8.1 OCI_TYPECODE_TIME : constant := SQLT_TIME; OCI_TYPECODE_TIME_TZ : constant := SQLT_TIME_TZ; OCI_TYPECODE_TIMESTAMP : constant := SQLT_TIMESTAMP; OCI_TYPECODE_TIMESTAMP_TZ : constant := SQLT_TIMESTAMP_TZ; OCI_TYPECODE_TIMESTAMP_LTZ : constant := SQLT_TIMESTAMP_LTZ; OCI_TYPECODE_INTERVAL_YM : constant := SQLT_INTERVAL_YM; OCI_TYPECODE_INTERVAL_DS : constant := SQLT_INTERVAL_DS; OCI_TYPECODE_UROWID : constant := SQLT_RDD; OCI_TYPECODE_OTMFIRST : constant := 228; OCI_TYPECODE_OTMLAST : constant := 320; OCI_TYPECODE_SYSFIRST : constant := 228; OCI_TYPECODE_SYSLAST : constant := 235; OCI_TYPECODE_PLS_INTEGER : constant := 266; -- NOTE : The following NCHAR related codes are just short forms for saying -- OCI_TYPECODE_VARCHAR2 with a charset form of SQLCS_NCHAR. These codes -- are intended for use in the OCIAnyData API only and nowhere else. OCI_TYPECODE_NCHAR : constant := 286; OCI_TYPECODE_NVARCHAR2 : constant := 287; OCI_TYPECODE_NCLOB : constant := 288; -- To indicate absence of typecode being specified OCI_TYPECODE_NONE : constant := 0; -- To indicate error has to be taken from error handle - reserved for -- sqlplus use OCI_TYPECODE_ERRHP : constant := 283; OCI_DEFAULT : constant := 0; OCI_THREADED : constant := 1; OCI_OBJECT : constant := 2; OCI_EVENTS : constant := 4; OCI_SHARED : constant := 16#10#; OCI_NO_UCB : constant := 16#40#; OCI_NO_MUTEX : constant := 16#80#; OCI_ENV_NO_UCB : constant := 1; OCI_ENV_NO_MUTEX : constant := 8; OCI_HTYPE_FIRST : constant := 1; OCI_HTYPE_ENV : constant := 1; OCI_HTYPE_ERROR : constant := 2; OCI_HTYPE_SVCCTX : constant := 3; OCI_HTYPE_STMT : constant := 4; OCI_HTYPE_BIND : constant := 5; OCI_HTYPE_DEFINE : constant := 6; OCI_HTYPE_DESCRIBE : constant := 7; OCI_HTYPE_SERVER : constant := 8; OCI_HTYPE_SESSION : constant := 9; OCI_HTYPE_TRANS : constant := 10; OCI_HTYPE_COMPLEXOBJECT : constant := 11; OCI_HTYPE_SECURITY : constant := 12; OCI_HTYPE_SUBSCRIPTION : constant := 13; OCI_HTYPE_DIRPATH_CTX : constant := 14; OCI_HTYPE_DIRPATH_COLUMN_ARRAY : constant := 15; OCI_HTYPE_DIRPATH_STREAM : constant := 16; OCI_HTYPE_PROC : constant := 17; OCI_HTYPE_LAST : constant := 17; OCI_ONE_PIECE : constant := 0; OCI_FIRST_PIECE : constant := 1; OCI_NEXT_PIECE : constant := 2; OCI_LAST_PIECE : constant := 3; OCI_PARAM_IN : constant := 1; -- in parameter OCI_PARAM_OUT : constant := 2; -- out parameter OCI_DATA_AT_EXEC : constant := 2; OCI_DYNAMIC_FETCH : constant := 2; OCI_PIECEWISE : constant := 4; OCI_TEMP_BLOB : constant := 1; OCI_TEMP_CLOB : constant := 2; OCI_TEMP_NCLOB : constant := 3; -- CHAR/NCHAR/VARCHAR2/NVARCHAR2/CLOB/NCLOB char set "form" information SQLCS_IMPLICIT : constant := 1; -- CHAR, VARCHAR2, CLOB w/o a specified set SQLCS_NCHAR : constant := 2; -- NCHAR, NCHAR VARYING, NCLOB SQLCS_EXPLICIT : constant := 3; -- CHAR, etc, with "CHARACTER SET..." syntax SQLCS_FLEXIBLE : constant := 4; -- PL/SQL "flexible" parameters SQLCS_LIT_NULL : constant := 5; -- typecheck of NULL and empty_clob() lits -------------------------Credential Types------------------------- OCI_CRED_RDBMS : constant := 1; -- database username/password OCI_CRED_EXT : constant := 2; -- externally provided credentials OCI_CRED_PROXY : constant := 3; -- proxy authentication ------------------------------------------------------------------ -- DB Change: Operation types -- OCI_OPCODE_ALLROWS : constant := 16#01#; OCI_OPCODE_INSERT : constant := 16#02#; OCI_OPCODE_UPDATE : constant := 16#04#; OCI_OPCODE_DELETE : constant := 16#08#; OCI_OPCODE_ALTER : constant := 16#10#; OCI_OPCODE_DROP : constant := 16#20#; OCI_OPCODE_UNKNOWN : constant := 16#40#; OCI_NUMBER_UNSIGNED : constant := 0; -- Unsigned type - ubX OCI_NUMBER_SIGNED : constant := 2; -- Signed type - sbX TRUE : constant := 1; FALSE : constant := 0; subtype C_Boolean is C.int; Null_Indicator : constant := -1; Not_Null_Indicator : constant := 0; OCI_STMT_SELECT : constant := 1; OCI_STMT_UPDATE : constant := 2; OCI_STMT_DELETE : constant := 3; OCI_STMT_INSERT : constant := 4; OCI_STMT_CREATE : constant := 5; OCI_STMT_DROP : constant := 6; OCI_STMT_ALTER : constant := 7; OCI_STMT_BEGIN : constant := 8; OCI_STMT_DECLARE : constant := 9; type OCIDuration is new Ub2; OCI_DURATION_BEGIN : constant OCIDuration := 10; OCI_DURATION_NULL : constant OCIDuration := OCI_DURATION_BEGIN - 1; OCI_DURATION_DEFAULT : constant OCIDuration := OCI_DURATION_BEGIN - 2; OCI_DURATION_NEXT : constant OCIDuration := OCI_DURATION_BEGIN - 3; OCI_DURATION_SESSION : constant OCIDuration := OCI_DURATION_BEGIN; OCI_DURATION_TRANS : constant OCIDuration := OCI_DURATION_BEGIN + 1; OCI_UCBTYPE_ENTRY : constant := 1; -- entry callback OCI_UCBTYPE_EXIT : constant := 2; -- exit callback OCI_UCBTYPE_REPLACE : constant := 3; -- replacement callback type OCITime is record OCITimeHH : Ub1; OCITimeMI : Ub1; OCITimeSS : Ub1; end record; pragma Convention (C, OCITime); type OCIDate is record OCIDateYYYY : Sb2; OCIDateMM : Ub1; OCIDateDD : Ub1; OCIDateTime : OCITime; end record; pragma Convention (C, OCIDate); OCI_NUMBER_SIZE : constant := 22; type OCINumber is array (1 .. OCI_NUMBER_SIZE) of Ub1; pragma Convention (C, OCINumber); type OCIString is new DVoid; type A_OCILobLocator is access all OCILobLocator; subtype OCICLOBLOCATOR is OCILobLocator; subtype OCIBLOBLOCATOR is OCILobLocator; subtype OCIBFILELOCATOR is OCILobLocator; function OCIEnvCreate (Envh : access OCIEnv; Mode : in Ub4; Ctxp : in DVoid := Empty_Handle; Malocfp : in DVoid := Empty_Handle; Ralocfp : in DVoid := Empty_Handle; Mfreefp : in DVoid := Empty_Handle; Xtramemsz : in C.size_t := 0; Usrmempp : in Undefined := Empty_Undefined) return SWord; function OCIErrorGet (Hndlp : in OCIHandle; Recordno : in Ub4 := 1; Sqlstate : in Undefined := Empty_Undefined; Errcodep : access Sb4; Bufp : in Text_Ptr; Bufsiz : in Ub4; Htype : in Ub4) return SWord; function OCIErrorGet (Hndlp : in OCIError; Recordno : in Ub4 := 1; Sqlstate : in Undefined := Empty_Undefined; Errcodep : access Sb4; Bufp : in Text_Ptr; Bufsiz : in Ub4; Htype : in Ub4) return SWord; function OCILogon (Envhp : in OCIEnv; Errhp : in OCIError; Svchp : access OCISvcCtx; Username : in Text; Uname_Len : in Ub4; Password : in Text; Passwd_Len : in Ub4; Dbname : in Text; Dbname_Len : in Ub4) return SWord; function OCILogoff (Svchp : in OCISvcCtx; Errhp : in OCIError) return SWord; function OCIInitialize (Mode : in Ub4; Ctxp : in Undefined := Empty_Undefined; Malocfp : in Undefined := Empty_Undefined; Ralocfp : in Undefined := Empty_Undefined; Mfreefp : in Undefined := Empty_Undefined) return SWord; function OCIEnvInit (Envh : access OCIEnv; Mode : in Ub4; Xtramemsz : in C.size_t := 0; Usrmempp : in Undefined := Empty_Undefined) return SWord; function OCIHandleAlloc (Parenth : in OCIHandle; Hndlpp : access OCIHandle; Htype : in Ub4; Xtramem_Sz : in C.size_t := 0; Usrmempp : in Undefined := Empty_Undefined) return SWord; function OCIHandleFree (Hndlp : OCIHandle; Htype : Ub4) return SWord; function OCIStmtPrepare (Stmtp : in OCIStmt; Errhp : in OCIError; Stmt : in Text; Stmt_Len : in Ub4; Language : in Ub4 := OCI_NTV_SYNTAX; Mode : in Ub4 := OCI_DEFAULT) return SWord; function OCIStmtExecute (Svchp : in OCISvcCtx; Stmtp : in OCIStmt; Errhp : in OCIError; Iters : in Ub4; Rowoff : in Ub4 := 0; Snap_In : in OCIHandle := Empty_Handle; Snap_Out : in OCIHandle := Empty_Handle; Mode : in Ub4 := OCI_DEFAULT) return SWord; function OCIParamGet (Hndlp : in OCIHandle; Htype : in Ub4; Errhp : in OCIError; Parmdpp : access OCIParam; Pos : in Ub4) return SWord; function OCIAttrGet (Trgthndlp : in OCIHandle; Trghndltyp : in Ub4; Attributep : in DVoid; Sizep : in A_Ub4; Attrtype : in Ub4; Errhp : in OCIError) return SWord; function OCIAttrGet (Trgthndlp : in OCIHandle; Trghndltyp : in Ub4; Attributep : access CStr.chars_ptr; Sizep : access Ub4; Attrtype : in Ub4; Errhp : in OCIError) return SWord; function OCIAttrSet (Trgthndlp : in OCIHandle; Trghndltyp : in Ub4; Attributep : in Text; Size : in Ub4; Attrtype : in Ub4; Errhp : in OCIError) return SWord; function OCIAttrSet (Trgthndlp : in OCIHandle; Trghndltyp : in Ub4; Attributep : in DVoid; Size : in Ub4; Attrtype : in Ub4; Errhp : in OCIError) return SWord; function OCIStmtFetch (Stmtp : in OCIStmt; Errhp : in OCIError; Nrows : in Ub4 := 1; Orientation : in Ub2 := OCI_FETCH_NEXT; Mode : in Ub4 := OCI_DEFAULT) return SWord; function OCIBindByName (Stmtp : in OCIStmt; Bindpp : access OCIBind; Errhp : in OCIError; Placeholder : in Text; Placeh_Len : in Sb4; Valuep : in DVoid; Value_Sz : in Sb4; Dty : in Ub2; Indp : in A_Sb2; Alenp : in A_Ub2 := null; Rcodep : in A_Ub2 := null; Maxarr_Len : in Ub4 := 0; Curelep : in A_Ub4 := null; Mode : in Ub4 := OCI_DEFAULT) return SWord; function OCIBindByName (Stmtp : in OCIStmt; Bindpp : access OCIBind; Errhp : in OCIError; Placeholder : in Text; Placeh_Len : in Sb4; Valuep : in Text_Ptr; Value_Sz : in Sb4; Dty : in Ub2; Indp : access Sb2; Alenp : in A_Ub2 := null; Rcodep : in A_Ub2 := null; Maxarr_Len : in Ub4 := 0; Curelep : in A_Ub4 := null; Mode : in Ub4 := OCI_DEFAULT) return SWord; function OCIBindByPos (Stmtp : in OCIStmt; Bindpp : access OCIBind; Errhp : in OCIError; Position : in Ub4; Valuep : in DVoid; Value_Sz : in Sb4; Dty : in Ub2; Indp : in A_Sb2; Alenp : in A_Ub2 := null; Rcodep : in A_Ub2 := null; Maxarr_Len : in Ub4 := 0; Curelep : in A_Ub4 := null; Mode : in Ub4 := OCI_DEFAULT) return SWord; function OCIBindByPos (Stmtp : in OCIStmt; Bindpp : access OCIBind; Errhp : in OCIError; Position : in Ub4; Valuep : in Text_Ptr; Value_Sz : in Sb4; Dty : in Ub2; Indp : access Sb2; Alenp : in A_Ub2 := null; Rcodep : in A_Ub2 := null; Maxarr_Len : in Ub4 := 0; Curelep : in A_Ub4 := null; Mode : in Ub4 := OCI_DEFAULT) return SWord; function OCIDateToText (Err : in OCIError; Date : in OCIDate; Fmt : in Text; Fmt_Length : in Ub1; Lang_Name : in Text_Ptr; Lang_Length : in Ub4; Buf_Size : access Ub4; Buf : in Text_Ptr) return SWord; function OCIDateFromText (Err : in OCIError; Date_Str : in Text; d_Str_Length : in Ub4; Fmt : in Text; Fmt_Length : in Ub1; Lang_Name : in Text_Ptr; Lang_Length : in Ub4; Date : access OCIDate) return SWord; function OCIDateCompare (Err : in OCIError; Date1 : in OCIDate; Date2 : in OCIDate; Result : access SWord) return SWord; function OCIDefineByPos (Stmtp : in OCIStmt; Defnpp : access OCIDefine; Errhp : in OCIError; Position : in Ub4; Value : in DVoid; Value_Sz : in Sb4; Dty : in Ub2; Indp : in A_Sb2; Rlenp : in A_Ub2 := null; Rcodep : in A_Ub2 := null; Mode : in Ub4 := OCI_DEFAULT) return SWord; function OCIDefineByPos (Stmtp : in OCIStmt; Defnpp : access OCIDefine; Errhp : in OCIError; Position : in Ub4; Value : in Text_Ptr; Value_Sz : in Sb4; Dty : in Ub2; Indp : access Sb2; Rlenp : in A_Ub2 := null; Rcodep : in A_Ub2 := null; Mode : in Ub4 := OCI_DEFAULT) return SWord; function OCINumberToText (Err : in OCIError; Date : in OCINumber; Fmt : in Text; Fmt_Length : in Ub4; Nls_Name : in Undefined; Nls_Length : in Ub4; Buf_Size : access Ub4; Buf : in Text_Ptr) return SWord; function OCINumberFromText (Err : in OCIError; Buf : in Text; Str_Length : in Ub4; Fmt : in Text; Fmt_Length : in Ub4; NLS_params : in Undefined; nls_p_length : in Ub4; number : access OCINumber) return SWord; function OCIDateSysDate (Err : in OCIError; Date : access OCIDate) return SWord; function OCIStringResize (Env : in OCIEnv; Err : in OCIError; New_Size : in Ub4; Str : access OCIString) return SWord; function OCIStringAssignText (Env : in OCIEnv; Err : in OCIError; Rhs : in Text; Rhs_Len : in Ub2; Lhs : access OCIString) return SWord; function OCIStringPtr (Env : OCIEnv; Vs : OCIString) return CStr.chars_ptr; function OCIStringSize (Env : in OCIEnv; Vs : in OCIString) return Ub4; function OCIStringAllocSize (Env : in OCIEnv; Vs : in OCIString; Allocsize : access Ub4) return SWord; function OCIDescriptorAlloc (Parenth : in OCIEnv; Descpp : access DVoid; Htype : in Ub4; Xtramem_Sz : in C.size_t := 0; Usrmempp : in Undefined := Empty_Undefined) return SWord; function OCIDescriptorFree (Descp : OCIHandle; Dtype : Ub4) return SWord; function OCIServerVersion (Hndlp : in OCIHandle; Errhp : in OCIError; Bufp : in Text_Ptr; Bufsz : in Ub4; Hndltype : in Ub1) return SWord; procedure OCIClientVersion (Major_Version : access SWord; Minor_Version : access SWord; Update_Num : access SWord; Patch_Num : access SWord; Port_Update_Num : access SWord); function OCITransCommit (Svchp : in OCISvcCtx; Errhp : in OCIError; Flags : in Ub4 := OCI_DEFAULT) return SWord; function OCITransRollback (Svchp : in OCISvcCtx; Errhp : in OCIError; Flags : in Ub4 := OCI_DEFAULT) return SWord; function OCINumberAbs (Err : in OCIError; Number : in OCINumber; Result : access OCINumber) return SWord; function OCINumberArcCos (Err : in OCIError; Number : in OCINumber; Result : access OCINumber) return SWord; function OCINumberArcSin (Err : in OCIError; Number : in OCINumber; Result : access OCINumber) return SWord; function OCINumberArcTan (Err : in OCIError; Number : in OCINumber; Result : access OCINumber) return SWord; function OCINumberAssign (Err : in OCIError; Number : in OCINumber; Result : access OCINumber) return SWord; function OCINumberCeil (Err : in OCIError; Number : in OCINumber; Result : access OCINumber) return SWord; function OCINumberCos (Err : in OCIError; Number : in OCINumber; Result : access OCINumber) return SWord; function OCINumberExp (Err : in OCIError; Number : in OCINumber; Result : access OCINumber) return SWord; function OCINumberFloor (Err : in OCIError; Number : in OCINumber; Result : access OCINumber) return SWord; function OCINumberHypCos (Err : in OCIError; Number : in OCINumber; Result : access OCINumber) return SWord; function OCINumberHypSin (Err : in OCIError; Number : in OCINumber; Result : access OCINumber) return SWord; function OCINumberHypTan (Err : in OCIError; Number : in OCINumber; Result : access OCINumber) return SWord; function OCINumberLn (Err : in OCIError; Number : in OCINumber; Result : access OCINumber) return SWord; function OCINumberNeg (Err : in OCIError; Number : in OCINumber; Result : access OCINumber) return SWord; function OCINumberSin (Err : in OCIError; Number : in OCINumber; Result : access OCINumber) return SWord; function OCINumberSqrt (Err : in OCIError; Number : in OCINumber; Result : access OCINumber) return SWord; function OCINumberTan (Err : in OCIError; Number : in OCINumber; Result : access OCINumber) return SWord; function OCINumberArcTan2 (Err : in OCIError; Number1 : in OCINumber; Number2 : in OCINumber; Result : access OCINumber) return SWord; function OCINumberAdd (Err : in OCIError; Number1 : in OCINumber; Number2 : in OCINumber; Result : access OCINumber) return SWord; function OCINumberCmp (Err : in OCIError; Number1 : in OCINumber; Number2 : in OCINumber; Result : access SWord) return SWord; function OCINumberSign (Err : in OCIError; Number : in OCINumber; Result : access SWord) return SWord; function OCINumberDiv (Err : in OCIError; Number1 : in OCINumber; Number2 : in OCINumber; Result : access OCINumber) return SWord; function OCINumberLog (Err : in OCIError; Number1 : in OCINumber; Number2 : in OCINumber; Result : access OCINumber) return SWord; function OCINumberMod (Err : in OCIError; Number1 : in OCINumber; Number2 : in OCINumber; Result : access OCINumber) return SWord; function OCINumberMul (Err : in OCIError; Number1 : in OCINumber; Number2 : in OCINumber; Result : access OCINumber) return SWord; function OCINumberPower (Err : in OCIError; Number1 : in OCINumber; Number2 : in OCINumber; Result : access OCINumber) return SWord; function OCINumberSub (Err : in OCIError; Number1 : in OCINumber; Number2 : in OCINumber; Result : access OCINumber) return SWord; function OCINumberToReal (Err : in OCIError; Number : in OCINumber; Rsl_Length : in UWord; Rsl : in DVoid) return SWord; function OCINumberToInt (Err : in OCIError; Number : in OCINumber; Rsl_Length : in UWord; Rsl_Flag : in UWord; Rsl : in DVoid) return SWord; function OCINumberFromReal (Err : in OCIError; Rnum : in DVoid; Rnum_Length : in UWord; Number : access OCINumber) return SWord; function OCINumberFromInt (Err : in OCIError; Inum : in DVoid; Inum_Length : in UWord; Inum_S_Flag : in UWord; Number : access OCINumber) return SWord; function OCINumberRound (Err : in OCIError; Number : in OCINumber; DecPlace : in SWord; Result : access OCINumber) return SWord; function OCINumberPrec (Err : in OCIError; Number : in OCINumber; NDigs : in EWord; Result : access OCINumber) return SWord; function OCINumberTrunc (Err : in OCIError; Number : in OCINumber; DecPlace : in SWord; Result : access OCINumber) return SWord; function OCINumberIntPower (Err : in OCIError; Number : in OCINumber; Exp : in SWord; Result : access OCINumber) return SWord; function OCINumberShift (Err : in OCIError; Number : in OCINumber; nDig : in SWord; Result : access OCINumber) return SWord; function OCINumberIsZero (Err : in OCIError; Number : in OCINumber; Result : access C_Boolean) return SWord; function OCILobAppend (Svchp : in OCISvcCtx; Errhp : in OCIError; Dst_Locp : in OCILobLocator; Src_Locp : in OCILobLocator) return SWord; function OCILobAssign (Envhp : in OCIEnv; Errhp : in OCIError; Src_Locp : in OCILobLocator; Dst_Locpp : in A_OCILobLocator) return SWord; function OCILobCharSetForm (Envhp : in OCIEnv; Errhp : in OCIError; Locp : in OCILobLocator; Csfrm : in A_Ub1) return SWord; function OCILobCharSetId (Envhp : in OCIEnv; Errhp : in OCIError; Locp : in OCILobLocator; Csid : in A_Ub2) return SWord; function OCILobCopy (Svchp : in OCISvcCtx; Errhp : in OCIError; Dst_Locp : in OCILobLocator; Src_Locp : in OCILobLocator; Amount : in Ub4; Dst_Offset : in Ub4; Src_Offset : in Ub4) return SWord; function OCILobCreateTemporary (Svchp : in OCISvcCtx; Errhp : in OCIError; Locp : in OCILobLocator; Csid : in Ub2; Csfrm : in Ub1; Lobtype : in Ub1; Cache : in C.int; Duration : in OCIDuration) return SWord; function OCILobClose (Svchp : in OCISvcCtx; Errhp : in OCIError; Locp : in OCILobLocator) return SWord; function OCILobDisableBuffering (Svchp : in OCISvcCtx; Errhp : in OCIError; Locp : in OCILobLocator) return SWord; function OCILobEnableBuffering (Svchp : in OCISvcCtx; Errhp : in OCIError; Locp : in OCILobLocator) return SWord; function OCILobErase (Svchp : in OCISvcCtx; Errhp : in OCIError; Locp : in OCILobLocator; Amount : in A_Ub4; Offset : in Ub4) return SWord; function OCILobFileClose (Svchp : in OCISvcCtx; Errhp : in OCIError; Filep : in OCILobLocator) return SWord; function OCILobFileCloseAll (Svchp : in OCISvcCtx; Errhp : in OCIError) return SWord; function OCILobFileExists (Svchp : in OCISvcCtx; Errhp : in OCIError; Filep : in OCILobLocator; Flag : in C.int) return SWord; function OCILobFileGetName (Envhp : in OCIEnv; Errhp : in OCIError; Filep : in OCILobLocator; Dir_Alias : in OraText; D_Length : in A_Ub2; Filename : in OraText; F_Length : in A_Ub2) return SWord; function OCILobFileIsOpen (Svchp : in OCISvcCtx; Errhp : in OCIError; Filep : in OCILobLocator; Flag : in A_Int) return SWord; function OCILobFileOpen (Svchp : in OCISvcCtx; Errhp : in OCIError; Filep : in OCILobLocator; Mode : in Ub1) return SWord; function OCILobFileSetName (Envhp : in OCIEnv; Errhp : in OCIError; Filepp : in A_OCILobLocator; Dir_Alias : in OraText; D_Length : in Ub2; Filename : in OraText; F_Length : in Ub2) return SWord; function OCILobFlushBuffer (Svchp : in OCISvcCtx; Errhp : in OCIError; Locp : in OCILobLocator; Flag : in Ub4) return SWord; function OCILobFreeTemporary (Svchp : in OCISvcCtx; Errhp : in OCIError; Locp : in OCILobLocator) return SWord; function OCILobGetChunkSize (Svchp : in OCISvcCtx; Errhp : in OCIError; Locp : in OCILobLocator; Chunksizep : in A_Ub4) return SWord; function OCILobGetLength (Svchp : in OCISvcCtx; Errhp : in OCIError; Locp : in OCILobLocator; Lenp : in A_Ub4) return SWord; function OCILobIsEqual (Envhp : in OCIEnv; X : in OCILobLocator; Y : in OCILobLocator; Is_Equal : in A_Int) return SWord; function OCILobIsOpen (Svchp : in OCISvcCtx; Errhp : in OCIError; Locp : in OCILobLocator; Flag : in A_Int) return SWord; function OCILobIsTemporary (Envhp : in OCIEnv; Errhp : in OCIError; Locp : in OCILobLocator; Is_Temporary : in A_Int) return SWord; function OCILobLoadFromFile (Svchp : in OCISvcCtx; Errhp : in OCIError; Dst_Locp : in OCILobLocator; Src_Filep : in OCILobLocator; Amount : in Ub4; Dst_Offset : in Ub4; Src_Offset : in Ub4) return SWord; function OCILobLocatorAssign (Svchp : in OCISvcCtx; Errhp : in OCIError; Src_Locp : in OCILobLocator; Dst_Locpp : in A_OCILobLocator) return SWord; function OCILobLocatorIsInit (Envhp : in OCIEnv; Errhp : in OCIError; Locp : in OCILobLocator; Is_Initialized : in A_Int) return SWord; function OCILobOpen (Svchp : in OCISvcCtx; Errhp : in OCIError; Locp : in OCILobLocator; Mode : in Ub1) return SWord; function OCILobRead (Svchp : in OCISvcCtx; Errhp : in OCIError; Locp : in OCILobLocator; Amtp : in A_Ub4; Offset : in Ub4; Bufp : in System.Address; Bufl : in Ub4; Ctxp : in System.Address; Cbfp : in Function_Pointer; Csid : in Ub2; Csfrm : in Ub1 := SQLCS_IMPLICIT) return SWord; function OCILobTrim (Svchp : in OCISvcCtx; Errhp : in OCIError; Locp : in OCILobLocator; Newlen : in Ub4) return SWord; function OCILobWrite (Svchp : in OCISvcCtx; Errhp : in OCIError; Locp : in OCILobLocator; Amtp : in A_Ub4; Offset : in Ub4; Bufp : in System.Address; Buflen : in Ub4; Piece : in Ub1; Ctxp : in System.Address; Cbfp : in Function_Pointer; Csid : in Ub2; Csfrm : in Ub1 := SQLCS_IMPLICIT) return SWord; function OCILobWriteAppend (Svchp : in OCISvcCtx; Errhp : in OCIError; Lobp : in OCILobLocator; Amtp : in A_Ub4; Bufp : in System.Address; Bufl : in Ub4; Piece : in Ub1; Ctxp : in System.Address; Cbfp : in Function_Pointer; Csid : in Ub2; Csfrm : in Ub1 := SQLCS_IMPLICIT) return SWord; function OCIStmtGetBindInfo (Stmtp : in OCIStmt; Errhp : in OCIError; Size : in Ub4; Startloc : in Ub4; Found : in A_Sb4; Bvnp : in Vector_Of_OraText; Bvnl : in Vector_Of_Ub1; Invp : in Vector_Of_OraText; Inpl : in Vector_Of_Ub1; Dupl : in Vector_Of_Ub1; Hndl : in Vector_Of_OCIBind) return SWord; function OCIStmtGetBindInfo (Stmtp : in OCIStmt; Errhp : in OCIError; Size : in Ub4; Startloc : in Ub4; Found : in A_Sb4; Bvnp : in A_Vector_Of_OraText; Bvnl : in A_Vector_Of_Ub1; Invp : in A_Vector_Of_OraText; Inpl : in A_Vector_Of_Ub1; Dupl : in A_Vector_Of_Ub1; Hndl : in A_Vector_Of_OCIBind) return SWord; function OCIDescribeAny (Svchp : in OCISvcCtx; Errhp : in OCIError; Objptr : in DVoid; Objnm_Len : in Ub4; Objptr_Typ : in Ub1; Info_Level : in Ub1; Objtyp : in Ub1; Dschp : in OCIDescribe) return SWord; type OCICallbackInBind is access function (Ictxp : in DVoid; Bindp : in OCIBind; Iter : in Ub4; Index : in Ub4; Bufpp : access DVoid; Alenp : access Ub4; Piecep : access Ub1; Indp : access DVoid) return SWord; pragma Convention (C, OCICallbackInBind); type OCICallbackOutBind is access function (Octxp : in DVoid; Bindp : in OCIBind; Iter : in Ub4; Index : in Ub4; Bufp : access DVoid; Alenpp : access A_Ub4; Piecep : access Ub1; Indpp : access DVoid; Rcodepp : access A_Ub2) return SWord; pragma Convention (C, OCICallbackOutBind); function OCIBindDynamic (Bindp : in OCIBind; Errhp : in OCIError; Ictxp : in DVoid; Icbfp : in DVoid; Octxp : in DVoid; Ocbfp : in DVoid) return SWord; function OCIBindDynamic (Bindp : in OCIBind; Errhp : in OCIError; Ictxp : in DVoid; Icbfp : in OCICallbackInBind; Octxp : in DVoid; Ocbfp : in OCICallbackOutBind) return SWord; type OCICallbackDefine is access function (Octxp : in DVoid; Defnp : in OCIDefine; Iter : in Ub4; Bufpp : access DVoid; Alenpp : access A_Ub4; Piecep : access Ub1; Indpp : access DVoid; Rcodepp : access A_Ub2) return SWord; pragma Convention (C, OCICallbackDefine); function OCIDefineDynamic (Defnp : in OCIDefine; Errhp : in OCIError; Octxp : in DVoid; Ocbfp : in OCICallbackDefine) return SWord; function OCIDefineDynamic (Defnp : in OCIDefine; Errhp : in OCIError; Octxp : in DVoid; Ocbfp : in DVoid) return SWord; -- External Proc Callbacks -- function OCIExtProcGetEnv (octxp : in OCIExtProcContext; Envhp : access OCIEnv; Svchp : access OCISvcCtx; Errhp : access OCIError) return SWord; function OCITerminate (Mode : Ub4 := OCI_DEFAULT) return SWord; type OCIUserCallback is access function (Ctxp : in DVoid; Hndlp : in OCIHandle; Htype : in Ub4; Fcode : in Ub4; When_Call : in Ub1; ReturnCode : in SWord; Errnop : access Sb4; Arglist : in DVoid) return SWord; pragma Convention (C, OCIUserCallback); function OCIUserCallbackRegister (Hndlp : in OCIHandle; Htype : in Ub4; Ehndlp : in OCIError; Callback : in OCIUserCallback; Ctxp : in DVoid; Fcode : in Ub4; When_Call : in Ub1; UcbDesc : in DVoid) return SWord; function OCIUserCallbackRegister (Hndlp : in OCIHandle; Htype : in Ub4; Ehndlp : in OCIError; Callback : in DVoid; Ctxp : in DVoid; Fcode : in Ub4; When_Call : in Ub1; UcbDesc : in DVoid) return SWord; function OCIServerAttach (Srvhp : in OCIServer; Errhp : in OCIError; Dblink : in Text; Dblink_Len : in Sb4; Mode : in Ub4 := OCI_DEFAULT) return SWord; function OCIServerDetach (Srvhp : in OCIServer; Errhp : in OCIError; Mode : in Ub4 := OCI_DEFAULT) return SWord; function OCISessionBegin (Svchp : in OCISvcCtx; Errhp : in OCIError; Usrhp : in OCISession; Credt : in Ub4 := OCI_CRED_RDBMS; Mode : in Ub4 := OCI_DEFAULT) return SWord; function OCISessionEnd (Svchp : in OCISvcCtx; Errhp : in OCIError; Usrhp : in OCISession; Mode : in Ub4 := OCI_DEFAULT) return SWord; function OCIBreak (hndlp : in OCIHandle; ehndlp : in OCIError) return SWord; function OCIReset (hndlp : in OCIHandle; ehndlp : in OCIError) return SWord; function OCISubscriptionRegister (Svchp : in OCISvcCtx; Subscrhpp : access OCISubscription; Count : in Ub2; Errhp : in OCIError; Mode : in Ub4) return SWord; function OCISubscriptionUnRegister (Svchp : in OCISvcCtx; Subscrhp : in OCISubscription; Errhp : in OCIError; Mode : in Ub4) return SWord; function OCISubscriptionEnable (Subscrhp : in OCISubscription; Errhp : in OCIError; Mode : in Ub4) return SWord; function OCISubscriptionDisable (Subscrhp : in OCISubscription; Errhp : in OCIError; Mode : in Ub4) return SWord; function OCISubscriptionPost (Svchp : in OCISvcCtx; Subscrhpp : access OCISubscription; Count : in Ub2; Errhp : in OCIError; Mode : in Ub4) return SWord; function OCIObjectNew (Env : in OCIEnv; Err : in OCIError; Svc : in OCISvcCtx; Typecode : in OCITypeCode; TDO : in OCIType; Table : in OCIHandle; Duration : in OCIDuration; Value : in Bool; Instance : access OCIHandle) return SWord; function OCITypeByName (Env : in OCIEnv; Err : in OCIError; Svc : in OCISvcCtx; Schema : in Text; S_Length : in Ub4; Type_Name : in Text; T_Length : in Ub4; Version : in Text; V_Length : in Ub4; Duration : in OCIDuration; Option : in OCITypeGetOpt; TDO : access OCIType) return SWord; function OCIObjectFree (Env : in OCIEnv; Err : in OCIError; Instance : in OCIHandle; Flags : in Ub2) return SWord; function OCIObjectGetInd (Env : in OCIEnv; Err : in OCIError; Instance : in OCIHandle; Null_Struct : access OCIHandle) return SWord; function OCIDefineObject (Defnp : in OCIDefine; Errhp : in OCIError; TDO : in OCIType; Value : in DVoid; Value_Sz : in A_Sb4; Indp : in DVoid; Ind_Sz : in A_Sb4) return SWord; function OCIBindObject (Bindp : in OCIBind; Errhp : in OCIError; TDO : in OCIType; Value : in DVoid; Value_Sz : in A_Sb4; Indp : in DVoid; Ind_Sz : in A_Sb4) return SWord; function OCICollAppend (Env : in OCIEnv; Err : in OCIError; Elem : in DVoid; Elemind : in DVoid := System.Null_Address; Coll : in OCIColl) return SWord; function OCICollSize (Env : in OCIEnv; Err : in OCIError; Coll : in OCIColl; Size : access Sb4) return SWord; function OCICollGetElem (Env : in OCIEnv; Err : in OCIError; Coll : in OCIColl; Index : in Sb4; Exists : access Bool; Elem : access DVoid; Elemind : in DVoid := System.Null_Address) return SWord; function OCICollGetElemArray (Env : in OCIEnv; Err : in OCIError; Coll : in OCIColl; Index : in Sb4; Exists : access Bool; Elem : access DVoid; Elemind : in DVoid := System.Null_Address; Length : access UWord) return SWord; function OCIStmtGetPieceInfo (Stmtp : in OCIStmt; Errhp : in OCIError; Hndlpp : access DVoid; Typep : access Ub4; In_Outp : access Ub1; Iterp : access Ub4; Idxp : access Ub4; Piecep : access Ub1) return SWord; function OCIStmtSetPieceInfo (Hndlp : in DVoid; Typev : in Ub4; Errhp : in OCIError; Bufp : in DVoid; Alenp : access Ub4; Piece : in Ub1; Indp : in DVoid; Rcodep : access Ub2) return SWord; procedure OCIThreadProcessInit; function OCIThreadInit (Hndl : in DVoid; Err : in OCIError) return SWord; function OCIThreadHndInit (Hndl : in DVoid; Err : in OCIError; THnd : access OCIThreadHandle) return SWord; function OCIThreadCreate (Hndl : in DVoid; Err : in OCIError; Start : in Function_Pointer; -- void (*start) (dvoid *arg) Arg : in DVoid; tid : in OCIThreadId; tHnd : in OCIThreadHandle) return SWord; function OCIThreadJoin (Hndl : in DVoid; Err : in OCIError; THnd : in OCIThreadHandle) return SWord; function OCIThreadMutexInit (Hndl : in DVoid; Err : in OCIError; Mutex : access OCIThreadMutex) return SWord; function OCIThreadMutexDestroy (Hndl : in DVoid; Err : in OCIError; Mutex : access OCIThreadMutex) return SWord; function OCIThreadMutexAcquire (Hndl : in DVoid; Err : in OCIError; Mutex : in OCIThreadMutex) return SWord; function OCIThreadMutexRelease (Hndl : in DVoid; Err : in OCIError; Mutex : in OCIThreadMutex) return SWord; private pragma Import (C, OCIEnvCreate, "OCIEnvCreate"); pragma Import (C, OCIErrorGet, "OCIErrorGet"); pragma Import (C, OCILogon, "OCILogon"); pragma Import (C, OCILogoff, "OCILogoff"); pragma Import (C, OCIInitialize, "OCIInitialize"); pragma Import (C, OCIEnvInit, "OCIEnvInit"); pragma Import (C, OCIHandleAlloc, "OCIHandleAlloc"); pragma Import (C, OCIHandleFree, "OCIHandleFree"); pragma Import (C, OCIStmtPrepare, "OCIStmtPrepare"); pragma Import (C, OCIStmtExecute, "OCIStmtExecute"); pragma Import (C, OCIStmtGetPieceInfo, "OCIStmtGetPieceInfo"); pragma Import (C, OCIStmtSetPieceInfo, "OCIStmtSetPieceInfo"); pragma Import (C, OCIParamGet, "OCIParamGet"); pragma Import (C, OCIAttrGet, "OCIAttrGet"); pragma Import (C, OCIAttrSet, "OCIAttrSet"); pragma Import (C, OCIStmtFetch, "OCIStmtFetch"); pragma Import (C, OCIBindByName, "OCIBindByName"); pragma Import (C, OCIBindByPos, "OCIBindByPos"); pragma Import (C, OCIDefineByPos, "OCIDefineByPos"); pragma Import (C, OCIDateToText, "OCIDateToText"); pragma Import (C, OCIDateFromText, "OCIDateFromText"); pragma Import (C, OCIDateCompare, "OCIDateCompare"); pragma Import (C, OCIDateSysDate, "OCIDateSysDate"); pragma Import (C, OCIStringResize, "OCIStringResize"); pragma Import (C, OCIStringAssignText, "OCIStringAssignText"); pragma Import (C, OCIStringPtr, "OCIStringPtr"); pragma Import (C, OCIStringSize, "OCIStringSize"); pragma Import (C, OCIStringAllocSize, "OCIStringAllocSize"); pragma Import (C, OCIDescriptorAlloc, "OCIDescriptorAlloc"); pragma Import (C, OCIDescriptorFree, "OCIDescriptorFree"); pragma Import (C, OCIServerVersion, "OCIServerVersion"); pragma Import (C, OCIClientVersion, "OCIClientVersion"); pragma Import (C, OCITransCommit, "OCITransCommit"); pragma Import (C, OCITransRollback, "OCITransRollback"); pragma Import (C, OCINumberAbs, "OCINumberAbs"); pragma Import (C, OCINumberArcCos, "OCINumberArcCos"); pragma Import (C, OCINumberArcSin, "OCINumberArcSin"); pragma Import (C, OCINumberArcTan, "OCINumberArcTan"); pragma Import (C, OCINumberAssign, "OCINumberAssign"); pragma Import (C, OCINumberCeil, "OCINumberCeil"); pragma Import (C, OCINumberCos, "OCINumberCos"); pragma Import (C, OCINumberExp, "OCINumberExp"); pragma Import (C, OCINumberFloor, "OCINumberFloor"); pragma Import (C, OCINumberHypCos, "OCINumberHypCos"); pragma Import (C, OCINumberHypSin, "OCINumberHypSin"); pragma Import (C, OCINumberHypTan, "OCINumberHypTan"); pragma Import (C, OCINumberLn, "OCINumberLn"); pragma Import (C, OCINumberNeg, "OCINumberNeg"); pragma Import (C, OCINumberSin, "OCINumberSin"); pragma Import (C, OCINumberSqrt, "OCINumberSqrt"); pragma Import (C, OCINumberTan, "OCINumberTan"); pragma Import (C, OCINumberArcTan2, "OCINumberArcTan2"); pragma Import (C, OCINumberAdd, "OCINumberAdd"); pragma Import (C, OCINumberCmp, "OCINumberCmp"); pragma Import (C, OCINumberSign, "OCINumberSign"); pragma Import (C, OCINumberDiv, "OCINumberDiv"); pragma Import (C, OCINumberLog, "OCINumberLog"); pragma Import (C, OCINumberMod, "OCINumberMod"); pragma Import (C, OCINumberMul, "OCINumberMul"); pragma Import (C, OCINumberPower, "OCINumberPower"); pragma Import (C, OCINumberSub, "OCINumberSub"); pragma Import (C, OCINumberToReal, "OCINumberToReal"); pragma Import (C, OCINumberToInt, "OCINumberToInt"); pragma Import (C, OCINumberFromReal, "OCINumberFromReal"); pragma Import (C, OCINumberFromInt, "OCINumberFromInt"); pragma Import (C, OCINumberToText, "OCINumberToText"); pragma Import (C, OCINumberFromText, "OCINumberFromText"); pragma Import (C, OCINumberRound, "OCINumberRound"); pragma Import (C, OCINumberTrunc, "OCINumberTrunc"); pragma Import (C, OCINumberPrec, "OCINumberPrec"); pragma Import (C, OCINumberIntPower, "OCINumberIntPower"); pragma Import (C, OCINumberShift, "OCINumberShift"); pragma Import (C, OCINumberIsZero, "OCINumberIsZero"); pragma Import (C, OCILobAppend, "OCILobAppend"); pragma Import (C, OCILobAssign, "OCILobAssign"); pragma Import (C, OCILobCharSetForm, "OCILobCharSetForm"); pragma Import (C, OCILobCharSetId, "OCILobCharSetId"); pragma Import (C, OCILobCopy, "OCILobCopy"); pragma Import (C, OCILobCreateTemporary, "OCILobCreateTemporary"); pragma Import (C, OCILobClose, "OCILobClose"); pragma Import (C, OCILobDisableBuffering, "OCILobDisableBuffering"); pragma Import (C, OCILobEnableBuffering, "OCILobEnableBuffering"); pragma Import (C, OCILobErase, "OCILobErase"); pragma Import (C, OCILobFileClose, "OCILobFileClose"); pragma Import (C, OCILobFileCloseAll, "OCILobFileCloseAll"); pragma Import (C, OCILobFileExists, "OCILobFileExists"); pragma Import (C, OCILobFileGetName, "OCILobFileGetName"); pragma Import (C, OCILobFileIsOpen, "OCILobFileIsOpen"); pragma Import (C, OCILobFileOpen, "OCILobFileOpen"); pragma Import (C, OCILobFileSetName, "OCILobFileSetName"); pragma Import (C, OCILobFlushBuffer, "OCILobFlushBuffer"); pragma Import (C, OCILobFreeTemporary, "OCILobFreeTemporary"); pragma Import (C, OCILobGetChunkSize, "OCILobGetChunkSize"); pragma Import (C, OCILobGetLength, "OCILobGetLength"); pragma Import (C, OCILobIsEqual, "OCILobIsEqual"); pragma Import (C, OCILobIsOpen, "OCILobIsOpen"); pragma Import (C, OCILobIsTemporary, "OCILobIsTemporary"); pragma Import (C, OCILobLoadFromFile, "OCILobLoadFromFile"); pragma Import (C, OCILobLocatorAssign, "OCILobLocatorAssign"); pragma Import (C, OCILobLocatorIsInit, "OCILobLocatorIsInit"); pragma Import (C, OCILobOpen, "OCILobOpen"); pragma Import (C, OCILobRead, "OCILobRead"); pragma Import (C, OCILobTrim, "OCILobTrim"); pragma Import (C, OCILobWrite, "OCILobWrite"); pragma Import (C, OCILobWriteAppend, "OCILobWriteAppend"); pragma Import (C, OCIStmtGetBindInfo, "OCIStmtGetBindInfo"); pragma Import (C, OCIDescribeAny, "OCIDescribeAny"); pragma Import (C, OCIBindDynamic, "OCIBindDynamic"); pragma Import (C, OCIDefineDynamic, "OCIDefineDynamic"); pragma Import (C, OCIExtProcGetEnv, "ociepgoe"); pragma Import (C, OCITerminate, "OCITerminate"); pragma Import (C, OCIUserCallbackRegister, "OCIUserCallbackRegister"); pragma Import (C, OCIServerAttach, "OCIServerAttach"); pragma Import (C, OCIServerDetach, "OCIServerDetach"); pragma Import (C, OCISessionBegin, "OCISessionBegin"); pragma Import (C, OCISessionEnd, "OCISessionEnd"); pragma Import (C, OCIBreak, "OCIBreak"); pragma Import (C, OCIReset, "OCIReset"); pragma Import (C, OCISubscriptionRegister, "OCISubscriptionRegister"); pragma Import (C, OCISubscriptionUnRegister, "OCISubscriptionUnRegister"); pragma Import (C, OCISubscriptionDisable, "OCISubscriptionDisable"); pragma Import (C, OCISubscriptionEnable, "OCISubscriptionEnable"); pragma Import (C, OCISubscriptionPost, "OCISubscriptionPost"); pragma Import (C, OCIObjectNew, "OCIObjectNew"); pragma Import (C, OCITypeByName, "OCITypeByName"); pragma Import (C, OCIObjectFree, "OCIObjectFree"); pragma Import (C, OCIObjectGetInd, "OCIObjectGetInd"); pragma Import (C, OCIDefineObject, "OCIDefineObject"); pragma Import (C, OCIBindObject, "OCIBindObject"); pragma Import (C, OCICollSize, "OCICollSize"); pragma Import (C, OCICollGetElem, "OCICollGetElem"); pragma Import (C, OCICollGetElemArray, "OCICollGetElemArray"); pragma Import (C, OCICollAppend, "OCICollAppend"); pragma Import (C, OCIThreadProcessInit, "OCIThreadProcessInit"); pragma Import (C, OCIThreadInit, "OCIThreadInit"); pragma Import (C, OCIThreadCreate, "OCIThreadCreate"); pragma Import (C, OCIThreadHndInit, "OCIThreadHndInit"); pragma Import (C, OCIThreadJoin, "OCIThreadJoin"); pragma Import (C, OCIThreadMutexInit, "OCIThreadMutexInit"); pragma Import (C, OCIThreadMutexDestroy, "OCIThreadMutexDestroy"); pragma Import (C, OCIThreadMutexAcquire, "OCIThreadMutexAcquire"); pragma Import (C, OCIThreadMutexRelease, "OCIThreadMutexRelease"); end OCI.Lib; gnade-1.6.2.orig/dbi/oci/oci-reference_finalization.adb0000644000175000017500000000330610537157463022647 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Thin Ada95 binding to OCI™ (Oracle® Call Interface™) -- -- Copyright (C) 2000-2006 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-reference_finalization.adb,v 1.8 2006/12/11 04:31:47 vagul Exp $ with Ada.Unchecked_Deallocation; package body OCI.Reference_Finalization is procedure Free is new Ada.Unchecked_Deallocation (Counter, Access_Count); ------------ -- Adjust -- ------------ procedure Adjust (Object : in out Controlled_Reference) is begin Object.Refer.Inc; end Adjust; ------------- -- Counter -- ------------- protected body Counter is --------- -- Dec -- --------- procedure Dec (Zero : out Boolean) is begin Data := Data - 1; Zero := Data = 0; end Dec; --------- -- Inc -- --------- procedure Inc is begin Data := Data + 1; end Inc; end Counter; -------------- -- Finalize -- -------------- procedure Finalize (Object : in out Controlled_Reference) is Zero : Boolean; begin Object.Refer.Dec (Zero); if Zero then Destroy (Controlled_Reference'Class (Object)); Free (Object.Refer); end if; end Finalize; ---------------- -- Initialize -- ---------------- procedure Initialize (Object : in out Controlled_Reference) is begin Object.Refer := new Counter; end Initialize; end OCI.Reference_Finalization; gnade-1.6.2.orig/dbi/oci/oci-reference_finalization.ads0000644000175000017500000000246310537157463022673 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Ada95 Interface to Oracle RDBMS -- -- Copyright (C) 2000-2006 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-reference_finalization.ads,v 1.8 2006/12/11 04:31:47 vagul Exp $ with System, Ada.Finalization; package OCI.Reference_Finalization is package AF renames Ada.Finalization; type Controlled_Reference is abstract new AF.Controlled with private; procedure Destroy (Object : in out Controlled_Reference) is abstract; private type Ref_Count is mod System.Max_Binary_Modulus; protected type Counter is procedure Dec (Zero : out Boolean); procedure Inc; private Data : Ref_Count := 1; end Counter; type Access_Count is access all Counter; type Controlled_Reference is abstract new AF.Controlled with record Refer : Access_Count; end record; procedure Initialize (Object : in out Controlled_Reference); procedure Adjust (Object : in out Controlled_Reference); procedure Finalize (Object : in out Controlled_Reference); end OCI.Reference_Finalization; gnade-1.6.2.orig/dbi/oci/oci-thick-binds.adb0000644000175000017500000000277211033070070020323 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Thin Ada95 binding to OCI™ (Oracle® Call Interface™) -- -- Copyright (C) 2000-2006 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-thick-binds.adb,v 1.13 2008/07/03 06:22:48 vagul Exp $ with OCI.Thread; package body OCI.Thick.Binds is ---------- -- Bind -- ---------- procedure Bind (Stmt : in Statement; Var : in out Abstract_Bind'Class; Name : in String; Type_Id : in Ub2; Value : in DVoid; Size : in Sb4; Ind : in A_Sb2) is begin Check_Error (OCIBindByName (Stmtp => OCIStmt (Handle (Stmt)), Bindpp => Var.Bind'Access, Errhp => Thread.Error, Placeholder => C.To_C (Name), Placeh_Len => Name'Length, Valuep => Value, Value_Sz => Size, Dty => Type_Id, Indp => Ind)); Var.Stmt := Stmt; end Bind; ------------- -- Destroy -- ------------- procedure Destroy (Item : in out Abstract_Bind) is pragma Unreferenced (Item); begin null; end Destroy; end OCI.Thick.Binds; gnade-1.6.2.orig/dbi/oci/oci-thick-binds.ads0000644000175000017500000000210610537157463020357 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Thin Ada95 binding to OCI™ (Oracle® Call Interface™) -- -- Copyright (C) 2000-2006 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-thick-binds.ads,v 1.8 2006/12/11 04:31:47 vagul Exp $ with OCI.Thick.Statements; package OCI.Thick.Binds is use Statements; type Abstract_Bind is abstract tagged private; private procedure Bind (Stmt : in Statement; Var : in out Abstract_Bind'Class; Name : in String; Type_Id : in Ub2; Value : in DVoid; Size : in Sb4; Ind : in A_Sb2); type Abstract_Bind is abstract new RF.Controlled_Reference with record Bind : aliased OCIBind := OCIBind (Empty_Handle); Stmt : Statement; end record; procedure Destroy (Item : in out Abstract_Bind); end OCI.Thick.Binds; gnade-1.6.2.orig/dbi/oci/oci-thick-connections.adb0000644000175000017500000002427511033070070021550 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Thin Ada95 binding to OCI™ (Oracle® Call Interface™) -- -- Copyright (C) 2000-2007 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-thick-connections.adb,v 1.20 2008/07/03 06:22:48 vagul Exp $ with Ada.Exceptions; with Ada.Strings.Fixed; with Ada.Unchecked_Deallocation; with OCI.Thread; package body OCI.Thick.Connections is use type SWord; use type Ub4; use type OCIHandle; ----------- -- Break -- ----------- procedure Break (It : Connection) is begin Check_Error (OCIBreak (Handle (It), Thread.Error)); end Break; ------------ -- Commit -- ------------ procedure Commit (Connect : in Connection) is begin Check_Error (OCITransCommit (OCISvcCtx (Connect.Handle), Thread.Error)); end Commit; ------------- -- Destroy -- ------------- procedure Destroy (Object : in out Connection) is H : OCIHandle := Object.Handle; procedure Free is new Ada.Unchecked_Deallocation (Type_Caches.Map, Type_Cache_Access); begin if H /= Empty_Handle then if Object.Sessn /= OCISession (Empty_Handle) then Ignore_Error (OCISessionEnd (Svchp => OCISvcCtx (H), Errhp => Thread.Error, Usrhp => Object.Sessn)); Free (OCIHandle (Object.Sessn), OCI_HTYPE_SESSION); Free (H, OCI_HTYPE_SVCCTX); else Ignore_Error (OCILogoff (Svchp => OCISvcCtx (H), Errhp => Thread.Error)); -- ??? Check_Error -- 8i bug end if; Free (Object.Type_Cache); end if; end Destroy; -------------------- -- Get_Connection -- -------------------- function Get_Connection (Context : in OCIExtProcContext) return Connection is Rc : SWord; H : aliased OCISvcCtx; E : aliased OCIEnv; Er : aliased OCIError; -- tr : OCI.Environments.Thread_Environment; Result : Connection; begin Rc := OCIExtProcGetEnv (octxp => Context, Envhp => E'Access, Errhp => Er'Access, Svchp => H'Access); -- tr := (RF.Controlled_Reference with Handle => E); -- Thread.Set_Environment (tr); Thread.Set_Error (E, Er); Check_Error (Rc); Result.Handle := OCIHandle (H); Result.Environment := Thread.Synch.Environment; return Result; end Get_Connection; -------------- -- Get_Type -- -------------- function Get_Type (Connect : in Connection; Name : in String) return OCIType is CN : Type_Caches.Cursor := Connect.Type_Cache.Find (Name); TDO : aliased OCIType; SS : Boolean; Empty : Text (1 .. 0); begin if Type_Caches.Has_Element (CN) then return Type_Caches.Element (CN); else Check_Error (OCITypeByName (Env => Thread.Environment, Err => Thread.Error, Svc => OCISvcCtx (Handle (Connect)), Schema => Empty, S_Length => 0, Type_Name => C.To_C (Name, False), T_Length => Name'Length, Version => Empty, V_Length => 0, Duration => OCI_DURATION_SESSION, Option => OCI_TYPEGET_ALL, TDO => TDO'Access)); Connect.Type_Cache.Insert (Name, TDO, CN, SS); return TDO; end if; end Get_Type; ----------------- -- Is_Blocking -- ----------------- function Is_Blocking (Connect : in Connection) return Boolean is function Get_Attrib is new Get_Attr_G (Ub1); use type Ub1; begin return Get_Attrib (Connect.Handle, OCI_HTYPE_SVCCTX, OCI_ATTR_NONBLOCKING_MODE) = 0; end Is_Blocking; ------------ -- Logoff -- ------------ procedure Logoff (Connect : in out Connection) is Result : Connection; begin Connect := Result; end Logoff; ----------- -- Logon -- ----------- function Logon (Server_Name : in String; User : in String; Password : in String) return Connection is begin return Logon (DB => Attach (Server_Name), User => User, Password => Password); end Logon; function Logon (DB : Server; User : String; Password : String) return Connection is Result : Connection; begin Result.Environment := Thread.Synch.Environment; Result.DB := DB; Result.Handle := Alloc_Handle (Thread.Environment, OCI_HTYPE_SVCCTX); Set_Attr (Result.Handle, OCI_HTYPE_SVCCTX, OCI_ATTR_SERVER, Handle (DB)); Result.Sessn := OCISession (Alloc_Handle (Thread.Environment, OCI_HTYPE_SESSION)); Set_Attr (OCIHandle (Result.Sessn), OCI_HTYPE_SESSION, OCI_ATTR_USERNAME, User); Set_Attr (OCIHandle (Result.Sessn), OCI_HTYPE_SESSION, OCI_ATTR_PASSWORD, Password); Set_Attr (Result.Handle, OCI_HTYPE_SVCCTX, OCI_ATTR_SESSION, OCIHandle (Result.Sessn)); Check_Error (OCISessionBegin (OCISvcCtx (Result.Handle), Thread.Error, Result.Sessn)); if OCI.Environments.Is_Objects then Result.Type_Cache := new Type_Caches.Map; end if; return Result; end Logon; function Logon (Connect : String) return Connection is User_First : Positive; User_Last : Positive; Password_First : Positive; Password_Last : Natural; Server_First : Positive; Server_Last : Natural; begin Split_Connect_String (Connect => Connect, User_First => User_First, User_Last => User_Last, Password_First => Password_First, Password_Last => Password_Last, Server_First => Server_First, Server_Last => Server_Last); return Logon (Server_Name => Connect (Server_First .. Server_Last), User => Connect (User_First .. User_Last), Password => Connect (Password_First .. Password_Last)); end Logon; ----------- -- Reset -- ----------- procedure Reset (It : in Connection) is begin Check_Error (OCIReset (Handle (It), Thread.Error)); end Reset; -------------- -- Rollback -- -------------- procedure Rollback (Connect : in Connection) is begin Check_Error (OCITransRollback (OCISvcCtx (Connect.Handle), Thread.Error)); end Rollback; function Rollback (Connect : in Connection) return Boolean is begin return OCITransRollback (OCISvcCtx (Connect.Handle), Thread.Error) = OCI_SUCCESS; end Rollback; -------------------- -- Server_Version -- -------------------- function Server_Version (Connect : in Connection) return String is Buff : aliased Text := (0 .. 511 => C.nul); begin Check_Error (OCIServerVersion (Hndlp => Connect.Handle, Errhp => Thread.Error, Bufp => CStr.To_Chars_Ptr (Buff'Unchecked_Access), Bufsz => Buff'Length - 1, Hndltype => OCI_HTYPE_SVCCTX)); return C.To_Ada (Buff); end Server_Version; ------------------ -- Set_Blocking -- ------------------ procedure Set_Blocking (Connect : in out Connection; Mode : in Boolean) is B1 : aliased constant Ub1 := Boolean'Pos (not Mode); begin if Is_Blocking (Connect) = Mode then return; end if; Set_Attr (Connect.Handle, OCI_HTYPE_SVCCTX, OCI_ATTR_NONBLOCKING_MODE, Value => B1'Address); if Is_Blocking (Connect) /= Mode then raise Program_Error with "Set blocking mode error."; end if; end Set_Blocking; -------------------------- -- Split_Connect_String -- -------------------------- procedure Split_Connect_String (Connect : in String; User_First : out Positive; User_Last : out Positive; Password_First : out Positive; Password_Last : out Natural; Server_First : out Positive; Server_Last : out Natural) is DP, DS : Natural; use Ada.Strings.Fixed, Ada.Strings; begin DP := Index (Connect, "/"); DS := Index (Connect, "@", Backward); User_First := Connect'First; if DS > 0 and then DP > DS then Ada.Exceptions.Raise_Exception (Constraint_Error'Identity, "Wrong connect string format """ & Connect & '"'); elsif DS = 0 and then DP = 0 then User_Last := Connect'Last; Password_First := Connect'First; Password_Last := Connect'First - 1; Server_First := Connect'First; Server_Last := Connect'First - 1; else if DP /= 0 then User_Last := DP - 1; Password_First := DP + 1; if DS /= 0 then Password_Last := DS - 1; Server_First := DS + 1; Server_Last := Connect'Last; else Password_Last := Connect'Last; Server_First := Connect'First; Server_Last := Connect'First - 1; end if; else -- DP = 0 and DS /= 0 User_Last := DS - 1; Password_First := Connect'First; Password_Last := Connect'First - 1; Server_First := DS + 1; Server_Last := Connect'Last; end if; end if; end Split_Connect_String; --------------- -- User_Name -- --------------- function User_Name (Connect : in Connection) return String is begin return Get_Attr (OCIHandle (Connect.Sessn), OCI_HTYPE_SESSION, OCI_ATTR_USERNAME); end User_Name; end OCI.Thick.Connections; gnade-1.6.2.orig/dbi/oci/oci-thick-connections.ads0000644000175000017500000000571710647346415021614 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Ada95 Interface to Oracle RDBMS -- -- Copyright (C) 2000-2007 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-thick-connections.ads,v 1.14 2007/07/18 08:19:25 vagul Exp $ with Ada.Containers.Indefinite_Hashed_Maps; with Ada.Strings.Hash; with OCI.Environments; with OCI.Thick.Servers; package OCI.Thick.Connections is use OCI.Thick.Servers; type Connection is new Handle_Reference with private; function Logon (Server_Name : in String; User : in String; Password : in String) return Connection; function Logon (Connect : String) return Connection; function Logon (DB : in Server; User : in String; Password : in String) return Connection; procedure Split_Connect_String (Connect : in String; User_First : out Positive; User_Last : out Positive; Password_First : out Positive; Password_Last : out Natural; Server_First : out Positive; Server_Last : out Natural); procedure Logoff (Connect : in out Connection); procedure Set_Blocking (Connect : in out Connection; Mode : in Boolean); function Is_Blocking (Connect : in Connection) return Boolean; function User_Name (Connect : in Connection) return String; function Server_Version (Connect : in Connection) return String; procedure Commit (Connect : in Connection); procedure Rollback (Connect : in Connection); function Rollback (Connect : in Connection) return Boolean; -- Return false in error on rollback operation. -- Use it if you do not want to cach exception just on Rollback. -- It is convinient when connection is be broken, and we could not -- recognise it from first error code. procedure Break (It : Connection); procedure Reset (It : Connection); function Get_Connection (Context : OCIExtProcContext) return Connection; -- get Connection for extproc callbacks function Get_Type (Connect : in Connection; Name : in String) return OCIType; -- Need to object type creation private package Type_Caches is new Ada.Containers.Indefinite_Hashed_Maps (Key_Type => String, Element_Type => OCIType, Hash => Ada.Strings.Hash, Equivalent_Keys => "=", "=" => System."="); type Type_Cache_Access is access all Type_Caches.Map; type Connection is new Handle_Reference with record DB : Server; Sessn : OCISession := OCISession (Empty_Handle); Environment : OCI.Environments.Thread_Environment; Type_Cache : Type_Cache_Access; end record; procedure Destroy (Object : in out Connection); end OCI.Thick.Connections; gnade-1.6.2.orig/dbi/oci/oci-thick-containers-enumeration.adb0000644000175000017500000001731010766200426023723 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Thin Ada binding to OCI™ (Oracle® Call Interface™) -- -- Copyright (C) 2007-2008 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $RCSfile: oci-thick-containers-enumeration.adb,v $ -- $Revision: 1.6 $ $Date: 2008/03/13 10:25:26 $ $Author: vagul $ with OCI.Thick.DB; package body OCI.Thick.Containers.Enumeration is ----------- -- Clear -- ----------- procedure Clear (Container : in out Container_Type; Name : in Enum; Iteration : in Positive := 1) is begin Clear (Container => Container, Position => Container.Index (Name), Iteration => Iteration); end Clear; --------- -- Get -- --------- function Get (Container : in Container_Type; Name : in Enum; Iteration : in Positive := 1) return Integer is begin return Get (Container => Container, Position => Container.Index (Name), Iteration => Iteration); end Get; --------- -- Get -- --------- function Get (Container : in Container_Type; Name : in Enum; Iteration : in Positive := 1) return Long_Float is begin return Get (Container => Container, Position => Container.Index (Name), Iteration => Iteration); end Get; --------- -- Get -- --------- function Get (Container : in Container_Type; Name : in Enum; Iteration : in Positive := 1) return String is begin return Get (Container => Container, Position => Container.Index (Name), Iteration => Iteration); end Get; --------- -- Get -- --------- function Get (Container : in Container_Type; Name : in Enum; Iteration : in Positive := 1) return OCINumber is begin return Get (Container => Container, Position => Container.Index (Name), Iteration => Iteration); end Get; --------- -- Get -- --------- function Get (Container : in Container_Type; Name : in Enum; Iteration : in Positive := 1) return Ada.Calendar.Time is begin return Get (Container => Container, Position => Container.Index (Name), Iteration => Iteration); end Get; --------- -- Get -- --------- function Get (Container : in Container_Type; Name : in Enum; Iteration : in Positive := 1) return Lobs.Locator is begin return Get (Container => Container, Position => Container.Index (Name), Iteration => Iteration); end Get; --------- -- Get -- --------- function Get (Container : in Container_Type; Name : in Enum; Iteration : in Positive := 1) return Data_Holder is begin return Get (Container => Container, Position => Container.Index (Name), Iteration => Iteration); end Get; --------- -- Get -- --------- procedure Get (Container : in Container_Type; Item : out Data_Holder; Name : in Enum; Iteration : in Positive := 1) is begin Get (Container => Container, Item => Item, Position => Container.Index (Name), Iteration => Iteration); end Get; ----------- -- Index -- ----------- function Index (Container : in Container_Type; Name : in Enum) return Natural is begin return Container.Index (Name); end Index; ------------- -- Is_Null -- ------------- function Is_Null (Container : in Container_Type; Name : in Enum; Iteration : in Positive := 1) return Boolean is begin return Is_Null (Container => Container, Position => Container.Index (Name), Iteration => Iteration); end Is_Null; ------------------------- -- Name_Bind_Positions -- ------------------------- procedure Name_Bind_Positions (Container : in out Container_Type; Statement : in DB.Statement) is begin Container.Index := (others => 0); for J in 1 .. DB.Bind_Count (Statement) loop Container.Index (Enum'Value (DB.Bind_Name (Statement, J))) := J; end loop; end Name_Bind_Positions; --------------------------- -- Name_Define_Positions -- --------------------------- procedure Name_Define_Positions (Container : in out Container_Type; Statement : in DB.Statement) is begin Container.Index := (others => 0); for J in 1 .. DB.Number_Of_Columns (Statement) loop Container.Index (Enum'Value (DB.Column_Name (Statement, J))) := J; end loop; end Name_Define_Positions; --------- -- Set -- --------- procedure Set (Container : in out Container_Type; Item : in Integer; Name : in Enum; Iteration : in Positive := 1) is begin Set (Container => Container, Item => Item, Position => Container.Index (Name), Iteration => Iteration); end Set; --------- -- Set -- --------- procedure Set (Container : in out Container_Type; Item : in Long_Float; Name : in Enum; Iteration : in Positive := 1) is begin Set (Container => Container, Item => Item, Position => Container.Index (Name), Iteration => Iteration); end Set; --------- -- Set -- --------- procedure Set (Container : in out Container_Type; Item : in String; Name : in Enum; Iteration : in Positive := 1) is begin Set (Container => Container, Item => Item, Position => Container.Index (Name), Iteration => Iteration); end Set; --------- -- Set -- --------- procedure Set (Container : in out Container_Type; Item : in OCINumber; Name : in Enum; Iteration : in Positive := 1) is begin Set (Container => Container, Item => Item, Position => Container.Index (Name), Iteration => Iteration); end Set; --------- -- Set -- --------- procedure Set (Container : in out Container_Type; Item : in Ada.Calendar.Time; Name : in Enum; Iteration : in Positive := 1) is begin Set (Container => Container, Item => Item, Position => Container.Index (Name), Iteration => Iteration); end Set; --------- -- Set -- --------- procedure Set (Container : in out Container_Type; Item : in Lobs.Locator; Name : in Enum; Iteration : in Positive := 1) is begin Set (Container => Container, Item => Item, Position => Container.Index (Name), Iteration => Iteration); end Set; --------- -- Set -- --------- procedure Set (Container : in out Container_Type; Item : in Data_Holder; Name : in Enum; Iteration : in Positive := 1) is begin Set (Container => Container, Item => Item, Position => Container.Index (Name), Iteration => Iteration); end Set; end OCI.Thick.Containers.Enumeration; gnade-1.6.2.orig/dbi/oci/oci-thick-containers-enumeration.ads0000644000175000017500000001051710766200426023746 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Thin Ada binding to OCI™ (Oracle® Call Interface™) -- -- Copyright (C) 2007-2008 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $RCSfile: oci-thick-containers-enumeration.ads,v $ -- $Revision: 1.5 $ $Date: 2008/03/13 10:25:26 $ $Author: vagul $ limited with OCI.Thick.DB; generic type Enum is (<>); package OCI.Thick.Containers.Enumeration is type Container_Type is new Containers.Container_Type with private; procedure Name_Bind_Positions (Container : in out Container_Type; Statement : in DB.Statement); -- Initialise container bind names index from DB module procedure Name_Define_Positions (Container : in out Container_Type; Statement : in DB.Statement); -- Initialise container define names index from DB module function Index (Container : in Container_Type; Name : Enum) return Natural; -- Returns index of the name in container. -- Return 0 if name does not found. pragma Inline (Index); procedure Set (Container : in out Container_Type; Item : in Integer; Name : in Enum; Iteration : in Positive := 1); pragma Inline (Set); procedure Set (Container : in out Container_Type; Item : in Long_Float; Name : in Enum; Iteration : in Positive := 1); pragma Inline (Set); procedure Set (Container : in out Container_Type; Item : in String; Name : in Enum; Iteration : in Positive := 1); pragma Inline (Set); procedure Set (Container : in out Container_Type; Item : in OCINumber; Name : in Enum; Iteration : in Positive := 1); pragma Inline (Set); procedure Set (Container : in out Container_Type; Item : in Ada.Calendar.Time; Name : in Enum; Iteration : in Positive := 1); pragma Inline (Set); procedure Set (Container : in out Container_Type; Item : in Lobs.Locator; Name : in Enum; Iteration : in Positive := 1); pragma Inline (Set); procedure Set (Container : in out Container_Type; Item : in Data_Holder; Name : in Enum; Iteration : in Positive := 1); pragma Inline (Set); procedure Clear (Container : in out Container_Type; Name : in Enum; Iteration : in Positive := 1); pragma Inline (Clear); function Is_Null (Container : in Container_Type; Name : in Enum; Iteration : in Positive := 1) return Boolean; pragma Inline (Is_Null); function Get (Container : in Container_Type; Name : in Enum; Iteration : in Positive := 1) return Integer; pragma Inline (Get); function Get (Container : in Container_Type; Name : in Enum; Iteration : in Positive := 1) return Long_Float; pragma Inline (Get); function Get (Container : in Container_Type; Name : in Enum; Iteration : in Positive := 1) return String; pragma Inline (Get); function Get (Container : in Container_Type; Name : in Enum; Iteration : in Positive := 1) return OCINumber; pragma Inline (Get); function Get (Container : in Container_Type; Name : in Enum; Iteration : in Positive := 1) return Ada.Calendar.Time; pragma Inline (Get); function Get (Container : in Container_Type; Name : in Enum; Iteration : in Positive := 1) return Lobs.Locator; pragma Inline (Get); function Get (Container : in Container_Type; Name : in Enum; Iteration : in Positive := 1) return Data_Holder; pragma Inline (Get); procedure Get (Container : in Container_Type; Item : out Data_Holder; Name : in Enum; Iteration : in Positive := 1); pragma Inline (Get); private type Index_Type is array (Enum) of Natural; type Container_Type is new Containers.Container_Type with record Index : Index_Type := (others => 0); end record; end OCI.Thick.Containers.Enumeration; gnade-1.6.2.orig/dbi/oci/oci-thick-containers-strings.adb0000644000175000017500000001773010766200426023074 0ustar lbrentalbrentawith Ada.Characters.Handling; with OCI.Thick.DB; package body OCI.Thick.Containers.Strings is function To_Bind_Name (Item : String) return Bind_Names.Bounded_String; pragma Inline (To_Bind_Name); ----------- -- Clear -- ----------- procedure Clear (Container : in out Container_Type; Name : in String; Iteration : in Positive := 1) is begin Set (Container => Container, Item => Null_Data, Name => Name, Iteration => Iteration); end Clear; --------- -- Get -- --------- procedure Get (Container : in Container_Type; Item : out Data_Holder; Name : in String; Iteration : in Positive := 1) is begin Get (Container => Container, Item => Item, Position => Container.Index.Element (To_Bind_Name (Name)), Iteration => Iteration); end Get; function Get (Container : in Container_Type; Name : in String; Iteration : in Positive := 1) return Integer is Result : Data_Holder; begin Get (Container => Container, Item => Result, Name => Name, Iteration => Iteration); return Result.Int; end Get; function Get (Container : in Container_Type; Name : in String; Iteration : in Positive := 1) return Long_Float is Result : Data_Holder; begin Get (Container => Container, Item => Result, Name => Name, Iteration => Iteration); return Result.Flt; end Get; function Get (Container : in Container_Type; Name : in String; Iteration : in Positive := 1) return String is Result : Data_Holder; begin Get (Container => Container, Item => Result, Name => Name, Iteration => Iteration); return Ada.Strings.Unbounded.To_String (Result.Str); end Get; function Get (Container : in Container_Type; Name : in String; Iteration : in Positive := 1) return OCINumber is Result : Data_Holder; begin Get (Container => Container, Item => Result, Name => Name, Iteration => Iteration); return Result.Numb; end Get; function Get (Container : in Container_Type; Name : in String; Iteration : in Positive := 1) return Ada.Calendar.Time is Result : Data_Holder; begin Get (Container => Container, Item => Result, Name => Name, Iteration => Iteration); return Result.Dat; end Get; function Get (Container : in Container_Type; Name : in String; Iteration : in Positive := 1) return Lobs.Locator is Result : Data_Holder; begin Get (Container => Container, Item => Result, Name => Name, Iteration => Iteration); return Result.Loc; end Get; function Get (Container : in Container_Type; Name : in String; Iteration : in Positive := 1) return Data_Holder is Result : Data_Holder; begin Get (Container => Container, Item => Result, Name => Name, Iteration => Iteration); return Result; end Get; ----------- -- Index -- ----------- function Index (Container : in Container_Type; Name : String) return Natural is C : constant Name_Indexes.Cursor := Container.Index.Find (To_Bind_Name (Name)); begin if Name_Indexes.Has_Element (C) then return Name_Indexes.Element (C); else return 0; end if; end Index; ------------- -- Is_Null -- ------------- function Is_Null (Container : in Container_Type; Name : in String; Iteration : in Positive := 1) return Boolean is begin return Is_Null (Container => Container, Position => Container.Index.Element (To_Bind_Name (Name)), Iteration => Iteration); end Is_Null; ------------------------- -- Name_Bind_Positions -- ------------------------- procedure Name_Bind_Positions (Container : in out Container_Type; Statement : in DB.Statement) is begin Container.Index.Clear; for J in 1 .. DB.Bind_Count (Statement) loop Container.Index.Insert (To_Bind_Name (DB.Bind_Name (Statement, J)), J); end loop; end Name_Bind_Positions; --------------------------- -- Name_Define_Positions -- --------------------------- procedure Name_Define_Positions (Container : in out Container_Type; Statement : in DB.Statement) is begin Container.Index.Clear; for J in 1 .. DB.Bind_Count (Statement) loop Container.Index.Insert (To_Bind_Name (DB.Column_Name (Statement, J)), J); end loop; end Name_Define_Positions; --------- -- Set -- --------- procedure Set (Container : in out Container_Type; Item : in Data_Holder; Name : in String; Iteration : in Positive := 1) is begin Set (Container => Container, Item => Item, Position => Container.Index.Element (To_Bind_Name (Name)), Iteration => Iteration); end Set; procedure Set (Container : in out Container_Type; Item : in Integer; Name : in String; Iteration : in Positive := 1) is begin Set (Container => Container, Item => Data_Holder'(Kind => Type_Integer, Int => Item), Name => Name, Iteration => Iteration); end Set; procedure Set (Container : in out Container_Type; Item : in Long_Float; Name : in String; Iteration : in Positive := 1) is begin Set (Container => Container, Item => Data_Holder'(Kind => Type_Long_Float, Flt => Item), Name => Name, Iteration => Iteration); end Set; procedure Set (Container : in out Container_Type; Item : in String; Name : in String; Iteration : in Positive := 1) is begin Set (Container => Container, Item => Data_Holder' (Kind => Type_String, Str => Ada.Strings.Unbounded.To_Unbounded_String (Item)), Name => Name, Iteration => Iteration); end Set; procedure Set (Container : in out Container_Type; Item : in OCINumber; Name : in String; Iteration : in Positive := 1) is begin Set (Container => Container, Item => Data_Holder'(Kind => Type_Number, Numb => Item), Name => Name, Iteration => Iteration); end Set; procedure Set (Container : in out Container_Type; Item : in Ada.Calendar.Time; Name : in String; Iteration : in Positive := 1) is begin Set (Container => Container, Item => Data_Holder'(Kind => Type_Date, Dat => Item), Name => Name, Iteration => Iteration); end Set; procedure Set (Container : in out Container_Type; Item : in Lobs.Locator; Name : in String; Iteration : in Positive := 1) is begin Set (Container => Container, Item => Data_Holder'(Kind => Type_Lob, Loc => Item), Name => Name, Iteration => Iteration); end Set; ------------------ -- To_Bind_Name -- ------------------ function To_Bind_Name (Item : String) return Bind_Names.Bounded_String is begin return Bind_Names.To_Bounded_String (Ada.Characters.Handling.To_Upper (Item)); end To_Bind_Name; end OCI.Thick.Containers.Strings; gnade-1.6.2.orig/dbi/oci/oci-thick-containers-strings.ads0000644000175000017500000001025510766200426023110 0ustar lbrentalbrentawith Ada.Containers.Hashed_Maps; with Ada.Strings.Bounded.Hash; limited with OCI.Thick.DB; package OCI.Thick.Containers.Strings is type Container_Type is new Containers.Container_Type with private; procedure Name_Bind_Positions (Container : in out Container_Type; Statement : in DB.Statement); -- Initialise container bind name index from DB module. procedure Name_Define_Positions (Container : in out Container_Type; Statement : in DB.Statement); -- Initialise container define name index from DB module. -- Use this routine only if select statement do not have case insensitive -- quoted oracle column names and do not have duplicated column names. function Index (Container : in Container_Type; Name : in String) return Natural; -- Returns index of the name in container. -- Return 0 if name does not found. procedure Clear (Container : in out Container_Type; Name : in String; Iteration : in Positive := 1); pragma Inline (Clear); procedure Set (Container : in out Container_Type; Item : in Data_Holder; Name : in String; Iteration : in Positive := 1); procedure Set (Container : in out Container_Type; Item : in Integer; Name : in String; Iteration : in Positive := 1); pragma Inline (Set); procedure Set (Container : in out Container_Type; Item : in Long_Float; Name : in String; Iteration : in Positive := 1); pragma Inline (Set); procedure Set (Container : in out Container_Type; Item : in String; Name : in String; Iteration : in Positive := 1); pragma Inline (Set); procedure Set (Container : in out Container_Type; Item : in OCINumber; Name : in String; Iteration : in Positive := 1); pragma Inline (Set); procedure Set (Container : in out Container_Type; Item : in Ada.Calendar.Time; Name : in String; Iteration : in Positive := 1); pragma Inline (Set); procedure Set (Container : in out Container_Type; Item : in Lobs.Locator; Name : in String; Iteration : in Positive := 1); pragma Inline (Set); function Is_Null (Container : in Container_Type; Name : in String; Iteration : in Positive := 1) return Boolean; function Get (Container : in Container_Type; Name : in String; Iteration : in Positive := 1) return Data_Holder; pragma Inline (Get); function Get (Container : in Container_Type; Name : in String; Iteration : in Positive := 1) return Integer; pragma Inline (Get); function Get (Container : in Container_Type; Name : in String; Iteration : in Positive := 1) return Long_Float; pragma Inline (Get); function Get (Container : in Container_Type; Name : in String; Iteration : in Positive := 1) return String; pragma Inline (Get); function Get (Container : in Container_Type; Name : in String; Iteration : in Positive := 1) return OCINumber; pragma Inline (Get); function Get (Container : in Container_Type; Name : in String; Iteration : in Positive := 1) return Ada.Calendar.Time; pragma Inline (Get); function Get (Container : in Container_Type; Name : in String; Iteration : in Positive := 1) return Lobs.Locator; pragma Inline (Get); procedure Get (Container : in Container_Type; Item : out Data_Holder; Name : in String; Iteration : in Positive := 1); private function Bounded_Hash is new Ada.Strings.Bounded.Hash (Bind_Names); package Name_Indexes is new Ada.Containers.Hashed_Maps (Key_Type => Bind_Names.Bounded_String, Hash => Bounded_Hash, Element_Type => Positive, Equivalent_Keys => Bind_Names."="); type Container_Type is new Containers.Container_Type with record Index : Name_Indexes.Map; end record; end OCI.Thick.Containers.Strings; gnade-1.6.2.orig/dbi/oci/oci-thick-containers.adb0000644000175000017500000003461411007547441021405 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Ada95 Interface to Oracle RDBMS -- -- Copyright (C) 2006 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-thick-containers.adb,v 1.17 2008/05/05 09:10:57 vagul Exp $ with Ada.Strings.Fixed; with OCI.Thick.Number_Functions; with OCI.Thick.Date; package body OCI.Thick.Containers is use type SWord; use type Ub4; use type OCIHandle; ------------ -- Append -- ------------ procedure Append (Holder : in out Data_Holder; Item : in String) is use C; begin Ada.Strings.Unbounded.Append (Holder.Str, Item); end Append; procedure Append (Container : in out Data_Container; Item : in String; Position : in Positive; Iteration : in Positive := 1) is use type Ada.Containers.Count_Type; procedure Modify (V : in out Positions.Vector); ------------ -- Modify -- ------------ procedure Modify (V : in out Positions.Vector) is procedure Modify (D : in out Data_Holder); procedure Modify (D : in out Data_Holder) is begin Append (D, Item); end Modify; begin V.Update_Element (Position, Modify'Access); end Modify; begin Container.Data.Update_Element (Iteration, Modify'Access); end Append; ------------- -- C_Slice -- ------------- procedure C_Slice (Holder : in Data_Holder; Low : in Positive; Item : out C.char_array; Last : out C.size_t; Done : out Boolean) is use type Lib.C.size_t; use Ada.Strings.Unbounded; High : Positive := Low + Item'Length - 1; begin Done := High >= Length (Holder.Str); if Done then High := Length (Holder.Str); Last := Lib.C.size_t (High - Low) + Item'First; else Last := Item'Last; end if; Item (Item'First .. Last) := C.To_C (Slice (Holder.Str, Low => Low, High => High), Append_Nul => False); end C_Slice; ----------- -- Clear -- ----------- procedure Clear (Container : in out Data_Container) is begin Container.Data.Clear; end Clear; procedure Clear (Container : in out Container_Type; Position : in Positive; Iteration : in Positive := 1) is begin Set (Container => Container, Item => Null_Data, Position => Position, Iteration => Iteration); end Clear; --------- -- Get -- --------- procedure Get (Container : in Container_Type; Item : out Data_Holder; Position : in Positive; Iteration : in Positive := 1) is procedure Query (Item : in Positions.Vector); procedure Query (Item : in Positions.Vector) is begin if Position <= Integer (Item.Length) then Get.Item := Positions.Element (Item, Position); else Get.Item := Null_Data; end if; end Query; begin Container.Data.Query_Element (Iteration, Query'Access); end Get; function Get (Container : in Container_Type; Position : in Positive; Iteration : in Positive := 1) return Integer is Result : Data_Holder; begin Get (Container => Container, Item => Result, Position => Position, Iteration => Iteration); return Result.Int; end Get; function Get (Container : in Container_Type; Position : in Positive; Iteration : in Positive := 1) return Long_Float is Result : Data_Holder; begin Get (Container => Container, Item => Result, Position => Position, Iteration => Iteration); return Result.Flt; end Get; function Get (Container : in Container_Type; Position : in Positive; Iteration : in Positive := 1) return String is Result : Data_Holder; begin Get (Container => Container, Item => Result, Position => Position, Iteration => Iteration); return Value (Result); end Get; function Get (Container : in Container_Type; Position : in Positive; Iteration : in Positive := 1) return OCINumber is Result : Data_Holder; begin Get (Container => Container, Item => Result, Position => Position, Iteration => Iteration); return Result.Numb; end Get; function Get (Container : in Container_Type; Position : in Positive; Iteration : in Positive := 1) return Ada.Calendar.Time is Result : Data_Holder; begin Get (Container => Container, Item => Result, Position => Position, Iteration => Iteration); return Result.Dat; end Get; function Get (Container : in Container_Type; Position : in Positive; Iteration : in Positive := 1) return Lobs.Locator is Result : Data_Holder; begin Get (Container => Container, Item => Result, Position => Position, Iteration => Iteration); return Result.Loc; end Get; function Get (Container : in Container_Type; Position : in Positive; Iteration : in Positive := 1) return Data_Holder is Result : Data_Holder; begin Get (Container => Container, Item => Result, Position => Position, Iteration => Iteration); return Result; end Get; ----------- -- Image -- ----------- function Image (Item : in Data_Holder; Null_Image : in String := "") return String is use OCI.Thick.Date; function Reduced_Float_Image return String; function Reduced_Float_Image return String is use Ada.Strings; Img : constant String := Long_Float'Image (Item.Flt); Last_0 : constant Natural := Fixed.Index (Img, "0E", Backward); begin if Last_0 = 0 then return Img; end if; for J in reverse Img'First + 1 .. Last_0 - 1 loop if Img (J) /= '0' then return Img (Img'First .. J - Boolean'Pos (Img (J) = '.')) & Img (Last_0 + 1 .. Img'Last); end if; end loop; raise Program_Error; end Reduced_Float_Image; begin case Item.Kind is when Type_Null => return Null_Image; when Type_String => return Value (Item); when Type_Number => return Number_Functions.To_String (Item.Numb); when Type_Integer => return Item.Int'Img; when Type_Long_Float => return Reduced_Float_Image; when Type_Date => return To_String (To_OCI (Item.Dat)); when Type_Lob => return "(LOB)"; end case; end Image; ------------- -- Is_Null -- ------------- function Is_Null (Item : in Data_Holder) return Boolean is use Ada.Strings.Unbounded; begin return Item.Kind = Type_Null or else (Item.Kind = Type_String and then Item.Str = Null_Unbounded_String); end Is_Null; function Is_Null (Container : in Container_Type; Position : in Positive; Iteration : in Positive := 1) return Boolean is Result : Boolean := True; procedure Query (Item : in Positions.Vector); ----------- -- Query -- ----------- procedure Query (Item : in Positions.Vector) is begin if Position <= Integer (Item.Length) then Result := Is_Null (Item.Element (Position)); end if; end Query; begin Container.Data.Query_Element (Iteration, Query'Access); return Result; end Is_Null; ------------ -- Length -- ------------ function Length (Container : in Container_Type) return Natural is begin return Natural (Container.Data.Length); end Length; --------- -- Set -- --------- procedure Set (Container : in out Container_Type; Item : in Data_Holder; Position : in Positive; Iteration : in Positive := 1) is use type Ada.Containers.Count_Type; procedure Modify (Item : in out Positions.Vector); ------------ -- Modify -- ------------ procedure Modify (Item : in out Positions.Vector) is begin if Natural (Item.Length) < Position then Item.Append (Null_Data, Ada.Containers.Count_Type (Position) - Item.Length); end if; Item.Replace_Element (Position, Set.Item); end Modify; begin if Container.Length < Iteration then Container.Data.Append (Positions.Empty_Vector, Ada.Containers.Count_Type (Iteration - Container.Length)); end if; Container.Data.Update_Element (Iteration, Modify'Access); end Set; procedure Set (Container : in out Container_Type; Item : in Integer; Position : in Positive; Iteration : in Positive := 1) is begin Set (Container => Container, Item => Data_Holder'(Kind => Type_Integer, Int => Item), Position => Position, Iteration => Iteration); end Set; procedure Set (Container : in out Container_Type; Item : in Long_Float; Position : in Positive; Iteration : in Positive := 1) is begin Set (Container => Container, Item => Data_Holder'(Kind => Type_Long_Float, Flt => Item), Position => Position, Iteration => Iteration); end Set; procedure Set (Container : in out Container_Type; Item : in String; Position : in Positive; Iteration : in Positive := 1) is begin Set (Container => Container, Item => Data_Holder' (Kind => Type_String, Str => Ada.Strings.Unbounded.To_Unbounded_String (Item)), Position => Position, Iteration => Iteration); end Set; procedure Set (Container : in out Container_Type; Item : in OCINumber; Position : in Positive; Iteration : in Positive := 1) is begin Set (Container => Container, Item => Data_Holder'(Kind => Type_Number, Numb => Item), Position => Position, Iteration => Iteration); end Set; procedure Set (Container : in out Container_Type; Item : in Ada.Calendar.Time; Position : in Positive; Iteration : in Positive := 1) is begin Set (Container => Container, Item => Data_Holder'(Kind => Type_Date, Dat => Item), Position => Position, Iteration => Iteration); end Set; procedure Set (Container : in out Container_Type; Item : in Lobs.Locator; Position : in Positive; Iteration : in Positive := 1) is begin Set (Container => Container, Item => Data_Holder'(Kind => Type_Lob, Loc => Item), Position => Position, Iteration => Iteration); end Set; ------------- -- To_Data -- ------------- function To_Data (Item : Integer) return Data_Holder is begin return (Kind => Type_Integer, Int => Item); end To_Data; function To_Data (Item : String) return Data_Holder is begin return (Kind => Type_String, Str => Ada.Strings.Unbounded.To_Unbounded_String (Item)); end To_Data; function To_Data (Item : C.char_array) return Data_Holder is use type C.char; begin return To_Data (C.To_Ada (Item, Trim_Nul => Item (Item'Last) = C.nul)); end To_Data; function To_Data (Item : OCINumber) return Data_Holder is begin return (Kind => Type_Number, Numb => Item); end To_Data; function To_Data (Item : Long_Float) return Data_Holder is begin return (Kind => Type_Long_Float, Flt => Item); end To_Data; function To_Data (Item : Ada.Calendar.Time) return Data_Holder is begin return (Kind => Type_Date, Dat => Item); end To_Data; function To_Data (Item : Lobs.Locator) return Data_Holder is begin return (Kind => Type_Lob, Loc => Item); end To_Data; ----------- -- Value -- ----------- function Value (Item : in Data_Holder; Default : in Integer) return Integer is begin if Item.Kind = Type_Null then return Default; else return Item.Int; end if; end Value; function Value (Item : in Data_Holder; Default : in String) return String is begin if Item.Kind = Type_Null then return Default; else return Ada.Strings.Unbounded.To_String (Item.Str); end if; end Value; function Value (Item : in Data_Holder; Default : in Long_Float) return Long_Float is begin if Item.Kind = Type_Null then return Default; else return Item.Flt; end if; end Value; function Value (Item : in Data_Holder; Default : in OCINumber) return OCINumber is begin if Item.Kind = Type_Null then return Default; else return Item.Numb; end if; end Value; function Value (Item : in Data_Holder; Default : in Ada.Calendar.Time) return Ada.Calendar.Time is begin if Item.Kind = Type_Null then return Default; else return Item.Dat; end if; end Value; function Value (Item : in Data_Holder) return Integer is begin return Item.Int; end Value; function Value (Item : in Data_Holder) return String is begin return Value (Item, ""); end Value; function Value (Item : in Data_Holder) return Long_Float is begin return Item.Flt; end Value; function Value (Item : in Data_Holder) return OCINumber is begin return Item.Numb; end Value; function Value (Item : in Data_Holder) return Ada.Calendar.Time is begin return Item.Dat; end Value; function Value (Item : in Data_Holder) return Lobs.Locator is begin return Item.Loc; end Value; end OCI.Thick.Containers; gnade-1.6.2.orig/dbi/oci/oci-thick-containers.ads0000644000175000017500000001644110766200427021425 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Thin Ada95 binding to OCI™ (Oracle® Call Interface™) -- -- Copyright (C) 2006 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-thick-containers.ads,v 1.15 2008/03/13 10:25:27 vagul Exp $ with Ada.Calendar; with Ada.Containers.Vectors; with Ada.Strings.Unbounded; with OCI.Thick.Lobs; package OCI.Thick.Containers is type Data_Holder is private; Null_Data : constant Data_Holder; type Container_Type is tagged private; subtype Data_Container is Container_Type; -- ??? Old name for some time backward compartibility. procedure Clear (Container : in out Container_Type); pragma Inline (Clear); -- Clear container. function Length (Container : in Container_Type) return Natural; pragma Inline (Length); -- Number of field sets in container. procedure Set (Container : in out Container_Type; Item : in Integer; Position : in Positive; Iteration : in Positive := 1); pragma Inline (Set); procedure Set (Container : in out Container_Type; Item : in Long_Float; Position : in Positive; Iteration : in Positive := 1); pragma Inline (Set); procedure Set (Container : in out Container_Type; Item : in String; Position : in Positive; Iteration : in Positive := 1); pragma Inline (Set); procedure Set (Container : in out Container_Type; Item : in OCINumber; Position : in Positive; Iteration : in Positive := 1); pragma Inline (Set); procedure Set (Container : in out Container_Type; Item : in Ada.Calendar.Time; Position : in Positive; Iteration : in Positive := 1); pragma Inline (Set); procedure Set (Container : in out Container_Type; Item : in Lobs.Locator; Position : in Positive; Iteration : in Positive := 1); pragma Inline (Set); procedure Set (Container : in out Container_Type; Item : in Data_Holder; Position : in Positive; Iteration : in Positive := 1); procedure Clear (Container : in out Container_Type; Position : in Positive; Iteration : in Positive := 1); pragma Inline (Clear); function Is_Null (Container : in Container_Type; Position : in Positive; Iteration : in Positive := 1) return Boolean; function Get (Container : in Container_Type; Position : in Positive; Iteration : in Positive := 1) return Integer; pragma Inline (Get); function Get (Container : in Container_Type; Position : in Positive; Iteration : in Positive := 1) return Long_Float; pragma Inline (Get); function Get (Container : in Container_Type; Position : in Positive; Iteration : in Positive := 1) return String; pragma Inline (Get); function Get (Container : in Container_Type; Position : in Positive; Iteration : in Positive := 1) return OCINumber; pragma Inline (Get); function Get (Container : in Container_Type; Position : in Positive; Iteration : in Positive := 1) return Ada.Calendar.Time; pragma Inline (Get); function Get (Container : in Container_Type; Position : in Positive; Iteration : in Positive := 1) return Lobs.Locator; pragma Inline (Get); function Get (Container : in Container_Type; Position : in Positive; Iteration : in Positive := 1) return Data_Holder; pragma Inline (Get); procedure Get (Container : in Container_Type; Item : out Data_Holder; Position : in Positive; Iteration : in Positive := 1); procedure Append (Container : in out Container_Type; Item : in String; Position : in Positive; Iteration : in Positive := 1); procedure Append (Holder : in out Data_Holder; Item : in String); procedure C_Slice (Holder : in Data_Holder; Low : in Positive; Item : out C.char_array; Last : out C.size_t; Done : out Boolean); function Is_Null (Item : in Data_Holder) return Boolean; function Value (Item : in Data_Holder) return Integer; pragma Inline (Value); function Value (Item : in Data_Holder) return String; pragma Inline (Value); function Value (Item : in Data_Holder) return Long_Float; pragma Inline (Value); function Value (Item : in Data_Holder) return OCINumber; pragma Inline (Value); function Value (Item : in Data_Holder) return Ada.Calendar.Time; pragma Inline (Value); function Value (Item : in Data_Holder) return Lobs.Locator; pragma Inline (Value); function Value (Item : in Data_Holder; Default : in Integer) return Integer; pragma Inline (Value); function Value (Item : in Data_Holder; Default : in String) return String; pragma Inline (Value); function Value (Item : in Data_Holder; Default : in Long_Float) return Long_Float; pragma Inline (Value); function Value (Item : in Data_Holder; Default : in OCINumber) return OCINumber; pragma Inline (Value); function Value (Item : in Data_Holder; Default : in Ada.Calendar.Time) return Ada.Calendar.Time; pragma Inline (Value); function To_Data (Item : Integer) return Data_Holder; pragma Inline (To_Data); function To_Data (Item : String) return Data_Holder; pragma Inline (To_Data); function To_Data (Item : C.char_array) return Data_Holder; pragma Inline (To_Data); function To_Data (Item : OCINumber) return Data_Holder; pragma Inline (To_Data); function To_Data (Item : Long_Float) return Data_Holder; pragma Inline (To_Data); function To_Data (Item : Ada.Calendar.Time) return Data_Holder; pragma Inline (To_Data); function To_Data (Item : Lobs.Locator) return Data_Holder; pragma Inline (To_Data); function Image (Item : in Data_Holder; Null_Image : in String := "") return String; private type Data_Type is (Type_Null, Type_Integer, Type_Long_Float, Type_String, Type_Number, Type_Date, Type_Lob); type Data_Holder (Kind : Data_Type := Type_Null) is record case Kind is when Type_Number => Numb : OCINumber; when Type_Integer => Int : Integer; when Type_Long_Float => Flt : Long_Float; when Type_Date => Dat : Ada.Calendar.Time; when Type_String => Str : Ada.Strings.Unbounded.Unbounded_String; when Type_Lob => Loc : Lobs.Locator; when Type_Null => null; end case; end record; Null_Data : constant Data_Holder := (Kind => Type_Null); package Positions is new Ada.Containers.Vectors (Index_Type => Positive, Element_Type => Data_Holder); package Data_Vectors is new Ada.Containers.Vectors (Index_Type => Positive, Element_Type => Positions.Vector, "=" => Positions."="); type Container_Type is tagged record Data : Data_Vectors.Vector; end record; end OCI.Thick.Containers; gnade-1.6.2.orig/dbi/oci/oci-thick-date-internal.adb0000644000175000017500000000602110754006321021751 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Ada95 Interface to Oracle RDBMS -- -- Copyright (C) 2000-2006 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-thick-date-internal.adb,v 1.1 2008/02/11 08:52:33 vagul Exp $ package body OCI.Thick.Date.Internal is function SysDate return Date_Time is begin return To_Oracle (SysDate); end SysDate; function To_Ada (DT : in Date_Time) return Ada.Calendar.Time is use type Ub1; begin return Ada.Calendar.Time_Of (Year => Integer (DT (0) - 100) * 100 + Integer (DT (1) - 100), Month => Integer (DT (2)), Day => Integer (DT (3)), Seconds => Duration (Natural (DT (6) - 1) + 60 * (Natural (DT (5) - 1) + 60 * Natural (DT (4) - 1)))); end To_Ada; function To_Date (Item : String; Format : String) return Date_Time is begin return To_Oracle (To_Date (Item, Format)); end To_Date; function To_OCI (DT : in Date_Time) return OCIDate is use type Sb2; use type Ub1; begin return (OCIDateYYYY => Sb2 (DT (0) - 100) * 100 + Sb2 (DT (1) - 100), OCIDateMM => DT (2), OCIDateDD => DT (3), OCIDateTime => (OCITimeHH => DT (4) - 1, OCITimeMI => DT (5) - 1, OCITimeSS => DT (6) - 1)); end To_OCI; --------------- -- To_Oracle -- --------------- function To_Oracle (DT : in OCIDate) return Date_Time is use type Ub1; use type Sb2; begin return (0 => 100 + Ub1 (DT.OCIDateYYYY / 100), 1 => 100 + Ub1 (DT.OCIDateYYYY mod 100), 2 => DT.OCIDateMM, 3 => DT.OCIDateDD, 4 => DT.OCIDateTime.OCITimeHH + 1, 5 => DT.OCIDateTime.OCITimeMI + 1, 6 => DT.OCIDateTime.OCITimeSS + 1); end To_Oracle; function To_Oracle (DT : in Ada.Calendar.Time) return Date_Time is use Ada.Calendar; Year : Year_Number; Month : Month_Number; Day : Day_Number; Seconds : Day_Duration; Secs : Natural; begin Split (DT, Year, Month, Day, Seconds); if Seconds = 0.0 then Secs := 0; else Secs := Natural (Seconds - 0.5); end if; return (0 => Ub1 (100 + Year / 100), 1 => Ub1 (100 + Year mod 100), 2 => Ub1 (Month), 3 => Ub1 (Day), 4 => Ub1 (Secs / 3600 + 1), 5 => Ub1 (Secs / 60 rem 60 + 1), 6 => Ub1 (Secs rem 60 + 1)); end To_Oracle; function To_String (From : Date_Time; Format : String) return String is begin return To_String (To_OCI (From), Format); end To_String; end OCI.Thick.Date.Internal; gnade-1.6.2.orig/dbi/oci/oci-thick-date-internal.ads0000644000175000017500000000216110754006321021773 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Ada95 Interface to Oracle RDBMS -- -- Copyright (C) 2000-2006 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-thick-date-internal.ads,v 1.1 2008/02/11 08:52:33 vagul Exp $ with Ada.Calendar; package OCI.Thick.Date.Internal is type Date_Time is private; -- Internal oracle date representation. -- SQLT_DAT. function To_String (From : Date_Time; Format : String) return String; function To_Date (Item : String; Format : String) return Date_Time; function To_Ada (DT : in Date_Time) return Ada.Calendar.Time; function To_Oracle (DT : in Ada.Calendar.Time) return Date_Time; function To_OCI (DT : in Date_Time) return OCIDate; function To_Oracle (DT : in OCIDate) return Date_Time; function SysDate return Date_Time; private type Date_Time is array (0 .. 6) of Ub1; end OCI.Thick.Date.Internal; gnade-1.6.2.orig/dbi/oci/oci-thick-date.adb0000644000175000017500000001106310754006321020141 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Thin Ada95 binding to OCI™ (Oracle® Call Interface™) -- -- Copyright (C) 2000-2006 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-thick-date.adb,v 1.16 2008/02/11 08:52:33 vagul Exp $ with OCI.Lib; with OCI.Thread; with Interfaces.C; package body OCI.Thick.Date is --------- -- "<" -- --------- function "<" (Left, Right : OCIDate) return Boolean is begin return Compare (Left, Right) = -1; end "<"; ---------- -- "<=" -- ---------- function "<=" (Left, Right : OCIDate) return Boolean is begin return Compare (Left, Right) /= 1; end "<="; --------- -- ">" -- --------- function ">" (Left, Right : OCIDate) return Boolean is begin return Compare (Left, Right) = 1; end ">"; ---------- -- "=>" -- ---------- function ">=" (Left, Right : OCIDate) return Boolean is begin return Compare (Left, Right) /= -1; end ">="; ------------- -- Compare -- ------------- function Compare (Left, Right : OCIDate) return Compare_Result is Result : aliased SWord; begin Check_Error (OCIDateCompare (Err => Thread.Error, Date1 => Left, Date2 => Right, Result => Result'Access)); return Compare_Result (Result); end Compare; ----------- -- Equal -- ----------- function Equal (Left, Right : OCIDate) return Boolean is begin return Compare (Left, Right) = 0; end Equal; ------------- -- SysDate -- ------------- function SysDate return OCIDate is Result : aliased OCIDate; begin Check_Error (OCIDateSysDate (Err => Thread.Error, Date => Result'Access)); return Result; end SysDate; ------------ -- To_Ada -- ------------ function To_Ada (DT : in OCIDate) return Ada.Calendar.Time is begin return Ada.Calendar.Time_Of (Year => Integer (DT.OCIDateYYYY), Month => Integer (DT.OCIDateMM), Day => Integer (DT.OCIDateDD), Seconds => Duration (Natural (DT.OCIDateTime.OCITimeSS) + 60 * (Natural (DT.OCIDateTime.OCITimeMI) + 60 * Natural (DT.OCIDateTime.OCITimeHH)))); end To_Ada; ------------- -- To_Date -- ------------- function To_Date (Item : String; Format : String) return OCIDate is Result : aliased OCIDate; begin Check_Error (OCIDateFromText (Err => Thread.Error, Date_Str => C.To_C (Item), d_Str_Length => Item'Length, Fmt => C.To_C (Format), Fmt_Length => Format'Length, Lang_Name => CStr.Null_Ptr, Lang_Length => 0, Date => Result'Access)); return Result; end To_Date; ------------ -- To_OCI -- ------------ function To_OCI (DT : in Ada.Calendar.Time) return OCIDate is use Ada.Calendar; Year : Year_Number; Month : Month_Number; Day : Day_Number; Seconds : Day_Duration; Secs : Natural; begin Split (DT, Year, Month, Day, Seconds); if Seconds = 0.0 then Secs := 0; else Secs := Natural (Seconds - 0.5); end if; return (OCIDateYYYY => Sb2 (Year), OCIDateMM => Ub1 (Month), OCIDateDD => Ub1 (Day), OCIDateTime => (OCITimeHH => Ub1 (Secs / 3600), OCITimeMI => Ub1 (Secs / 60 rem 60), OCITimeSS => Ub1 (Secs rem 60))); end To_OCI; --------------- -- To_String -- --------------- function To_String (From : in OCIDate; Format : in String := "YYYY-MM-DD HH24:MI:SS") return String is use Interfaces.C; use type Ub4; Buff : aliased Text := (0 .. Format'Length + 64 => C.nul); Len : aliased Ub4 := Buff'Length - 1; begin Check_Error (OCIDateToText (Err => Thread.Error, Date => From, Fmt => C.To_C (Format), Fmt_Length => Format'Length, Lang_Name => CStr.Null_Ptr, Lang_Length => 0, Buf_Size => Len'Access, Buf => CStr.To_Chars_Ptr (Buff'Unchecked_Access))); return C.To_Ada (Buff, False) (1 .. Integer (Len)); end To_String; end OCI.Thick.Date; gnade-1.6.2.orig/dbi/oci/oci-thick-date.ads0000644000175000017500000000364610754006321020172 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Ada95 Interface to Oracle RDBMS -- -- Copyright (C) 2000-2006 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-thick-date.ads,v 1.12 2008/02/11 08:52:33 vagul Exp $ with Ada.Calendar; package OCI.Thick.Date is type OCIDate is new Lib.OCIDate; type Compare_Result is new Integer range -1 .. 1; function To_String (From : in OCIDate; Format : in String := "YYYY-MM-DD HH24:MI:SS") return String; function To_Date (Item : String; Format : String) return OCIDate; function To_Ada (DT : in OCIDate) return Ada.Calendar.Time; function To_OCI (DT : in Ada.Calendar.Time) return OCIDate; function SysDate return OCIDate; function Compare (Left, Right : OCIDate) return Compare_Result; function "<" (Left, Right : OCIDate) return Boolean; function ">" (Left, Right : OCIDate) return Boolean; function Equal (Left, Right : OCIDate) return Boolean; -- The name is not "=" to avoid conflict with Standard "=" -- operator. function "<=" (Left, Right : OCIDate) return Boolean; function ">=" (Left, Right : OCIDate) return Boolean; pragma Inline ("<", ">", "<=", ">=", Equal); Init_OCIDate : constant OCIDate; private Init_OCIDate : constant OCIDate := ( OCIDateYYYY => 0, -- gregorian year; range is -4712 <= year <= 9999 OCIDateMM => 1, -- month; range is 1 <= month < 12 OCIDateDD => 1, -- day; range is 1 <= day <= 31 OCIDateTime => ( OCITimeHH => 0, -- hours; range is 0 <= hours <=23 OCITimeMI => 0, -- minutes; range is 0 <= minutes <= 59 OCITimeSS => 0) -- seconds; range is 0 <= seconds <= 59 ); end OCI.Thick.Date; gnade-1.6.2.orig/dbi/oci/oci-thick-date_var.ads0000644000175000017500000000114710754006321021034 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Thin Ada95 binding to OCI™ (Oracle® Call Interface™) -- -- Copyright (C) 2000-2006 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-thick-date_var.ads,v 1.2 2008/02/11 08:52:33 vagul Exp $ with OCI.Thick.Var; with OCI.Thick.Date.Internal; package OCI.Thick.Date_Var is new OCI.Thick.Var (OCI.Thick.Date.Internal.Date_Time, SQLT_DAT); gnade-1.6.2.orig/dbi/oci/oci-thick-db.adb0000644000175000017500000012215711033070070017611 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Ada95 Interface to Oracle RDBMS -- -- Copyright (C) 2006-2008 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-thick-db.adb,v 1.35 2008/07/03 06:22:48 vagul Exp $ with Ada.Characters.Handling, Ada.Exceptions, Ada.Strings.Fixed, Ada.Strings.Maps, Ada.Unchecked_Conversion, Ada.Unchecked_Deallocation, Interfaces.C.Strings, OCI.Thread; -- with Ada.Text_IO; -- with System.Address_Image; package body OCI.Thick.DB is -- procedure Print (Item : in String) renames Ada.Text_IO.Put_Line; use type SWord; use type Ub4; use type OCIHandle; Dummy_Connect : Connection; use Ada.Strings.Maps; package Dates renames Date.Internal; type Context_Type is record In_Data : access procedure (Data : out Data_Holder; Position : in Positive; Iteration : in Positive); Out_Data : access procedure (Data : in Data_Holder; Position : in Positive; Iteration : in Positive); Holder : Data_Holder; Buffer : aliased Buffer_Type; Alen : aliased Ub4; -- Output length Ind : aliased Sb2; -- Output null indicator Rcode : aliased Ub2; -- Output return code Piece : Ub1; -- Output piece Position : Natural := 0; -- Output position Iteration : Natural := 0; -- Output iteration Kind : Data_Type; -- Output data type Loc : Lobs.Locator; -- Output locator Output : Boolean := False; Str_Low : Natural := 0; Connect : Connection; -- to be able to create lob locator. Defines : Define_Array_Access; Error : Ada.Exceptions.Exception_Occurrence; -- from callback Iters : Natural; -- To check the number of iterations in callbacks end record; To_Data_Type : constant array (Lobs.Lob_Type) of Data_Type := (Lobs.Bin => Type_Bin_Lob, Lobs.File => Type_Bin_Lob, Lobs.Char => Type_Char_Lob, Lobs.NChar => Type_Char_Lob); subtype Lob_Subtype is Data_Type range Type_Char_Lob .. Type_Bin_Lob; To_Lob_Type : constant array (Lob_Subtype) of Lobs.Lob_Type := (Type_Char_Lob => Lobs.Char, Type_Bin_Lob => Lobs.Bin); Dos_Fix_CR : constant Character_Mapping := To_Mapping ("" & ASCII.CR, " "); Size_Of : constant array (Data_Type) of Sb4 := (Type_Integer => Sb4 (Integer'Size / System.Storage_Unit), Type_Long_Float => Sb4 (Long_Float'Size / System.Storage_Unit), Type_String => Sb4 (Sb2'Last), Type_Number => Sb4 (OCINumber'Size / System.Storage_Unit), Type_Date => Sb4 (Dates.Date_Time'Size / System.Storage_Unit), Type_Char_Lob => Sb4 (OCILobLocator'Size / System.Storage_Unit), Type_Bin_Lob => Sb4 (OCILobLocator'Size / System.Storage_Unit)); Same_Indicator : constant Sb2 := 16#ADA#; function To_Statement_Type is new Ada.Unchecked_Conversion (Ub2, Statement_Type); function To_OCI is new Ada.Unchecked_Conversion (Data_Type, Ub2); procedure Reset_Bind_Iter (Binds : in Bind_Array_Access); -- Procedure to reset internal iteration checker in binded variables. -- It is necessary to detect Oracle bugs reseting iteration counter. function Is_Lob (Kind : Data_Type) return Boolean; pragma Inline (Is_Lob); function Callback_In_Bind (Ictxp : in Bind_Access; Bindp : in OCIBind; Iter : in Ub4; Index : in Ub4; Bufpp : access DVoid; Alenp : in A_Ub4; Piecep : in A_Ub1; Indpp : access A_Sb2) return SWord; pragma Convention (C, Callback_In_Bind); function Callback_Out_Bind (Octxp : in Bind_Access; Bindp : in OCIBind; Iter : in Ub4; Index : in Ub4; Bufpp : access DVoid; Alenpp : access A_Ub4; Piecep : in A_Ub1; Indpp : access A_Sb2; Rcodepp : access A_Ub2) return SWord; pragma Convention (C, Callback_Out_Bind); procedure Callback_Out (PC : in Context_Access; Kind : in Data_Type; Iteration : in Positive; Position : in Positive; Loc : in Lobs.Locator; -- only for lob types. Bufp : out DVoid; Alenp : in out A_Ub4; Piece : in out Ub1; Indp : in out A_Sb2; Rcodep : in out A_Ub2; Result : out SWord); function Callback_Define (Octxp : in Define_Access; Defnp : in OCIDefine; Iter : in Ub4; Bufpp : access DVoid; Alenpp : access A_Ub4; Piecep : in A_Ub1; Indpp : access A_Sb2; Rcodepp : access A_Ub2) return SWord; pragma Convention (C, Callback_Define); procedure Execute_Internal (Stmt : in out Statement; In_Data : access procedure (Data : out Data_Holder; Position : in Positive; Iteration : in Positive); Out_Data : access procedure (Data : in Data_Holder; Position : in Positive; Iteration : in Positive); Count : in Natural; Raise_Exception : in out Boolean; Commit_On_Success : in Boolean); procedure Execute_Internal (Stmt : in out Statement; Data : in out Container_Type'Class; Raise_Exception : in out Boolean; Commit_On_Success : in Boolean); procedure Out_Flush (PC : in Context_Access; Last : in Boolean); -- Common code for Execute Bind output and for Fetch function Get_Attr_Ub2 is new Get_Attr_G (Ub2); function Get_Attr_Ub4 is new Get_Attr_G (Ub4); ---------- -- Bind -- ---------- procedure Bind (Stmt : in out Statement; Kind : in Data_Type; Position : in Positive) is begin Check_Error (OCIBindByPos (Stmtp => OCIStmt (Stmt.Handle), Bindpp => Stmt.Binds (Position).Bind'Access, Errhp => OCI.Thread.Error, Position => Ub4 (Position), Valuep => System.Null_Address, Value_Sz => Size_Of (Kind), Dty => To_OCI (Kind), Indp => null, Mode => OCI_DATA_AT_EXEC)); Check_Error (OCIBindDynamic (Bindp => Stmt.Binds (Position).Bind, Errhp => OCI.Thread.Error, Ictxp => Stmt.Binds (Position)'Address, Icbfp => Callback_In_Bind'Address, Octxp => Stmt.Binds (Position)'Address, Ocbfp => Callback_Out_Bind'Address)); Stmt.Binds (Position).Kind := Kind; Stmt.Binds (Position).Position := Position; Stmt.Binds (Position).Context := Stmt.Context; end Bind; procedure Bind (Stmt : in out Statement; Kind : in Data_Type; Name : in String) is begin for J in Stmt.Binds'Range loop -- Do not need indexed search because bind should be only once for -- statement and there is not very much bind variables. if Bind_Names."=" (Stmt.Binds (J).Name, Ada.Characters.Handling.To_Upper (Name)) then Check_Error (OCIBindByName (Stmtp => OCIStmt (Stmt.Handle), Bindpp => Stmt.Binds (J).Bind'Access, Errhp => OCI.Thread.Error, Placeholder => C.To_C (Name), Placeh_Len => Name'Length, Valuep => System.Null_Address, Value_Sz => Size_Of (Kind), Dty => To_OCI (Kind), Indp => null, Mode => OCI_DATA_AT_EXEC)); Check_Error (OCIBindDynamic (Bindp => Stmt.Binds (J).Bind, Errhp => OCI.Thread.Error, Ictxp => Stmt.Binds (J)'Address, Icbfp => Callback_In_Bind'Address, Octxp => Stmt.Binds (J)'Address, Ocbfp => Callback_Out_Bind'Address)); Stmt.Binds (J).Kind := Kind; Stmt.Binds (J).Position := J; Stmt.Binds (J).Context := Stmt.Context; return; end if; end loop; raise Lib_Error with "Bind variable '" & Name & "' not found"; end Bind; ---------------- -- Bind_Count -- ---------------- function Bind_Count (Stmt : in Statement) return Natural is begin if Stmt.Binds = null then return 0; else return Stmt.Binds'Length; end if; end Bind_Count; --------------- -- Bind_Name -- --------------- function Bind_Name (Stmt : in Statement; Position : Positive) return String is begin return Bind_Names.To_String (Stmt.Binds (Position).Name); end Bind_Name; --------------------- -- Callback_Define -- --------------------- function Callback_Define (Octxp : in Define_Access; Defnp : in OCIDefine; Iter : in Ub4; Bufpp : access DVoid; Alenpp : access A_Ub4; Piecep : in A_Ub1; Indpp : access A_Sb2; Rcodepp : access A_Ub2) return SWord is pragma Unreferenced (Defnp); Result : SWord; begin Callback_Out (PC => Octxp.Context, Iteration => Positive (Iter + 1), Position => Octxp.Position, Kind => Octxp.Kind, Loc => Octxp.Loc, Bufp => Bufpp.all, Alenp => Alenpp.all, Piece => Piecep.all, Indp => Indpp.all, Rcodep => Rcodepp.all, Result => Result); return Result; end Callback_Define; ---------------------- -- Callback_In_Bind -- ---------------------- function Callback_In_Bind (Ictxp : in Bind_Access; Bindp : in OCIBind; Iter : in Ub4; Index : in Ub4; Bufpp : access DVoid; Alenp : in A_Ub4; Piecep : in A_Ub1; Indpp : access A_Sb2) return SWord is pragma Unreferenced (Index); use type Ub1; PC : Context_Access := Ictxp.Context; Iteration : constant Positive := Positive (Iter + 1); procedure In_String_Piece; --------------------- -- In_String_Piece -- --------------------- procedure In_String_Piece is use type Lib.C.size_t; Done : Boolean; Last : Lib.C.size_t; begin if Piecep.all = OCI_FIRST_PIECE then PC.Str_Low := 1; PC.Holder := Null_Data; if PC.In_Data /= null then PC.In_Data (PC.Holder, Ictxp.Position, Iteration => Iteration); end if; if Is_Null (PC.Holder) then PC.Buffer.Char (1) := Lib.C.nul; Alenp.all := 1; Piecep.all := OCI_ONE_PIECE; PC.Ind := Null_Indicator; return; else PC.Ind := Not_Null_Indicator; end if; end if; C_Slice (PC.Holder, Low => PC.Str_Low, Item => PC.Buffer.Char (1 .. Char_Buffer_Size - 1), Last => Last, Done => Done); if Done then PC.Buffer.Char (Last + 1) := Lib.C.nul; Alenp.all := Ub4 (Last + 1); if PC.Str_Low = 1 then Piecep.all := OCI_ONE_PIECE; else Piecep.all := OCI_LAST_PIECE; end if; else Alenp.all := Ub4 (Last); if PC.Str_Low = 1 then Piecep.all := OCI_FIRST_PIECE; else Piecep.all := OCI_NEXT_PIECE; end if; end if; PC.Str_Low := PC.Str_Low + Natural (Last); end In_String_Piece; begin if Iteration > PC.Iters then raise Program_Error with "Iteration" & Natural'Image (Iteration) & " more then " & Natural'Image (PC.Iters); end if; Out_Flush (Ictxp.Context, Last => True); if Bindp /= Ictxp.Bind then raise Program_Error; end if; Indpp.all := PC.Ind'Access; Bufpp.all := PC.Buffer'Address; if Ictxp.Kind = Type_String then In_String_Piece; else PC.Holder := Null_Data; if PC.In_Data /= null then PC.In_Data (PC.Holder, Ictxp.Position, Iteration); end if; Alenp.all := Ub4 (Size_Of (Ictxp.Kind)); Piecep.all := OCI_ONE_PIECE; if Is_Null (PC.Holder) then PC.Ind := Null_Indicator; else PC.Ind := Not_Null_Indicator; case Ictxp.Kind is when Type_String => raise Program_Error; when Type_Integer => PC.Buffer.Int := Value (PC.Holder); when Type_Long_Float => PC.Buffer.Flt := Value (PC.Holder); when Type_Number => PC.Buffer.Numb := Value (PC.Holder); when Type_Date => PC.Buffer.Dat := Dates.To_Oracle (Value (PC.Holder)); when Type_Char_Lob | Type_Bin_Lob => -- Save in value for further out value. Ictxp.Loc := Value (PC.Holder); Bufpp.all := Handle (Ictxp.Loc); end case; end if; if Is_Lob (Ictxp.Kind) then if Is_Null (PC.Holder) or else Bufpp.all = Empty_Handle then Ictxp.Loc := Lobs.Create (Ictxp.Context.Connect, To_Lob_Type (Ictxp.Kind)); Bufpp.all := Handle (Ictxp.Loc); end if; if not Lobs.Is_Init (Ictxp.Loc) then PC.Ind := Null_Indicator; end if; end if; end if; if Piecep.all = OCI_FIRST_PIECE or else Piecep.all = OCI_ONE_PIECE then Ictxp.Iter := Ictxp.Iter + 1; Ictxp.Was := True; if Ictxp.Iter /= Iteration then raise Program_Error with "Unexpected iteration sequence in input" & Natural'Image (Ictxp.Iter) & Natural'Image (Iteration); end if; end if; return OCI_CONTINUE; exception when E : others => Ada.Exceptions.Save_Occurrence (PC.Error, E); return OCI_ERROR; end Callback_In_Bind; ------------------ -- Callback_Out -- ------------------ procedure Callback_Out (PC : in Context_Access; Kind : in Data_Type; Iteration : in Positive; Position : in Positive; Loc : in Lobs.Locator; Bufp : out DVoid; Alenp : in out A_Ub4; Piece : in out Ub1; Indp : in out A_Sb2; Rcodep : in out A_Ub2; Result : out SWord) is begin Out_Flush (PC => PC, Last => PC.Position /= Position or else PC.Iteration /= Iteration); if Kind = Type_String then PC.Alen := PC.Buffer.Char'Length; PC.Buffer.Char (1) := C.nul; else PC.Alen := Ub4 (Size_Of (Kind)); Piece := OCI_ONE_PIECE; end if; Alenp := PC.Alen'Access; Indp := PC.Ind'Access; Rcodep := PC.Rcode'Access; PC.Ind := Same_Indicator; if Is_Lob (Kind) then Bufp := Handle (Loc); if Bufp = Empty_Handle then PC.Loc := Lobs.Create (PC.Connect, To_Lob_Type (Kind)); Bufp := Handle (PC.Loc); else PC.Loc := Loc; end if; else Bufp := PC.Buffer'Address; end if; PC.Position := Position; PC.Iteration := Iteration; PC.Piece := Piece; PC.Output := True; PC.Kind := Kind; Result := OCI_CONTINUE; exception when E : others => Ada.Exceptions.Save_Occurrence (PC.Error, E); Result := OCI_ERROR; end Callback_Out; ----------------------- -- Callback_Out_Bind -- ----------------------- function Callback_Out_Bind (Octxp : in Bind_Access; Bindp : in OCIBind; Iter : in Ub4; Index : in Ub4; Bufpp : access DVoid; Alenpp : access A_Ub4; Piecep : in A_Ub1; Indpp : access A_Sb2; Rcodepp : access A_Ub2) return SWord is use type Ub1; pragma Unreferenced (Bindp, Index); Iteration : constant Positive := Positive (Iter + 1); Result : SWord; begin if Piecep.all = OCI_FIRST_PIECE or else Piecep.all = OCI_ONE_PIECE then if Octxp.Was then Octxp.Was := False; else Octxp.Iter := Octxp.Iter + 1; end if; if Octxp.Iter /= Iteration then raise Program_Error with "Unexpected iteration sequence in output" & Natural'Image (Octxp.Iter) & Natural'Image (Iteration); end if; end if; Callback_Out (PC => Octxp.Context, Kind => Octxp.Kind, Iteration => Iteration, Position => Octxp.Position, Loc => Octxp.Loc, Bufp => Bufpp.all, Alenp => Alenpp.all, Piece => Piecep.all, Indp => Indpp.all, Rcodep => Rcodepp.all, Result => Result); return Result; end Callback_Out_Bind; ------------ -- Cancel -- ------------ procedure Cancel (Stmt : in Statement) is begin Check_Error (OCIStmtFetch (OCIStmt (Stmt.Handle), Thread.Error, Nrows => 0)); end Cancel; ------------------ -- Column_Index -- ------------------ function Column_Index (Stmt : in Statement; Name : in String) return Positive is begin if Stmt.Context.Defines = null then Stmt.Context.Defines := new Define_Array (1 .. Number_Of_Columns (Stmt)); end if; for J in Stmt.Context.Defines'Range loop -- Do not need indexed search because define should be only once for -- statement and there is not very much define variables. if Column_Name (Stmt, J) = Ada.Characters.Handling.To_Upper (Name) then return J; end if; end loop; raise Constraint_Error with "Column '" & Name & "' not found."; end Column_Index; ----------------- -- Column_Name -- ----------------- function Column_Name (Stmt : in Statement; Position : in Positive) return String is begin if Stmt.Context.Defines (Position).Param = OCIParam (System.Null_Address) then Check_Error (OCIParamGet (Hndlp => Stmt.Handle, Htype => OCI_HTYPE_STMT, Errhp => Thread.Error, Parmdpp => Stmt.Context.Defines (Position).Param'Access, Pos => Ub4 (Position))); end if; return Get_Attr (OCIHandle (Stmt.Context.Defines (Position).Param), OCI_DTYPE_PARAM, OCI_ATTR_NAME); end Column_Name; ------------ -- Define -- ------------ procedure Define (Stmt : in out Statement; Kind : in Data_Type; Position : in Positive) is begin if Stmt.Context.Defines = null then Stmt.Context.Defines := new Define_Array (1 .. Number_Of_Columns (Stmt)); end if; Check_Error (OCIDefineByPos (Stmtp => OCIStmt (Stmt.Handle), Defnpp => Stmt.Context.Defines (Position).Define'Access, Errhp => OCI.Thread.Error, Position => Ub4 (Position), Value => System.Null_Address, Value_Sz => Size_Of (Kind), Dty => To_OCI (Kind), Indp => null, Mode => OCI_DYNAMIC_FETCH)); Check_Error (OCIDefineDynamic (Defnp => Stmt.Context.Defines (Position).Define, Errhp => OCI.Thread.Error, Octxp => Stmt.Context.Defines (Position)'Address, Ocbfp => Callback_Define'Address)); Stmt.Context.Defines (Position).Kind := Kind; Stmt.Context.Defines (Position).Position := Position; Stmt.Context.Defines (Position).Context := Stmt.Context; end Define; procedure Define (Stmt : in out Statement; Kind : in Data_Type; Name : in String) is begin Define (Stmt, Kind, Column_Index (Stmt, Name)); end Define; procedure Define (Stmt : in out Statement; Loc : in Lobs.Locator; Position : in Positive) is begin Define (Stmt, To_Data_Type (Lobs.Get_Lob_Type (Loc)), Position); Stmt.Context.Defines (Position).Loc := Loc; end Define; procedure Define (Stmt : in out Statement; Loc : in Lobs.Locator; Name : in String) is begin Define (Stmt, Loc, Column_Index (Stmt, Name)); end Define; ------------- -- Defined -- ------------- function Defined (Stmt : in Statement) return Boolean is begin return Stmt.Context /= null and then Stmt.Context.Defines /= null; end Defined; -------------- -- Describe -- -------------- procedure Describe (Connect : in Connection; Stmt : in out Statement) is begin Stmt.Connect := Connect; Describe (Stmt); end Describe; -------------- -- Describe -- -------------- procedure Describe (Stmt : in out Statement) is begin Check_Error (OCIStmtExecute (OCISvcCtx (Handle (Stmt.Connect)), OCIStmt (Stmt.Handle), Thread.Error, 0, Mode => OCI_DESCRIBE_ONLY)); Stmt.Described := True; end Describe; -------------- -- Describe -- -------------- procedure Describe (Stmt : in out Statement; Success : out Boolean) is begin Success := OCIStmtExecute (OCISvcCtx (Handle (Stmt.Connect)), OCIStmt (Stmt.Handle), Thread.Error, 0, Mode => OCI_DESCRIBE_ONLY) = OCI_SUCCESS; if Success then Stmt.Described := True; end if; end Describe; --------------- -- Described -- --------------- function Described (Stmt : in Statement) return Boolean is begin return Stmt.Described; end Described; ------------- -- Destroy -- ------------- procedure Destroy (Object : in out Statement) is procedure Free is new Ada.Unchecked_Deallocation (Bind_Array, Bind_Array_Access); procedure Free is new Ada.Unchecked_Deallocation (Define_Array, Define_Array_Access); procedure Free is new Ada.Unchecked_Deallocation (Context_Type, Context_Access); Ctx : Context_Access renames Object.Context; begin if Object.Handle /= Empty_Handle then if Ctx /= null then if Ctx.Defines /= null then for J in Ctx.Defines'Range loop if Ctx.Defines (J).Param /= OCIParam (Empty_Handle) then Check_Error (OCIDescriptorFree (Descp => OCIHandle (Ctx.Defines (J).Param), Dtype => OCI_DTYPE_PARAM), Raise_Exception => False); end if; end loop; Free (Ctx.Defines); end if; Free (Object.Context); end if; OCI.Thick.Free (Object.Handle, OCI_HTYPE_STMT); Free (Object.Binds); end if; end Destroy; ------------- -- Execute -- ------------- procedure Execute (Connect : in Connection; Stmt : in out Statement; Auto_Commit : in Boolean := False) is begin Stmt.Connect := Connect; Execute (Stmt, Auto_Commit => Auto_Commit); end Execute; procedure Execute (Stmt : in out Statement; In_Data : access procedure (Data : out Data_Holder; Position : in Positive; Iteration : in Positive); Out_Data : access procedure (Data : in Data_Holder; Position : in Positive; Iteration : in Positive); Count : in Natural := 1; Auto_Commit : in Boolean := False) is Raise_Exception : Boolean := True; begin Execute_Internal (Stmt => Stmt, In_Data => In_Data, Out_Data => Out_Data, Count => Count, Raise_Exception => Raise_Exception, Commit_On_Success => Auto_Commit); end Execute; procedure Execute (Stmt : in out Statement; In_Data : access procedure (Data : out Data_Holder; Position : in Positive; Iteration : in Positive); Out_Data : access procedure (Data : in Data_Holder; Position : in Positive; Iteration : in Positive); Success : out Boolean; Count : in Natural := 1; Auto_Commit : in Boolean := False) is Raise_Exception : Boolean := False; begin Execute_Internal (Stmt => Stmt, In_Data => In_Data, Out_Data => Out_Data, Count => Count, Raise_Exception => Raise_Exception, Commit_On_Success => Auto_Commit); Success := not Raise_Exception; end Execute; procedure Execute (Connect : in Connection; Stmt : in out Statement; Data : in out Container_Type'Class; Auto_Commit : in Boolean := False) is begin Stmt.Connect := Connect; Execute (Stmt, Data, Auto_Commit => Auto_Commit); end Execute; procedure Execute (Stmt : in out Statement; Auto_Commit : in Boolean := False) is Raise_Exception : Boolean := True; Data : Container_Type; begin Execute_Internal (Stmt, Data, Raise_Exception, Commit_On_Success => Auto_Commit); end Execute; procedure Execute (Stmt : in out Statement; Data : in out Container_Type'Class; Auto_Commit : in Boolean := False) is Raise_Exception : Boolean := True; begin Execute_Internal (Stmt, Data, Raise_Exception, Commit_On_Success => Auto_Commit); end Execute; procedure Execute (Stmt : in out Statement; Data : in out Container_Type'Class; Success : out Boolean; Auto_Commit : in Boolean := False) is Raise_Exception : Boolean := False; begin Execute_Internal (Stmt, Data, Raise_Exception, Commit_On_Success => Auto_Commit); Success := not Raise_Exception; end Execute; procedure Execute (Stmt : in out Statement; Success : out Boolean; Auto_Commit : in Boolean := False) is Raise_Exception : Boolean := False; Data : Container_Type; begin Execute_Internal (Stmt, Data, Raise_Exception => Raise_Exception, Commit_On_Success => Auto_Commit); Success := not Raise_Exception; end Execute; ------------- -- Execute -- ------------- function Execute (Connect : in Connection; Code : in String; Auto_Commit : in Boolean := False) return Statement is Result : Statement := Prepare (Connect, Code); begin Execute (Result, Auto_Commit => Auto_Commit); return Result; end Execute; procedure Execute (Connect : in Connection; Code : in String; Auto_Commit : in Boolean := False) is Dummy : Statement := Prepare (Connect, Code); begin Execute (Dummy, Auto_Commit => Auto_Commit); end Execute; ---------------------- -- Execute_Internal -- ---------------------- procedure Execute_Internal (Stmt : in out Statement; Data : in out Container_Type'Class; Raise_Exception : in out Boolean; Commit_On_Success : in Boolean) is procedure In_Data (Holder : out Data_Holder; Position : in Positive; Iteration : in Positive); procedure Out_Data (Holder : in Data_Holder; Position : in Positive; Iteration : in Positive); ------------- -- In_Data -- ------------- procedure In_Data (Holder : out Data_Holder; Position : in Positive; Iteration : in Positive) is begin Get (Container => Data, Item => Holder, Position => Position, Iteration => Iteration); end In_Data; -------------- -- Out_Data -- -------------- procedure Out_Data (Holder : in Data_Holder; Position : in Positive; Iteration : in Positive) is begin Set (Container => Data, Item => Holder, Position => Position, Iteration => Iteration); end Out_Data; begin Execute_Internal (Stmt => Stmt, In_Data => In_Data'Access, Out_Data => Out_Data'Access, Count => Length (Data), Raise_Exception => Raise_Exception, Commit_On_Success => Commit_On_Success); end Execute_Internal; procedure Execute_Internal (Stmt : in out Statement; In_Data : access procedure (Data : out Data_Holder; Position : in Positive; Iteration : in Positive); Out_Data : access procedure (Data : in Data_Holder; Position : in Positive; Iteration : in Positive); Count : in Natural; Raise_Exception : in out Boolean; Commit_On_Success : in Boolean) is use Ada.Exceptions; Select_Stmt : constant Boolean := Type_Of_Statement (Stmt) = Stmt_Select; Commit_Mode : constant array (Boolean) of Ub4 := (False => OCI_DEFAULT, True => OCI_COMMIT_ON_SUCCESS); Rc : SWord; Iters : constant Ub4 := Ub4'Max (Boolean'Pos (not Select_Stmt), Boolean'Pos (not Select_Stmt) * Ub4 (Count)); begin if Stmt.Context /= null then Stmt.Context.In_Data := In_Data; Stmt.Context.Out_Data := Out_Data; Stmt.Context.Connect := Stmt.Connect; Stmt.Context.Iters := Natural (Iters); Save_Occurrence (Stmt.Context.Error, Null_Occurrence); Reset_Bind_Iter (Stmt.Binds); end if; Rc := OCIStmtExecute (OCISvcCtx (Handle (Stmt.Connect)), OCIStmt (Stmt.Handle), Thread.Error, Iters => Iters, Mode => Commit_Mode (Commit_On_Success)); if Stmt.Context /= null then if Exception_Identity (Stmt.Context.Error) /= Null_Id then Reraise_Occurrence (Stmt.Context.Error); end if; if not Select_Stmt then Out_Flush (Stmt.Context, Last => True); end if; end if; Stmt.Executing := Rc = OCI_STILL_EXECUTING; if Rc = OCI_SUCCESS then Stmt.Executed := True; Stmt.Described := True; Raise_Exception := False; elsif Stmt.Executing then Raise_Exception := False; elsif Raise_Exception then Check_Error (Rc); else Raise_Exception := True; end if; end Execute_Internal; -------------- -- Executed -- -------------- function Executed (Stmt : in Statement) return Boolean is begin return Stmt.Executed; end Executed; ----------- -- Fetch -- ----------- function Fetch (Stmt : in Statement; Process : access procedure (Data : in Data_Holder; Position : in Positive; Iteration : in Positive); Count : in Positive := 1) return Boolean is use Ada.Exceptions; RC : SWord; begin Stmt.Context.Out_Data := Process; Stmt.Context.Connect := Stmt.Connect; Save_Occurrence (Stmt.Context.Error, Null_Occurrence); RC := OCIStmtFetch (OCIStmt (Stmt.Handle), Thread.Error, Nrows => Ub4 (Count)); if Exception_Identity (Stmt.Context.Error) /= Null_Id then Reraise_Occurrence (Stmt.Context.Error); end if; Out_Flush (Stmt.Context, Last => True); case RC is when OCI_NO_DATA => return False; when OCI_SUCCESS => return True; when others => Check_Error (RC); end case; -- We should not be there. raise Program_Error; end Fetch; procedure Fetch (Stmt : in Statement; Data : out Container_Type'Class; Count : in Positive) is procedure Process (Holder : in Data_Holder; Position, Index : in Positive); ------------- -- Process -- ------------- procedure Process (Holder : in Data_Holder; Position, Index : in Positive) is begin Set (Data, Holder, Position, Index); end Process; begin Data.Clear; if Fetch (Stmt, Process'Access, Count) then null; end if; end Fetch; -------------------- -- Get_Connection -- -------------------- function Get_Connection (Stmt : in Statement) return Connection is begin return Stmt.Connect; end Get_Connection; ------------------ -- Is_Executing -- ------------------ function Is_Executing (Stmt : in Statement) return Boolean is begin return Stmt.Executing; end Is_Executing; function Is_Lob (Kind : Data_Type) return Boolean is begin return Kind = Type_Char_Lob or else Kind = Type_Bin_Lob; end Is_Lob; ----------------------- -- Number_Of_Columns -- ----------------------- function Number_Of_Columns (Stmt : in Statement) return Natural is begin return Natural (Get_Attr_Ub4 (Stmt.Handle, OCI_HTYPE_STMT, OCI_ATTR_PARAM_COUNT)); end Number_Of_Columns; --------------- -- Out_Flush -- --------------- procedure Out_Flush (PC : in Context_Access; Last : in Boolean) is use type Sb2; use type C.char; function String_Buffer return String; pragma Inline (String_Buffer); function String_Buffer return String is use C; begin return To_Ada (PC.Buffer.Char (1 .. size_t (PC.Alen)), Trim_Nul => PC.Buffer.Char (size_t (PC.Alen)) = nul); end String_Buffer; begin if PC.Output then PC.Output := False; if PC.Ind = Same_Indicator and then not (PC.Kind = Type_String and then PC.Buffer.Char (1) /= C.nul) then -- Not touched indicator mean absent output data. -- Not documented oracle feature or bug. return; end if; else return; end if; if PC.Ind = Null_Indicator then PC.Holder := Null_Data; if PC.Out_Data /= null then PC.Out_Data (PC.Holder, PC.Position, PC.Iteration); end if; else case PC.Kind is when Type_String => case PC.Piece is when OCI_FIRST_PIECE | OCI_ONE_PIECE => -- In bind "one" does not mean absent "next" -- In define "First" does not mean present "next". -- It is because of week design of parameter Piece in output -- user callbacks. if PC.Alen = 0 then -- Strange OCI behavior, -- empty string with not null indicator. PC.Holder := Null_Data; else PC.Holder := To_Data (String_Buffer); end if; when OCI_NEXT_PIECE => Append (PC.Holder, String_Buffer); when others => raise Constraint_Error with PC.Piece'Img; end case; when Type_Integer => PC.Holder := To_Data (PC.Buffer.Int); when Type_Long_Float => PC.Holder := To_Data (PC.Buffer.Flt); when Type_Number => PC.Holder := To_Data (PC.Buffer.Numb); when Type_Date => PC.Holder := To_Data (Dates.To_Ada (PC.Buffer.Dat)); when Type_Char_Lob | Type_Bin_Lob => PC.Holder := To_Data (PC.Loc); end case; if Last and PC.Out_Data /= null then PC.Out_Data (PC.Holder, PC.Position, PC.Iteration); end if; end if; end Out_Flush; ------------------------ -- Parse_Error_Offset -- ------------------------ function Parse_Error_Offset (Stmt : in Statement) return Natural is begin return Natural (Get_Attr_Ub2 (Stmt.Handle, OCI_HTYPE_STMT, OCI_ATTR_PARSE_ERROR_OFFSET)); end Parse_Error_Offset; ------------- -- Prepare -- ------------- function Prepare (Connect : in Connection; Code : in String) return Statement is Stmt : Statement; procedure Set_Bind_Names; -------------------- -- Set_Bind_Names -- -------------------- procedure Set_Bind_Names is Names : aliased Vector_Of_OraText (1 .. 256); Lens : aliased Vector_Of_Ub1 (Names'Range); INames : aliased Vector_Of_OraText (Names'Range); ILens : aliased Vector_Of_Ub1 (Names'Range); Dups : aliased Vector_Of_Ub1 (Names'Range); Binds : aliased Vector_Of_OCIBind (Names'Range); Found : aliased Sb4; RC : constant SWord := OCIStmtGetBindInfo (Stmtp => OCIStmt (Stmt.Handle), Errhp => Thread.Error, Size => Names'Length, Startloc => 1, Found => Found'Unchecked_Access, Bvnp => Names (Names'First)'Unchecked_Access, Bvnl => Lens (Lens'First)'Unchecked_Access, Invp => INames (INames'First)'Unchecked_Access, Inpl => ILens (ILens'First)'Unchecked_Access, Dupl => Dups (Dups'First)'Unchecked_Access, Hndl => Binds (Binds'First)'Unchecked_Access); use Interfaces.C.Strings; use type C.size_t; use type Ub1; begin if RC = OCI_NO_DATA then return; end if; Check_Error (RC); declare Binds : Bind_Array (1 .. Integer (Found)); Count : Natural := 0; begin for J in 1 .. Integer (Found) loop if Dups (J) = 0 then Count := Count + 1; Bind_Names.Set_Bounded_String (Binds (Count).Name, C.To_Ada (Value (Names (J), C.size_t (Lens (J))), False)); end if; end loop; Stmt.Binds := new Bind_Array'(Binds (1 .. Count)); end; end Set_Bind_Names; begin Stmt.Handle := Alloc_Handle (Thread.Environment, OCI_HTYPE_STMT); Check_Error (OCIStmtPrepare (OCIStmt (Stmt.Handle), Thread.Error, C.To_C (Ada.Strings.Fixed.Translate (Code, Dos_Fix_CR)), Code'Length)); Set_Bind_Names; Stmt.Connect := Connect; if Type_Of_Statement (Stmt) = Stmt_Select or else Stmt.Binds /= null then Stmt.Context := new Context_Type; end if; return Stmt; end Prepare; function Prepare (Code : in String) return Statement is begin return Prepare (Dummy_Connect, Code); end Prepare; --------------------- -- Reset_Bind_Iter -- --------------------- procedure Reset_Bind_Iter (Binds : in Bind_Array_Access) is begin if Binds /= null then for J in Binds'Range loop Binds (J).Iter := 0; Binds (J).Was := False; end loop; end if; end Reset_Bind_Iter; -------------------- -- Rows_Processed -- -------------------- function Rows_Processed (Stmt : in Statement) return Natural is begin return Natural (Get_Attr_Ub4 (Stmt.Handle, OCI_HTYPE_STMT, OCI_ATTR_ROW_COUNT)); end Rows_Processed; ------------------ -- Set_Blocking -- ------------------ procedure Set_Blocking (Item : in out Statement; Mode : in Boolean) is begin Connections.Set_Blocking (Item.Connect, Mode); end Set_Blocking; -------------------- -- Set_Connection -- -------------------- procedure Set_Connection (Stmt : in out Statement; Connect : in Connection) is begin Stmt.Connect := Connect; end Set_Connection; ----------------------- -- Type_Of_Statement -- ----------------------- function Type_Of_Statement (Stmt : in Statement) return Statement_Type is begin return To_Statement_Type (Get_Attr_Ub2 (Stmt.Handle, OCI_HTYPE_STMT, OCI_ATTR_STMT_TYPE)); end Type_Of_Statement; end OCI.Thick.DB; gnade-1.6.2.orig/dbi/oci/oci-thick-db.ads0000644000175000017500000002251310770130716017640 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Thin Ada95 binding to OCI™ (Oracle® Call Interface™) -- -- Copyright (C) 2006-2008 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-thick-db.ads,v 1.22 2008/03/19 06:25:18 vagul Exp $ with OCI.Thick.Connections; with OCI.Thick.Containers; with OCI.Thick.Lobs; with OCI.Thick.Date.Internal; package OCI.Thick.DB is use Connections; use Containers; type Statement is new Handle_Reference with private; type Statement_Type is (Stmt_Unknown, Stmt_Select, Stmt_Update, Stmt_Delete, Stmt_Insert, Stmt_Create, Stmt_Drop, Stmt_Alter, Stmt_Begin, Stmt_Declare); type Data_Type is (Type_Integer, Type_Long_Float, Type_String, Type_Number, Type_Date, Type_Char_Lob, Type_Bin_Lob); ------------------------------------------------- -- Undepended from Connection statement stile. -- ------------------------------------------------- function Prepare (Code : in String) return Statement; procedure Execute (Connect : in Connection; Stmt : in out Statement; Auto_Commit : in Boolean := False); procedure Execute (Connect : in Connection; Stmt : in out Statement; Data : in out Container_Type'Class; Auto_Commit : in Boolean := False); procedure Describe (Connect : in Connection; Stmt : in out Statement); ----------------------------------------------- -- Depended from Connection statement stile. -- -- Like ODBC -- ----------------------------------------------- function Prepare (Connect : in Connection; Code : in String) return Statement; procedure Execute (Stmt : in out Statement; Auto_Commit : in Boolean := False); procedure Execute (Stmt : in out Statement; Data : in out Container_Type'Class; Auto_Commit : in Boolean := False); procedure Execute (Stmt : in out Statement; Data : in out Container_Type'Class; Success : out Boolean; Auto_Commit : in Boolean := False); procedure Execute (Stmt : in out Statement; In_Data : access procedure (Data : out Data_Holder; Position : in Positive; Iteration : in Positive); Out_Data : access procedure (Data : in Data_Holder; Position : in Positive; Iteration : in Positive); Count : in Natural := 1; Auto_Commit : in Boolean := False); -- Count is for non select statements. -- Iteration in Process routine would be from 1 to Count. procedure Execute (Stmt : in out Statement; In_Data : access procedure (Data : out Data_Holder; Position : in Positive; Iteration : in Positive); Out_Data : access procedure (Data : in Data_Holder; Position : in Positive; Iteration : in Positive); Success : out Boolean; Count : in Natural := 1; Auto_Commit : in Boolean := False); procedure Execute (Stmt : in out Statement; Success : out Boolean; Auto_Commit : in Boolean := False); function Execute (Connect : in Connection; Code : in String; Auto_Commit : in Boolean := False) return Statement; procedure Execute (Connect : in Connection; Code : in String; Auto_Commit : in Boolean := False); procedure Describe (Stmt : in out Statement); procedure Describe (Stmt : in out Statement; Success : out Boolean); function Type_Of_Statement (Stmt : in Statement) return Statement_Type; function Described (Stmt : in Statement) return Boolean; function Executed (Stmt : in Statement) return Boolean; pragma Inline (Executed); function Is_Executing (Stmt : in Statement) return Boolean; procedure Set_Connection (Stmt : in out Statement; Connect : in Connection); function Get_Connection (Stmt : in Statement) return Connection; pragma Inline (Get_Connection); function Fetch (Stmt : in Statement; Process : access procedure (Data : in Data_Holder; Position, Iteration : in Positive); Count : in Positive := 1) return Boolean; procedure Fetch (Stmt : in Statement; Data : out Container_Type'Class; Count : in Positive); procedure Cancel (Stmt : in Statement); function Parse_Error_Offset (Stmt : in Statement) return Natural; function Number_Of_Columns (Stmt : in Statement) return Natural; function Rows_Processed (Stmt : in Statement) return Natural; -- Returns the number of rows processed so far. procedure Set_Blocking (Item : in out Statement; Mode : in Boolean); -- Set the statement connection to the spetsific blocking mode. -------------------------------- -- Bind and define routines. -- -------------------------------- function Bind_Count (Stmt : in Statement) return Natural; function Bind_Name (Stmt : in Statement; Position : Positive) return String; function Column_Name (Stmt : in Statement; Position : in Positive) return String; function Column_Index (Stmt : in Statement; Name : in String) return Positive; procedure Bind (Stmt : in out Statement; Kind : in Data_Type; Position : in Positive); procedure Bind (Stmt : in out Statement; Kind : in Data_Type; Name : in String); function Defined (Stmt : in Statement) return Boolean; procedure Define (Stmt : in out Statement; Kind : in Data_Type; Position : in Positive); -- Define could be called only after Describe or first Execute. procedure Define (Stmt : in out Statement; Kind : in Data_Type; Name : in String); procedure Define (Stmt : in out Statement; Loc : in Lobs.Locator; Position : in Positive); -- Define with already exists lob locator. procedure Define (Stmt : in out Statement; Loc : in Lobs.Locator; Name : in String); -- Define with already exists lob locator. private for Statement_Type use (Stmt_Unknown => 0, -- Undocumented OCI Stmt type. Stmt_Select => OCI_STMT_SELECT, Stmt_Update => OCI_STMT_UPDATE, Stmt_Delete => OCI_STMT_DELETE, Stmt_Insert => OCI_STMT_INSERT, Stmt_Create => OCI_STMT_CREATE, Stmt_Drop => OCI_STMT_DROP, Stmt_Alter => OCI_STMT_ALTER, Stmt_Begin => OCI_STMT_BEGIN, Stmt_Declare => OCI_STMT_DECLARE); for Statement_Type'Size use Ub2'Size; for Data_Type use (Type_String => SQLT_STR, Type_Char_Lob => SQLT_CLOB, Type_Bin_Lob => SQLT_BLOB, Type_Integer => SQLT_INT, Type_Long_Float => SQLT_FLT, Type_Number => SQLT_VNU, Type_Date => SQLT_DAT); -- ?? try OCIDate => SQLT_ODT for Data_Type'Size use Ub2'Size; type Context_Type; type Context_Access is access all Context_Type; type Bind_Type is record Name : Bind_Names.Bounded_String; Kind : Data_Type; Position : Positive; Iter : Natural; -- To detect Oracle bug resetting iteration counter Was : Boolean; -- / Loc : Lobs.Locator; -- Need to keep *in* Loc value for set *out*. Bind : aliased OCIBind := OCIBind (Empty_Handle); Context : Context_Access; end record; type Define_Type is record Param : aliased OCIParam := OCIParam (System.Null_Address); Kind : Data_Type; Position : Positive; Loc : Lobs.Locator; -- For define with already created locator. Define : aliased OCIDefine := OCIDefine (System.Null_Address); Context : Context_Access; end record; type Bind_Array is array (Positive range <>) of aliased Bind_Type; type Bind_Array_Access is access all Bind_Array; type Bind_Access is access Bind_Type; type Define_Array is array (Positive range <>) of aliased Define_Type; type Define_Array_Access is access all Define_Array; type Define_Access is access Define_Type; Char_Buffer_Size : constant := 1024; type Buffer_Type (Kind : Data_Type := Type_String) is record case Kind is when Type_String => Char : C.char_array (1 .. Char_Buffer_Size); when Type_Integer => Int : Integer; when Type_Long_Float => Flt : Long_Float; when Type_Number => Numb : OCINumber; when Type_Date => Dat : Date.Internal.Date_Time; when Type_Char_Lob | Type_Bin_Lob => Dummy : Integer; end case; end record; pragma Unchecked_Union (Buffer_Type); type Statement is new Handle_Reference with record Connect : Connection; Binds : Bind_Array_Access; Context : Context_Access; Executed, Described, Executing : Boolean := False; end record; procedure Destroy (Object : in out Statement); end OCI.Thick.DB; gnade-1.6.2.orig/dbi/oci/oci-thick-debug_allocation.adb0000644000175000017500000001531711033070070022516 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Thin Ada95 binding to OCI™ (Oracle® Call Interface™) -- -- Copyright (C) 2000-2006 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-thick-debug_allocation.adb,v 1.14 2008/07/03 06:22:48 vagul Exp $ with Ada.Text_IO; with Interfaces.C; with OCI.Thread; package body OCI.Thick.Debug_Allocation is type Integer_Parameters is array (0 .. 16) of Integer; type Integer_Parameters_Access is access all Integer_Parameters; function Callback (ctxp : in DVoid; hndlp : in OCIHandle; htype : in Ub4; fcode : in Ub4; when_call : in Ub1; returnCode : in SWord; errnop : access Sb4; arglist : in Integer_Parameters_Access) return SWord; pragma Convention (C, Callback); OCIHandleAlloc_FCode : constant := 2; OCIHandleFree_FCode : constant := 3; OCIDescriptorAlloc_FCode : constant := 4; OCIDescriptorFree_FCode : constant := 5; HandleAlloc : aliased constant String := "HandleAlloc"; HandleFree : aliased constant String := "HandleFree"; DescriptorAlloc : aliased constant String := "DescriptorAlloc"; DescriptorFree : aliased constant String := "DescriptorFree"; type String_Access is access constant String; Started : Boolean := False; subtype Func_Code is Integer range OCIHandleAlloc_FCode .. OCIDescriptorFree_FCode; subtype Handle_Type is Integer range OCI_HTYPE_FIRST .. OCI_HTYPE_LAST; subtype Descriptor_Type is Integer range OCI_DTYPE_FIRST .. OCI_DTYPE_LAST; subtype Call_Counter is Natural; Func_Names : constant array (Func_Code) of String_Access := (OCIHandleAlloc_FCode => HandleAlloc'Access, OCIHandleFree_FCode => HandleFree'Access, OCIDescriptorAlloc_FCode => DescriptorAlloc'Access, OCIDescriptorFree_FCode => DescriptorFree'Access); Statistic : array (Func_Code) of Call_Counter := (others => 0); Error_Statistic : array (Func_Code) of Call_Counter := (others => 0); Handle_Allocated : array (Handle_Type) of Call_Counter := (others => 0); Handle_Freed : array (Handle_Type) of Call_Counter := (others => 0); Descriptor_Allocated : array (Descriptor_Type) of Call_Counter := (others => 0); Descriptor_Freed : array (Descriptor_Type) of Call_Counter := (others => 0); protected Oper is procedure Increment (Item : in out Call_Counter); end Oper; -------------- -- Callback -- -------------- function Callback (ctxp : in DVoid; hndlp : in OCIHandle; htype : in Ub4; fcode : in Ub4; when_call : in Ub1; returnCode : in SWord; errnop : access Sb4; arglist : in Integer_Parameters_Access) return SWord is pragma Unreferenced (ctxp, hndlp, htype, when_call, returnCode); use type Sb4; use Interfaces.C; Alloc_Type : Integer renames arglist (2); Free_Type : Integer renames arglist (1); procedure Warning (Output : String) renames Ada.Text_IO.Put_Line; begin if errnop.all = OCI_SUCCESS then Oper.Increment (Statistic (Func_Code (fcode))); else Oper.Increment (Error_Statistic (Func_Code (fcode))); end if; case fcode is when OCIHandleAlloc_FCode => if Alloc_Type in Handle_Type then Oper.Increment (Handle_Allocated (Alloc_Type)); else Warning ("Alloc unrecognized handlee "); end if; when OCIHandleFree_FCode => if Free_Type in Handle_Type then Oper.Increment (Handle_Freed (Free_Type)); else Warning ("Free unrecognized handle."); end if; when OCIDescriptorAlloc_FCode => if Alloc_Type in Descriptor_Type then Oper.Increment (Descriptor_Allocated (Alloc_Type)); else Warning ("Alloc unrecognized descriptor."); end if; when OCIDescriptorFree_FCode => if Free_Type in Descriptor_Type then Oper.Increment (Descriptor_Freed (Free_Type)); else Warning ("Free unrecognized descriptor."); end if; when others => Warning ("Callback for unregistered function call."); end case; return OCI_CONTINUE; end Callback; ---------- -- Oper -- ---------- protected body Oper is procedure Increment (Item : in out Call_Counter) is begin Item := Item + 1; end Increment; end Oper; ---------------- -- Print_Info -- ---------------- procedure Print_Info is use Ada.Text_IO; begin for I in Func_Code loop Put_Line (Func_Names (I).all & Integer'Image (Statistic (I)) & Integer'Image (Error_Statistic (I))); end loop; Put_Line ("Handles " & Integer'Image (Statistic (OCIHandleAlloc_FCode) - Statistic (OCIHandleFree_FCode))); Put_Line ("Descriptors " & Integer'Image (Statistic (OCIDescriptorAlloc_FCode) - Statistic (OCIDescriptorFree_FCode))); for I in Handle_Type loop Put_Line (Integer'Image (I) & '.' & Integer'Image (Handle_Allocated (I)) & '-' & Integer'Image (Handle_Freed (I)) & '=' & Integer'Image (Handle_Allocated (I) - Handle_Freed (I))); end loop; for I in Descriptor_Type loop Put_Line (Integer'Image (I) & '.' & Integer'Image (Descriptor_Allocated (I)) & '-' & Integer'Image (Descriptor_Freed (I)) & '=' & Integer'Image (Descriptor_Allocated (I) - Descriptor_Freed (I))); end loop; end Print_Info; ----------- -- Start -- ----------- procedure Start is Rc : SWord; Env : constant OCIEnv := Thread.Environment; Error : constant OCIError := Thread.Error; begin if not Started then for J in Func_Code'Range loop Rc := Lib.OCIUserCallbackRegister (Hndlp => OCIHandle (Env), Htype => OCI_HTYPE_ENV, Ehndlp => Error, Callback => Callback'Address, Ctxp => Empty_Handle, Fcode => Ub4 (J), When_call => OCI_UCBTYPE_EXIT, UcbDesc => Lib.Empty_Handle); Check_Error (Rc); end loop; Started := True; end if; end Start; end OCI.Thick.Debug_Allocation; gnade-1.6.2.orig/dbi/oci/oci-thick-debug_allocation.ads0000644000175000017500000000112110537157463022547 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Thin Ada95 binding to OCI™ (Oracle® Call Interface™) -- -- Copyright (C) 2000-2006 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-thick-debug_allocation.ads,v 1.8 2006/12/11 04:31:47 vagul Exp $ package OCI.Thick.Debug_Allocation is procedure Start; procedure Print_Info; end OCI.Thick.Debug_Allocation; gnade-1.6.2.orig/dbi/oci/oci-thick-gen_ocinumber.adb0000644000175000017500000003421411007547442022051 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Ada95 Interface to Oracle RDBMS -- -- Copyright (C) 2000-2006 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-thick-gen_ocinumber.adb,v 1.24 2008/05/05 09:10:58 vagul Exp $ with Ada.Decimal; with Interfaces.C; with OCI.Thread; package body OCI.Thick.Gen_OCINumber is --------------------- -- Binary_Function -- --------------------- function Binary_Function (Left, Right : OCINumber) return OCINumber is Result : aliased OCINumber; begin Check_Error (OCINumberOper (Thread.Error, Left, Right, Result'Access)); return Result; end Binary_Function; ---------------------- -- Compare_Function -- ---------------------- function Compare_Function (Left, Right : OCINumber) return Boolean is Result : aliased SWord; begin Check_Error (OCINumberCmp (Err => Thread.Error, Number1 => Left, Number2 => Right, Result => Result'Access)); return Compare (Result, 0); end Compare_Function; ----------------------- -- Decimal_To_Number -- ----------------------- function Decimal_To_Number (From : Decimal_Type) return OCINumber is -- float conversion variant. -- function To_Number is new Float_To_Number (C.long_double); type LLI is range System.Min_Int .. System.Max_Int; type DLLI is delta 1.0 digits System.Max_Digits; function To_Number is new Int_To_Number (LLI); function Shift is new Integer_Function (Integer, OCINumberShift); procedure Divide is new Ada.Decimal.Divide (Dividend_Type => Decimal_Type, Divisor_Type => Decimal_Type, Quotient_Type => DLLI, Remainder_Type => DLLI); Quotient : DLLI; Remainder : DLLI; begin Divide (Dividend => From, Divisor => Decimal_Type'Delta, Quotient => Quotient, Remainder => Remainder); if Remainder /= 0.0 then raise Program_Error; end if; return Shift (To_Number (LLI (Quotient)), -Decimal_Type'Aft); -- float conversion variant not support Max_Digits. -- return To_Number (C.long_double (From)); end Decimal_To_Number; --------------------- -- Float_To_Number -- --------------------- function Float_To_Number (From : in Float_Type) return OCINumber is use type UWord; Result : aliased OCINumber; procedure Double_Convert; procedure Double_Convert is F1 : constant Long_Float := Long_Float (From); F2 : constant Long_Float := Long_Float (From - Float_Type (F1)); P1 : aliased OCINumber; P2 : aliased OCINumber; begin Check_Error (OCINumberFromReal (Thread.Error, F1'Address, F1'Size / System.Storage_Unit, P1'Access)); Check_Error (OCINumberFromReal (Thread.Error, F2'Address, F2'Size / System.Storage_Unit, P2'Access)); Check_Error (OCINumberAdd (Thread.Error, P1, P2, Result'Access)); end Double_Convert; begin if Float_Type'Size <= Long_Float'Size then -- Oracle could not correct make convertion if Float size more than -- sizeof double. Check_Error (OCINumberFromReal (Thread.Error, From'Address, From'Size / System.Storage_Unit, Result'Access)); else Double_Convert; end if; return Result; end Float_To_Number; ---------------------------- -- Float_To_Number_Better -- ---------------------------- function Float_To_Number_Better (From : Float_Type) return OCINumber is type Unsigned_Type is mod System.Max_Binary_Modulus; function To_Number is new Unsigned_To_Number (Unsigned_Type); N : aliased OCINumber := To_Number (Unsigned_Type (abs Float_Type'Fraction (From) * Float_Type (Float_Type'Machine_Radix) ** Float_Type'Machine_Mantissa)); P : Integer := Float_Type'Exponent (From) - Float_Type'Machine_Mantissa; E : OCINumber; function "/" is new Binary_Function (OCINumberDiv); pragma Inline ("/"); function "*" is new Binary_Function (OCINumberMul); pragma Inline ("*"); function Prec is new Integer_Function (Integer, OCINumberPrec); begin if From < 0.0 then Check_Error (OCINumberNeg (Thread.Error, N, N'Access)); end if; while abs P >= Unsigned_Type'Size loop E := To_Number (2 ** (Unsigned_Type'Size - 1)); if P >= 0 then N := N * E; P := P - Unsigned_Type'Size + 1; else N := N / E; P := P + Unsigned_Type'Size - 1; end if; end loop; E := To_Number (Float_Type'Machine_Radix ** (abs P)); -- 3 is just experimental constant for each Float would be converted -- to OCINumber and back without modification. if P >= 0 then return Prec (N * E, Float_Type'Digits + 3); else return Prec (N / E, Float_Type'Digits + 3); end if; end Float_To_Number_Better; ------------------- -- Int_To_Number -- ------------------- function Int_To_Number (From : in Integer_Type) return OCINumber is use type UWord; Result : aliased OCINumber; begin Check_Error (OCINumberFromInt (Thread.Error, Inum => From'Address, Inum_Length => From'Size / System.Storage_Unit, Inum_S_Flag => OCI_NUMBER_SIGNED, Number => Result'Access)); return Result; end Int_To_Number; ---------------------- -- Integer_Function -- ---------------------- function Integer_Function (Left : OCINumber; Right : Integer_Type) return OCINumber is Result : aliased OCINumber; begin Check_Error (OCINumberOper (Thread.Error, Left, SWord (Right), Result'Access)); return Result; end Integer_Function; -------------------- -- Num_To_Decimal -- -------------------- function Num_To_Decimal (Numb : OCINumber) return Decimal_Type is -- float variant. -- function To_Float is new Num_To_Float (C.long_double); type LLI is range System.Min_Int .. System.Max_Int; type DLLI is delta 1.0 digits System.Max_Digits; function To_Integer is new Num_To_Integer (LLI); function Shift is new Integer_Function (Integer, OCINumberShift); function Round is new Integer_Function (Integer, OCINumberRound); procedure Divide is new Ada.Decimal.Divide (Dividend_Type => DLLI, Divisor_Type => DLLI, Quotient_Type => Decimal_Type, Remainder_Type => Decimal_Type); L : constant DLLI := DLLI (To_Integer (Shift (Round (Numb, Decimal_Type'Aft), Decimal_Type'Aft))); Quotient : Decimal_Type; Remainder : Decimal_Type; begin Divide (Dividend => L, Divisor => DLLI (10.0**Decimal_Type'Aft), Quotient => Quotient, Remainder => Remainder); if Remainder /= 0.0 then raise Program_Error; end if; return Quotient; -- float variant. -- return Decimal_Type (To_Float (Numb)); end Num_To_Decimal; ------------------ -- Num_To_Float -- ------------------ function Num_To_Float (Numb : in OCINumber) return Float_Type is use type UWord; Result : aliased Float_Type; procedure Double_Convert; procedure Double_Convert is N1 : aliased OCINumber; N2 : aliased OCINumber; P1 : aliased Long_Float; P2 : aliased Long_Float; begin Check_Error (OCINumberToReal (Thread.Error, Numb, P1'Size / System.Storage_Unit, P1'Address)); Check_Error (OCINumberFromReal (Thread.Error, P1'Address, P1'Size / System.Storage_Unit, N1'Access)); Check_Error (OCINumberSub (Thread.Error, Numb, N1, N2'Access)); Check_Error (OCINumberToReal (Thread.Error, N2, P2'Size / System.Storage_Unit, P2'Address)); Result := Float_Type (P1) + Float_Type (P2); end Double_Convert; begin if Float_Type'Size <= Long_Float'Size then -- Oracle could not correct make convertion if Float size more than -- sizeof double. Check_Error (OCINumberToReal (Thread.Error, Numb, Result'Size / System.Storage_Unit, Result'Address)); else Double_Convert; end if; return Result; end Num_To_Float; ------------------------- -- Num_To_Float_Better -- ------------------------- function Num_To_Float_Better (Numb : in OCINumber) return Float_Type is use type SWord; type Max_Float is digits System.Max_Digits; type Unsigned_Type is mod System.Max_Binary_Modulus; function To_Number is new Unsigned_To_Number (Unsigned_Type); function To_Integer is new Num_To_Integer (Integer); function To_Unsigned is new Num_To_Unsigned (Unsigned_Type); function "/" is new Binary_Function (OCINumberDiv); pragma Inline ("/"); function "*" is new Binary_Function (OCINumberMul); pragma Inline ("*"); function "+" is new Binary_Function (OCINumberAdd); pragma Inline ("+"); function Log is new Binary_Function (OCINumberLog); function "abs" is new Unary_Function (OCINumberAbs); pragma Inline ("abs"); function Ceil is new Unary_Function (OCINumberCeil); function Round is new Integer_Function (Integer, OCINumberRound); function Power is new Integer_Function (Integer, OCINumberIntPower); function "=" is new Compare_Function (Interfaces.C."="); NMax : constant OCINumber := To_Number (Unsigned_Type'Last) + To_Number (1); N2 : constant OCINumber := To_Number (2); ANum : constant OCINumber := abs Numb; P : Integer; NR : OCINumber; FR : Max_Float; Sign : aliased SWord; Zero : aliased C_Boolean; -- N * 2 ** X < UMax; -- N * 2 ** X > UMax / 2; -- 2 ** -X > N / UMax; -- 2 ** -X < N / UMax / 2; -- -X > L2 (N / UMax) -- -X < L2 (N / UMax / 2) begin Check_Error (OCINumberSign (Thread.Error, Numb, Sign'Access)); if Sign = 0 then -- Strange, but sometimes OCINumberIsZero show non zero when Sign -- show zero. Check_Error (OCINumberIsZero (Thread.Error, Numb, Zero'Access)); if Zero /= OCI.Lib.FALSE then return 0.0; end if; end if; P := To_Integer (Ceil (Log (N2, ANum))) - Unsigned_Type'Size; if P > 0 then NR := Round (ANum / Power (N2, P), 0); else declare VP : Integer := P; Skip : constant := 400; begin NR := ANum; while VP < -Skip loop NR := NR * Power (N2, Skip); VP := VP + Skip; end loop; NR := Round (NR * Power (N2, -VP), 0); end; end if; if NR = NMax then FR := 2.0 ** Unsigned_Type'Size; else FR := Max_Float (To_Unsigned (NR)); end if; if P < 0 then FR := FR / 2.0 ** (-P); else FR := FR * 2.0 ** P; end if; if Sign < 0 then return Float_Type (-FR); end if; return Float_Type (FR); end Num_To_Float_Better; -------------------- -- Num_To_Integer -- -------------------- function Num_To_Integer (Numb : in OCINumber) return Integer_Type is use type UWord; Result : aliased Integer_Type; begin Check_Error (OCINumberToInt (Thread.Error, Numb, Rsl_Length => Result'Size / System.Storage_Unit, Rsl_Flag => OCI_NUMBER_SIGNED, Rsl => Result'Address)); return Result; end Num_To_Integer; --------------------- -- Num_To_Unsigned -- --------------------- function Num_To_Unsigned (Numb : OCINumber) return Unsigned_Type is use type UWord; Result : aliased Unsigned_Type; begin Check_Error (OCINumberToInt (Thread.Error, Numb, Rsl_Length => Result'Size / System.Storage_Unit, Rsl_Flag => OCI_NUMBER_UNSIGNED, Rsl => Result'Address)); return Result; end Num_To_Unsigned; -------------------- -- Unary_Function -- -------------------- function Unary_Function (Item : OCINumber) return OCINumber is Result : aliased OCINumber; begin Check_Error (OCINumberOper (Thread.Error, Item, Result'Access)); return Result; end Unary_Function; ------------------------ -- Unsigned_To_Number -- ------------------------ function Unsigned_To_Number (From : in Unsigned_Type) return OCINumber is use type UWord; Result : aliased OCINumber; begin Check_Error (OCINumberFromInt (Thread.Error, Inum => From'Address, Inum_Length => From'Size / System.Storage_Unit, Inum_S_Flag => OCI_NUMBER_UNSIGNED, Number => Result'Access)); return Result; end Unsigned_To_Number; end OCI.Thick.Gen_OCINumber; gnade-1.6.2.orig/dbi/oci/oci-thick-gen_ocinumber.ads0000644000175000017500000000545510537157463022106 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Thin Ada95 binding to OCI™ (Oracle® Call Interface™) -- -- Copyright (C) 2000-2006 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-thick-gen_ocinumber.ads,v 1.13 2006/12/11 04:31:47 vagul Exp $ package OCI.Thick.Gen_OCINumber is generic with function OCINumberOper (err : in OCIError; number : in OCINumber; result : access OCINumber) return SWord; function Unary_Function (Item : OCINumber) return OCINumber; pragma Inline (Unary_Function); generic with function OCINumberOper (err : in OCIError; number1 : in OCINumber; number2 : in OCINumber; result : access OCINumber) return SWord; function Binary_Function (Left, Right : OCINumber) return OCINumber; pragma Inline (Binary_Function); generic type Integer_Type is range <>; with function OCINumberOper (Err : in OCIError; Number : in OCINumber; Value : in SWord; Result : access OCINumber) return SWord; function Integer_Function (Left : OCINumber; Right : Integer_Type) return OCINumber; pragma Inline (Integer_Function); generic with function Compare (Left, Right : SWord) return Boolean; function Compare_Function (Left, Right : OCINumber) return Boolean; pragma Inline (Compare_Function); generic type Integer_Type is range <>; function Num_To_Integer (Numb : OCINumber) return Integer_Type; generic type Integer_Type is range <>; function Int_To_Number (From : Integer_Type) return OCINumber; generic type Unsigned_Type is mod <>; function Unsigned_To_Number (From : Unsigned_Type) return OCINumber; generic type Unsigned_Type is mod <>; function Num_To_Unsigned (Numb : OCINumber) return Unsigned_Type; generic type Float_Type is digits <>; function Float_To_Number (From : Float_Type) return OCINumber; generic type Float_Type is digits <>; function Num_To_Float (Numb : OCINumber) return Float_Type; generic type Float_Type is digits <>; function Float_To_Number_Better (From : Float_Type) return OCINumber; generic type Float_Type is digits <>; function Num_To_Float_Better (Numb : OCINumber) return Float_Type; generic type Decimal_Type is delta <> digits <>; function Decimal_To_Number (From : Decimal_Type) return OCINumber; generic type Decimal_Type is delta <> digits <>; function Num_To_Decimal (Numb : OCINumber) return Decimal_Type; end OCI.Thick.Gen_OCINumber; gnade-1.6.2.orig/dbi/oci/oci-thick-integer_var.ads0000644000175000017500000000106210537157463021565 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Thin Ada95 binding to OCI™ (Oracle® Call Interface™) -- -- Copyright (C) 2000-2006 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-thick-integer_var.ads,v 1.7 2006/12/11 04:31:47 vagul Exp $ with OCI.Thick.Var; package OCI.Thick.Integer_Var is new OCI.Thick.Var (Integer, SQLT_INT); gnade-1.6.2.orig/dbi/oci/oci-thick-lobs.adb0000644000175000017500000002761611033070070020167 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Ada95 Interface to Oracle RDBMS -- -- Copyright (C) 2000-2006 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-thick-lobs.adb,v 1.21 2008/07/03 06:22:48 vagul Exp $ with OCI.Thread; with System; package body OCI.Thick.Lobs is use Ada.Strings.Unbounded; Type4Alloc : constant array (Lob_Type) of Ub4 := (File => OCI_DTYPE_FILE, Bin => OCI_DTYPE_LOB, NChar => OCI_DTYPE_LOB, Char => OCI_DTYPE_LOB); Type4Create_Temp : constant array (Lob_Type) of Ub1 := (File => 0, Bin => OCI_TEMP_BLOB, NChar => OCI_TEMP_NCLOB, Char => OCI_TEMP_CLOB); procedure Read (Loc : in Locator; Amount : in out Count; Offset : in Positive_Count; Buffer : in System.Address); procedure Write (Loc : in out Locator; Offset : in Positive_Count; Buffer : in System.Address; Length : in Ub4); ------------ -- Create -- ------------ function Create (Connect : in Connection; Kind : in Lob_Type := Char) return Locator is Object : Locator; begin Object.Connect := Connect; Object.Kind := Kind; Object.Handle := Alloc_Descriptor (Thread.Environment, Type4Alloc (Kind)); return Object; end Create; ---------------------- -- Create_Temporary -- ---------------------- function Create_Temporary (Connect : in Connection; Kind : in Lob_Type := Char) return Locator is Loc : Locator := Create (Connect, Kind); begin Create_Temporary (Loc); return Loc; end Create_Temporary; procedure Create_Temporary (Loc : in out Locator; Cache : in Boolean := True) is Rc : SWord; To_OCI_Boolean : constant array (Boolean) of C.int := (True => Lib.TRUE, False => Lib.FALSE); begin Rc := OCILobCreateTemporary (Svchp => OCISvcCtx (Handle (Loc.Connect)), Errhp => Thread.Error, Locp => OCILobLocator (Loc.Handle), Csid => OCI_DEFAULT, Csfrm => SQLCS_IMPLICIT, Lobtype => Type4Create_Temp (Loc.Kind), Cache => To_OCI_Boolean (Cache), Duration => OCI_DURATION_SESSION); Check_Error (Rc); end Create_Temporary; procedure Create_Temporary (Stream : in out Lob_Stream; Connect : in Connection; Kind : in Lob_Type := Char) is begin Stream.Loc := Create (Connect, Kind); Create_Temporary (Stream.Loc); end Create_Temporary; ------------- -- Destroy -- ------------- procedure Destroy (Object : in out Locator) is use type System.Address; begin if Object.Handle /= Empty_Handle then Check_Error (OCIDescriptorFree (Descp => Object.Handle, Dtype => Type4Alloc (Object.Kind))); end if; end Destroy; ----------------- -- End_Of_File -- ----------------- function End_Of_File (Stream : in Lob_Stream) return Boolean is begin return Stream.Position > Length (Stream.Loc); end End_Of_File; -------------------- -- Free_Temporary -- -------------------- procedure Free_Temporary (Loc : in out Locator) is begin Check_Error (OCILobFreeTemporary (Svchp => OCISvcCtx (Handle (Loc.Connect)), Errhp => Thread.Error, Locp => OCILobLocator (Loc.Handle))); end Free_Temporary; procedure Free_Temporary (Stream : in out Lob_Stream) is begin Free_Temporary (Stream.Loc); end Free_Temporary; ------------------ -- Get_Lob_Type -- ------------------ function Get_Lob_Type (Loc : Locator) return Lob_Type is begin return Loc.Kind; end Get_Lob_Type; ---------------- -- Is_Created -- ---------------- function Is_Created (Value : in Locator) return Boolean is use type OCIHandle; begin return Value.Handle /= Empty_Handle; end Is_Created; ------------- -- Is_Init -- ------------- function Is_Init (Value : in Locator) return Boolean is Result : aliased C.int; Rc : SWord; use type DVoid; begin if Value.Handle = Empty_Handle then return False; end if; Rc := OCILobLocatorIsInit (Envhp => Thread.Environment, Errhp => Thread.Error, Locp => OCILobLocator (Value.Handle), Is_Initialized => Result'Unchecked_Access); Check_Error (Rc); return Boolean'Val (Result); end Is_Init; ------------- -- Is_Open -- ------------- function Is_Open (Value : in Locator) return Boolean is Result : aliased C.int; Rc : SWord; use type DVoid; begin if Value.Handle = Empty_Handle then return False; end if; Rc := OCILobIsOpen (Svchp => OCISvcCtx (Handle (Value.Connect)), Errhp => Thread.Error, Locp => OCILobLocator (Value.Handle), Flag => Result'Unchecked_Access); Check_Error (Rc); return Boolean'Val (Result); end Is_Open; ------------------ -- Is_Temporary -- ------------------ function Is_Temporary (Value : in Locator) return Boolean is Result : aliased C.int; begin Check_Error (OCILobIsTemporary (Envhp => Thread.Environment, Errhp => Thread.Error, Locp => OCILobLocator (Value.Handle), Is_Temporary => Result'Unchecked_Access)); return Boolean'Val (Result); end Is_Temporary; ------------ -- Length -- ------------ function Length (Loc : in Locator) return Count is Result : aliased Ub4; begin Check_Error (OCILobGetLength (Svchp => OCISvcCtx (Handle (Loc.Connect)), Errhp => Thread.Error, Locp => OCILobLocator (Loc.Handle), Lenp => Result'Unchecked_Access)); return Count (Result); end Length; ---------- -- Read -- ---------- procedure Read (Loc : in Locator; Amount : in out Count; Offset : in Positive_Count; Buffer : in System.Address) is Amt : aliased Ub4 := Ub4 (Amount); use System; begin Check_Error (OCILobRead (Svchp => OCISvcCtx (Handle (Loc.Connect)), Errhp => Thread.Error, Locp => OCILobLocator (Loc.Handle), Amtp => Amt'Unchecked_Access, Offset => Ub4 (Offset), Bufp => Buffer, Bufl => Ub4 (Amount), Ctxp => Empty_Handle, Cbfp => Empty_Handle, Csid => 0)); Amount := Count (Amt); end Read; procedure Read (Loc : in Locator; Offset : in Positive_Count; Buffer : out Raw; Last : out Raw_Offset) is Amt : Count := Buffer'Length; begin Read (Loc, Amt, Offset, Buffer'Address); Last := Buffer'Last - Raw_Offset (Buffer'Length - Amt); end Read; procedure Read (Loc : in Locator; Offset : in Positive_Count; Buffer : out String; Last : out Integer) is Amt : Count := Buffer'Length; begin Read (Loc, Amt, Offset, Buffer'Address); Last := Buffer'Last - Integer (Buffer'Length - Amt); end Read; procedure Read (Stream : in out Lob_Stream; Item : out Stream_Element_Array; Last : out Stream_Element_Offset) is begin Read (Stream.Loc, Offset => Stream.Position, Buffer => Item, Last => Last); Stream.Position := Stream.Position + Count (Last - Item'First + 1); end Read; ----------- -- Reset -- ----------- procedure Reset (Stream : in out Lob_Stream) is begin Stream.Position := Positive_Count'First; end Reset; procedure Set_Index (Stream : in out Lob_Stream; Offset : in Positive_Count) is begin Stream.Position := Offset; end Set_Index; ------------ -- Stream -- ------------ procedure Stream (Stream : in out Lob_Stream'Class; Loc : in Locator) is begin Stream.Loc := Loc; Stream.Position := Positive_Count'First; end Stream; --------------- -- To_String -- --------------- function To_String (Loc : in Locator) return String is Len : Count := Length (Loc); Result : C.char_array (0 .. C.size_t (Len - 1)); begin Read (Loc, Len, 1, Result'Address); return C.To_Ada (Result, False); end To_String; function To_String (Loc : in Lob_Stream) return String is begin return To_String (Loc.Loc); end To_String; ------------------------- -- To_Unbounded_String -- ------------------------- function To_Unbounded_String (Loc : in Locator) return Unbounded_String is Position : Count := 1; Buffer : String (1 .. 16#4000#); Result : Unbounded_String; Last : Natural; begin loop Read (Loc => Loc, Offset => Position, Buffer => Buffer, Last => Last); Append (Result, Buffer (1 .. Last)); exit when Last < Buffer'Last; Position := Position + Count (Last); end loop; return Result; end To_Unbounded_String; ---------- -- Trim -- ---------- procedure Trim (Loc : in out Locator; Length : in Count := 0) is begin Check_Error (OCILobTrim (Svchp => OCISvcCtx (Handle (Loc.Connect)), Errhp => Thread.Error, Locp => OCILobLocator (Loc.Handle), Newlen => Ub4 (Length))); end Trim; ----------- -- Write -- ----------- procedure Write (Loc : in out Locator; Offset : in Positive_Count; Buffer : in System.Address; Length : in Ub4) is use type Ub4; Amt : aliased Ub4 := Length; begin if Length > 0 then Check_Error (OCILobWrite (Svchp => OCISvcCtx (Handle (Loc.Connect)), Errhp => Thread.Error, Locp => OCILobLocator (Loc.Handle), Amtp => Amt'Unchecked_Access, Offset => Ub4 (Offset), Bufp => Buffer, Buflen => Length, Piece => OCI_ONE_PIECE, Ctxp => Empty_Handle, Cbfp => Empty_Handle, Csid => 0)); end if; end Write; procedure Write (Loc : in out Locator; Offset : in Positive_Count; Buffer : in Raw) is begin Write (Loc, Offset, Buffer'Address, Buffer'Length); end Write; procedure Write (Loc : in out Locator; Offset : in Positive_Count; Buffer : in String) is begin Write (Loc, Offset, Buffer'Address, Buffer'Length); end Write; ----------- -- Write -- ----------- procedure Write (Stream : in out Lob_Stream; Item : in Stream_Element_Array) is begin Write (Loc => Stream.Loc, Buffer => Item, Offset => Stream.Position); Stream.Position := Stream.Position + Item'Length; end Write; end OCI.Thick.Lobs; gnade-1.6.2.orig/dbi/oci/oci-thick-lobs.ads0000644000175000017500000000776610537157463020240 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Thin Ada95 binding to OCI™ (Oracle® Call Interface™) -- -- Copyright (C) 2000-2006 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-thick-lobs.ads,v 1.17 2006/12/11 04:31:47 vagul Exp $ with Ada.Streams; with Ada.Strings.Unbounded; with OCI.Thick.Connections; with System.Address_To_Access_Conversions; package OCI.Thick.Lobs is use Ada.Streams; use Connections; type Lob_Type is (Bin, File, Char, NChar); type Locator is new Handle_Reference with private; ------------------------------- -- Ada like stream interface -- ------------------------------- type Lob_Stream is new Root_Stream_Type with private; procedure Stream (Stream : in out Lob_Stream'Class; Loc : in Locator); procedure Read (Stream : in out Lob_Stream; Item : out Stream_Element_Array; Last : out Stream_Element_Offset); procedure Write (Stream : in out Lob_Stream; Item : in Stream_Element_Array); function End_Of_File (Stream : in Lob_Stream) return Boolean; -- Use Last < Item'Last condition after Read call for better performance. -------------------------------- -- Oracle like lob interface. -- -------------------------------- function Create (Connect : in Connection; Kind : in Lob_Type := Char) return Locator; -- For backward compartibility. function Create_Temporary (Connect : in Connection; Kind : in Lob_Type := Char) return Locator; procedure Create_Temporary (Loc : in out Locator; Cache : in Boolean := True); procedure Free_Temporary (Loc : in out Locator); type Count is new Natural; subtype Positive_Count is Count range 1 .. Count'Last; subtype Raw is Ada.Streams.Stream_Element_Array; subtype Raw_Offset is Ada.Streams.Stream_Element_Offset; procedure Read (Loc : in Locator; Offset : in Positive_Count; Buffer : out Raw; Last : out Raw_Offset); procedure Read (Loc : in Locator; Offset : in Positive_Count; Buffer : out String; Last : out Integer); procedure Write (Loc : in out Locator; Offset : in Positive_Count; Buffer : in Raw); procedure Write (Loc : in out Locator; Offset : in Positive_Count; Buffer : in String); procedure Trim (Loc : in out Locator; Length : in Count := 0); function Length (Loc : in Locator) return Count; function To_String (Loc : in Locator) return String; function To_Unbounded_String (Loc : in Locator) return Ada.Strings.Unbounded.Unbounded_String; function Is_Created (Value : in Locator) return Boolean; function Is_Init (Value : in Locator) return Boolean; function Is_Open (Value : in Locator) return Boolean; function Is_Temporary (Value : in Locator) return Boolean; procedure Create_Temporary (Stream : in out Lob_Stream; Connect : in Connection; Kind : in Lob_Type := Char); procedure Free_Temporary (Stream : in out Lob_Stream); function To_String (Loc : in Lob_Stream) return String; procedure Reset (Stream : in out Lob_Stream); procedure Set_Index (Stream : in out Lob_Stream; Offset : in Positive_Count); function Get_Lob_Type (Loc : Locator) return Lob_Type; private use Reference_Finalization; pragma Inline (To_String); package AC is new System.Address_To_Access_Conversions (OCIHandle); type Locator is new Handle_Reference with record Kind : Lob_Type; Connect : Connection; end record; procedure Destroy (Object : in out Locator); type Lob_Stream is new Root_Stream_Type with record Loc : Locator; Position : Positive_Count := Positive_Count'First; end record; end OCI.Thick.Lobs; gnade-1.6.2.orig/dbi/oci/oci-thick-long_float_var.ads0000644000175000017500000000107310537157463022256 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Thin Ada95 binding to OCI™ (Oracle® Call Interface™) -- -- Copyright (C) 2000-2006 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-thick-long_float_var.ads,v 1.7 2006/12/11 04:31:47 vagul Exp $ with OCI.Thick.Var; package OCI.Thick.Long_Float_Var is new OCI.Thick.Var (Long_Float, SQLT_FLT); gnade-1.6.2.orig/dbi/oci/oci-thick-notifications-db_change.adb0000644000175000017500000001761610613627455024012 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Ada95 Interface to Oracle RDBMS -- -- Copyright (C) 2006 Maxim Reznik -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ with OCI.Thread; with OCI.Environments; with System.Address_To_Access_Conversions; package body OCI.Thick.Notifications.DB_Change is function Get_Table (Object : Change_Descriptor; Index : Positive) return OCIColl; function Get_Table_Collection (Object : Change_Descriptor) return OCIColl; function Get_Attr_Ub4 is new Get_Attr_G (Ub4); function Get_Attr_Coll is new Get_Attr_G (OCIColl); --------------- -- Associate -- --------------- procedure Associate (Item : in out Change_Subscription; Stmt : in out Statements.Statement) is begin Set_Attr (Handle (Stmt), OCI_HTYPE_STMT, OCI_ATTR_CHNF_REGHANDLE, Value => OCIHandle (Item.Handle)); Statements.Execute (Stmt); Set_Attr (Handle (Stmt), OCI_HTYPE_STMT, OCI_ATTR_CHNF_REGHANDLE, Empty_Handle); end Associate; ----------------- -- Change_Kind -- ----------------- function Change_Kind (Object : Change_Descriptor) return Change_Kinds is Code : constant Ub4 := Get_Attr_Ub4 (OCIHandle (Object.Descriptor), OCI_DTYPE_CHDES, OCI_ATTR_CHDES_NFYTYPE); begin return Change_Kinds'Val (Code); end Change_Kind; ------------ -- Create -- ------------ procedure Create (Item : in out Change_Subscription; Need_Rowids : in Boolean := False) is use type Ub4; Yes : aliased constant Bool := OCI.Lib.TRUE; begin Create (Item, OCI_SUBSCR_NAMESPACE_DBCHANGE); if Need_Rowids then Set_Attr (OCIHandle (Item.Handle), OCI_HTYPE_SUBSCRIPTION, OCI_ATTR_CHNF_ROWIDS, Value => Yes'Address); end if; end Create; --------------- -- Get_Table -- --------------- function Get_Table (Object : Change_Descriptor; Index : Positive) return OCIColl is package Convert is new System.Address_To_Access_Conversions (OCIColl); Collection : constant OCIColl := Get_Table_Collection (Object); Exists : aliased Bool; Elem : aliased DVoid; begin Check_Error (OCICollGetElem (Thread.Environment, Thread.Error, Collection, Sb4 (Index - 1), Exists'Access, Elem'Access)); return Convert.To_Pointer (Elem).all; end Get_Table; -------------------------- -- Get_Table_Collection -- -------------------------- function Get_Table_Collection (Object : Change_Descriptor) return OCIColl is Collection : constant OCIColl := Get_Attr_Coll (OCIHandle (Object.Descriptor), OCI_DTYPE_CHDES, OCI_ATTR_CHDES_TABLE_CHANGES); begin return Collection; end Get_Table_Collection; --------------------- -- Internal_Notify -- --------------------- procedure Internal_Notify (Item : in out Change_Subscription; Descriptor : in OCI.Lib.DVoid; Buffer : in Buffer_Type) is pragma Unreferenced (Buffer); Data : Change_Descriptor; begin Data.Descriptor := Descriptor; Notify (Change_Subscription'Class (Item), Data); end Internal_Notify; ------------ -- Notify -- ------------ procedure Notify (Item : in out Change_Subscription; Data : in Change_Descriptor) is pragma Unreferenced (Item); pragma Unreferenced (Data); begin -- To be overloaded null; end Notify; ----------------- -- Table_Count -- ----------------- function Table_Count (Object : Change_Descriptor) return Natural is Collection : constant OCIColl := Get_Table_Collection (Object); Size : aliased Sb4; begin if Collection = OCIColl (Empty_Handle) then return 0; else Check_Error (OCICollSize (Thread.Environment, Thread.Error, Collection, Size'Access)); return Natural (Size); end if; end Table_Count; ---------------- -- Table_Name -- ---------------- function Table_Name (Object : Change_Descriptor; Index : Positive) return String is Table : constant OCIColl := Get_Table (Object, Index); begin return Get_Attr (OCIHandle (Table), OCI_DTYPE_TABLE_CHDES, OCI_ATTR_CHDES_TABLE_NAME); end Table_Name; --------------------- -- Table_Operation -- --------------------- function Table_Operation (Object : Change_Descriptor; Index : Positive) return Operation_Kinds is Table : constant OCIColl := Get_Table (Object, Index); Code : constant Ub4 := Get_Attr_Ub4 (OCIHandle (Table), OCI_DTYPE_TABLE_CHDES, OCI_ATTR_CHDES_TABLE_OPFLAGS); begin return Operation_Kinds (Code); end Table_Operation; ---------------- -- Table_Rows -- ---------------- function Table_Rows (Object : Change_Descriptor; Index : Positive) return Row_Array is use Ada.Strings.Unbounded; package Convert is new System.Address_To_Access_Conversions (OCIHandle); Table : constant OCIColl := Get_Table (Object, Index); Rows : constant OCIColl := Get_Attr_Coll (OCIHandle (Table), OCI_DTYPE_TABLE_CHDES, OCI_ATTR_CHDES_TABLE_ROW_CHANGES); Size : aliased Sb4; begin if Rows = OCIColl (Empty_Handle) then return (1 .. 0 => (Null_Unbounded_String, 0)); else Check_Error (OCICollSize (Thread.Environment, Thread.Error, Rows, Size'Access)); declare Length : aliased UWord := UWord (Size); Exists : array (1 .. Size) of aliased Bool := (others => 0); Elem : array (1 .. Size) of aliased DVoid; Result : Row_Array (1 .. Natural (Size)); Index : Positive := 1; Handle : OCIHandle; begin Check_Error (OCICollGetElemArray (Thread.Environment, Thread.Error, Rows, 0, Exists (1)'Access, Elem (1)'Access, Length => Length'Access)); for J in Elem'Range loop Handle := Convert.To_Pointer (Elem (J)).all; Result (Index).Id := To_Unbounded_String (Get_Attr (Handle, OCI_DTYPE_ROW_CHDES, OCI_ATTR_CHDES_ROW_ROWID)); Result (Index).Kind := Operation_Kinds (Get_Attr_Ub4 (Handle, OCI_DTYPE_ROW_CHDES, OCI_ATTR_CHDES_ROW_OPFLAGS)); Index := Index + 1; end loop; return Result; end; end if; end Table_Rows; begin OCI.Environments.Set_Create_Mode_Flag (OCI_OBJECT); end OCI.Thick.Notifications.DB_Change; gnade-1.6.2.orig/dbi/oci/oci-thick-notifications-db_change.ads0000644000175000017500000000537110471310715024014 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Ada95 Interface to Oracle RDBMS -- -- Copyright (C) 2006 Maxim Reznik -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ with OCI.Thick.Statements; with Ada.Strings.Unbounded; package OCI.Thick.Notifications.DB_Change is type Change_Kinds is (None, Startup, Shutdown, Shutdown_Any, Drop_Db, Deregistration, Object_Change); type Operation_Kinds is mod 256; All_Rows : constant Operation_Kinds; Insert : constant Operation_Kinds; Update : constant Operation_Kinds; Delete : constant Operation_Kinds; Alter : constant Operation_Kinds; Drop : constant Operation_Kinds; type Row is record Id : Ada.Strings.Unbounded.Unbounded_String; Kind : Operation_Kinds; end record; type Row_Array is array (Positive range <>) of Row; type Change_Descriptor is limited private; function Change_Kind (Object : Change_Descriptor) return Change_Kinds; function Table_Count (Object : Change_Descriptor) return Natural; function Table_Name (Object : Change_Descriptor; Index : Positive) return String; function Table_Operation (Object : Change_Descriptor; Index : Positive) return Operation_Kinds; function Table_Rows (Object : Change_Descriptor; Index : Positive) return Row_Array; type Change_Subscription is new Base_Subscription with private; procedure Create (Item : in out Change_Subscription; Need_Rowids : in Boolean := False); procedure Associate (Item : in out Change_Subscription; Stmt : in out Statements.Statement); -- Associate also executes the statement. procedure Notify (Item : in out Change_Subscription; Data : in Change_Descriptor); private All_Rows : constant Operation_Kinds := OCI.Lib.OCI_OPCODE_ALLROWS; Insert : constant Operation_Kinds := OCI.Lib.OCI_OPCODE_INSERT; Update : constant Operation_Kinds := OCI.Lib.OCI_OPCODE_UPDATE; Delete : constant Operation_Kinds := OCI.Lib.OCI_OPCODE_DELETE; Alter : constant Operation_Kinds := OCI.Lib.OCI_OPCODE_ALTER; Drop : constant Operation_Kinds := OCI.Lib.OCI_OPCODE_DROP; type Change_Descriptor is limited record Descriptor : OCI.Lib.DVoid; end record; type Change_Subscription is new Base_Subscription with null record; procedure Internal_Notify (Item : in out Change_Subscription; Descriptor : in OCI.Lib.DVoid; Buffer : in Buffer_Type); end OCI.Thick.Notifications.DB_Change; gnade-1.6.2.orig/dbi/oci/oci-thick-notifications.adb0000644000175000017500000001726110613627455022116 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Ada95 Interface to Oracle RDBMS -- -- Copyright (C) 2000-2006 Dmitriy Anisimkov, Maxim Reznik -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-thick-notifications.adb,v 1.12 2007/04/25 10:36:29 vagul Exp $ with Ada.Exceptions; with Ada.Text_IO; with OCI.Lib; with OCI.Thread; with OCI.Environments; with Interfaces.C; with System.Address_To_Access_Conversions; package body OCI.Thick.Notifications is use type System.Address; To_UB4 : constant array (Namespace_Enum) of Ub4 := (AQ => OCI_SUBSCR_NAMESPACE_AQ, Anonymous => OCI_SUBSCR_NAMESPACE_ANONYMOUS); function OCISubscriptionNotify (pCtx : in DVoid; pSubscrHp : in OCISubscription; pPayload : in DVoid; iPayloadLen : in Ub4; pDescriptor : in DVoid; iMode : in Ub4) return SWord; pragma Convention (C, OCISubscriptionNotify); ------------ -- Create -- ------------ procedure Create (Item : in out Subscription; Name : in String; Namespace : in Namespace_Enum) is begin Create (Item, To_UB4 (Namespace)); Set_Attr (OCIHandle (Item.Handle), OCI_HTYPE_SUBSCRIPTION, OCI_ATTR_SUBSCR_NAME, Name); end Create; procedure Create (Item : in out Base_Subscription; Namespace : in OCI.Lib.Ub4) is begin if Item.Handle /= OCISubscription (Empty_Handle) then -- Avoid memory and handles leak. raise Already_Registered; end if; Item.Handle := OCISubscription (Alloc_Handle (Thread.Environment, OCI_HTYPE_SUBSCRIPTION)); Set_Attr (OCIHandle (Item.Handle), OCI_HTYPE_SUBSCRIPTION, OCI_ATTR_SUBSCR_NAMESPACE, Value => Namespace'Address); end Create; ------------- -- Disable -- ------------- procedure Disable (Item : in Base_Subscription) is begin Check_Error (OCISubscriptionDisable (Item.Handle, Thread.Error, OCI_DEFAULT)); end Disable; ------------ -- Enable -- ------------ procedure Enable (Item : in Base_Subscription)is begin Check_Error (OCISubscriptionEnable (Item.Handle, Thread.Error, OCI_DEFAULT)); end Enable; -------------- -- Finalize -- -------------- procedure Finalize (Object : in out Subscription) is begin if Object.Handle /= OCISubscription (Empty_Handle) then Free (H => OCIHandle (Object.Handle), HType => OCI_HTYPE_SUBSCRIPTION); end if; end Finalize; --------------------- -- Internal_Notify -- --------------------- procedure Internal_Notify (Item : in out Base_Subscription; Descriptor : in OCI.Lib.DVoid; Buffer : in Buffer_Type) is pragma Unreferenced (Item); pragma Unreferenced (Buffer); pragma Unreferenced (Descriptor); begin -- To be overloaded in child types null; end Internal_Notify; procedure Internal_Notify (Item : in out Subscription; Descriptor : in OCI.Lib.DVoid; Buffer : in Buffer_Type) is pragma Unreferenced (Descriptor); begin Notify (Subscription'Class (Item), Buffer); end Internal_Notify; ------------ -- Notify -- ------------ procedure Notify (Item : in out Subscription; Buffer : in Buffer_Type) is pragma Unreferenced (Item); pragma Unreferenced (Buffer); begin null; end Notify; --------------------------- -- OCISubscriptionNotify -- --------------------------- function OCISubscriptionNotify (pCtx : in DVoid; pSubscrHp : in OCISubscription; pPayload : in DVoid; iPayloadLen : in Ub4; pDescriptor : in DVoid; iMode : in Ub4) return SWord is pragma Unreferenced (pSubscrHp); pragma Unreferenced (iMode); package Converter is new System.Address_To_Access_Conversions (Subscription'Class); use Converter; use Ada.Text_IO; Subscr : constant Object_Pointer := To_Pointer (pCtx); -- Queue_Name : String := Get_Attr (pDescriptor, -- OCI_DTYPE_AQNFY_DESCRIPTOR, OCI_ATTR_QUEUE_NAME); -- CONSUMER_Name : String := Get_Attr (pDescriptor, -- OCI_DTYPE_AQNFY_DESCRIPTOR, OCI_ATTR_CONSUMER_NAME); Buffer : constant Buffer_Type := (Ptr => pPayload, Length => Natural (iPayloadLen)); begin Internal_Notify (Subscr.all, pDescriptor, Buffer); return OCI_CONTINUE; exception when E : others => Put_Line (Current_Error, Ada.Exceptions.Exception_Information (E)); return OCI_ERROR; end OCISubscriptionNotify; ---------- -- Post -- ---------- procedure Post (Item : in out Subscription; Connect : in Connection; Data : in String) is begin Set_Attr (H => OCIHandle (Item.Handle), HType => OCI_HTYPE_SUBSCRIPTION, Attr => OCI_ATTR_SUBSCR_PAYLOAD, Value => Data); Check_Error (OCISubscriptionPost (svchp => OCISvcCtx (Handle (Connect)), subscrhpp => Item.Handle'Access, count => 1, errhp => Thread.Error, mode => OCI_DEFAULT)); Item.Connect := Connect; Set_Attr (H => OCIHandle (Item.Handle), HType => OCI_HTYPE_SUBSCRIPTION, Attr => OCI_ATTR_SUBSCR_PAYLOAD, Value => System.Null_Address); end Post; -------------- -- Register -- -------------- procedure Register (Item : in out Base_Subscription; Connect : in Connection) is RC : SWord; Connect_Handle : constant OCIHandle := Handle (Connect); begin Set_Attr (OCIHandle (Item.Handle), OCI_HTYPE_SUBSCRIPTION, OCI_ATTR_SUBSCR_CALLBACK, Value => OCISubscriptionNotify'Address); Set_Attr (OCIHandle (Item.Handle), OCI_HTYPE_SUBSCRIPTION, OCI_ATTR_SUBSCR_CTX, Value => Item'Address); RC := OCISubscriptionRegister (svchp => OCISvcCtx (Connect_Handle), subscrhpp => Item.Handle'Access, count => 1, errhp => Thread.Error, mode => OCI_DEFAULT); Check_Error (RC); Item.Connect := Connect; end Register; --------------- -- To_String -- --------------- function To_String (Buffer : in Buffer_Type) return String is use Interfaces.C; type Data_Type is new char_array (0 .. size_t (Buffer.Length) - 1); package Converter is new System.Address_To_Access_Conversions (Data_Type); use Converter; Ptr : constant Object_Pointer := To_Pointer (Buffer.Ptr); begin if Ptr = null then return ""; else return To_Ada (Ptr.all, Trim_Nul => False); end if; end To_String; ---------------- -- Unregister -- ---------------- procedure Unregister (Item : in out Base_Subscription) is begin Check_Error (OCISubscriptionUnRegister (svchp => OCISvcCtx (Handle (Item.Connect)), subscrhp => Item.Handle, errhp => Thread.Error, mode => OCI_DEFAULT)); end Unregister; begin OCI.Environments.Set_Create_Mode_Flag (OCI_EVENTS); end OCI.Thick.Notifications; gnade-1.6.2.orig/dbi/oci/oci-thick-notifications.ads0000644000175000017500000000452310537157463022136 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Thin Ada95 binding to OCI™ (Oracle® Call Interface™) -- -- Copyright (C) 2000-2006 Dmitriy Anisimkov, Maxim Reznik -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-thick-notifications.ads,v 1.8 2006/12/11 04:31:47 vagul Exp $ with OCI.Thick.Connections; with System; package OCI.Thick.Notifications is use OCI.Thick.Connections; type Base_Subscription is abstract tagged limited private; procedure Enable (Item : in Base_Subscription); procedure Disable (Item : in Base_Subscription); procedure Register (Item : in out Base_Subscription; Connect : in Connection); procedure Unregister (Item : in out Base_Subscription); type Subscription is new Base_Subscription with private; type Namespace_Enum is (AQ, Anonymous); type Buffer_Type is private; procedure Create (Item : in out Subscription; Name : in String; Namespace : in Namespace_Enum); procedure Post (Item : in out Subscription; Connect : in Connection; Data : in String); procedure Notify (Item : in out Subscription; Buffer : in Buffer_Type); function To_String (Buffer : in Buffer_Type) return String; Already_Registered : exception; private type Base_Subscription is new AF.Limited_Controlled with record Handle : aliased OCISubscription := OCISubscription (Empty_Handle); Connect : Connection; end record; procedure Internal_Notify (Item : in out Base_Subscription; Descriptor : in OCI.Lib.DVoid; Buffer : in Buffer_Type); procedure Create (Item : in out Base_Subscription; Namespace : in OCI.Lib.Ub4); type Subscription is new Base_Subscription with null record; procedure Internal_Notify (Item : in out Subscription; Descriptor : in OCI.Lib.DVoid; Buffer : in Buffer_Type); type Buffer_Type is record Ptr : System.Address := System.Null_Address; Length : Natural := 0; end record; procedure Finalize (Object : in out Subscription); end OCI.Thick.Notifications; gnade-1.6.2.orig/dbi/oci/oci-thick-number_functions.adb0000644000175000017500000000450611007574127022616 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Ada95 Interface to Oracle RDBMS -- -- Copyright (C) 2000-2006 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-thick-number_functions.adb,v 1.19 2008/05/05 12:06:47 vagul Exp $ with OCI.Thread; package body OCI.Thick.Number_Functions is ------------- -- Is_Zero -- ------------- function Is_Zero (Num : in OCINumber) return Boolean is use type C.int; Zero : aliased C_Boolean; begin Check_Error (OCINumberIsZero (Thread.Error, Num, Zero'Access)); return Zero /= Lib.FALSE; end Is_Zero; ---------- -- Sign -- ---------- function Sign (Num : in OCINumber) return Integer is Sign : aliased SWord; begin Check_Error (OCINumberSign (Thread.Error, Num, Sign'Access)); return Integer (Sign); end Sign; --------------- -- To_Number -- --------------- function To_Number (From : String; Format : String) return OCINumber is Result : aliased OCINumber; begin Check_Error (OCINumberFromText (Err => Thread.Error, Buf => C.To_C (From), Str_Length => From'Length, Fmt => C.To_C (Format), Fmt_Length => Format'Length, NLS_params => Empty_Undefined, nls_p_length => 0, number => Result'Access)); return Result; end To_Number; --------------- -- To_String -- --------------- function To_String (From : OCINumber; Format : String := "TM9") return String is use type Ub4; Buff : aliased Text := (0 .. 127 => C.nul); Len : aliased Ub4 := Buff'Length; begin Check_Error (OCINumberToText (Err => Thread.Error, Date => From, Fmt => C.To_C (Format), Fmt_Length => Format'Length, Nls_Name => Empty_Undefined, Nls_Length => 0, Buf_Size => Len'Access, Buf => CStr.To_Chars_Ptr (Buff'Unchecked_Access))); return C.To_Ada (Buff (0 .. C.size_t (Len - 1)), False); end To_String; end OCI.Thick.Number_Functions; gnade-1.6.2.orig/dbi/oci/oci-thick-number_functions.ads0000644000175000017500000000633211007574127022636 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Thin Ada95 binding to OCI™ (Oracle® Call Interface™) -- -- Copyright (C) 2000-2006 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-thick-number_functions.ads,v 1.15 2008/05/05 12:06:47 vagul Exp $ with Interfaces.C; with OCI.Thick.Gen_OCINumber; package OCI.Thick.Number_Functions is use Thick.Gen_OCINumber; function "abs" is new Unary_Function (OCINumberAbs); function ArcCos is new Unary_Function (OCINumberArcCos); function ArcSin is new Unary_Function (OCINumberArcSin); function ArcTan is new Unary_Function (OCINumberArcTan); function Assign is new Unary_Function (OCINumberAssign); function Ceil is new Unary_Function (OCINumberCeil); function Cos is new Unary_Function (OCINumberCos); function Exp is new Unary_Function (OCINumberExp); function Floor is new Unary_Function (OCINumberFloor); function HypCos is new Unary_Function (OCINumberHypCos); function HypSin is new Unary_Function (OCINumberHypSin); function HypTan is new Unary_Function (OCINumberHypTan); function Ln is new Unary_Function (OCINumberLn); function "-" is new Unary_Function (OCINumberNeg); function Sin is new Unary_Function (OCINumberSin); function Sqrt is new Unary_Function (OCINumberSqrt); function Tan is new Unary_Function (OCINumberTan); function ArcTan2 is new Binary_Function (OCINumberArcTan2); function "+" is new Binary_Function (OCINumberAdd); pragma Inline ("+"); function "/" is new Binary_Function (OCINumberDiv); pragma Inline ("/"); function Log is new Binary_Function (OCINumberLog); function "mod" is new Binary_Function (OCINumberMod); function "*" is new Binary_Function (OCINumberMul); pragma Inline ("*"); function "**" is new Binary_Function (OCINumberPower); function "-" is new Binary_Function (OCINumberSub); pragma Inline ("-"); function Round is new Integer_Function (Integer, OCINumberRound); function Trunc is new Integer_Function (Integer, OCINumberTrunc); function Shift is new Integer_Function (Integer, OCINumberShift); function "**" is new Integer_Function (Integer, OCINumberIntPower); function ">" is new Compare_Function (Interfaces.C.">"); function "<" is new Compare_Function (Interfaces.C."<"); function "=" is new Compare_Function (Interfaces.C."="); function To_String (From : OCINumber; Format : String := "TM9") return String; function To_Number (From : String; Format : String) return OCINumber; function To_Long_Float is new Num_To_Float (Long_Float); function To_Number is new Float_To_Number (Long_Float); function To_Integer is new Num_To_Integer (Integer); function To_Number is new Int_To_Number (Integer); function To_Long_Integer is new Num_To_Integer (Long_Integer); function To_Number is new Int_To_Number (Long_Integer); function Sign (Num : in OCINumber) return Integer; function Is_Zero (Num : in OCINumber) return Boolean; end OCI.Thick.Number_Functions; gnade-1.6.2.orig/dbi/oci/oci-thick-object.adb0000644000175000017500000001574611033070070020477 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Ada95 Interface to Oracle RDBMS -- -- Copyright (C) 2006 Maxim Reznik. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-thick-object.adb,v 1.4 2008/07/03 06:22:48 vagul Exp $ with OCI.Thread; with Ada.Unchecked_Conversion; with System.Address_To_Access_Conversions; package body OCI.Thick.Object is package Convert is new System.Address_To_Access_Conversions (Object_Node); function Get_TDO (Connect : in Connections.Connection) return OCIType; protected TDO_Lock is entry Get; procedure Release; private Open : Boolean := True; end TDO_Lock; TDO : aliased OCIType; TDO_Ready : Boolean := False; pragma Atomic (TDO_Ready); ---------- -- Bind -- ---------- procedure Bind (Stmt : in Statements.Statement; Item : in out Variable; Position : in Positive) is RC : SWord; TDO : constant OCIType := Get_TDO (Statements.Get_Connection (Stmt)); begin RC := OCIBindByPos (Stmtp => OCIStmt (Handle (Stmt)), Bindpp => Item.Bind'Access, Errhp => Thread.Error, Position => Ub4 (Position), Valuep => Empty_Handle, Value_Sz => 0, Dty => SQLT_NTY, Indp => null); Check_Error (RC); RC := OCIBindObject (Bindp => Item.Bind, Errhp => Thread.Error, TDO => TDO, Value => Item.Data'Address, Value_Sz => null, Indp => Item.Ind'Address, Ind_Sz => null); Check_Error (RC); end Bind; procedure Bind (Stmt : in Statements.Statement; Item : in out Variable; Name : in String) is RC : SWord; TDO : constant OCIType := Get_TDO (Statements.Get_Connection (Stmt)); begin RC := OCIBindByName (Stmtp => OCIStmt (Handle (Stmt)), Bindpp => Item.Bind'Access, Errhp => Thread.Error, Placeholder => C.To_C (Name), Placeh_Len => Name'Length, Valuep => Empty_Handle, Value_Sz => 0, Dty => SQLT_NTY, Indp => null); Check_Error (RC); RC := OCIBindObject (Bindp => Item.Bind, Errhp => Thread.Error, TDO => TDO, Value => Item.Data'Address, Value_Sz => null, Indp => Item.Ind'Address, Ind_Sz => null); Check_Error (RC); end Bind; ------------ -- Create -- ------------ procedure Create (Connect : in Connections.Connection; Item : out Variable) is TDO : constant OCIType := Get_TDO (Connect); RC : SWord; begin RC := OCIObjectNew (Thread.Environment, Thread.Error, OCISvcCtx (Handle (Connect)), OCI_TYPECODE_OBJECT, TDO, Empty_Handle, OCI_DURATION_SESSION, 0, Item.Data'Access); Check_Error (RC); RC := OCIObjectGetInd (Thread.Environment, Thread.Error, Item.Data, Item.Ind'Access); Check_Error (RC); end Create; ------------ -- Define -- ------------ procedure Define (Stmt : in Statements.Statement; Item : in out Variable; Position : in Positive) is RC : SWord; TDO : constant OCIType := Get_TDO (Statements.Get_Connection (Stmt)); begin RC := OCIDefineByPos (Stmtp => OCIStmt (Handle (Stmt)), Defnpp => Item.Define'Access, Errhp => Thread.Error, Position => Ub4 (Position), Value => Empty_Handle, Value_Sz => 0, Dty => SQLT_NTY, Indp => null); Check_Error (RC); RC := OCIDefineObject (Defnp => Item.Define, Errhp => Thread.Error, TDO => TDO, Value => Item.Data'Address, Value_Sz => null, Indp => Item.Ind'Address, Ind_Sz => null); Check_Error (RC); end Define; ---------- -- Free -- ---------- procedure Free (Item : in out Variable) is RC : constant SWord := OCIObjectFree (Thread.Environment, Thread.Error, Item.Data, 0); begin Check_Error (RC); Item.Data := Empty_Handle; Item.Ind := Empty_Handle; end Free; ------------------- -- Get_Indicator -- ------------------- function Get_Indicator (Item : Variable) return Indicator_Access is function "+" is new Ada.Unchecked_Conversion (OCIHandle, Indicator_Access); begin return +Item.Ind; end Get_Indicator; function Get_Indicator (Item : Variable) return Indicator is begin return Get_Indicator (Item).all; end Get_Indicator; ------------- -- Get_TDO -- ------------- function Get_TDO (Connect : in Connections.Connection) return OCIType is use type C.int; use type OCIType; RC : SWord; Empty : Text (1 .. 0); Name : constant Text := C.To_C (Type_Name, False); begin if not TDO_Ready then TDO_Lock.Get; RC := OCI_SUCCESS; if not TDO_Ready then RC := OCITypeByName (Thread.Environment, Thread.Error, OCISvcCtx (Handle (Connect)), Empty, 0, Name, Type_Name'Length, Empty, 0, OCI_DURATION_SESSION, OCI_TYPEGET_ALL, TDO'Access); TDO_Ready := RC = OCI_SUCCESS; end if; TDO_Lock.Release; Check_Error (RC); end if; return TDO; end Get_TDO; --------------- -- Get_Value -- --------------- function Get_Value (Item : Variable) return Object_Access is begin return Object_Access (Convert.To_Pointer (Item.Data)); end Get_Value; function Get_Value (Item : Variable) return Object_Node is begin return Get_Value (Item).all; end Get_Value; ------------------- -- Set_Indicator -- ------------------- procedure Set_Indicator (Item : in out Variable; Nullity : in Indicator) is begin Get_Indicator (Item).all := Nullity; end Set_Indicator; --------------- -- Set_Value -- --------------- procedure Set_Value (Item : in out Variable; Value : in Object_Node) is begin Get_Value (Item).all := Value; end Set_Value; -------------- -- TDO_Lock -- -------------- protected body TDO_Lock is entry Get when Open is begin Open := False; end Get; procedure Release is begin Open := True; end Release; end TDO_Lock; end OCI.Thick.Object; gnade-1.6.2.orig/dbi/oci/oci-thick-object.ads0000644000175000017500000000476010444715006020524 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Ada95 Interface to Oracle RDBMS -- -- Copyright (C) 2006 Maxim Reznik. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-thick-object.ads,v 1.2 2006/06/17 05:58:30 vagul Exp $ with OCI.Thick.Statements; with OCI.Thick.Connections; generic type Object_Node is private; -- Object_Node represents record correspond to Oracle Named Type -- Use ott tools to get C struct definition and write equal Ada type. type Indicator is private; -- Indicator is record contains indicators for whole object and -- for each field. 'ott' names it as "struct *_ind" Type_Name : in String; -- name of Oracle Named Type package OCI.Thick.Object is type Object_Access is access all Object_Node; type Indicator_Access is access all Indicator; type Variable is limited private; procedure Create (Connect : in Connections.Connection; Item : out Variable); procedure Free (Item : in out Variable); function Get_Value (Item : Variable) return Object_Access; function Get_Value (Item : Variable) return Object_Node; procedure Set_Value (Item : in out Variable; Value : in Object_Node); function Get_Indicator (Item : Variable) return Indicator_Access; function Get_Indicator (Item : Variable) return Indicator; procedure Set_Indicator (Item : in out Variable; Nullity : in Indicator); procedure Bind (Stmt : in Statements.Statement; Item : in out Variable; Position : in Positive); procedure Bind (Stmt : in Statements.Statement; Item : in out Variable; Name : in String); procedure Define (Stmt : in Statements.Statement; Item : in out Variable; Position : in Positive); Type_Size_Error : exception; -- Raised by Get_Value & Get_Indicator is size of Ada record doesn't -- match value returned by Oracle private use type C.long; type Variable is record Bind : aliased OCIBind := OCIBind (Empty_Handle); Define : aliased OCIDefine := OCIDefine (Empty_Handle); Data : aliased OCIHandle := Empty_Handle; Ind : aliased OCIHandle := Empty_Handle; end record; end OCI.Thick.Object; gnade-1.6.2.orig/dbi/oci/oci-thick-ocidate_var.ads0000644000175000017500000000113110537157463021535 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Thin Ada95 binding to OCI™ (Oracle® Call Interface™) -- -- Copyright (C) 2000-2006 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-thick-ocidate_var.ads,v 1.7 2006/12/11 04:31:47 vagul Exp $ with OCI.Thick.Var; with OCI.Thick.Date; package OCI.Thick.OCIDate_Var is new OCI.Thick.Var (OCI.Thick.Date.OCIDate, SQLT_ODT); gnade-1.6.2.orig/dbi/oci/oci-thick-ocihandle_var.ads0000644000175000017500000000107110537157463022056 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Thin Ada95 binding to OCI™ (Oracle® Call Interface™) -- -- Copyright (C) 2000-2006 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-thick-ocihandle_var.ads,v 1.7 2006/12/11 04:31:47 vagul Exp $ with OCI.Thick.Variable; package OCI.Thick.OCIHandle_Var is new OCI.Thick.Variable (OCIHandle); gnade-1.6.2.orig/dbi/oci/oci-thick-ocinumber_var.ads0000644000175000017500000000107010537157463022112 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Thin Ada95 binding to OCI™ (Oracle® Call Interface™) -- -- Copyright (C) 2000-2006 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-thick-ocinumber_var.ads,v 1.6 2006/12/11 04:31:47 vagul Exp $ with OCI.Thick.Var; package OCI.Thick.OCINumber_Var is new OCI.Thick.Var (OCINumber, SQLT_VNU); gnade-1.6.2.orig/dbi/oci/oci-thick-parameters-set.adb0000644000175000017500000001004110624537360022163 0ustar lbrentalbrentawith OCI.Thread; package body OCI.Thick.Parameters.Set is ------------ -- Create -- ------------ function Create return Parameter is Result : Parameter; begin Result.Handle := Alloc_Descriptor (Thread.Environment, OCI_DTYPE_PARAM); return Result; end Create; --------------- -- Data_Size -- --------------- procedure Data_Size (Param : in Parameter; Value : in Natural) is B2 : aliased constant Ub2 := Ub2 (Value); begin Set_Attr (H => Param.Handle, HType => OCI_DTYPE_PARAM, Attr => OCI_ATTR_DATA_SIZE, Value => B2'Address); end Data_Size; --------------- -- Data_Type -- --------------- procedure Data_Type (Param : in Parameter; Value : in SQL_Type) is begin Set_Attr (H => Param.Handle, HType => OCI_DTYPE_PARAM, Attr => OCI_ATTR_DATA_TYPE, Value => Value'Address); end Data_Type; ------------- -- Is_Null -- ------------- procedure Is_Null (Param : in Parameter; Value : in Boolean) is B1 : aliased constant Ub1 := Ub1 (Boolean'Pos (Value)); begin Set_Attr (H => Param.Handle, HType => OCI_DTYPE_PARAM, Attr => OCI_ATTR_IS_NULL, Value => B1'Address); end Is_Null; ---------- -- Name -- ---------- procedure Name (Param : in Parameter; Value : in String) is begin Set_Attr (H => Param.Handle, HType => OCI_DTYPE_PARAM, Attr => OCI_ATTR_NAME, Value => Value); end Name; --------------- -- Precision -- --------------- procedure Precision (Param : in Parameter; Value : in Integer) is use System; use type Sb2; B2 : aliased constant Sb2 := Sb2 (Value); T2 : aliased Sb2 := -B2; B1 : aliased Ub1; begin Set_Attr (H => Param.Handle, HType => OCI_DTYPE_PARAM, Attr => OCI_ATTR_NAME, Value => B2'Address); if Default_Bit_Order = Low_Order_First then return; end if; -- Sb2 result type is for implicit describe by OCIStmtExecute() -- Ub1 result for explicit describe with OCIDescribeAny() -- Try to detect attribute size. Check_Error (OCIAttrGet (Trgthndlp => Param.Handle, Trghndltyp => OCI_DTYPE_PARAM, Attributep => T2'Address, Sizep => null, Attrtype => OCI_ATTR_PRECISION, Errhp => Thread.Error)); if B2 /= T2 then B1 := Ub1 (Value); Set_Attr (H => Param.Handle, HType => OCI_DTYPE_PARAM, Attr => OCI_ATTR_NAME, Value => B1'Address); end if; end Precision; ----------- -- Scale -- ----------- procedure Scale (Param : in Parameter; Value : in Integer) is B1 : aliased constant Sb1 := Sb1 (Value); begin Set_Attr (H => Param.Handle, HType => OCI_DTYPE_PARAM, Attr => OCI_ATTR_SCALE, Value => B1'Address); end Scale; ----------------- -- Schema_Name -- ----------------- procedure Schema_Name (Param : in Parameter; Value : in String) is begin Set_Attr (H => Param.Handle, HType => OCI_DTYPE_PARAM, Attr => OCI_ATTR_SCHEMA_NAME, Value => Value); end Schema_Name; -------------- -- Type_Code -- -------------- procedure Type_Code (Param : in Parameter; Value : in SQL_Type) is begin Set_Attr (H => Param.Handle, HType => OCI_DTYPE_PARAM, Attr => OCI_ATTR_TYPECODE, Value => Value'Address); end Type_Code; --------------- -- Type_Name -- --------------- procedure Type_Name (Param : in Parameter; Value : in String) is begin Set_Attr (H => Param.Handle, HType => OCI_DTYPE_PARAM, Attr => OCI_ATTR_TYPE_NAME, Value => Value); end Type_Name; end OCI.Thick.Parameters.Set; gnade-1.6.2.orig/dbi/oci/oci-thick-parameters-set.ads0000644000175000017500000000225710624537360022216 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Thin Ada95 binding to OCI™ (Oracle® Call Interface™) -- -- Copyright (C) 2000-2006 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-thick-parameters-set.ads,v 1.3 2007/05/22 09:59:12 vagul Exp $ package OCI.Thick.Parameters.Set is function Create return Parameter; procedure Schema_Name (Param : in Parameter; Value : in String); procedure Name (Param : in Parameter; Value : in String); procedure Type_Name (Param : in Parameter; Value : in String); procedure Data_Type (Param : in Parameter; Value : in SQL_Type); procedure Type_Code (Param : in Parameter; Value : in SQL_Type); procedure Data_Size (Param : in Parameter; Value : in Natural); procedure Precision (Param : in Parameter; Value : in Integer); procedure Scale (Param : in Parameter; Value : in Integer); procedure Is_Null (Param : in Parameter; Value : in Boolean); end OCI.Thick.Parameters.Set; gnade-1.6.2.orig/dbi/oci/oci-thick-parameters.adb0000644000175000017500000001351711033070070021366 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Ada95 Interface to Oracle RDBMS -- -- Copyright (C) 2000-2006 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-thick-parameters.adb,v 1.17 2008/07/03 06:22:48 vagul Exp $ with Ada.Unchecked_Conversion, OCI.Thread; package body OCI.Thick.Parameters is use type SWord; use type Ub4; use type OCIHandle; function To_SQL_Type is new Ada.Unchecked_Conversion (Ub2, SQL_Type); function Get_Attr_Ub2 is new Get_Attr_G (Ub2); function Get_Attr_Ub1 is new Get_Attr_G (Ub1); function Get_Attr_Sb1 is new Get_Attr_G (Sb1); procedure Init (Item : in out Parameter; Stmt : in Statement; Index : in Positive); ------------ -- Column -- ------------ function Column (Stmt : in Statement; Position : in Positive) return Parameter is Result : Parameter; begin Init (Result, Stmt, Position); return Result; end Column; --------------- -- Data_Size -- --------------- function Data_Size (Param : Parameter) return Natural is begin return Natural (Get_Attr_Ub2 (Param.Handle, OCI_DTYPE_PARAM, OCI_ATTR_DATA_SIZE)); end Data_Size; --------------- -- Data_Type -- --------------- function Data_Type (Param : Parameter) return SQL_Type is begin return To_SQL_Type (Get_Attr_Ub2 (Param.Handle, OCI_DTYPE_PARAM, OCI_ATTR_DATA_TYPE)); end Data_Type; ------------- -- Destroy -- ------------- procedure Destroy (Object : in out Parameter) is Rc : SWord; begin if Object.Handle = Empty_Handle then return; end if; Rc := OCIDescriptorFree (Descp => Object.Handle, Dtype => OCI_DTYPE_PARAM); Object.Handle := Empty_Handle; Check_Error (Rc); end Destroy; -------------------- -- Get_Parameters -- -------------------- function Get_Parameters (Stmt : Statement) return Parameter_Array is Result : Parameter_Array (1 .. Number_Of_Columns (Stmt)); begin for J in Result'Range loop Init (Result (J), Stmt, J); end loop; return Result; end Get_Parameters; ---------- -- Init -- ---------- procedure Init (Item : in out Parameter; Stmt : in Statement; Index : in Positive) is Result : aliased OCIParam; Rc : constant SWord := OCIParamGet (Hndlp => Handle (Stmt), Htype => OCI_HTYPE_STMT, Errhp => Thread.Error, Parmdpp => Result'Access, Pos => Ub4 (Index)); begin -- if Rc = OCI_NO_DATA then -- return OCIParam (Empty_Handle); -- end if; Check_Error (Rc); Item.Handle := OCIHandle (Result); Item.Last_Stmt := Stmt; end Init; ------------- -- Is_Null -- ------------- function Is_Null (Param : Parameter) return Boolean is use type Ub1; begin return Get_Attr_Ub1 (Param.Handle, OCI_DTYPE_PARAM, OCI_ATTR_IS_NULL) /= 0; end Is_Null; ---------- -- Name -- ---------- function Name (Param : Parameter) return String is H : constant OCIHandle := Param.Handle; begin if H = Empty_Handle then return ""; else return Get_Attr (H, OCI_DTYPE_PARAM, OCI_ATTR_NAME); end if; end Name; --------------- -- Precision -- --------------- function Precision (Param : Parameter) return Integer is use System; use type Sb2; B2 : aliased Sb2 := 0; T2 : aliased Sb2; T1 : aliased Ub1; for T1'Address use T2'Address; begin Check_Error (OCIAttrGet (Trgthndlp => Param.Handle, Trghndltyp => OCI_DTYPE_PARAM, Attributep => B2'Address, Sizep => null, Attrtype => OCI_ATTR_PRECISION, Errhp => Thread.Error)); if Default_Bit_Order = Low_Order_First then return Integer (B2); end if; -- Sb2 result type is for implicit describe by OCIStmtExecute() -- Ub1 result for explicit describe with OCIDescribeAny() -- Try to detect attribute size. T2 := -B2; Check_Error (OCIAttrGet (Trgthndlp => Param.Handle, Trghndltyp => OCI_DTYPE_PARAM, Attributep => T2'Address, Sizep => null, Attrtype => OCI_ATTR_PRECISION, Errhp => Thread.Error)); if T2 = B2 then return Integer (B2); else return Integer (T1); end if; end Precision; ----------- -- Scale -- ----------- function Scale (Param : Parameter) return Integer is begin return Integer (Get_Attr_Sb1 (Param.Handle, OCI_DTYPE_PARAM, OCI_ATTR_SCALE)); end Scale; ----------------- -- Schema_Name -- ----------------- function Schema_Name (Param : Parameter) return String is begin return Get_Attr (Param.Handle, OCI_DTYPE_PARAM, OCI_ATTR_SCHEMA_NAME); end Schema_Name; --------------- -- Type_Name -- --------------- function Type_Name (Param : Parameter) return String is H : constant OCIHandle := Param.Handle; begin if H = Empty_Handle then return ""; else return Get_Attr (H, OCI_DTYPE_PARAM, OCI_ATTR_TYPE_NAME); end if; end Type_Name; end OCI.Thick.Parameters; gnade-1.6.2.orig/dbi/oci/oci-thick-parameters.ads0000644000175000017500000001424110613624256021420 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Thin Ada95 binding to OCI™ (Oracle® Call Interface™) -- -- Copyright (C) 2000-2006 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-thick-parameters.ads,v 1.12 2007/04/25 10:08:46 vagul Exp $ with OCI.Thick.Statements; package OCI.Thick.Parameters is use Statements; type SQL_Type is (CHR, -- (ORANET TYPE) character string NUM, -- (ORANET TYPE) oracle numeric INT, -- (ORANET TYPE) integer FLT, -- (ORANET TYPE) Floating point number STR, -- zero terminated string VNU, -- NUM with preceding length byte PDN, -- (ORANET TYPE) Packed Decimal Numeric LNG, -- long VCS, -- Variable character string NON, -- Null/empty PCC Descriptor entry RID, -- rowid DAT, -- date in oracle format VBI, -- binary in VCS format BIN, -- binary data(DTYBIN) LBI, -- long binary UIN, -- unsigned integer SLS, -- Display sign leading separate LVC, -- Longer longs (char) LVB, -- Longer long binary AFC, -- Ansi fixed char AVC, -- Ansi Var char CUR, -- cursor type RDD, -- rowid descriptor LAB, -- label type OSL, -- oslabel type NTY, -- named object type REF, -- ref type CLOB, -- character lob BLOB, -- binary lob BFILE, -- binary file lob CFILE, -- character file lob RSET, -- result set type NCO, -- named collection type (varray or nested table) VST, -- OCIString type ODT, -- OCIDate type DATE, -- ANSI Date TIME, -- TIME TIME_TZ, -- TIME WITH TIME ZONE TIMESTAMP, -- TIMESTAMP TIMESTAMP_TZ, -- TIMESTAMP WITH TIME ZONE INTERVAL_YM, -- INTERVAL YEAR TO MONTH INTERVAL_DS, -- INTERVAL DAY TO SECOND TIMESTAMP_LTZ, -- TIMESTAMP WITH LOCAL TZ PNTY); -- pl/sql representation of named -- More readable constants for some SQL_Type's. SQL_Date : constant SQL_Type; SQL_Float : constant SQL_Type; SQL_Number : constant SQL_Type; SQL_Decimal : constant SQL_Type; SQL_Unsigned8 : constant SQL_Type; SQL_Integer : constant SQL_Type; SQL_Raw : constant SQL_Type; SQL_Varchar2 : constant SQL_Type; SQL_Char : constant SQL_Type; SQL_Varchar : constant SQL_Type; SQL_Mlslabel : constant SQL_Type; SQL_Object : constant SQL_Type; SQL_NamedCollection : constant SQL_Type; SQL_Long : constant SQL_Type; type Parameter is new Handle_Reference with private; type Parameter_Array is array (Positive range <>) of Parameter; function Column (Stmt : Statement; Position : Positive) return Parameter; function Get_Parameters (Stmt : Statement) return Parameter_Array; function Schema_Name (Param : Parameter) return String; function Name (Param : Parameter) return String; function Type_Name (Param : Parameter) return String; function Data_Type (Param : Parameter) return SQL_Type; function Data_Size (Param : Parameter) return Natural; function Precision (Param : Parameter) return Integer; function Scale (Param : Parameter) return Integer; function Is_Null (Param : Parameter) return Boolean; function Get_SQL_Type (Param : Parameter) return SQL_Type renames Data_Type; -- Get_SQL_Type is obsolete not good name for backward compartibility private for SQL_Type'Size use Ub2'Size; for SQL_Type use (CHR => SQLT_CHR, NUM => SQLT_NUM, INT => SQLT_INT, FLT => SQLT_FLT, STR => SQLT_STR, VNU => SQLT_VNU, PDN => SQLT_PDN, LNG => SQLT_LNG, VCS => SQLT_VCS, NON => SQLT_NON, RID => SQLT_RID, DAT => SQLT_DAT, VBI => SQLT_VBI, BIN => SQLT_BIN, LBI => SQLT_LBI, UIN => SQLT_UIN, SLS => SQLT_SLS, LVC => SQLT_LVC, LVB => SQLT_LVB, AFC => SQLT_AFC, AVC => SQLT_AVC, CUR => SQLT_CUR, RDD => SQLT_RDD, LAB => SQLT_LAB, OSL => SQLT_OSL, NTY => SQLT_NTY, REF => SQLT_REF, CLOB => SQLT_CLOB, BLOB => SQLT_BLOB, BFILE => SQLT_BFILE, CFILE => SQLT_CFILE, RSET => SQLT_RSET, NCO => SQLT_NCO, VST => SQLT_VST, ODT => SQLT_ODT, DATE => SQLT_DATE, TIME => SQLT_TIME, TIME_TZ => SQLT_TIME_TZ, TIMESTAMP => SQLT_TIMESTAMP, TIMESTAMP_TZ => SQLT_TIMESTAMP_TZ, INTERVAL_YM => SQLT_INTERVAL_YM, INTERVAL_DS => SQLT_INTERVAL_DS, TIMESTAMP_LTZ => SQLT_TIMESTAMP_LTZ, PNTY => SQLT_PNTY); SQL_Date : constant SQL_Type := DAT; SQL_Float : constant SQL_Type := FLT; SQL_Number : constant SQL_Type := NUM; SQL_Decimal : constant SQL_Type := PDN; SQL_Unsigned8 : constant SQL_Type := BIN; SQL_Integer : constant SQL_Type := INT; SQL_Raw : constant SQL_Type := LVB; SQL_Varchar2 : constant SQL_Type := VCS; SQL_Char : constant SQL_Type := AFC; SQL_Varchar : constant SQL_Type := CHR; SQL_Mlslabel : constant SQL_Type := LAB; SQL_Object : constant SQL_Type := NTY; SQL_NamedCollection : constant SQL_Type := NCO; SQL_Long : constant SQL_Type := LNG; type Parameter is new Handle_Reference with record Last_Stmt : Statement; end record; procedure Destroy (Object : in out Parameter); end OCI.Thick.Parameters; gnade-1.6.2.orig/dbi/oci/oci-thick-servers.adb0000644000175000017500000000646311033070070020716 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Ada95 Interface to Oracle RDBMS -- -- Copyright (C) 2000-2006 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-thick-servers.adb,v 1.14 2008/07/03 06:22:48 vagul Exp $ with Interfaces.C; with OCI.Thread; package body OCI.Thick.Servers is use type Interfaces.C.int; ------------ -- Attach -- ------------ function Attach (Name : String) return Server is H : OCIHandle := Alloc_Handle (Thread.Environment, OCI_HTYPE_SERVER); begin Check_Error (OCIServerAttach (OCIServer (H), Thread.Error, Interfaces.C.To_C (Name), Name'Length)); return (RF.Controlled_Reference with Handle => H, Environment => Thread.Synch.Environment); exception when Lib_Error => Free (H, OCI_HTYPE_SERVER); raise; end Attach; ----------- -- Break -- ----------- procedure Break (It : Server) is begin Check_Error (OCIBreak (Handle (It), Thread.Error)); end Break; ------------- -- Destroy -- ------------- procedure Destroy (It : in out Server) is use type OCI.Lib.OCIHandle; begin if It.Handle /= Empty_Handle then if OCIServerDetach (OCIServer (It.Handle), Thread.Error) /= OCI_SUCCESS then null; -- ??? end if; Free (It.Handle, OCI_HTYPE_SERVER); end if; end Destroy; ----------------- -- Is_Blocking -- ----------------- function Is_Blocking (Item : in Server) return Boolean is function Get_Attrib is new Get_Attr_G (Ub1); use type Ub1; begin return Get_Attrib (Item.Handle, OCI_HTYPE_SERVER, OCI_ATTR_NONBLOCKING_MODE) = 0; end Is_Blocking; ----------- -- Reset -- ----------- procedure Reset (It : Server) is begin Check_Error (OCIReset (Handle (It), Thread.Error)); end Reset; -------------------- -- Server_Version -- -------------------- function Server_Version (Item : in Server) return String is use type Ub4; Buff : aliased Text := (0 .. 511 => C.nul); begin Check_Error (OCIServerVersion (Hndlp => Item.Handle, Errhp => Thread.Error, Bufp => CStr.To_Chars_Ptr (Buff'Unchecked_Access), Bufsz => Buff'Length - 1, Hndltype => OCI_HTYPE_SERVER)); return C.To_Ada (Buff); end Server_Version; ------------------ -- Set_Blocking -- ------------------ procedure Set_Blocking (Item : in out Server; Mode : in Boolean) is B1 : aliased constant Ub1 := Boolean'Pos (not Mode); begin if Is_Blocking (Item) = Mode then return; end if; Set_Attr (Item.Handle, OCI_HTYPE_SERVER, OCI_ATTR_NONBLOCKING_MODE, Value => B1'Address); if Is_Blocking (Item) /= Mode then raise Program_Error with "Set blocking mode error."; end if; end Set_Blocking; end OCI.Thick.Servers; gnade-1.6.2.orig/dbi/oci/oci-thick-servers.ads0000644000175000017500000000211110613624256020737 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Thin Ada95 binding to OCI™ (Oracle® Call Interface™) -- -- Copyright (C) 2000-2006 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-thick-servers.ads,v 1.9 2007/04/25 10:08:46 vagul Exp $ with OCI.Environments; package OCI.Thick.Servers is type Server is new Handle_Reference with private; function Attach (Name : String) return Server; procedure Set_Blocking (Item : in out Server; Mode : in Boolean); function Is_Blocking (Item : in Server) return Boolean; function Server_Version (Item : in Server) return String; procedure Break (It : Server); procedure Reset (It : Server); private type Server is new Handle_Reference with record Environment : OCI.Environments.Thread_Environment; end record; overriding procedure Destroy (It : in out Server); end OCI.Thick.Servers; gnade-1.6.2.orig/dbi/oci/oci-thick-statements.adb0000644000175000017500000002672711033070070021421 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Ada95 Interface to Oracle RDBMS -- -- Copyright (C) 2000-2006 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-thick-statements.adb,v 1.25 2008/07/03 06:22:48 vagul Exp $ with Ada.Strings.Maps, Ada.Strings.Fixed, Ada.Unchecked_Conversion, Interfaces.C.Strings, OCI.Thread; package body OCI.Thick.Statements is use type SWord; use type Ub4; use type OCIHandle; Dummy_Connect : Connection; use Ada.Strings.Maps; Dos_Fix_CR : constant Character_Mapping := To_Mapping ("" & ASCII.CR, " "); function To_Statement_Type is new Ada.Unchecked_Conversion (Ub2, Statement_Type); procedure Execute_Internal (Stmt : in out Statement; Raise_Exception : in out Boolean; Commit_On_Success : in Boolean := False); function Get_Attr_Ub2 is new Get_Attr_G (Ub2); function Get_Attr_Ub4 is new Get_Attr_G (Ub4); ---------------- -- Bind_Names -- ---------------- function Bind_Names (Stmt : Statement) return VStrings is Names : aliased Vector_Of_OraText (1 .. 256); Lens : aliased Vector_Of_Ub1 (Names'Range); INames : aliased Vector_Of_OraText (Names'Range); ILens : aliased Vector_Of_Ub1 (Names'Range); Dups : aliased Vector_Of_Ub1 (Names'Range); Binds : aliased Vector_Of_OCIBind (Names'Range); Found : aliased Sb4; RC : constant SWord := OCIStmtGetBindInfo (Stmtp => OCIStmt (Stmt.Handle), Errhp => Thread.Error, Size => Names'Length, Startloc => 1, Found => Found'Unchecked_Access, Bvnp => Names (Names'First)'Unchecked_Access, Bvnl => Lens (Lens'First)'Unchecked_Access, Invp => INames (INames'First)'Unchecked_Access, Inpl => ILens (ILens'First)'Unchecked_Access, Dupl => Dups (Dups'First)'Unchecked_Access, Hndl => Binds (Binds'First)'Unchecked_Access); use Interfaces.C.Strings; use type C.size_t; use type Ub1; begin if RC = OCI_NO_DATA then return (1 .. 0 => Null_Unbounded_String); end if; Check_Error (RC); declare Result : VStrings (1 .. Natural (Found)); Count : Natural := 0; begin for i in Result'Range loop if Dups (i) = 0 then Count := Count + 1; Result (Count) := To_Unbounded_String (C.To_Ada (Value (Names (i), C.size_t (Lens (i))), False)); end if; end loop; return Result (1 .. Count); end; end Bind_Names; ------------ -- Cancel -- ------------ procedure Cancel (Stmt : in Statement) is begin Check_Error (OCIStmtFetch (OCIStmt (Stmt.Handle), Thread.Error, Nrows => 0)); end Cancel; -------------- -- Describe -- -------------- procedure Describe (Connect : in Connection; Stmt : in out Statement) is begin Stmt.Connect := Connect; Describe (Stmt); end Describe; -------------- -- Describe -- -------------- procedure Describe (Stmt : in out Statement) is begin Check_Error (OCIStmtExecute (OCISvcCtx (Handle (Stmt.Connect)), OCIStmt (Stmt.Handle), Thread.Error, 0, Mode => OCI_DESCRIBE_ONLY)); Stmt.Described := True; end Describe; -------------- -- Describe -- -------------- procedure Describe (Stmt : in out Statement; Success : out Boolean) is begin Success := OCIStmtExecute (OCISvcCtx (Handle (Stmt.Connect)), OCIStmt (Stmt.Handle), Thread.Error, 0, Mode => OCI_DESCRIBE_ONLY) = OCI_SUCCESS; if Success then Stmt.Described := True; end if; end Describe; --------------- -- Described -- --------------- function Described (Stmt : in Statement) return Boolean is begin return Stmt.Described; end Described; ------------- -- Destroy -- ------------- procedure Destroy (Object : in out Statement) is begin if Object.Handle /= Empty_Handle then OCI.Thick.Free (Object.Handle, OCI_HTYPE_STMT); end if; end Destroy; ------------- -- Execute -- ------------- procedure Execute (Connect : in Connection; Stmt : in out Statement) is begin Stmt.Connect := Connect; Execute (Stmt); end Execute; procedure Execute (Stmt : in out Statement) is Raise_Exception : Boolean := True; begin Execute_Internal (Stmt, Raise_Exception); end Execute; procedure Execute (Stmt : in out Statement; Success : out Boolean) is Raise_Exception : Boolean := False; begin Execute_Internal (Stmt, Raise_Exception => Raise_Exception); Success := not Raise_Exception; end Execute; ------------- -- Execute -- ------------- function Execute (Connect : in Connection; Code : in String) return Statement is Result : Statement := Prepare (Connect, Code); begin Execute (Result); return Result; end Execute; procedure Execute (Connect : in Connection; Code : in String) is Dummy : Statement := Prepare (Connect, Code); begin Execute (Dummy); end Execute; ------------------------ -- Execute_And_Commit -- ------------------------ procedure Execute_And_Commit (Connect : in Connection; Stmt : in out Statement) is begin Stmt.Connect := Connect; Execute_And_Commit (Stmt); end Execute_And_Commit; procedure Execute_And_Commit (Stmt : in out Statement) is Raise_Exception : Boolean := True; begin Execute_Internal (Stmt, Raise_Exception => Raise_Exception, Commit_On_Success => True); end Execute_And_Commit; procedure Execute_And_Commit (Stmt : in out Statement; Success : out Boolean) is Raise_Exception : Boolean := False; begin Execute_Internal (Stmt, Raise_Exception => Raise_Exception, Commit_On_Success => True); Success := not Raise_Exception; end Execute_And_Commit; ---------------------- -- Execute_Internal -- ---------------------- procedure Execute_Internal (Stmt : in out Statement; Raise_Exception : in out Boolean; Commit_On_Success : in Boolean := False) is Not_Select : constant Boolean := Type_Of_Statement (Stmt) /= Stmt_Select; Commit_Mode : constant array (Boolean) of Ub4 := (False => OCI_DEFAULT, True => OCI_COMMIT_ON_SUCCESS); Rc : SWord := OCIStmtExecute (OCISvcCtx (Handle (Stmt.Connect)), OCIStmt (Stmt.Handle), Thread.Error, Boolean'Pos (Not_Select), Mode => Commit_Mode (Commit_On_Success)); begin if Rc = OCI_ERROR and then Last_Error_Code = 1405 then -- Work aroung Oracle bug 1850169 -- Fixed in 9.2.0.3 Rc := OCI_SUCCESS; end if; Stmt.Executing := Rc = OCI_STILL_EXECUTING; if Stmt.Executing then Raise_Exception := False; elsif Raise_Exception then Check_Error (Rc); Raise_Exception := False; else if Rc = OCI_SUCCESS then Stmt.Executed := True; Stmt.Described := True; else Raise_Exception := True; end if; end if; end Execute_Internal; -------------- -- Executed -- -------------- function Executed (Stmt : in Statement) return Boolean is begin return Stmt.Executed; end Executed; ----------- -- Fetch -- ----------- function Fetch (Stmt : in Statement) return Boolean is RC : constant SWord := OCIStmtFetch (OCIStmt (Stmt.Handle), Thread.Error); begin case RC is when OCI_NO_DATA => return False; when OCI_SUCCESS => return True; when others => Check_Error (RC); end case; -- We should not be there. raise Program_Error; end Fetch; -------------------- -- Get_Connection -- -------------------- function Get_Connection (Stmt : in Statement) return Connection is begin return Stmt.Connect; end Get_Connection; ------------------ -- Is_Executing -- ------------------ function Is_Executing (Stmt : in Statement) return Boolean is begin return Stmt.Executing; end Is_Executing; ----------------------- -- Number_Of_Columns -- ----------------------- function Number_Of_Columns (Stmt : in Statement) return Natural is begin return Natural (Get_Attr_Ub4 (Stmt.Handle, OCI_HTYPE_STMT, OCI_ATTR_PARAM_COUNT)); end Number_Of_Columns; ------------------------ -- Parse_Error_Offset -- ------------------------ function Parse_Error_Offset (Stmt : in Statement) return Natural is begin return Natural (Get_Attr_Ub2 (Stmt.Handle, OCI_HTYPE_STMT, OCI_ATTR_PARSE_ERROR_OFFSET)); end Parse_Error_Offset; ------------- -- Prepare -- ------------- function Prepare (Connect : in Connection; Code : in String) return Statement is H : OCIHandle := Alloc_Handle (Thread.Environment, OCI_HTYPE_STMT); Rc : SWord; begin Rc := OCIStmtPrepare (OCIStmt (H), Thread.Error, C.To_C (Ada.Strings.Fixed.Translate (Code, Dos_Fix_CR)), Code'Length); if Rc /= OCI_SUCCESS then OCI.Thick.Free (H, OCI_HTYPE_STMT); Check_Error (Rc); end if; return (RF.Controlled_Reference with Handle => H, Connect => Connect, Executed => False, Executing => False, Described => False); end Prepare; function Prepare (Code : in String) return Statement is begin return Prepare (Dummy_Connect, Code); end Prepare; -------------------- -- Rows_Processed -- -------------------- function Rows_Processed (Stmt : in Statement) return Natural is begin return Natural (Get_Attr_Ub4 (Stmt.Handle, OCI_HTYPE_STMT, OCI_ATTR_ROW_COUNT)); end Rows_Processed; ------------------ -- Set_Blocking -- ------------------ procedure Set_Blocking (Item : in out Statement; Mode : in Boolean) is begin Connections.Set_Blocking (Item.Connect, Mode); end Set_Blocking; -------------------- -- Set_Connection -- -------------------- procedure Set_Connection (Stmt : in out Statement; Connect : in Connection) is begin Stmt.Connect := Connect; end Set_Connection; ----------------------- -- Type_Of_Statement -- ----------------------- function Type_Of_Statement (Stmt : in Statement) return Statement_Type is begin return To_Statement_Type (Get_Attr_Ub2 (Stmt.Handle, OCI_HTYPE_STMT, OCI_ATTR_STMT_TYPE)); end Type_Of_Statement; end OCI.Thick.Statements; gnade-1.6.2.orig/dbi/oci/oci-thick-statements.ads0000644000175000017500000000773110613624257021453 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Thin Ada95 binding to OCI™ (Oracle® Call Interface™) -- -- Copyright (C) 2000-2006 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-thick-statements.ads,v 1.15 2007/04/25 10:08:47 vagul Exp $ with OCI.Thick.Connections; with Ada.Strings.Unbounded; package OCI.Thick.Statements is use Connections; use Ada.Strings.Unbounded; type Statement is new Handle_Reference with private; type VStrings is array (Positive range <>) of Unbounded_String; type Statement_Type is (Stmt_Unknown, Stmt_Select, Stmt_Update, Stmt_Delete, Stmt_Insert, Stmt_Create, Stmt_Drop, Stmt_Alter, Stmt_Begin, Stmt_Declare); function Prepare (Connect : in Connection; Code : in String) return Statement; ------------------------------------------------- -- Undepended from Connection statement stile. -- ------------------------------------------------- function Prepare (Code : in String) return Statement; procedure Execute (Connect : in Connection; Stmt : in out Statement); procedure Describe (Connect : in Connection; Stmt : in out Statement); ----------------------------------------------- -- Depended from Connection statement stile. -- -- Like ODBC -- ----------------------------------------------- procedure Execute (Stmt : in out Statement); procedure Execute (Stmt : in out Statement; Success : out Boolean); procedure Execute_And_Commit (Connect : in Connection; Stmt : in out Statement); procedure Execute_And_Commit (Stmt : in out Statement); procedure Execute_And_Commit (Stmt : in out Statement; Success : out Boolean); procedure Describe (Stmt : in out Statement); procedure Describe (Stmt : in out Statement; Success : out Boolean); function Execute (Connect : in Connection; Code : in String) return Statement; procedure Execute (Connect : in Connection; Code : in String); function Type_Of_Statement (Stmt : in Statement) return Statement_Type; function Described (Stmt : in Statement) return Boolean; function Executed (Stmt : in Statement) return Boolean; function Is_Executing (Stmt : in Statement) return Boolean; procedure Set_Connection (Stmt : in out Statement; Connect : in Connection); function Get_Connection (Stmt : in Statement) return Connection; function Fetch (Stmt : in Statement) return Boolean; procedure Cancel (Stmt : in Statement); function Parse_Error_Offset (Stmt : in Statement) return Natural; function Number_Of_Columns (Stmt : in Statement) return Natural; function Rows_Processed (Stmt : in Statement) return Natural; -- Returns the number of rows processed so far. function Bind_Names (Stmt : in Statement) return VStrings; procedure Set_Blocking (Item : in out Statement; Mode : in Boolean); -- Set the statement connection to the spetsific blocking mode. pragma Inline (Executed, Get_Connection); private for Statement_Type use (Stmt_Unknown => 0, -- Undocumented OCI Stmt type. Stmt_Select => OCI_STMT_SELECT, Stmt_Update => OCI_STMT_UPDATE, Stmt_Delete => OCI_STMT_DELETE, Stmt_Insert => OCI_STMT_INSERT, Stmt_Create => OCI_STMT_CREATE, Stmt_Drop => OCI_STMT_DROP, Stmt_Alter => OCI_STMT_ALTER, Stmt_Begin => OCI_STMT_BEGIN, Stmt_Declare => OCI_STMT_DECLARE); for Statement_Type'Size use Ub2'Size; type Statement is new Handle_Reference with record Connect : Connection; Executed, Described, Executing : Boolean := False; end record; procedure Destroy (Object : in out Statement); end OCI.Thick.Statements; gnade-1.6.2.orig/dbi/oci/oci-thick-string_bounded.adb0000644000175000017500000000662511033070070022233 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Ada95 Interface to Oracle RDBMS -- -- Copyright (C) 2000-2006 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-thick-string_bounded.adb,v 1.16 2008/07/03 06:22:48 vagul Exp $ with OCI.Thread; package body OCI.Thick.String_Bounded is procedure Bind (Stmt : in Statement; Value : in out Variable; Name : in String) is begin Check_Error (OCIBindByName (Stmtp => OCIStmt (Handle (Stmt)), Bindpp => Value.Bind'Access, Errhp => Thread.Error, Placeholder => C.To_C (Name), Placeh_Len => Name'Length, Valuep => Value.Value'Address, Value_Sz => Value.Value'Length, Dty => SQLT_STR, Indp => Value.Indicator'Unchecked_Access)); end Bind; procedure Bind (Stmt : in Statement; Value : in out Variable; Position : in Positive) is begin Check_Error (OCIBindByPos (Stmtp => OCIStmt (Handle (Stmt)), Bindpp => Value.Bind'Access, Errhp => Thread.Error, Position => Ub4 (Position), Valuep => Value.Value'Address, Value_Sz => Value.Value'Length, Dty => SQLT_STR, Indp => Value.Indicator'Unchecked_Access)); end Bind; procedure Define (Stmt : in Statement; Value : in out Variable; Position : in Positive) is begin Check_Error (OCIDefineByPos (Stmtp => OCIStmt (Handle (Stmt)), Defnpp => Value.Define'Access, Errhp => Thread.Error, Position => Ub4 (Position), Value => Value.Value'Address, Value_Sz => Value.Value'Length, Dty => SQLT_STR, Indp => Value.Indicator'Unchecked_Access)); end Define; --------------- -- Get_Value -- --------------- function Get_Value (Var : Variable) return String is begin if Is_Null (Var) then raise Null_Value; else return C.To_Ada (Var.Value); end if; end Get_Value; function Get_Value (Var : in Variable; Default : in String; Mode : in Default_Mode := Instead_Any) return String is begin if not Is_Attached (Var) then if Mode = Instead_Not_Attached or Mode = Instead_Any then return Default; else raise Not_Attached; end if; elsif Is_Null (Var) then if Mode = Instead_Null or Mode = Instead_Any then return Default; else raise Null_Value; end if; else return C.To_Ada (Var.Value); end if; end Get_Value; --------------- -- Set_Value -- --------------- procedure Set_Value (Var : in out Variable; Value : String) is Len : String_Size; use type String_Size; begin if Value'Length > Var.Length then raise Constraint_Error; end if; Var.Indicator := 0; C.To_C (Item => Value, Target => Var.Value, Count => Len, Append_Nul => True); end Set_Value; end OCI.Thick.String_Bounded; gnade-1.6.2.orig/dbi/oci/oci-thick-string_bounded.ads0000644000175000017500000000307410613624257022266 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Thin Ada95 binding to OCI™ (Oracle® Call Interface™) -- -- Copyright (C) 2000-2006 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-thick-string_bounded.ads,v 1.10 2007/04/25 10:08:47 vagul Exp $ with OCI.Thick.Statements; package OCI.Thick.String_Bounded is use Statements; subtype String_Size is C.size_t; type Variable (Length : String_Size) is new Limited_Variable with private; procedure Bind (Stmt : Statement; Value : in out Variable; Name : String); procedure Bind (Stmt : in Statement; Value : in out Variable; Position : in Positive); procedure Define (Stmt : in Statement; Value : in out Variable; Position : in Positive); procedure Set_Value (Var : in out Variable; Value : String); function Get_Value (Var : Variable) return String; function Value (Var : Variable) return String renames Get_Value; function String_Value (Var : Variable) return String renames Get_Value; function Get_Value (Var : in Variable; Default : in String; Mode : in Default_Mode := Instead_Any) return String; private type Variable (Length : String_Size) is new Limited_Variable with record Value : C.char_array (0 .. Length); end record; end OCI.Thick.String_Bounded; gnade-1.6.2.orig/dbi/oci/oci-thick-string_var.adb0000644000175000017500000001043311033070070021373 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Ada95 Interface to Oracle RDBMS -- -- Copyright (C) 2000-2006 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-thick-string_var.adb,v 1.15 2008/07/03 06:22:48 vagul Exp $ with OCI.Thread, OCI.Thick.Parameters; with OCI.Environments; package body OCI.Thick.String_Var is use Parameters; use type OCIHandle; procedure Correct_Size (Stmt : in Statement; Value : in out Variable; Position : in Positive); function Allocated_Size (Value : in Variable) return Natural; -------------------- -- Allocated_Size -- -------------------- function Allocated_Size (Value : in Variable) return Natural is alsize : aliased Ub4 := 0; Str : constant OCIString := OCIString (Get_Value_Internal (Value)); begin Check_Error (OCIStringAllocSize (Env => Thread.Environment, Vs => Str, Allocsize => alsize'Access)); return Natural (alsize); end Allocated_Size; ------------------ -- Correct_Size -- ------------------ procedure Correct_Size (Stmt : in Statement; Value : in out Variable; Position : in Positive) is Param : constant Parameter := Column (Stmt, Position); NSize : Natural; TCode : constant SQL_Type := Get_SQL_Type (Param); begin if TCode = SQL_Varchar2 or TCode = SQL_Char or TCode = SQL_Varchar then NSize := Data_Size (Param) + 1; else NSize := 64; -- ot fanaria end if; if Get_Value_Internal (Value) = Empty_Handle or else Allocated_Size (Value) < NSize then Resize (Value, NSize); end if; end Correct_Size; ------------ -- Define -- ------------ procedure Define (Stmt : in Statement; Value : in out Variable; Position : in Positive) is begin if Described (Stmt) then Correct_Size (Stmt, Value, Position); end if; Define (Stmt, OCIHandle_Var.Var_Type (Value), Position); end Define; -------------- -- Finalize -- -------------- procedure Finalize (Object : in out Variable) is begin if Get_Value_Internal (Object) /= Empty_Handle then Resize (Object, 0); end if; Finalize (Var_Type (Object)); end Finalize; --------------- -- Get_Value -- --------------- function Get_Value (Var : in Variable) return String is Env : constant OCIEnv := Thread.Environment; Str : constant OCIString := OCIString (OCIHandle_Var.Get_Value (Var_Type (Var))); begin return C.To_Ada (CStr.Value (OCIStringPtr (Env, Str), C.size_t (OCIStringSize (Env, Str))), False); end Get_Value; ---------------- -- Initialize -- ---------------- procedure Initialize (Object : in out Variable) is begin Initialize (Var_Type (Object)); Set_Value (Object, Empty_Handle); end Initialize; ------------ -- Resize -- ------------ procedure Resize (Var : in out Variable; Length : in Natural) is Value : aliased OCIString := OCIString (Get_Value_Internal (Var)); rc : SWord; use type Ub4; begin rc := OCIStringResize (Env => Thread.Environment, Err => Thread.Error, New_Size => Ub4 (Length), Str => Value'Access); Check_Error (rc); Set_Value (Var, OCIHandle (Value)); end Resize; --------------- -- Set_Value -- --------------- procedure Set_Value (Var : in out Variable; Value : in String) is str : aliased OCIString := OCIString (Get_Value_Internal (Var)); begin Check_Error (OCIStringAssignText (Env => Thread.Environment, Err => Thread.Error, Rhs => C.To_C (Value), Rhs_Len => Value'Length, Lhs => str'Access)); Set_Value (Var, OCIHandle (str)); end Set_Value; begin OCI.Environments.Set_Create_Mode_Flag (OCI_OBJECT); end OCI.Thick.String_Var; gnade-1.6.2.orig/dbi/oci/oci-thick-string_var.ads0000644000175000017500000000226410537157463021443 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Thin Ada95 binding to OCI™ (Oracle® Call Interface™) -- -- Copyright (C) 2000-2006 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-thick-string_var.ads,v 1.9 2006/12/11 04:31:47 vagul Exp $ with OCI.Thick.OCIHandle_Var, OCI.Thick.Statements; package OCI.Thick.String_Var is use Statements; use OCI.Thick.OCIHandle_Var; type Variable is new Var_Type (SQLT_VST) with null record; procedure Resize (Var : in out Variable; Length : in Natural); procedure Set_Value (Var : in out Variable; Value : in String); function Get_Value (Var : in Variable) return String; function Value (Var : in Variable) return String renames Get_Value; procedure Define (Stmt : in Statement; Value : in out Variable; Position : in Positive); private procedure Initialize (Object : in out Variable); procedure Finalize (Object : in out Variable); end OCI.Thick.String_Var; gnade-1.6.2.orig/dbi/oci/oci-thick-variable.adb0000644000175000017500000000765711033070070021020 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Ada95 Interface to Oracle RDBMS -- -- Copyright (C) 2000-2006 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-thick-variable.adb,v 1.18 2008/07/03 06:22:48 vagul Exp $ with OCI.Thread; with System; package body OCI.Thick.Variable is use type Sb4; ---------- -- Bind -- ---------- procedure Bind (Stmt : in Statement; Value : in out Var_Type; Name : in String; Oblige : in Boolean := True) is use type C.int; Rc : constant SWord := OCIBindByName (Stmtp => OCIStmt (Handle (Stmt)), Bindpp => Value.Bind'Access, Errhp => Thread.Error, Placeholder => C.To_C (Name), Placeh_Len => Name'Length, Valuep => Value.Value'Address, Value_Sz => Value.Value'Size / System.Storage_Unit, Dty => Value.Type_Id, Indp => Value.Indicator'Unchecked_Access); begin if Rc = OCI_ERROR and then not (not Oblige and then Last_Error_Code = 1036) then Check_Error (Rc); end if; end Bind; procedure Bind (Stmt : in Statement; Value : in out Var_Type; Position : in Positive) is Rc : constant SWord := OCIBindByPos (Stmtp => OCIStmt (Handle (Stmt)), Bindpp => Value.Bind'Access, Errhp => Thread.Error, Position => Ub4 (Position), Valuep => Value.Value'Address, Value_Sz => Value.Value'Size / System.Storage_Unit, Dty => Value.Type_Id, Indp => Value.Indicator'Unchecked_Access); begin Check_Error (Rc); end Bind; ------------ -- Define -- ------------ procedure Define (Stmt : in Statement; Value : in out Var_Type; Position : in Positive) is Rc : constant SWord := OCIDefineByPos (Stmtp => OCIStmt (Handle (Stmt)), Defnpp => Value.Define'Access, Errhp => Thread.Error, Position => Ub4 (Position), Value => Value.Value'Address, Value_Sz => Value.Value'Size / System.Storage_Unit, Dty => Value.Type_Id, Indp => Value.Indicator'Unchecked_Access); begin Check_Error (Rc); end Define; --------------- -- Get_Value -- --------------- function Get_Value (Var : in Var_Type; Default : in Variable_Type; Mode : in Default_Mode := Instead_Any) return Variable_Type is begin if not Is_Attached (Var) then if Mode = Instead_Not_Attached or Mode = Instead_Any then return Default; else raise Not_Attached; end if; elsif Is_Null (Var) then if Mode = Instead_Null or Mode = Instead_Any then return Default; else raise Null_Value; end if; else return Var.Value; end if; end Get_Value; function Get_Value (Var : Var_Type) return Variable_Type is begin if Is_Null (Var) then raise Null_Value; else return Var.Value; end if; end Get_Value; ------------------------ -- Get_Value_Internal -- ------------------------ function Get_Value_Internal (Var : Var_Type) return Variable_Type is begin return Var.Value; end Get_Value_Internal; --------------- -- Set_Value -- --------------- procedure Set_Value (Var : in out Var_Type; Value : Variable_Type) is begin Var.Indicator := 0; Var.Value := Value; end Set_Value; end OCI.Thick.Variable; gnade-1.6.2.orig/dbi/oci/oci-thick-variable.ads0000644000175000017500000000336610537157463021056 0ustar lbrentalbrenta----------------------------------------------------------------------------- -- Thin Ada95 binding to OCI™ (Oracle® Call Interface™) -- -- Copyright (C) 2000-2006 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: oci-thick-variable.ads,v 1.11 2006/12/11 04:31:47 vagul Exp $ with OCI.Thick.Statements; generic type Variable_Type is private; package OCI.Thick.Variable is use OCI.Thick.Statements; type Default_Mode is (Instead_Null, Instead_Not_Attached, Instead_Any); type Var_Type (Type_Id : Ub2) is new Limited_Variable with private; procedure Bind (Stmt : in Statement; Value : in out Var_Type; Name : in String; Oblige : in Boolean := True); procedure Bind (Stmt : in Statement; Value : in out Var_Type; Position : in Positive); procedure Define (Stmt : in Statement; Value : in out Var_Type; Position : in Positive); procedure Set_Value (Var : in out Var_Type; Value : in Variable_Type); function Get_Value (Var : Var_Type) return Variable_Type; function Value (Var : Var_Type) return Variable_Type renames Get_Value; function Get_Value (Var : in Var_Type; Default : in Variable_Type; Mode : in Default_Mode := Instead_Any) return Variable_Type; function Get_Value_Internal (Var : Var_Type) return Variable_Type; private pragma Inline (Get_Value_Internal); type Var_Type (Type_Id : Ub2) is new Limited_Variable with record Value : Variable_Type; end record; end OCI.Thick.Variable; gnade-1.6.2.orig/dbi/odbc/0000755000175000017500000000000011040716276015046 5ustar lbrentalbrentagnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli.ads0000644000175000017500000024242610663647575020231 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2002 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with System.Storage_Elements; with Interfaces.C; package GNU.DB.SQLCLI is -- The name "SQLCLI" comes from the SQL (Standard Query Language) -- Call-Level Interface. Note that ODBC (Open Database -- Connectivity) is a similar standard. type SQLPOINTER is private; type SQLINTEGER is range -(2 ** 31) .. +(2 ** 31) - 1; for SQLINTEGER'Size use 32; type SQLUINTEGER is mod 2 ** SQLINTEGER'Size; for SQLUINTEGER'Size use SQLINTEGER'Size; type SQLSMALLINT is range -(2 ** 15) .. +(2 ** 15) - 1; for SQLSMALLINT'Size use 16; type SQLUSMALLINT is mod 2 ** SQLSMALLINT'Size; for SQLUSMALLINT'Size use SQLSMALLINT'Size; type SQLBIGINT is range -(2 ** 63) .. +(2 ** 63) - 1; for SQLBIGINT'Size use 64; type SQLUBIGINT is mod 2 ** SQLBIGINT'Size; for SQLUBIGINT'Size use SQLBIGINT'Size; type SQLTINYINT is range -(2 ** 7) .. +(2 ** 7) - 1; for SQLTINYINT'Size use 8; type SQLUTINYINT is mod 2 ** SQLTINYINT'Size; for SQLUTINYINT'Size use SQLTINYINT'Size; type SQLDOUBLE is new Interfaces.C.double; type SQLREAL is new Interfaces.C.C_float; type SQLCHAR is new Interfaces.C.unsigned_char; type SQLSCHAR is new Interfaces.C.signed_char; type SQLTCHAR is new Wide_Character; -- Component Types type SQLDATE is new SQLUTINYINT; type SQLDECIMAL is new SQLUTINYINT; type SQLNUMERIC is new SQLUTINYINT; type SQLTIME is new SQLUTINYINT; type SQLTIMESTAMP is new SQLUTINYINT; type SQLVARCHAR is new Interfaces.C.unsigned_char; type SQL_OPTION_BITMASK is mod 2 ** SQLUINTEGER'Size; type SQL_BOOLEAN is (SQL_FALSE, SQL_TRUE); for SQL_BOOLEAN'Size use SQLSMALLINT'Size; type PTR_SQLUINTEGER is access all SQLUINTEGER; pragma No_Strict_Aliasing (PTR_SQLUINTEGER); type PTR_SQLUSMALLINT is access all SQLUSMALLINT; pragma No_Strict_Aliasing (PTR_SQLUSMALLINT); type PTR_SQLINTEGER is access all SQLINTEGER; pragma No_Strict_Aliasing (PTR_SQLINTEGER); type PTR_SQLSMALLINT is access all SQLSMALLINT; pragma No_Strict_Aliasing (PTR_SQLSMALLINT); type PTR_SQLCHAR is access all SQLCHAR; pragma No_Strict_Aliasing (PTR_SQLINTEGER); type PTR_SQLTCHAR is access all SQLTCHAR; pragma No_Strict_Aliasing (PTR_SQLCHAR); type PTR_SQLDOUBLE is access all SQLDOUBLE; pragma No_Strict_Aliasing (PTR_SQLDOUBLE); type PTR_SQLREAL is access all SQLREAL; pragma No_Strict_Aliasing (PTR_SQLREAL); function To_SQLPOINTER (S : PTR_SQLTCHAR) return SQLPOINTER; function To_SQLPOINTER (S : PTR_SQLCHAR) return SQLPOINTER; function To_SQLPOINTER (S : PTR_SQLUINTEGER) return SQLPOINTER; function To_SQLPOINTER (S : PTR_SQLINTEGER) return SQLPOINTER; function To_SQLPOINTER (S : PTR_SQLUSMALLINT) return SQLPOINTER; function To_SQLPOINTER (S : PTR_SQLSMALLINT) return SQLPOINTER; function To_SQLPOINTER (S : access String) return SQLPOINTER; function To_SQLPOINTER (S : access Wide_String) return SQLPOINTER; function To_SQLPOINTER (S : System.Address) return SQLPOINTER; pragma Inline_Always (To_SQLPOINTER); function To_Address (P : SQLPOINTER) return System.Address; pragma Inline_Always (To_Address); function To_PTR_SQLCHAR (S : access String) return PTR_SQLCHAR; function To_PTR_SQLCHAR (S : System.Address) return PTR_SQLCHAR; pragma Inline_Always (To_PTR_SQLCHAR); function To_PTR_SQLTCHAR (S : access Wide_String) return PTR_SQLTCHAR; function To_PTR_SQLTCHAR (S : System.Address) return PTR_SQLTCHAR; pragma Inline_Always (To_PTR_SQLTCHAR); type SQL_DATE_STRUCT is record year : SQLSMALLINT; month : SQLUSMALLINT; day : SQLUSMALLINT; end record; pragma Convention (C, SQL_DATE_STRUCT); type SQL_TIME_STRUCT is record hour : SQLUSMALLINT; minute : SQLUSMALLINT; second : SQLUSMALLINT; end record; pragma Convention (C, SQL_TIME_STRUCT); type SQL_TIME_FRACTION is range 0 .. 999_999_999; for SQL_TIME_FRACTION'Size use SQLUINTEGER'Size; type SQL_TIMESTAMP_STRUCT is record year : SQLSMALLINT; month : SQLUSMALLINT; day : SQLUSMALLINT; hour : SQLUSMALLINT; minute : SQLUSMALLINT; second : SQLUSMALLINT; fraction : SQL_TIME_FRACTION; end record; pragma Convention (C, SQL_TIMESTAMP_STRUCT); type SQLINTERVAL is (SQL_IS_YEAR, SQL_IS_MONTH, SQL_IS_DAY, SQL_IS_HOUR, SQL_IS_MINUTE, SQL_IS_SECOND, SQL_IS_YEAR_TO_MONTH, SQL_IS_DAY_TO_HOUR, SQL_IS_DAY_TO_MINUTE, SQL_IS_DAY_TO_SECOND, SQL_IS_HOUR_TO_MINUTE, SQL_IS_HOUR_TO_SECOND, SQL_IS_MINUTE_TO_SECOND); for SQLINTERVAL use (SQL_IS_YEAR => 1, SQL_IS_MONTH => 2, SQL_IS_DAY => 3, SQL_IS_HOUR => 4, SQL_IS_MINUTE => 5, SQL_IS_SECOND => 6, SQL_IS_YEAR_TO_MONTH => 7, SQL_IS_DAY_TO_HOUR => 8, SQL_IS_DAY_TO_MINUTE => 9, SQL_IS_DAY_TO_SECOND => 10, SQL_IS_HOUR_TO_MINUTE => 11, SQL_IS_HOUR_TO_SECOND => 12, SQL_IS_MINUTE_TO_SECOND => 13); for SQLINTERVAL'Size use Interfaces.C.int'Size; type SQL_YEAR_MONTH_STRUCT is record year : SQLUINTEGER; month : SQLUINTEGER; end record; pragma Convention (C, SQL_YEAR_MONTH_STRUCT); type SQL_DAY_SECOND_STRUCT is record day : SQLUINTEGER; hour : SQLUINTEGER; minute : SQLUINTEGER; second : SQLUINTEGER; fraction : SQL_TIME_FRACTION; end record; pragma Convention (C, SQL_DAY_SECOND_STRUCT); type SQL_SIGNED_YEAR_MONTH_STRUCT is record interval_sign : SQL_BOOLEAN; -- SQL_TRUE if negative year : SQLUINTEGER; month : SQLUINTEGER; end record; pragma Convention (C, SQL_SIGNED_YEAR_MONTH_STRUCT); type SQL_SIGNED_DAY_SECOND_STRUCT is record interval_sign : SQL_BOOLEAN; -- SQL_TRUE if negative day : SQLUINTEGER; hour : SQLUINTEGER; minute : SQLUINTEGER; second : SQLUINTEGER; fraction : SQL_TIME_FRACTION; end record; pragma Convention (C, SQL_SIGNED_DAY_SECOND_STRUCT); type SQL_INTERVAL_STRUCT (Which : SQLINTERVAL := SQL_IS_YEAR) is record case Which is when SQL_IS_YEAR | SQL_IS_MONTH | SQL_IS_YEAR_TO_MONTH => year_month : SQL_SIGNED_YEAR_MONTH_STRUCT; when SQL_IS_DAY | SQL_IS_HOUR | SQL_IS_MINUTE | SQL_IS_SECOND | SQL_IS_DAY_TO_HOUR | SQL_IS_DAY_TO_MINUTE | SQL_IS_DAY_TO_SECOND | SQL_IS_HOUR_TO_MINUTE | SQL_IS_HOUR_TO_SECOND | SQL_IS_MINUTE_TO_SECOND => day_second : SQL_SIGNED_DAY_SECOND_STRUCT; end case; end record; pragma Convention (C, SQL_INTERVAL_STRUCT); pragma Unchecked_Union (SQL_INTERVAL_STRUCT); SQL_MAX_NUMERIC_LEN : constant := 16; type SQL_NUMERIC_ARRAY is array (0 .. (SQL_MAX_NUMERIC_LEN - 1)) of aliased SQLNUMERIC; pragma Convention (C, SQL_NUMERIC_ARRAY); type SQL_NUMERIC_STRUCT is record precision : SQLUTINYINT; scale : SQLTINYINT; sign : SQLUTINYINT; -- 1 if positive, 0 if negative val : SQL_NUMERIC_ARRAY; end record; pragma Convention (C, SQL_NUMERIC_STRUCT); Data_Error : exception; No_Data : exception; Need_Data : exception; Still_Executing : exception; Invalid_Handle : exception; -- These exceptions correspond to the well defined SQLRETURN codes -- in the ODBC headers Database_Error : exception; -- General Database error Unhandled_Enum : exception; -- ODBC returned unknown value Type_Error : exception; -- Runtime typecheck Error No_Unicode_Support : exception; -- Driver Mgr. has no Unicode -- These exceptions are generated by the binding Generate_Detailed_Exceptions : Boolean := True; -- When this is set to True (default), instead of the general -- Database_Error exception the SQLSTATE gets evaluated and a more -- detailed exception (see below) is raised. Wrong_Parameter_Count : exception; Invalid_Count_Field : exception; Restricted_Type_Violation : exception; Invalid_Descriptor_Index : exception; Invalid_Default_Parameter : exception; Prepared_Stmt_Not_Cursor : exception; Column_List_Mismatch : exception; Format_Error : exception; Syntax_Error : exception; Table_Already_Exists : exception; Table_Not_Found : exception; Index_Already_Exists : exception; Index_Not_Found : exception; Column_Already_Exists : exception; Column_Not_Found : exception; Connection_Error : exception; Invalid_Cursor_State : exception; Invalid_Cursor_Name : exception; Duplicate_Cursor_Name : exception; Invalid_Transaction_State : exception; Invalid_Auth_Spec : exception; Invalid_Catalog_Name : exception; Invalid_Schema_Name : exception; Serialization_Failure : exception; Integrity_Violation : exception; Unknown_Stmt_Completion : exception; With_Check_Violation : exception; Operation_Canceled : exception; Invalid_SQL_Datatype : exception; Memory_Allocation_Error : exception; Invalid_App_Buffer : exception; Statement_Not_Prepared : exception; Invalid_Null_Pointer : exception; Invalid_Function_Sequence : exception; Timeout_Expired : exception; Driver_Error : exception; Invalid_Buffer_Length : exception; Not_Implemented : exception; Invalid_Information_Type : exception; Functiontype_Out_Of_Range : exception; -- These exceptions are generated based on the value in the SQLSTATE -- diagnostic field. type SQLHANDLE is private; SQL_NULL_HANDLE : constant SQLHANDLE; subtype SQLHENV is SQLHANDLE; subtype SQLHDBC is SQLHANDLE; subtype SQLHSTMT is SQLHANDLE; subtype SQLHDESC is SQLHANDLE; subtype SQLHWND is SQLHANDLE; SQL_NULL_HENV : constant SQLHENV; SQL_NULL_HDBC : constant SQLHDBC; SQL_NULL_HSTMT : constant SQLHSTMT; SQL_NULL_HDESC : constant SQLHDESC; SQL_NULL_HWND : constant SQLHWND; SQL_SQLSTATE_SIZE : constant := 5; subtype SQLSTATE is String (1 .. SQL_SQLSTATE_SIZE); EMPTY_SQLSTATE : constant SQLSTATE := "00000"; subtype WIDE_SQLSTATE is Wide_String (1 .. SQL_SQLSTATE_SIZE); type SQLRETURN is new SQLSMALLINT; SQL_SUCCESS : constant SQLRETURN := 0; SQL_SUCCESS_WITH_INFO : constant SQLRETURN := 1; SQL_STILL_EXECUTING : constant SQLRETURN := 2; SQL_NEED_DATA : constant SQLRETURN := 99; SQL_NO_DATA : constant SQLRETURN := 100; SQL_ERROR : constant SQLRETURN := -1; SQL_INVALID_HANDLE : constant SQLRETURN := -2; SQL_NO_DATA_FOUND : constant SQLRETURN := SQL_NO_DATA; -- Old name -- Special length values SQL_NULL_DATA : constant := -1; SQL_DATA_AT_EXEC : constant := -2; SQL_NTS : constant := -3; SQL_NTSL : constant := -3; type SQLINTEGER_ARRAY is array (Natural range <>) of aliased SQLINTEGER; type SQLUINTEGER_ARRAY is array (Natural range <>) of aliased SQLUINTEGER; type SQLSMALLINT_ARRAY is array (Natural range <>) of aliased SQLSMALLINT; type SQLUSMALLINT_ARRAY is array (Natural range <>) of aliased SQLUSMALLINT; type SQL_HANDLE_TYPE is (SQL_HANDLE_ENV, SQL_HANDLE_DBC, SQL_HANDLE_STMT, SQL_HANDLE_DESC); for SQL_HANDLE_TYPE use (SQL_HANDLE_ENV => 1, SQL_HANDLE_DBC => 2, SQL_HANDLE_STMT => 3, SQL_HANDLE_DESC => 4); for SQL_HANDLE_TYPE'Size use SQLSMALLINT'Size; type SQL_ENDTRAN_HANDLE_TYPE is new SQL_HANDLE_TYPE range SQL_HANDLE_ENV .. SQL_HANDLE_DBC; function SQLAllocHandle (HandleType : in SQL_HANDLE_TYPE; InputHandle : in SQLHANDLE; OutputHandle : access SQLHANDLE) return SQLRETURN; procedure SQLAllocHandle (HandleType : in SQL_HANDLE_TYPE; InputHandle : in SQLHANDLE; OutputHandle : out SQLHANDLE); -- Obtains an environment, connection, statement, or descriptor handle. pragma Inline (SQLAllocHandle); function SQLFreeHandle (HandleType : SQL_HANDLE_TYPE; Handle : SQLHANDLE) return SQLRETURN; procedure SQLFreeHandle (HandleType : in SQL_HANDLE_TYPE; Handle : in out SQLHANDLE); -- Releases an environment, connection, statement, or descriptor handle. pragma Inline (SQLFreeHandle); type FreeStmt_Option is (SQL_CLOSE, SQL_DROP, SQL_UNBIND, SQL_RESET_PARAMS); for FreeStmt_Option'Size use SQLSMALLINT'Size; function SQLFreeStmt (StatementHandle : SQLHSTMT; Option : FreeStmt_Option) return SQLRETURN; procedure SQLFreeStmt (StatementHandle : in out SQLHSTMT; Option : in FreeStmt_Option := SQL_CLOSE); function SQLConnect (ConnectionHandle : in SQLHDBC; ServerName : in String; UserName : in String; Authentication : in String) return SQLRETURN; procedure SQLConnect (ConnectionHandle : SQLHDBC; ServerName : String; UserName : String; Authentication : String); function SQLConnect (ConnectionHandle : in SQLHDBC; ServerName : in Wide_String; UserName : in Wide_String; Authentication : in Wide_String) return SQLRETURN; procedure SQLConnect (ConnectionHandle : SQLHDBC; ServerName : Wide_String; UserName : Wide_String; Authentication : Wide_String); -- Connects to a specific driver by data source name, user ID -- and password. pragma Inline (SQLConnect); function SQLDisconnect (ConnectionHandle : SQLHDBC) return SQLRETURN; procedure SQLDisconnect (ConnectionHandle : in SQLHDBC); -- Closes the connection. pragma Inline (SQLDisconnect); type SQL_EXTENDED_FETCH_DIRECTION is (SQL_FETCH_NEXT, SQL_FETCH_FIRST, SQL_FETCH_LAST, SQL_FETCH_PRIOR, SQL_FETCH_ABSOLUTE, SQL_FETCH_RELATIVE, SQL_FETCH_RESUME, SQL_FETCH_BOOKMARK, SQL_FETCH_FIRST_USER, SQL_FETCH_FIRST_SYSTEM); for SQL_EXTENDED_FETCH_DIRECTION use (SQL_FETCH_NEXT => 1, SQL_FETCH_FIRST => 2, SQL_FETCH_LAST => 3, SQL_FETCH_PRIOR => 4, SQL_FETCH_ABSOLUTE => 5, SQL_FETCH_RELATIVE => 6, SQL_FETCH_RESUME => 7, SQL_FETCH_BOOKMARK => 8, SQL_FETCH_FIRST_USER => 31, SQL_FETCH_FIRST_SYSTEM => 32); for SQL_EXTENDED_FETCH_DIRECTION'Size use SQLSMALLINT'Size; type FETCH_DIRECTION is new SQL_EXTENDED_FETCH_DIRECTION range SQL_FETCH_NEXT .. SQL_FETCH_BOOKMARK; type SIMPLE_FETCH_DIRECTION is new FETCH_DIRECTION range SQL_FETCH_NEXT .. SQL_FETCH_FIRST; SQL_MAX_DSN_LENGTH : constant := 32; -- maximum data source name size procedure SQLDataSources (EnvironmentHandle : in SQLHENV; Direction : in SQL_EXTENDED_FETCH_DIRECTION; ServerName : out String; Description : out String; ErrorCode : out SQLRETURN); -- This version returns the error code in an out paramater procedure SQLDataSources (EnvironmentHandle : in SQLHENV; Direction : in SQL_EXTENDED_FETCH_DIRECTION; ServerName : out String; Description : out String); -- This version raises an exception; procedure SQLDataSources (EnvironmentHandle : in SQLHENV; Direction : in SQL_EXTENDED_FETCH_DIRECTION; ServerName : out Wide_String; Description : out Wide_String; ErrorCode : out SQLRETURN); -- This version returns the error code in an out paramater procedure SQLDataSources (EnvironmentHandle : in SQLHENV; Direction : in SQL_EXTENDED_FETCH_DIRECTION; ServerName : out Wide_String; Description : out Wide_String); -- This version raises an exception; type SQL_DATA_TYPE is (SQL_GUID, SQL_WLONGVARCHAR, SQL_WVARCHAR, SQL_WCHAR, SQL_BIT, SQL_TINYINT, SQL_BIGINT, SQL_LONGVARBINARY, SQL_VARBINARY, SQL_BINARY, SQL_LONGVARCHAR, SQL_UNKNOWN_TYPE, SQL_CHAR, SQL_NUMERIC, SQL_DECIMAL, SQL_INTEGER, SQL_SMALLINT, SQL_FLOAT, SQL_REAL, SQL_DOUBLE, SQL_DATETIME, SQL_TIME, SQL_TIMESTAMP, SQL_VARCHAR, SQL_TYPE_DATE, SQL_TYPE_TIME, SQL_TYPE_TIMESTAMP, SQL_DEFAULT, SQL_INTERVAL_YEAR, SQL_INTERVAL_MONTH, SQL_INTERVAL_DAY, SQL_INTERVAL_HOUR, SQL_INTERVAL_MINUTE, SQL_INTERVAL_SECOND, SQL_INTERVAL_YEAR_TO_MONTH, SQL_INTERVAL_DAY_TO_HOUR, SQL_INTERVAL_DAY_TO_MINUTE, SQL_INTERVAL_DAY_TO_SECOND, SQL_INTERVAL_HOUR_TO_MINUTE, SQL_INTERVAL_HOUR_TO_SECOND, SQL_INTERVAL_MINUTE_TO_SECOND); for SQL_DATA_TYPE use (SQL_GUID => -11, SQL_WLONGVARCHAR => -10, SQL_WVARCHAR => -9, SQL_WCHAR => -8, SQL_BIT => -7, SQL_TINYINT => -6, SQL_BIGINT => -5, SQL_LONGVARBINARY => -4, SQL_VARBINARY => -3, SQL_BINARY => -2, SQL_LONGVARCHAR => -1, SQL_UNKNOWN_TYPE => 0, SQL_CHAR => 1, SQL_NUMERIC => 2, SQL_DECIMAL => 3, SQL_INTEGER => 4, SQL_SMALLINT => 5, SQL_FLOAT => 6, SQL_REAL => 7, SQL_DOUBLE => 8, SQL_DATETIME => 9, SQL_TIME => 10, SQL_TIMESTAMP => 11, SQL_VARCHAR => 12, SQL_TYPE_DATE => 91, SQL_TYPE_TIME => 92, SQL_TYPE_TIMESTAMP => 93, SQL_DEFAULT => 99, SQL_INTERVAL_YEAR => 101, SQL_INTERVAL_MONTH => 102, SQL_INTERVAL_DAY => 103, SQL_INTERVAL_HOUR => 104, SQL_INTERVAL_MINUTE => 105, SQL_INTERVAL_SECOND => 106, SQL_INTERVAL_YEAR_TO_MONTH => 107, SQL_INTERVAL_DAY_TO_HOUR => 108, SQL_INTERVAL_DAY_TO_MINUTE => 109, SQL_INTERVAL_DAY_TO_SECOND => 110, SQL_INTERVAL_HOUR_TO_MINUTE => 111, SQL_INTERVAL_HOUR_TO_SECOND => 112, SQL_INTERVAL_MINUTE_TO_SECOND => 113); for SQL_DATA_TYPE'Size use SQLSMALLINT'Size; SQL_ALL_TYPES : constant SQL_DATA_TYPE := SQL_UNKNOWN_TYPE; type SQL_C_DATA_TYPE is (SQL_C_UTINYINT, SQL_C_UBIGINT, SQL_C_STINYINT, SQL_C_SBIGINT, SQL_C_ULONG, SQL_C_USHORT, SQL_C_SLONG, SQL_C_SSHORT, SQL_C_GUID, SQL_C_WCHAR, SQL_C_BIT, SQL_C_TINYINT, SQL_C_BINARY, SQL_C_CHAR, SQL_C_NUMERIC, SQL_C_LONG, SQL_C_SHORT, SQL_C_FLOAT, SQL_C_DOUBLE, SQL_C_DATE, SQL_C_TIME, SQL_C_TIMESTAMP, SQL_C_TYPE_DATE, SQL_C_TYPE_TIME, SQL_C_TYPE_TIMESTAMP, SQL_C_DEFAULT, SQL_C_INTERVAL_YEAR, SQL_C_INTERVAL_MONTH, SQL_C_INTERVAL_DAY, SQL_C_INTERVAL_HOUR, SQL_C_INTERVAL_MINUTE, SQL_C_INTERVAL_SECOND, SQL_C_INTERVAL_YEAR_TO_MONTH, SQL_C_INTERVAL_DAY_TO_HOUR, SQL_C_INTERVAL_DAY_TO_MINUTE, SQL_C_INTERVAL_DAY_TO_SECOND, SQL_C_INTERVAL_HOUR_TO_MINUTE, SQL_C_INTERVAL_HOUR_TO_SECOND, SQL_C_INTERVAL_MINUTE_TO_SECOND); for SQL_C_DATA_TYPE use (SQL_C_UTINYINT => -28, SQL_C_UBIGINT => -27, SQL_C_STINYINT => -26, SQL_C_SBIGINT => -25, SQL_C_ULONG => -18, SQL_C_USHORT => -17, SQL_C_SLONG => -16, SQL_C_SSHORT => -15, SQL_C_GUID => -11, SQL_C_WCHAR => -8, SQL_C_BIT => -7, SQL_C_TINYINT => -6, SQL_C_BINARY => -2, SQL_C_CHAR => 1, SQL_C_NUMERIC => 2, SQL_C_LONG => 4, SQL_C_SHORT => 5, SQL_C_FLOAT => 7, SQL_C_DOUBLE => 8, SQL_C_DATE => 9, SQL_C_TIME => 10, SQL_C_TIMESTAMP => 11, SQL_C_TYPE_DATE => 91, SQL_C_TYPE_TIME => 92, SQL_C_TYPE_TIMESTAMP => 93, SQL_C_DEFAULT => 99, SQL_C_INTERVAL_YEAR => 101, SQL_C_INTERVAL_MONTH => 102, SQL_C_INTERVAL_DAY => 103, SQL_C_INTERVAL_HOUR => 104, SQL_C_INTERVAL_MINUTE => 105, SQL_C_INTERVAL_SECOND => 106, SQL_C_INTERVAL_YEAR_TO_MONTH => 107, SQL_C_INTERVAL_DAY_TO_HOUR => 108, SQL_C_INTERVAL_DAY_TO_MINUTE => 109, SQL_C_INTERVAL_DAY_TO_SECOND => 110, SQL_C_INTERVAL_HOUR_TO_MINUTE => 111, SQL_C_INTERVAL_HOUR_TO_SECOND => 112, SQL_C_INTERVAL_MINUTE_TO_SECOND => 113); for SQL_C_DATA_TYPE'Size use SQLSMALLINT'Size; SQL_C_BOOKMARK : constant SQL_C_DATA_TYPE := SQL_C_ULONG; SQL_C_VARBOOKMARK : constant SQL_C_DATA_TYPE := SQL_C_BINARY; -- Values of NULLABLE field in descriptor type SQL_NULLABLE_INFO is (SQL_NO_NULLS, SQL_NULLABLE, -- Value returned by SQLGetTypeInfo to -- denote that it is not known whether or not -- a data type supports null values. SQL_NULLABLE_UNKNOWN); for SQL_NULLABLE_INFO'Size use SQLSMALLINT'Size; type SQL_NULLABLE_FIELD is new SQL_NULLABLE_INFO range SQL_NO_NULLS .. SQL_NULLABLE; -- | ---------------------------------------------------------------------- -- | -- Values returned by SQLGetTypeInfo to show WHERE clause supported type SQL_WHERE_INFO is (SQL_PRED_NONE, SQL_PRED_CHAR, SQL_PRED_BASIC); for SQL_WHERE_INFO'Size use SQLSMALLINT'Size; function SQLGetTypeInfo (StatementHandle : SQLHSTMT; DataType : SQL_DATA_TYPE) return SQLRETURN; procedure SQLGetTypeInfo (StatementHandle : SQLHSTMT; DataType : SQL_DATA_TYPE); -- Returns information about supported data types. pragma Inline (SQLGetTypeInfo); -- | ---------------------------------------------------------------------- -- | type SQL_Column_Number is new SQLUSMALLINT; Bookmark_Column : constant SQL_Column_Number := 0; function SQLBindCol (StatementHandle : SQLHSTMT; ColumnNumber : SQL_Column_Number; TargetType : SQL_C_DATA_TYPE; TargetValue : SQLPOINTER; BufferLength : SQLINTEGER; pStrLen_or_Ind : access SQLINTEGER) return SQLRETURN; procedure SQLBindCol (StatementHandle : in SQLHSTMT; ColumnNumber : in SQL_Column_Number; TargetType : in SQL_C_DATA_TYPE; TargetValuePtr : in SQLPOINTER; BufferLength : in SQLINTEGER; StrLen_Or_IndPtr : access SQLINTEGER); pragma Inline (SQLBindCol); function SQLBindCol (StatementHandle : SQLHSTMT; ColumnNumber : SQL_Column_Number; TargetValue : access String; StrLen_Or_IndPtr : access SQLINTEGER) return SQLRETURN; procedure SQLBindCol (StatementHandle : in SQLHSTMT; ColumnNumber : in SQL_Column_Number; TargetValue : access String; StrLen_Or_IndPtr : access SQLINTEGER); -- | ---------------------------------------------------------------------- -- | type SQL_Parameter_Number is new SQLUSMALLINT range 1 .. SQLUSMALLINT'Last; type SQL_Parameter_Type is (SQL_PARAM_TYPE_UNKNOWN, SQL_PARAM_INPUT, SQL_PARAM_INPUT_OUTPUT, SQL_RESULT_COL, SQL_PARAM_OUTPUT, SQL_RETURN_VALUE); for SQL_Parameter_Type'Size use SQLSMALLINT'Size; function SQLBindParameter (StatementHandle : in SQLHSTMT; ParameterNumber : in SQL_Parameter_Number; InputOutputType : in SQL_Parameter_Type; ValueType : in SQL_C_DATA_TYPE; ParameterType : in SQL_DATA_TYPE; ColumnSize : in SQLUINTEGER; DecimalDigits : in SQLSMALLINT; Value : in SQLPOINTER; BufferLength : in SQLINTEGER; StrLen_Or_IndPtr : access SQLINTEGER) return SQLRETURN; procedure SQLBindParameter (StatementHandle : in SQLHSTMT; ParameterNumber : in SQL_Parameter_Number; InputOutputType : in SQL_Parameter_Type; ValueType : in SQL_C_DATA_TYPE; ParameterType : in SQL_DATA_TYPE; ColumnSize : in SQLUINTEGER; DecimalDigits : in SQLSMALLINT; Value : in SQLPOINTER; BufferLength : in SQLINTEGER; StrLen_Or_IndPtr : access SQLINTEGER); pragma Inline (SQLBindParameter); function SQLBindParameter (StatementHandle : in SQLHSTMT; ParameterNumber : in SQL_Parameter_Number; Value : access String; Length : access SQLINTEGER; InputOutputType : in SQL_Parameter_Type := SQL_PARAM_INPUT) return SQLRETURN; procedure SQLBindParameter (StatementHandle : in SQLHSTMT; ParameterNumber : in SQL_Parameter_Number; Value : access String; Length : access SQLINTEGER; InputOutputType : in SQL_Parameter_Type := SQL_PARAM_INPUT); -- | ---------------------------------------------------------------------- -- | generic type Int is range <>; package IntegerBinding is function SQLBindCol (StatementHandle : in SQLHSTMT; ColumnNumber : in SQL_Column_Number; TargetValue : access Int; IndPtr : access SQLINTEGER) return SQLRETURN; procedure SQLBindCol (StatementHandle : in SQLHSTMT; ColumnNumber : in SQL_Column_Number; TargetValue : access Int; IndPtr : access SQLINTEGER); function SQLBindParameter (StatementHandle : in SQLHSTMT; ParameterNumber : in SQL_Parameter_Number; Value : access Int; Indicator : access SQLINTEGER; InputOutputType : in SQL_Parameter_Type := SQL_PARAM_INPUT) return SQLRETURN; procedure SQLBindParameter (StatementHandle : in SQLHSTMT; ParameterNumber : in SQL_Parameter_Number; Value : access Int; Indicator : access SQLINTEGER; InputOutputType : in SQL_Parameter_Type := SQL_PARAM_INPUT); end IntegerBinding; -- | ---------------------------------------------------------------------- -- | generic type Unsigned is mod <>; package UnsignedBinding is function SQLBindCol (StatementHandle : in SQLHSTMT; ColumnNumber : in SQL_Column_Number; TargetValue : access Unsigned; IndPtr : access SQLINTEGER) return SQLRETURN; procedure SQLBindCol (StatementHandle : in SQLHSTMT; ColumnNumber : in SQL_Column_Number; TargetValue : access Unsigned; IndPtr : access SQLINTEGER); function SQLBindParameter (StatementHandle : in SQLHSTMT; ParameterNumber : in SQL_Parameter_Number; Value : access Unsigned; Indicator : access SQLINTEGER; InputOutputType : in SQL_Parameter_Type := SQL_PARAM_INPUT) return SQLRETURN; procedure SQLBindParameter (StatementHandle : in SQLHSTMT; ParameterNumber : in SQL_Parameter_Number; Value : access Unsigned; Indicator : access SQLINTEGER; InputOutputType : in SQL_Parameter_Type := SQL_PARAM_INPUT); end UnsignedBinding; -- | ---------------------------------------------------------------------- -- | generic type Flt is digits <>; package FloatBinding is function SQLBindCol (StatementHandle : in SQLHSTMT; ColumnNumber : in SQL_Column_Number; TargetValue : access Flt; IndPtr : access SQLINTEGER) return SQLRETURN; procedure SQLBindCol (StatementHandle : in SQLHSTMT; ColumnNumber : in SQL_Column_Number; TargetValue : access Flt; IndPtr : access SQLINTEGER); function SQLBindParameter (StatementHandle : in SQLHSTMT; ParameterNumber : in SQL_Parameter_Number; Value : access Flt; Indicator : access SQLINTEGER; InputOutputType : in SQL_Parameter_Type := SQL_PARAM_INPUT) return SQLRETURN; procedure SQLBindParameter (StatementHandle : in SQLHSTMT; ParameterNumber : in SQL_Parameter_Number; Value : access Flt; Indicator : access SQLINTEGER; InputOutputType : in SQL_Parameter_Type := SQL_PARAM_INPUT); end FloatBinding; -- | ---------------------------------------------------------------------- -- | generic type Enum is (<>); package EnumBinding is function SQLBindCol (StatementHandle : in SQLHSTMT; ColumnNumber : in SQL_Column_Number; TargetValue : access Enum; IndPtr : access SQLINTEGER) return SQLRETURN; procedure SQLBindCol (StatementHandle : in SQLHSTMT; ColumnNumber : in SQL_Column_Number; TargetValue : access Enum; IndPtr : access SQLINTEGER); function SQLBindParameter (StatementHandle : in SQLHSTMT; ParameterNumber : in SQL_Parameter_Number; Value : access Enum; Indicator : access SQLINTEGER; InputOutputType : in SQL_Parameter_Type := SQL_PARAM_INPUT) return SQLRETURN; procedure SQLBindParameter (StatementHandle : in SQLHSTMT; ParameterNumber : in SQL_Parameter_Number; Value : access Enum; Indicator : access SQLINTEGER; InputOutputType : in SQL_Parameter_Type := SQL_PARAM_INPUT); end EnumBinding; -- | ---------------------------------------------------------------------- -- | procedure SQLDescribeParam (StatementHandle : in SQLHSTMT; ParameterNumber : in SQL_Parameter_Number; ParameterType : out SQL_DATA_TYPE; ColumnSize : out SQLUINTEGER; DecimalDigits : out SQLSMALLINT; Nullable : out SQL_NULLABLE_INFO; RC : out SQLRETURN); procedure SQLDescribeParam (StatementHandle : in SQLHSTMT; ParameterNumber : in SQL_Parameter_Number; ParameterType : out SQL_DATA_TYPE; ColumnSize : out SQLUINTEGER; DecimalDigits : out SQLSMALLINT; Nullable : out SQL_NULLABLE_INFO); -- | ---------------------------------------------------------------------- -- | function SQLCancel (StatementHandle : SQLHSTMT) return SQLRETURN; procedure SQLCancel (StatementHandle : in SQLHSTMT); pragma Inline (SQLCancel); -- | ---------------------------------------------------------------------- -- | function SQLCloseCursor (StatementHandle : SQLHSTMT) return SQLRETURN; procedure SQLCloseCursor (StatementHandle : in SQLHSTMT); pragma Inline (SQLCloseCursor); -- | ---------------------------------------------------------------------- -- | function SQLExecute (StatementHandle : SQLHSTMT) return SQLRETURN; procedure SQLExecute (StatementHandle : in SQLHSTMT); pragma Inline (SQLExecute); -- | ---------------------------------------------------------------------- -- | function SQLExecDirect (StatementHandle : SQLHSTMT; StatementText : String) return SQLRETURN; procedure SQLExecDirect (StatementHandle : in SQLHSTMT; StatementText : in String); function SQLExecDirect (StatementHandle : SQLHSTMT; StatementText : Wide_String) return SQLRETURN; procedure SQLExecDirect (StatementHandle : in SQLHSTMT; StatementText : in Wide_String); pragma Inline (SQLExecDirect); -- | ---------------------------------------------------------------------- -- | function SQLFetch (StatementHandle : SQLHSTMT) return SQLRETURN; procedure SQLFetch (StatementHandle : in SQLHSTMT); pragma Inline (SQLFetch); -- | ---------------------------------------------------------------------- -- | function SQLFetchScroll (StatementHandle : in SQLHSTMT; FetchDirection : in FETCH_DIRECTION; FetchOffset : in SQLINTEGER := 0) return SQLRETURN; procedure SQLFetchScroll (StatementHandle : in SQLHSTMT; FetchDirection : in FETCH_DIRECTION; FetchOffset : in SQLINTEGER := 0); pragma Inline (SQLFetchScroll); -- | ---------------------------------------------------------------------- -- | type ROW_STATUS is (SQL_ROW_SUCCESS, SQL_ROW_DELETED, SQL_ROW_UPDATED, SQL_ROW_NOROW, SQL_ROW_ADDED, SQL_ROW_ERROR, SQL_ROW_SUCCESS_WITH_INFO); for ROW_STATUS'Size use SQLUSMALLINT'Size; type RowStatusArray is array (Natural) of aliased ROW_STATUS; pragma Convention (C, RowStatusArray); type RowStatusArrayPtr is access all RowStatusArray; pragma No_Strict_Aliasing (RowStatusArrayPtr); -- This is a non-fat pointer function SQLPrepare (StatementHandle : SQLHSTMT; StatementText : String) return SQLRETURN; procedure SQLPrepare (StatementHandle : SQLHSTMT; StatementText : String); function SQLPrepare (StatementHandle : SQLHSTMT; StatementText : Wide_String) return SQLRETURN; procedure SQLPrepare (StatementHandle : SQLHSTMT; StatementText : Wide_String); pragma Inline (SQLPrepare); -- | ---------------------------------------------------------------------- -- | procedure SQLGetCursorName (StatementHandle : in SQLHSTMT; NameBuffer : out String; BufferLength : out SQLSMALLINT; ErrorCode : out SQLRETURN); -- This version doesn't raise an exception but returns the ErrorCode -- in an out parameter function SQLGetCursorName (StatementHandle : SQLHSTMT; MaxNameLength : SQLSMALLINT := 256) return String; -- This version may raise an exception procedure SQLGetCursorName (StatementHandle : in SQLHSTMT; NameBuffer : out Wide_String; BufferLength : out SQLSMALLINT; ErrorCode : out SQLRETURN); -- This version doesn't raise an exception but returns the ErrorCode -- in an out parameter function SQLGetCursorName (StatementHandle : SQLHSTMT; MaxNameLength : SQLSMALLINT := 256) return Wide_String; -- This version may raise an exception -- | ---------------------------------------------------------------------- -- | function SQLSetCursorName (StatementHandle : SQLHSTMT; CursorName : String) return SQLRETURN; procedure SQLSetCursorName (StatementHandle : in SQLHSTMT; CursorName : in String); function SQLSetCursorName (StatementHandle : SQLHSTMT; CursorName : Wide_String) return SQLRETURN; procedure SQLSetCursorName (StatementHandle : in SQLHSTMT; CursorName : in Wide_String); pragma Inline (SQLSetCursorName); -- | ---------------------------------------------------------------------- -- | type SQL_COMPLETION_TYPE is (SQL_COMMIT, SQL_ROLLBACK); for SQL_COMPLETION_TYPE'Size use SQLSMALLINT'Size; function SQLEndTran (HandleType : SQL_ENDTRAN_HANDLE_TYPE := SQL_HANDLE_DBC; Handle : SQLHANDLE; CompletionType : SQL_COMPLETION_TYPE := SQL_COMMIT) return SQLRETURN; procedure SQLEndTran (HandleType : in SQL_ENDTRAN_HANDLE_TYPE := SQL_HANDLE_DBC; Handle : in SQLHANDLE; CompletionType : in SQL_COMPLETION_TYPE := SQL_COMMIT); pragma Inline (SQLEndTran); -- -- Commodity -- procedure SQLCommit (ConnectionHandle : SQLHDBC); procedure SQLRollback (ConnectionHandle : SQLHDBC); pragma Inline (SQLCommit); pragma Inline (SQLRollback); -- Note : These versions may raise exceptions. If you don't want -- exceptions use the function SQLEndTran explicitly. -- | ---------------------------------------------------------------------- -- | function SQLNumParams (StatementHandle : SQLHSTMT; pNum : access SQLSMALLINT) return SQLRETURN; function SQLNumParams (StatementHandle : SQLHSTMT) return SQLSMALLINT; pragma Inline (SQLNumParams); -- | ---------------------------------------------------------------------- -- | function SQLNumResultCols (StatementHandle : SQLHSTMT; pColumnCount : access SQL_Column_Number) return SQLRETURN; function SQLNumResultCols (StatementHandle : SQLHSTMT) return SQL_Column_Number; pragma Inline (SQLNumResultCols); -- | ---------------------------------------------------------------------- -- | function SQLRowCount (StatementHandle : SQLHSTMT; pRowCount : access SQLINTEGER) return SQLRETURN; function SQLRowCount (StatementHandle : SQLHSTMT) return SQLINTEGER; pragma Inline (SQLRowCount); -- | ---------------------------------------------------------------------- -- | function SQLGetData (StatementHandle : in SQLHSTMT; ColumnNumber : in SQL_Column_Number; TargetType : in SQL_C_DATA_TYPE; TargetValue : in SQLPOINTER; BufferLength : in SQLINTEGER; StrLen_Or_Ind : access SQLINTEGER) return SQLRETURN; procedure SQLGetData (StatementHandle : in SQLHSTMT; ColumnNumber : in SQL_Column_Number; TargetType : in SQL_C_DATA_TYPE; TargetValue : in SQLPOINTER; BufferLength : in SQLINTEGER; StrLen_Or_Ind : access SQLINTEGER); pragma Inline (SQLGetData); -- | ---------------------------------------------------------------------- -- | function SQLPutData (StatementHandle : SQLHSTMT; Data : SQLPOINTER; StrLen_or_Ind : SQLINTEGER) return SQLRETURN; procedure SQLPutData (StatementHandle : in SQLHSTMT; Data : in SQLPOINTER; StrLen_Or_Ind : SQLINTEGER); pragma Inline (SQLPutData); -- | ---------------------------------------------------------------------- -- | function SQLParamData (StatementHandle : SQLHSTMT; pValue : access SQLPOINTER) return SQLRETURN; function SQLParamData (StatementHandle : in SQLHSTMT) return SQLPOINTER; pragma Inline (SQLParamData); -- | ---------------------------------------------------------------------- -- | function SQLCopyDesc (SourceHandle : SQLHDESC; TargetHandle : SQLHDESC) return SQLRETURN; procedure SQLCopyDesc (SourceHandle : in SQLHDESC; TargetHandle : in SQLHDESC); pragma Inline (SQLCopyDesc); -- | ---------------------------------------------------------------------- -- | type SQL_STATISTICS_UNIQUE_OPTION is (SQL_INDEX_UNIQUE, SQL_INDEX_ALL); for SQL_STATISTICS_UNIQUE_OPTION'Size use SQLSMALLINT'Size; type SQL_STATISTICS_PAGES_OPTION is (SQL_QUICK, SQL_ENSURE); for SQL_STATISTICS_PAGES_OPTION'Size use SQLSMALLINT'Size; function SQLStatistics (StatementHandle : SQLHSTMT; CatalogName : String; SchemaName : String; TableName : String; Unique : SQL_STATISTICS_UNIQUE_OPTION := SQL_INDEX_ALL; PagesImportance : SQL_STATISTICS_PAGES_OPTION := SQL_QUICK) return SQLRETURN; procedure SQLStatistics (StatementHandle : in SQLHSTMT; CatalogName : in String; SchemaName : in String; TableName : in String; Unique : in SQL_STATISTICS_UNIQUE_OPTION := SQL_INDEX_ALL; PagesImportance : in SQL_STATISTICS_PAGES_OPTION := SQL_QUICK); pragma Inline (SQLStatistics); function SQLStatistics (StatementHandle : SQLHSTMT; CatalogName : Wide_String; SchemaName : Wide_String; TableName : Wide_String; Unique : SQL_STATISTICS_UNIQUE_OPTION := SQL_INDEX_ALL; PagesImportance : SQL_STATISTICS_PAGES_OPTION := SQL_QUICK) return SQLRETURN; procedure SQLStatistics (StatementHandle : in SQLHSTMT; CatalogName : in Wide_String; SchemaName : in Wide_String; TableName : in Wide_String; Unique : in SQL_STATISTICS_UNIQUE_OPTION := SQL_INDEX_ALL; PagesImportance : in SQL_STATISTICS_PAGES_OPTION := SQL_QUICK); pragma Inline (SQLStatistics); -- | ---------------------------------------------------------------------- -- | SQL_ALL_PATTERN : constant String := "%"; SQL_ALL_CATALOGS : String renames SQL_ALL_PATTERN; SQL_ALL_SCHEMAS : String renames SQL_ALL_PATTERN; SQL_ALL_TABLES : String renames SQL_ALL_PATTERN; SQL_ALL_TABLE_TYPES : String renames SQL_ALL_PATTERN; SQL_ALL_PROCEDURES : String renames SQL_ALL_PATTERN; SQL_ALL_COLUMNS : String renames SQL_ALL_PATTERN; W_SQL_ALL_PATTERN : constant Wide_String := "%"; W_SQL_ALL_CATALOGS : Wide_String renames W_SQL_ALL_PATTERN; W_SQL_ALL_SCHEMAS : Wide_String renames W_SQL_ALL_PATTERN; W_SQL_ALL_TABLES : Wide_String renames W_SQL_ALL_PATTERN; W_SQL_ALL_TABLE_TYPES : Wide_String renames W_SQL_ALL_PATTERN; W_SQL_ALL_PROCEDURES : Wide_String renames W_SQL_ALL_PATTERN; W_SQL_ALL_COLUMNS : Wide_String renames W_SQL_ALL_PATTERN; function SQLTables (StatementHandle : SQLHSTMT; CatalogName : String := SQL_ALL_CATALOGS; SchemaName : String := SQL_ALL_SCHEMAS; TableName : String; TableType : String := SQL_ALL_TABLE_TYPES) return SQLRETURN; procedure SQLTables (StatementHandle : in SQLHSTMT; CatalogName : in String := SQL_ALL_CATALOGS; SchemaName : in String := SQL_ALL_SCHEMAS; TableName : in String; TableType : in String := SQL_ALL_TABLE_TYPES); function SQLTables (StatementHandle : SQLHSTMT; CatalogName : Wide_String := W_SQL_ALL_CATALOGS; SchemaName : Wide_String := W_SQL_ALL_SCHEMAS; TableName : Wide_String; TableType : Wide_String := W_SQL_ALL_TABLE_TYPES) return SQLRETURN; procedure SQLTables (StatementHandle : in SQLHSTMT; CatalogName : in Wide_String := W_SQL_ALL_CATALOGS; SchemaName : in Wide_String := W_SQL_ALL_SCHEMAS; TableName : in Wide_String; TableType : in Wide_String := W_SQL_ALL_TABLE_TYPES); pragma Inline (SQLTables); -- | ---------------------------------------------------------------------- -- | function SQLProcedures (StatementHandle : SQLHSTMT; CatalogName : String; SchemaName : String := SQL_ALL_SCHEMAS; ProcName : String := SQL_ALL_PROCEDURES) return SQLRETURN; procedure SQLProcedures (StatementHandle : SQLHSTMT; CatalogName : String; SchemaName : String := SQL_ALL_SCHEMAS; ProcName : String := SQL_ALL_PROCEDURES); function SQLProcedures (StatementHandle : SQLHSTMT; CatalogName : Wide_String; SchemaName : Wide_String := W_SQL_ALL_SCHEMAS; ProcName : Wide_String := W_SQL_ALL_PROCEDURES) return SQLRETURN; procedure SQLProcedures (StatementHandle : SQLHSTMT; CatalogName : Wide_String; SchemaName : Wide_String := W_SQL_ALL_SCHEMAS; ProcName : Wide_String := W_SQL_ALL_PROCEDURES); pragma Inline (SQLProcedures); -- | ---------------------------------------------------------------------- -- | function SQLProcedureColumns (StatementHandle : SQLHSTMT; CatalogName : String; SchemaName : String := SQL_ALL_SCHEMAS; ProcName : String := SQL_ALL_PROCEDURES; ColumnName : String := SQL_ALL_COLUMNS) return SQLRETURN; procedure SQLProcedureColumns (StatementHandle : SQLHSTMT; CatalogName : String; SchemaName : String := SQL_ALL_SCHEMAS; ProcName : String := SQL_ALL_PROCEDURES; ColumnName : String := SQL_ALL_COLUMNS); function SQLProcedureColumns (StatementHandle : SQLHSTMT; CatalogName : Wide_String; SchemaName : Wide_String := W_SQL_ALL_SCHEMAS; ProcName : Wide_String := W_SQL_ALL_PROCEDURES; ColumnName : Wide_String := W_SQL_ALL_COLUMNS) return SQLRETURN; procedure SQLProcedureColumns (StatementHandle : SQLHSTMT; CatalogName : Wide_String; SchemaName : Wide_String := W_SQL_ALL_SCHEMAS; ProcName : Wide_String := W_SQL_ALL_PROCEDURES; ColumnName : Wide_String := W_SQL_ALL_COLUMNS); pragma Inline (SQLProcedureColumns); -- | ---------------------------------------------------------------------- -- | function SQLTablePrivileges (StatementHandle : SQLHSTMT; CatalogName : String; SchemaName : String := SQL_ALL_SCHEMAS; TableName : String := SQL_ALL_TABLES) return SQLRETURN; procedure SQLTablePrivileges (StatementHandle : SQLHSTMT; CatalogName : String; SchemaName : String := SQL_ALL_SCHEMAS; TableName : String := SQL_ALL_TABLES); function SQLTablePrivileges (StatementHandle : SQLHSTMT; CatalogName : Wide_String; SchemaName : Wide_String := W_SQL_ALL_SCHEMAS; TableName : Wide_String := W_SQL_ALL_TABLES) return SQLRETURN; procedure SQLTablePrivileges (StatementHandle : SQLHSTMT; CatalogName : Wide_String; SchemaName : Wide_String := W_SQL_ALL_SCHEMAS; TableName : Wide_String := W_SQL_ALL_TABLES); pragma Inline (SQLTablePrivileges); -- | ---------------------------------------------------------------------- -- | function SQLColumnPrivileges (StatementHandle : SQLHSTMT; CatalogName : String; SchemaName : String; TableName : String; ColumnName : String := SQL_ALL_COLUMNS) return SQLRETURN; procedure SQLColumnPrivileges (StatementHandle : SQLHSTMT; CatalogName : String; SchemaName : String; TableName : String; ColumnName : String := SQL_ALL_COLUMNS); function SQLColumnPrivileges (StatementHandle : SQLHSTMT; CatalogName : Wide_String; SchemaName : Wide_String; TableName : Wide_String; ColumnName : Wide_String := W_SQL_ALL_COLUMNS) return SQLRETURN; procedure SQLColumnPrivileges (StatementHandle : SQLHSTMT; CatalogName : Wide_String; SchemaName : Wide_String; TableName : Wide_String; ColumnName : Wide_String := W_SQL_ALL_COLUMNS); pragma Inline (SQLColumnPrivileges); -- | ---------------------------------------------------------------------- -- | type Special_Column_Type is (SQL_BEST_ROWID, SQL_ROWVER); for Special_Column_Type use (SQL_BEST_ROWID => 1, SQL_ROWVER => 2); for Special_Column_Type'Size use SQLSMALLINT'Size; type ROWID_SCOPE is (SQL_SCOPE_CURROW, SQL_SCOPE_TRANSACTION, SQL_SCOPE_SESSION); for ROWID_SCOPE'Size use SQLSMALLINT'Size; function SQLSpecialColumns (StatementHandle : in SQLHSTMT; IdentifierType : in Special_Column_Type; CatalogName : in String; SchemaName : in String; TableName : in String; Scope : in ROWID_SCOPE; Nullable : in SQL_NULLABLE_FIELD) return SQLRETURN; procedure SQLSpecialColumns (StatementHandle : in SQLHSTMT; IdentifierType : in Special_Column_Type; CatalogName : in String; SchemaName : in String; TableName : in String; Scope : in ROWID_SCOPE; Nullable : in SQL_NULLABLE_FIELD); function SQLSpecialColumns (StatementHandle : in SQLHSTMT; IdentifierType : in Special_Column_Type; CatalogName : in Wide_String; SchemaName : in Wide_String; TableName : in Wide_String; Scope : in ROWID_SCOPE; Nullable : in SQL_NULLABLE_FIELD) return SQLRETURN; procedure SQLSpecialColumns (StatementHandle : in SQLHSTMT; IdentifierType : in Special_Column_Type; CatalogName : in Wide_String; SchemaName : in Wide_String; TableName : in Wide_String; Scope : in ROWID_SCOPE; Nullable : in SQL_NULLABLE_FIELD); pragma Inline (SQLSpecialColumns); -- | ---------------------------------------------------------------------- -- | function SQLPrimaryKeys (StatementHandle : SQLHSTMT; CatalogName : String; SchemaName : String; TableName : String) return SQLRETURN; procedure SQLPrimaryKeys (StatementHandle : SQLHSTMT; CatalogName : String; SchemaName : String; TableName : String); function SQLPrimaryKeys (StatementHandle : SQLHSTMT; CatalogName : Wide_String; SchemaName : Wide_String; TableName : Wide_String) return SQLRETURN; procedure SQLPrimaryKeys (StatementHandle : SQLHSTMT; CatalogName : Wide_String; SchemaName : Wide_String; TableName : Wide_String); pragma Inline (SQLPrimaryKeys); -- | ---------------------------------------------------------------------- -- | function SQLForeignKeys (StatementHandle : SQLHSTMT; PrimaryCatalogName : String; PrimarySchemaName : String; PrimaryTableName : String; ForeignCatalogName : String; ForeignSchemaName : String; ForeignTableName : String) return SQLRETURN; procedure SQLForeignKeys (StatementHandle : SQLHSTMT; PrimaryCatalogName : String; PrimarySchemaName : String; PrimaryTableName : String; ForeignCatalogName : String; ForeignSchemaName : String; ForeignTableName : String); function SQLForeignKeys (StatementHandle : SQLHSTMT; PrimaryCatalogName : Wide_String; PrimarySchemaName : Wide_String; PrimaryTableName : Wide_String; ForeignCatalogName : Wide_String; ForeignSchemaName : Wide_String; ForeignTableName : Wide_String) return SQLRETURN; procedure SQLForeignKeys (StatementHandle : SQLHSTMT; PrimaryCatalogName : Wide_String; PrimarySchemaName : Wide_String; PrimaryTableName : Wide_String; ForeignCatalogName : Wide_String; ForeignSchemaName : Wide_String; ForeignTableName : Wide_String); pragma Inline (SQLForeignKeys); -- | ---------------------------------------------------------------------- -- | function SQLDescribeCol (StatementHandle : SQLHSTMT; ColumnNumber : SQL_Column_Number; MaxNameLength : SQLSMALLINT; DataType : access SQL_DATA_TYPE; ColumnSize : access SQLUINTEGER; DecimalDigits : access SQLSMALLINT; Nullable : access SQL_NULLABLE_INFO; ErrorCode : access SQLRETURN) return String; -- This version returns the ErrorCode when an ODBC error occured function SQLDescribeCol (StatementHandle : SQLHSTMT; ColumnNumber : SQL_Column_Number; MaxNameLength : SQLSMALLINT; DataType : access SQL_DATA_TYPE; ColumnSize : access SQLUINTEGER; DecimalDigits : access SQLSMALLINT; Nullable : access SQL_NULLABLE_INFO) return String; -- This version raises an exception when an ODBC error occured function SQLDescribeCol (StatementHandle : SQLHSTMT; ColumnNumber : SQL_Column_Number; MaxNameLength : SQLSMALLINT; DataType : access SQL_DATA_TYPE; ColumnSize : access SQLUINTEGER; DecimalDigits : access SQLSMALLINT; Nullable : access SQL_NULLABLE_INFO; ErrorCode : access SQLRETURN) return Wide_String; -- This version returns the ErrorCode when an ODBC error occured function SQLDescribeCol (StatementHandle : SQLHSTMT; ColumnNumber : SQL_Column_Number; MaxNameLength : SQLSMALLINT; DataType : access SQL_DATA_TYPE; ColumnSize : access SQLUINTEGER; DecimalDigits : access SQLSMALLINT; Nullable : access SQL_NULLABLE_INFO) return Wide_String; -- This version raises an exception when an ODBC error occured -- | ---------------------------------------------------------------------- -- | function SQLColumns (StatementHandle : in SQLHSTMT; CatalogName : in String; SchemaName : in String := SQL_ALL_SCHEMAS; TableName : in String := SQL_ALL_TABLES; ColumnName : in String := SQL_ALL_COLUMNS) return SQLRETURN; procedure SQLColumns (StatementHandle : in SQLHSTMT; CatalogName : in String; SchemaName : in String := SQL_ALL_SCHEMAS; TableName : in String := SQL_ALL_TABLES; ColumnName : in String := SQL_ALL_COLUMNS); function SQLColumns (StatementHandle : in SQLHSTMT; CatalogName : in Wide_String; SchemaName : in Wide_String := W_SQL_ALL_SCHEMAS; TableName : in Wide_String := W_SQL_ALL_TABLES; ColumnName : in Wide_String := W_SQL_ALL_COLUMNS) return SQLRETURN; procedure SQLColumns (StatementHandle : in SQLHSTMT; CatalogName : in Wide_String; SchemaName : in Wide_String := W_SQL_ALL_SCHEMAS; TableName : in Wide_String := W_SQL_ALL_TABLES; ColumnName : in Wide_String := W_SQL_ALL_COLUMNS); pragma Inline (SQLColumns); -- | ---------------------------------------------------------------------- -- | function SQLNativeSql (ConnectionHandle : SQLHDBC; StatementText : String; MaxLength : SQLINTEGER := 1024; ErrorCode : access SQLRETURN) return String; -- This version returns the ErrorCode when an ODBC error occured function SQLNativeSql (ConnectionHandle : SQLHDBC; StatementText : String; MaxLength : SQLINTEGER := 1024) return String; -- This version raises an exception when an ODBC error occured function SQLNativeSql (ConnectionHandle : SQLHDBC; StatementText : Wide_String; MaxLength : SQLINTEGER := 1024; ErrorCode : access SQLRETURN) return Wide_String; -- This version returns the ErrorCode when an ODBC error occured function SQLNativeSql (ConnectionHandle : SQLHDBC; StatementText : Wide_String; MaxLength : SQLINTEGER := 1024) return Wide_String; -- This version raises an exception when an ODBC error occured -- | ---------------------------------------------------------------------- -- | procedure SQLDrivers (EnvironmentHandle : in SQLHENV; Direction : in SIMPLE_FETCH_DIRECTION; DriverDescription : out String; DriverAttributes : out String); -- This version raises an exception when an ODBC error occured procedure SQLDrivers (EnvironmentHandle : in SQLHENV; Direction : in SIMPLE_FETCH_DIRECTION; DriverDescription : out String; DriverAttributes : out String; RC : out SQLRETURN); procedure SQLDrivers (EnvironmentHandle : in SQLHENV; Direction : in SIMPLE_FETCH_DIRECTION; DriverDescription : out Wide_String; DriverAttributes : out Wide_String); -- This version raises an exception when an ODBC error occured procedure SQLDrivers (EnvironmentHandle : in SQLHENV; Direction : in SIMPLE_FETCH_DIRECTION; DriverDescription : out Wide_String; DriverAttributes : out Wide_String; RC : out SQLRETURN); -- | ---------------------------------------------------------------------- -- | type POSITIONAL_OPERATION is (SQL_POSITION, SQL_REFRESH, SQL_UPDATE, SQL_DELETE, SQL_ADD, SQL_UPDATE_BY_BOOKMARK, SQL_DELETE_BY_BOOKMARK, SQL_FETCH_BY_BOOKMARK); for POSITIONAL_OPERATION use (SQL_POSITION => 0, SQL_REFRESH => 1, SQL_UPDATE => 2, SQL_DELETE => 3, SQL_ADD => 4, SQL_UPDATE_BY_BOOKMARK => 5, SQL_DELETE_BY_BOOKMARK => 6, SQL_FETCH_BY_BOOKMARK => 7); for POSITIONAL_OPERATION'Size use SQLUSMALLINT'Size; type BULK_OPERATION is new POSITIONAL_OPERATION range SQL_ADD .. POSITIONAL_OPERATION'Last; function SQLBulkOperations (StatementHandle : SQLHSTMT; Operation : BULK_OPERATION) return SQLRETURN; procedure SQLBulkOperations (StatementHandle : SQLHSTMT; Operation : BULK_OPERATION); pragma Inline (SQLBulkOperations); -- | ---------------------------------------------------------------------- -- | function SQLMoreResults (StatementHandle : SQLHSTMT) return SQLRETURN; pragma Inline (SQLMoreResults); -- | ---------------------------------------------------------------------- -- | type POSITION_OPERATION is new POSITIONAL_OPERATION range POSITIONAL_OPERATION'First .. SQL_ADD; type POSITION_LOCKTYPE is (SQL_LOCK_NO_CHANGE, SQL_LOCK_EXCLUSIVE, SQL_LOCK_UNLOCK); for POSITION_LOCKTYPE use (SQL_LOCK_NO_CHANGE => 0, SQL_LOCK_EXCLUSIVE => 1, SQL_LOCK_UNLOCK => 2); for POSITION_LOCKTYPE'Size use SQLUSMALLINT'Size; function SQLSetPos (StatementHandle : in SQLHSTMT; RowNumber : in SQLUSMALLINT; Operation : in POSITION_OPERATION; LockType : in POSITION_LOCKTYPE) return SQLRETURN; procedure SQLSetPos (StatementHandle : in SQLHSTMT; RowNumber : in SQLUSMALLINT; Operation : in POSITION_OPERATION; LockType : in POSITION_LOCKTYPE); pragma Inline (SQLSetPos); -- | ---------------------------------------------------------------------- -- | type DRIVER_COMPLETION is (SQL_DRIVER_NOPROMPT, SQL_DRIVER_COMPLETE, SQL_DRIVER_PROMPT, SQL_DRIVER_COMPLETE_REQUIRED); for DRIVER_COMPLETION'Size use SQLUSMALLINT'Size; procedure SQLBrowseConnect (ConnectionHandle : in SQLHDBC; InConnectionString : in String; OutConnectionString : out String; OutConnectionStrLen : out SQLSMALLINT; RC : out SQLRETURN); procedure SQLBrowseConnect (ConnectionHandle : in SQLHDBC; InConnectionString : in String; OutConnectionString : out String; OutConnectionStrLen : out SQLSMALLINT); procedure SQLBrowseConnect (ConnectionHandle : in SQLHDBC; InConnectionString : in Wide_String; OutConnectionString : out Wide_String; OutConnectionStrLen : out SQLSMALLINT; RC : out SQLRETURN); procedure SQLBrowseConnect (ConnectionHandle : in SQLHDBC; InConnectionString : in Wide_String; OutConnectionString : out Wide_String; OutConnectionStrLen : out SQLSMALLINT); -- | ---------------------------------------------------------------------- -- | procedure SQLDriverConnect (ConnectionHandle : in SQLHDBC; WindowHandle : in SQLHWND := SQL_NULL_HWND; Completion : in DRIVER_COMPLETION := SQL_DRIVER_NOPROMPT; InConnectionString : in String; OutConnectionString : out String; OutConnectionStrLen : out SQLSMALLINT; RC : out SQLRETURN); procedure SQLDriverConnect (ConnectionHandle : in SQLHDBC; WindowHandle : in SQLHWND := SQL_NULL_HWND; Completion : in DRIVER_COMPLETION := SQL_DRIVER_NOPROMPT; InConnectionString : in String; OutConnectionString : out String; OutConnectionStrLen : out SQLSMALLINT); procedure SQLDriverConnect (ConnectionHandle : in SQLHDBC; WindowHandle : in SQLHWND := SQL_NULL_HWND; Completion : in DRIVER_COMPLETION := SQL_DRIVER_NOPROMPT; InConnectionString : in Wide_String; OutConnectionString : out Wide_String; OutConnectionStrLen : out SQLSMALLINT; RC : out SQLRETURN); procedure SQLDriverConnect (ConnectionHandle : in SQLHDBC; WindowHandle : in SQLHWND := SQL_NULL_HWND; Completion : in DRIVER_COMPLETION := SQL_DRIVER_NOPROMPT; InConnectionString : in Wide_String; OutConnectionString : out Wide_String; OutConnectionStrLen : out SQLSMALLINT); -- | ---------------------------------------------------------------------- -- | -- whether an attribute is a pointer or not SQL_IS_POINTER : constant := -4; SQL_IS_UINTEGER : constant := -5; SQL_IS_INTEGER : constant := -6; SQL_IS_USMALLINT : constant := -7; SQL_IS_SMALLINT : constant := -8; function SQL_LEN_DATA_AT_EXEC (Length : SQLINTEGER) return SQLINTEGER; pragma Inline (SQL_LEN_DATA_AT_EXEC); function SQL_LEN_BINARY_ATTR (Length : SQLINTEGER) return SQLINTEGER; pragma Inline (SQL_LEN_BINARY_ATTR); -- | ---------------------------------------------------------------------- -- | function Null_Handle return SQLHANDLE; pragma Inline (Null_Handle); function SQL_Error_Message (HandleType : SQL_HANDLE_TYPE; Handle : SQLHSTMT; State : access SQLSTATE) return String; -- Ada95 Helper Routine -- Return the formatted error message and fill the SQLSTATE -- | ---------------------------------------------------------------------- -- | procedure SQLFixNTS (Column : in out String; R_Index : SQLINTEGER := SQLINTEGER'Last; Pad : Character := ' '); -- Ada95 Helper Routine -- Unfortunately almost all ODBC implementation do not support to set -- the environment attribute SQL_OUTPUT_NTS to false; they simply assume -- C Strings are the only form of string passed to ODBC. So we offer this -- helper that replaces potentially added ASCII.NULs by spaces. -- In addtion to the Column to fix you can optionally pass the rightmost -- position in the string where to start replacing NULs by spaces; -- the default is to start at the rightmost position of the string. -- You may also specify another padding character than a space. procedure SQLFixNTS (Column : in out Wide_String; R_Index : SQLINTEGER := SQLINTEGER'Last; Pad : Wide_Character := Wide_Character'(' ')); pragma Inline (SQLFixNTS); -- | ---------------------------------------------------------------------- -- | procedure Unicode_Attributes (Flag : in Boolean := True); -- Set whether or not we should use Unicode for attributes that return -- string values. SQL_MAX_OPTION_STRING_LENGTH : constant := 256; type ASYNC_ENABLE is (SQL_ASYNC_ENABLE_OFF, SQL_ASYNC_ENABLE_ON); -- | -- | values for SQL_ATTR_ASYNC_ENABLE -- | for ASYNC_ENABLE'Size use SQLINTEGER'Size; SQL_ASYNC_ENABLE_DEFAULT : constant ASYNC_ENABLE := SQL_ASYNC_ENABLE_OFF; private -- Flag whether or not we use Unicode for attributes that return string -- values. Unicode_Attr_Flag : Boolean := False; type SQLPOINTER is new System.Storage_Elements.Integer_Address; -- Field width for labels in debug output Debug_Label_Width : constant := 40; type SQLHANDLE is new System.Storage_Elements.Integer_Address; SQL_NULL_HANDLE : constant SQLHANDLE := 0; SQL_NULL_HENV : constant SQLHENV := 0; SQL_NULL_HDBC : constant SQLHDBC := 0; SQL_NULL_HSTMT : constant SQLHSTMT := 0; SQL_NULL_HDESC : constant SQLHDESC := 0; SQL_NULL_HWND : constant SQLHWND := 0; SQL_MAX_MESSAGE_SIZE : constant := 256; SQL_LEN_DATA_AT_EXEC_OFFSET : constant := -100; SQL_LEN_BINARY_ATTR_OFFSET : constant := -100; SQL_ADA95_BINDING_ERROR : constant SQLRETURN := SQLRETURN'First; SQL_ADA95_DATA_ERROR : constant SQLRETURN := SQL_ADA95_BINDING_ERROR + 1; SQL_ADA95_INVALID_ENUM : constant SQLRETURN := SQL_ADA95_BINDING_ERROR + 2; SQL_ADA95_TYPE_ERROR : constant SQLRETURN := SQL_ADA95_BINDING_ERROR + 3; SQL_ADA95_NO_UNICODE : constant SQLRETURN := SQL_ADA95_BINDING_ERROR + 4; procedure Raise_SQL_Error (ProcedureName : in String; ErrorMessage : in String := ""; RC : in SQLRETURN := SQL_ADA95_BINDING_ERROR; State : in SQLSTATE := EMPTY_SQLSTATE); pragma No_Return (Raise_SQL_Error); procedure Check_SQL_Error (RC : in SQLRETURN; ProcedureName : in String; ErrorMessage : in String := ""; HandleType : in SQL_HANDLE_TYPE := SQL_HANDLE_STMT; Handle : in SQLHANDLE := SQL_NULL_HANDLE); function Is_SQL_Ok (ErrorCode : SQLRETURN) return Boolean; pragma Inline (Is_SQL_Ok); procedure Raise_Invalid_Enum (ProcedureName : in String; EnumName : in String; EnumValue : in String); pragma No_Return (Raise_Invalid_Enum); Attr_Not_Supported_Msg : constant String := " is not supported by Ada95 binding."; subtype C_SQLSTATE is Interfaces.C.char_array (1 .. SQL_SQLSTATE_SIZE); function To_Ada (State : C_SQLSTATE) return SQLSTATE; -- Convert the C character array State into an fixed length Ada String -- pragma Inline_Always (To_Ada); subtype C_WSQLSTATE is WIDE_SQLSTATE; function Length_Indicator (Size : Natural) return Integer; pragma Inline_Always (Length_Indicator); type Attr_Init is access procedure; procedure Register_Initializer (Ini : in Attr_Init); end GNU.DB.SQLCLI; gnade-1.6.2.orig/dbi/odbc/Makefile0000644000175000017500000001054310670455113016507 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/dbi/odbc/Makefile,v $ -- ## Description : Makefile for the ODBC binding -- ## Author : Michael Erdmann -- ## Created On : 23-Feb-2004 -- ## Last Modified By: $Author: persan $ -- ## Last Modified On: $Date: 2007/09/08 08:16:11 $ -- ## Status : $State: Exp $ -- ## -- ## Copyright (C) 2000-2004 -- ## -- ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## This makefile builds the thin ODBC binding headers and libraries and ## copies them into the proper include resp. lib directory. We build a ## static as well as a shared version of the binding library. ## ## Restrictions ## ============ ## ## References ## ========== ## include ../../make.conf libname=libgnadeodbc PREPFLAGS=-DCALLCONVENTION=Stdcall \ -DLINKOPT="\"$(ODBCLINKEROPT)\""\ ## ## -DUNICODE=True libdir=${prefix}/lib/GNADE/odbc includedir=${prefix}/include/GNADE/odbc buildlibdir=lib-obj/lib DIRS=${includedir} $(libdir) ${buildlibdir} PREPROCESSED_SOURCES = \ gnu-db-sqlcli-connection_attribute.adb \ gnu-db-sqlcli-desc.adb \ gnu-db-sqlcli-diag.adb \ gnu-db-sqlcli-environment_attribute.adb \ gnu-db-sqlcli-generic_attr-bitmap_attribute.adb \ gnu-db-sqlcli-info.adb \ gnu-db-sqlcli-statement_attribute.adb \ gnu-db-sqlcli.adb %.adb::%.gpb ../../make.conf # ignore gnatprep -u -r $(<) $(@) $(PREPFLAGS) prep:$(PREPROCESSED_SOURCES) ## ## Make all targets ## all:: prep ${buildlibdir} $(ADAMAKE) -p -Pgnade-odbc.gpr #ifneq ($(EXPORT),) # $(MAKE) install #endif ## ## ## ${DIRS}: ${MKDIR} -p ${@} install ::${includedir} $(libdir) ${CP} $(wildcard gnu-db-sql*.ad*) ${includedir} ${CP} $(wildcard lib-obj/lib/*) $(libdir) ## ## ## distclean clean :: rm -rf lib-obj $(RM) $(PREPROCESSED_SOURCES) $(RM) *.o *.ali core b~*.ad* *~ gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli.gpb0000644000175000017500000051141410663647575020226 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2002 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with System.Address_To_Access_Conversions; with Ada.Unchecked_Conversion; with Ada.Strings.Fixed; with Ada.Strings.Wide_Fixed; with Interfaces.C; use Interfaces.C; package body GNU.DB.SQLCLI is pragma Linker_Options ($LINKOPT); package P_SQLTCHAR is new System.Address_To_Access_Conversions (SQLTCHAR); package P_SQLCHAR is new System.Address_To_Access_Conversions (SQLCHAR); package P_SQLUI is new System.Address_To_Access_Conversions (SQLUINTEGER); package P_SQLI is new System.Address_To_Access_Conversions (SQLINTEGER); package P_SQLUSI is new System.Address_To_Access_Conversions (SQLUSMALLINT); package P_SQLSI is new System.Address_To_Access_Conversions (SQLSMALLINT); function To_Address (P : SQLPOINTER) return System.Address is begin return System.Storage_Elements.To_Address (System.Storage_Elements.Integer_Address (P)); end To_Address; function To_SQLPOINTER (S : System.Address) return SQLPOINTER is begin return To_Integer (S); end To_SQLPOINTER; function To_SQLPOINTER (S : PTR_SQLCHAR) return SQLPOINTER is use P_SQLCHAR; begin return To_Integer (To_Address (Object_Pointer (S))); end To_SQLPOINTER; function To_SQLPOINTER (S : PTR_SQLTCHAR) return SQLPOINTER is use P_SQLTCHAR; begin return To_Integer (To_Address (Object_Pointer (S))); end To_SQLPOINTER; function To_SQLPOINTER (S : PTR_SQLUINTEGER) return SQLPOINTER is use P_SQLUI; begin return To_Integer (To_Address (Object_Pointer (S))); end To_SQLPOINTER; function To_SQLPOINTER (S : PTR_SQLINTEGER) return SQLPOINTER is use P_SQLI; begin return To_Integer (To_Address (Object_Pointer (S))); end To_SQLPOINTER; function To_SQLPOINTER (S : PTR_SQLUSMALLINT) return SQLPOINTER is use P_SQLUSI; begin return To_Integer (To_Address (Object_Pointer (S))); end To_SQLPOINTER; function To_SQLPOINTER (S : PTR_SQLSMALLINT) return SQLPOINTER is use P_SQLSI; begin return To_Integer (To_Address (Object_Pointer (S))); end To_SQLPOINTER; function To_PTR_SQLCHAR (S : System.Address) return PTR_SQLCHAR is begin return PTR_SQLCHAR (P_SQLCHAR.To_Pointer (S)); end To_PTR_SQLCHAR; function To_PTR_SQLTCHAR (S : System.Address) return PTR_SQLTCHAR is begin return PTR_SQLTCHAR (P_SQLTCHAR.To_Pointer (S)); end To_PTR_SQLTCHAR; function To_PTR_SQLCHAR (S : access String) return PTR_SQLCHAR is begin return To_PTR_SQLCHAR (S.all'Address); end To_PTR_SQLCHAR; function To_PTR_SQLTCHAR (S : access Wide_String) return PTR_SQLTCHAR is begin return To_PTR_SQLTCHAR (S.all'Address); end To_PTR_SQLTCHAR; function To_SQLPOINTER (S : access String) return SQLPOINTER is use P_SQLCHAR; begin return To_Integer (To_Address (Object_Pointer (To_PTR_SQLCHAR (S)))); end To_SQLPOINTER; function To_SQLPOINTER (S : access Wide_String) return SQLPOINTER is use P_SQLTCHAR; begin return To_Integer (To_Address (Object_Pointer (To_PTR_SQLTCHAR (S)))); end To_SQLPOINTER; function Null_Handle return SQLHANDLE is begin return SQL_NULL_HANDLE; end Null_Handle; function To_Ada (State : C_SQLSTATE) return SQLSTATE is use Ada.Strings.Fixed; S : constant String := Interfaces.C.To_Ada (State, False); R : SQLSTATE; begin Move (Source => S, Target => R); SQLFixNTS (R); return R; end To_Ada; function Length_Indicator (Size : Natural) return Integer is begin if Size = SQLINTEGER'Size then return Integer (SQL_IS_INTEGER); elsif Size = SQLSMALLINT'Size then return Integer (SQL_IS_SMALLINT); else return 0; end if; end Length_Indicator; function SQL_Error_Message (HandleType : SQL_HANDLE_TYPE; Handle : SQLHSTMT; State : access SQLSTATE) return String is use Ada.Strings.Fixed; function GetDiagField (HandleType : SQL_HANDLE_TYPE; Handle : SQLHANDLE; RecNumber : SQLSMALLINT; DiagIdentifier : SQLSMALLINT; DiagInfo : SQLPOINTER; BufferLength : SQLSMALLINT; pStringLength : access SQLSMALLINT) return SQLRETURN; pragma Import ($CALLCONVENTION, GetDiagField, "SQLGetDiagField"); function GetDiagRec (HandleType : SQL_HANDLE_TYPE; Handle : SQLHANDLE; RecNumber : SQLSMALLINT; pSqlstate : access C_SQLSTATE; pNativeError : access SQLINTEGER; pMessageText : PTR_SQLCHAR; BufferLength : SQLSMALLINT; pTextLength : access SQLSMALLINT) return SQLRETURN; pragma Import ($CALLCONVENTION, GetDiagRec, "SQLGetDiagRec"); V_SQL_DIAG_SERVER_NAME : constant := 11; RNr : constant SQLSMALLINT := 1; Err_Native : aliased SQLINTEGER; Len : aliased SQLSMALLINT := SQL_MAX_MESSAGE_SIZE; D_Len : aliased SQLSMALLINT := SQL_MAX_MESSAGE_SIZE; Msg : String (1 .. SQL_MAX_MESSAGE_SIZE) := SQL_MAX_MESSAGE_SIZE * ' '; DiagMsg : String (1 .. SQL_MAX_MESSAGE_SIZE) := Msg; C_State : aliased C_SQLSTATE; RC : SQLRETURN; begin -- bug: #437590, MySQL 3.23, MS ODBC Driver Manager 3.510 -- if the GetDiagRec failes the State field is filled with -- junk, which causes SQL Error conditions to be triggered. -- In order to by pass this bug in the MySQL/Windows/DM -- configuration we reset the state field to empty = success class. -- RC := GetDiagRec (HandleType, Handle, RNr, C_State'Access, Err_Native'Access, To_PTR_SQLCHAR (Msg'Address), Len, Len'Access); if not Is_SQL_Ok (RC) then State.all := EMPTY_SQLSTATE; Len := 0; else State.all := GNU.DB.SQLCLI.To_Ada (C_State); if Len > SQL_MAX_MESSAGE_SIZE then Len := SQL_MAX_MESSAGE_SIZE; end if; end if; RC := GetDiagField (HandleType, Handle, RNr, V_SQL_DIAG_SERVER_NAME, To_SQLPOINTER (DiagMsg'Address), D_Len, D_Len'Access); if not Is_SQL_Ok (RC) then D_Len := 0; end if; return "[Server=" & DiagMsg (1 .. Integer (D_Len)) & "][State=" & State.all & "]" & Msg (1 .. Integer (Len)); end SQL_Error_Message; procedure Raise_SQL_Error (ProcedureName : in String; ErrorMessage : in String := ""; RC : in SQLRETURN := SQL_ADA95_BINDING_ERROR; State : in SQLSTATE := EMPTY_SQLSTATE) is separate; function Is_SQL_Ok (ErrorCode : SQLRETURN) return Boolean is begin if ErrorCode = SQL_SUCCESS or else ErrorCode = SQL_SUCCESS_WITH_INFO then return True; else return False; end if; end Is_SQL_Ok; procedure Check_SQL_Error (RC : in SQLRETURN; ProcedureName : in String; ErrorMessage : in String := ""; HandleType : in SQL_HANDLE_TYPE := SQL_HANDLE_STMT; Handle : in SQLHANDLE := SQL_NULL_HANDLE) is begin if not Is_SQL_Ok (RC) then if RC = SQL_ERROR then declare State : aliased SQLSTATE; Msg : constant String := ErrorMessage & SQL_Error_Message (HandleType, Handle, State'Access); begin Raise_SQL_Error (ProcedureName, Msg, RC, State); end; else Raise_SQL_Error (ProcedureName, ErrorMessage, RC); end if; end if; end Check_SQL_Error; function SQLAllocHandle (HandleType : in SQL_HANDLE_TYPE; InputHandle : in SQLHANDLE; OutputHandle : access SQLHANDLE) return SQLRETURN is function AllocHandle (HandleType : SQL_HANDLE_TYPE; InputHandle : SQLHANDLE; pOutputHandle : access SQLHANDLE) return SQLRETURN; pragma Import ($CALLCONVENTION, AllocHandle, "SQLAllocHandle"); begin return AllocHandle (HandleType, InputHandle, OutputHandle); end SQLAllocHandle; procedure SQLAllocHandle (HandleType : in SQL_HANDLE_TYPE; InputHandle : in SQLHANDLE; OutputHandle : out SQLHANDLE) is H_Out : aliased SQLHANDLE := SQL_NULL_HANDLE; RC : constant SQLRETURN := SQLAllocHandle (HandleType, InputHandle, H_Out'Access); Error_Handle_Type : SQL_HANDLE_TYPE; begin if HandleType /= SQL_HANDLE_TYPE'First then Error_Handle_Type := SQL_HANDLE_TYPE'Pred (HandleType); else Error_Handle_Type := SQL_HANDLE_TYPE'First; end if; Check_SQL_Error (RC => RC, ProcedureName => "SQLAllocHandle", HandleType => Error_Handle_Type, Handle => InputHandle); OutputHandle := H_Out; end SQLAllocHandle; function SQLFreeHandle (HandleType : SQL_HANDLE_TYPE; Handle : SQLHANDLE) return SQLRETURN is function FreeHandle (HandleType : SQL_HANDLE_TYPE; Handle : SQLHANDLE) return SQLRETURN; pragma Import ($CALLCONVENTION, FreeHandle, "SQLFreeHandle"); begin return FreeHandle (HandleType, Handle); end SQLFreeHandle; procedure SQLFreeHandle (HandleType : in SQL_HANDLE_TYPE; Handle : in out SQLHANDLE) is RC : constant SQLRETURN := SQLFreeHandle (HandleType, Handle); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLFreeHandle", HandleType => HandleType, Handle => Handle); Handle := SQL_NULL_HANDLE; end SQLFreeHandle; function SQLFreeStmt (StatementHandle : SQLHSTMT; Option : FreeStmt_Option) return SQLRETURN is function FreeStmt (StatementHandle : SQLHSTMT; Option : FreeStmt_Option) return SQLRETURN; pragma Import ($CALLCONVENTION, FreeStmt, "SQLFreeStmt"); begin return FreeStmt (StatementHandle, Option); end SQLFreeStmt; procedure SQLFreeStmt (StatementHandle : in out SQLHSTMT; Option : in FreeStmt_Option := SQL_CLOSE) is RC : constant SQLRETURN := SQLFreeStmt (StatementHandle, Option); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLFreeStmt", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); if Option = SQL_DROP then StatementHandle := SQL_NULL_HSTMT; end if; end SQLFreeStmt; function SQLConnect (ConnectionHandle : in SQLHDBC; ServerName : in String; UserName : in String; Authentication : in String) return SQLRETURN is function Connect (ConnectionHandle : SQLHDBC; pServerName : PTR_SQLCHAR; NameLength1 : SQLSMALLINT; pUserName : PTR_SQLCHAR; NameLength2 : SQLSMALLINT; pAuthentication : PTR_SQLCHAR; NameLength3 : SQLSMALLINT) return SQLRETURN; pragma Import ($CALLCONVENTION, Connect, "SQLConnect"); begin return Connect (ConnectionHandle, To_PTR_SQLCHAR (ServerName'Address), SQLSMALLINT (ServerName'Length), To_PTR_SQLCHAR (UserName'Address), SQLSMALLINT (UserName'Length), To_PTR_SQLCHAR (Authentication'Address), SQLSMALLINT (Authentication'Length)); end SQLConnect; procedure SQLConnect (ConnectionHandle : in SQLHDBC; ServerName : in String; UserName : in String; Authentication : in String) is RC : constant SQLRETURN := SQLConnect (ConnectionHandle, ServerName, UserName, Authentication); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLConnect", HandleType => SQL_HANDLE_DBC, Handle => ConnectionHandle); end SQLConnect; function SQLConnect (ConnectionHandle : in SQLHDBC; ServerName : in Wide_String; UserName : in Wide_String; Authentication : in Wide_String) return SQLRETURN is #if UNICODE then function Connect (ConnectionHandle : SQLHDBC; pServerName : PTR_SQLTCHAR; NameLength1 : SQLSMALLINT; pUserName : PTR_SQLTCHAR; NameLength2 : SQLSMALLINT; pAuthentication : PTR_SQLTCHAR; NameLength3 : SQLSMALLINT) return SQLRETURN; pragma Import ($CALLCONVENTION, Connect, "SQLConnectW"); #else pragma Unreferenced (ConnectionHandle, ServerName, UserName, Authentication); #end if; begin #if UNICODE then return Connect (ConnectionHandle, To_PTR_SQLTCHAR (ServerName'Address), SQLSMALLINT (ServerName'Length), To_PTR_SQLTCHAR (UserName'Address), SQLSMALLINT (UserName'Length), To_PTR_SQLTCHAR (Authentication'Address), SQLSMALLINT (Authentication'Length)); #else return SQL_ADA95_NO_UNICODE; #end if; end SQLConnect; procedure SQLConnect (ConnectionHandle : in SQLHDBC; ServerName : in Wide_String; UserName : in Wide_String; Authentication : in Wide_String) is RC : constant SQLRETURN := SQLConnect (ConnectionHandle, ServerName, UserName, Authentication); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLConnect", HandleType => SQL_HANDLE_DBC, Handle => ConnectionHandle); end SQLConnect; function SQLDisconnect (ConnectionHandle : SQLHDBC) return SQLRETURN is function Disconnect (ConnectionHandle : SQLHDBC) return SQLRETURN; pragma Import ($CALLCONVENTION, Disconnect, "SQLDisconnect"); begin return Disconnect (ConnectionHandle); end SQLDisconnect; procedure SQLDisconnect (ConnectionHandle : in SQLHDBC) is RC : constant SQLRETURN := SQLDisconnect (ConnectionHandle); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLDisconnect", HandleType => SQL_HANDLE_DBC, Handle => ConnectionHandle); end SQLDisconnect; function SQLGetTypeInfo (StatementHandle : SQLHSTMT; DataType : SQL_DATA_TYPE) return SQLRETURN is function GetTypeInfo (StatementHandle : SQLHSTMT; DataType : SQL_DATA_TYPE) return SQLRETURN; pragma Import ($CALLCONVENTION, GetTypeInfo, "SQLGetTypeInfo"); #if UNICODE then function GetTypeInfoW (StatementHandle : SQLHSTMT; DataType : SQL_DATA_TYPE) return SQLRETURN; pragma Import ($CALLCONVENTION, GetTypeInfoW, "SQLGetTypeInfoW"); #end if; begin if Unicode_Attr_Flag then #if UNICODE then return GetTypeInfoW (StatementHandle, DataType); #else return SQL_ADA95_NO_UNICODE; #end if; else return GetTypeInfo (StatementHandle, DataType); end if; end SQLGetTypeInfo; procedure SQLGetTypeInfo (StatementHandle : in SQLHSTMT; DataType : in SQL_DATA_TYPE) is RC : constant SQLRETURN := SQLGetTypeInfo (StatementHandle, DataType); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLGetTypeInfo", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); end SQLGetTypeInfo; procedure SQLDataSources (EnvironmentHandle : in SQLHENV; Direction : in SQL_EXTENDED_FETCH_DIRECTION; ServerName : out String; Description : out String; ErrorCode : out SQLRETURN) is use Ada.Strings; use Ada.Strings.Fixed; function DataSources (EnvironmentHandle : SQLHENV; Direction : SQL_EXTENDED_FETCH_DIRECTION; pServerName : PTR_SQLCHAR; BufferLength1 : SQLSMALLINT; pNameLength1 : access SQLSMALLINT; pDescription : PTR_SQLCHAR; BufferLength2 : SQLSMALLINT; pNameLength2 : access SQLSMALLINT) return SQLRETURN; pragma Import ($CALLCONVENTION, DataSources, "SQLDataSources"); pragma Warnings (Off); Str1 : aliased String (1 .. (1 + SQL_MAX_DSN_LENGTH)); Str2 : aliased String (1 .. 256); pragma Warnings (On); Len1 : aliased SQLSMALLINT := SQLSMALLINT (ServerName'Length); Len2 : aliased SQLSMALLINT := SQLSMALLINT (Str2'Length); RC : constant SQLRETURN := DataSources (EnvironmentHandle, Direction, To_PTR_SQLCHAR (Str1'Address), Len1, Len1'Access, To_PTR_SQLCHAR (Str2'Address), Len2, Len2'Access); begin ErrorCode := RC; if Is_SQL_Ok (RC) then Move (Source => Str1 (1 .. Integer (Len1)), Target => ServerName); Move (Source => Str2 (1 .. Integer (Len2)), Target => Description, Drop => Right); end if; end SQLDataSources; procedure SQLDataSources (EnvironmentHandle : in SQLHENV; Direction : in SQL_EXTENDED_FETCH_DIRECTION; ServerName : out String; Description : out String) is RC : SQLRETURN; begin SQLDataSources (EnvironmentHandle, Direction, ServerName, Description, RC); Check_SQL_Error (RC => RC, ProcedureName => "SQLDataSources", HandleType => SQL_HANDLE_ENV, Handle => EnvironmentHandle); end SQLDataSources; procedure SQLDataSources (EnvironmentHandle : in SQLHENV; Direction : in SQL_EXTENDED_FETCH_DIRECTION; ServerName : out Wide_String; Description : out Wide_String; ErrorCode : out SQLRETURN) is use Ada.Strings; use Ada.Strings.Wide_Fixed; #if UNICODE then function DataSources (EnvironmentHandle : SQLHENV; Direction : SQL_EXTENDED_FETCH_DIRECTION; pServerName : PTR_SQLTCHAR; BufferLength1 : SQLSMALLINT; pNameLength1 : access SQLSMALLINT; pDescription : PTR_SQLTCHAR; BufferLength2 : SQLSMALLINT; pNameLength2 : access SQLSMALLINT) return SQLRETURN; pragma Import ($CALLCONVENTION, DataSources, "SQLDataSourcesW"); pragma Warnings (Off); Str1 : aliased Wide_String (1 .. (1 + SQL_MAX_DSN_LENGTH)); Str2 : aliased Wide_String (1 .. 256); pragma Warnings (On); Len1 : aliased SQLSMALLINT := SQLSMALLINT (ServerName'Length); Len2 : aliased SQLSMALLINT := SQLSMALLINT (Str2'Length); RC : constant SQLRETURN := DataSources (EnvironmentHandle, Direction, To_PTR_SQLTCHAR (Str1'Address), Len1, Len1'Access, To_PTR_SQLTCHAR (Str2'Address), Len2, Len2'Access); #else pragma Unreferenced (EnvironmentHandle, Direction); #end if; begin #if UNICODE then ErrorCode := RC; if Is_SQL_Ok (RC) then Move (Source => Str1 (1 .. Integer (Len1)), Target => ServerName); Move (Source => Str2 (1 .. Integer (Len2)), Target => Description, Drop => Right); end if; #else ErrorCode := SQL_ADA95_NO_UNICODE; ServerName := ServerName'Length * Wide_Character'(' '); Description := Description'Length * Wide_Character'(' '); #end if; end SQLDataSources; procedure SQLDataSources (EnvironmentHandle : in SQLHENV; Direction : in SQL_EXTENDED_FETCH_DIRECTION; ServerName : out Wide_String; Description : out Wide_String) is RC : SQLRETURN; begin SQLDataSources (EnvironmentHandle, Direction, ServerName, Description, RC); Check_SQL_Error (RC => RC, ProcedureName => "SQLDataSources", HandleType => SQL_HANDLE_ENV, Handle => EnvironmentHandle); end SQLDataSources; procedure SQLDrivers (EnvironmentHandle : in SQLHENV; Direction : in SIMPLE_FETCH_DIRECTION; DriverDescription : out String; DriverAttributes : out String; RC : out SQLRETURN) is use Ada.Strings; use Ada.Strings.Fixed; function Drivers (EnvironmentHandle : SQLHENV; Direction : SIMPLE_FETCH_DIRECTION; pDesc : PTR_SQLCHAR; Len1 : SQLSMALLINT; pLen1 : access SQLSMALLINT; pAttr : PTR_SQLCHAR; Len2 : SQLSMALLINT; pLen2 : access SQLSMALLINT) return SQLRETURN; pragma Import ($CALLCONVENTION, Drivers, "SQLDrivers"); pragma Warnings (Off); Str1 : aliased String (1 .. 256); Str2 : aliased String (1 .. 256); pragma Warnings (On); Len1 : aliased SQLSMALLINT := SQLSMALLINT (DriverDescription'Length); Len2 : aliased SQLSMALLINT := SQLSMALLINT (DriverAttributes'Length); Err : constant SQLRETURN := Drivers (EnvironmentHandle, Direction, To_PTR_SQLCHAR (Str1'Address), Len1, Len1'Access, To_PTR_SQLCHAR (Str2'Address), Len2, Len2'Access); begin RC := Err; if Is_SQL_Ok (Err) then Move (Source => Str1 (1 .. Integer (Len1)), Target => DriverDescription); Move (Source => Str2 (1 .. Integer (Len2)), Target => DriverAttributes, Drop => Right); end if; end SQLDrivers; procedure SQLDrivers (EnvironmentHandle : in SQLHENV; Direction : in SIMPLE_FETCH_DIRECTION; DriverDescription : out String; DriverAttributes : out String) is RC : SQLRETURN; begin SQLDrivers (EnvironmentHandle, Direction, DriverDescription, DriverAttributes, RC); Check_SQL_Error (RC => RC, ProcedureName => "SQLDrivers", HandleType => SQL_HANDLE_ENV, Handle => EnvironmentHandle); end SQLDrivers; procedure SQLDrivers (EnvironmentHandle : in SQLHENV; Direction : in SIMPLE_FETCH_DIRECTION; DriverDescription : out Wide_String; DriverAttributes : out Wide_String; RC : out SQLRETURN) is use Ada.Strings; use Ada.Strings.Wide_Fixed; #if UNICODE function Drivers (EnvironmentHandle : SQLHENV; Direction : SIMPLE_FETCH_DIRECTION; pDesc : PTR_SQLTCHAR; Len1 : SQLSMALLINT; pLen1 : access SQLSMALLINT; pAttr : PTR_SQLTCHAR; Len2 : SQLSMALLINT; pLen2 : access SQLSMALLINT) return SQLRETURN; pragma Import ($CALLCONVENTION, Drivers, "SQLDriversW"); pragma Warnings (Off); Str1 : aliased Wide_String (1 .. 256); Str2 : aliased Wide_String (1 .. 256); pragma Warnings (On); Len1 : aliased SQLSMALLINT := 2*SQLSMALLINT (DriverDescription'Length); Len2 : aliased SQLSMALLINT := 2*SQLSMALLINT (DriverAttributes'Length); Err : constant SQLRETURN := Drivers (EnvironmentHandle, Direction, To_PTR_SQLTCHAR (Str1'Address), Len1, Len1'Access, To_PTR_SQLTCHAR (Str2'Address), Len2, Len2'Access); #else pragma Unreferenced (EnvironmentHandle, Direction); #end if; begin #if UNICODE then RC := Err; if Is_SQL_Ok (Err) then Move (Source => Str1 (1 .. Integer (Len1 / 2)), Target => DriverDescription); Move (Source => Str2 (1 .. Integer (Len2 / 2)), Target => DriverAttributes, Drop => Right); end if; #else RC := SQL_ADA95_NO_UNICODE; DriverDescription := DriverDescription'Length * Wide_Character'(' '); DriverAttributes := DriverAttributes'Length * Wide_Character'(' '); #end if; end SQLDrivers; procedure SQLDrivers (EnvironmentHandle : in SQLHENV; Direction : in SIMPLE_FETCH_DIRECTION; DriverDescription : out Wide_String; DriverAttributes : out Wide_String) is RC : SQLRETURN; begin SQLDrivers (EnvironmentHandle, Direction, DriverDescription, DriverAttributes, RC); Check_SQL_Error (RC => RC, ProcedureName => "SQLDrivers", HandleType => SQL_HANDLE_ENV, Handle => EnvironmentHandle); end SQLDrivers; function SQLBindCol (StatementHandle : SQLHSTMT; ColumnNumber : SQL_Column_Number; TargetType : SQL_C_DATA_TYPE; TargetValue : SQLPOINTER; BufferLength : SQLINTEGER; pStrLen_or_Ind : access SQLINTEGER) return SQLRETURN is function BindCol (StatementHandle : SQLHSTMT; ColumnNumber : SQL_Column_Number; TargetType : SQL_C_DATA_TYPE; TargetValue : SQLPOINTER; BufferLength : SQLINTEGER; pStrLen_or_Ind : access SQLINTEGER) return SQLRETURN; pragma Import ($CALLCONVENTION, BindCol, "SQLBindCol"); begin return BindCol (StatementHandle, ColumnNumber, TargetType, TargetValue, BufferLength, pStrLen_or_Ind); end SQLBindCol; procedure SQLBindCol (StatementHandle : in SQLHSTMT; ColumnNumber : in SQL_Column_Number; TargetType : in SQL_C_DATA_TYPE; TargetValuePtr : in SQLPOINTER; BufferLength : in SQLINTEGER; StrLen_Or_IndPtr : access SQLINTEGER) is RC : constant SQLRETURN := SQLBindCol (StatementHandle, ColumnNumber, TargetType, TargetValuePtr, BufferLength, StrLen_Or_IndPtr); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLBindCol", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); end SQLBindCol; function SQLBindCol (StatementHandle : SQLHSTMT; ColumnNumber : SQL_Column_Number; TargetValue : access String; StrLen_Or_IndPtr : access SQLINTEGER) return SQLRETURN is begin return SQLBindCol (StatementHandle, ColumnNumber, SQL_C_CHAR, To_SQLPOINTER (TargetValue), SQLINTEGER (TargetValue.all'Length), StrLen_Or_IndPtr); end SQLBindCol; procedure SQLBindCol (StatementHandle : in SQLHSTMT; ColumnNumber : in SQL_Column_Number; TargetValue : access String; StrLen_Or_IndPtr : access SQLINTEGER) is RC : constant SQLRETURN := SQLBindCol (StatementHandle, ColumnNumber, TargetValue, StrLen_Or_IndPtr); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLBindCol", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); end SQLBindCol; package body IntegerBinding is function SQLBindCol (StatementHandle : in SQLHSTMT; ColumnNumber : in SQL_Column_Number; TargetValue : access Int; IndPtr : access SQLINTEGER) return SQLRETURN is function BindCol (StatementHandle : SQLHSTMT; ColumnNumber : SQL_Column_Number; TargetType : SQL_C_DATA_TYPE; TargetValue : access Int; BufferLength : SQLINTEGER; pStrLen_or_Ind : access SQLINTEGER) return SQLRETURN; pragma Import ($CALLCONVENTION, BindCol, "SQLBindCol"); DT : SQL_C_DATA_TYPE; begin if Int'Size = SQLTINYINT'Size then DT := SQL_C_TINYINT; elsif Int'Size = SQLSMALLINT'Size then DT := SQL_C_SHORT; elsif Int'Size = SQLINTEGER'Size then DT := SQL_C_LONG; elsif Int'Size = SQLBIGINT'Size then DT := SQL_C_SBIGINT; else raise Constraint_Error; end if; return BindCol (StatementHandle, ColumnNumber, DT, TargetValue, SQLINTEGER (Int'Size / 8), IndPtr); end SQLBindCol; procedure SQLBindCol (StatementHandle : in SQLHSTMT; ColumnNumber : in SQL_Column_Number; TargetValue : access Int; IndPtr : access SQLINTEGER) is RC : constant SQLRETURN := SQLBindCol (StatementHandle, ColumnNumber, TargetValue, IndPtr); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLBindCol", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); end SQLBindCol; function SQLBindParameter (StatementHandle : in SQLHSTMT; ParameterNumber : in SQL_Parameter_Number; Value : access Int; Indicator : access SQLINTEGER; InputOutputType : in SQL_Parameter_Type := SQL_PARAM_INPUT) return SQLRETURN is C_DataType : SQL_C_DATA_TYPE; SQL_DataType : SQL_DATA_TYPE; ColumnSize : SQLUINTEGER; begin if Int'Size = SQLTINYINT'Size then C_DataType := SQL_C_TINYINT; SQL_DataType := SQL_TINYINT; ColumnSize := 3; elsif Int'Size = SQLSMALLINT'Size then C_DataType := SQL_C_SHORT; SQL_DataType := SQL_SMALLINT; ColumnSize := 5; elsif Int'Size = SQLINTEGER'Size then C_DataType := SQL_C_LONG; SQL_DataType := SQL_INTEGER; ColumnSize := 10; elsif Int'Size = SQLBIGINT'Size then C_DataType := SQL_C_SBIGINT; SQL_DataType := SQL_BIGINT; ColumnSize := 19; else raise Constraint_Error; end if; return SQLBindParameter (StatementHandle, ParameterNumber, InputOutputType, ValueType => C_DataType, ParameterType => SQL_DataType, ColumnSize => ColumnSize, DecimalDigits => 0, Value => To_SQLPOINTER (Value.all'Address), BufferLength => 0, StrLen_Or_IndPtr => Indicator); end SQLBindParameter; procedure SQLBindParameter (StatementHandle : in SQLHSTMT; ParameterNumber : in SQL_Parameter_Number; Value : access Int; Indicator : access SQLINTEGER; InputOutputType : in SQL_Parameter_Type := SQL_PARAM_INPUT) is RC : constant SQLRETURN := SQLBindParameter (StatementHandle, ParameterNumber, Value, Indicator, InputOutputType); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLBindParameter", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); end SQLBindParameter; end IntegerBinding; package body UnsignedBinding is function SQLBindCol (StatementHandle : in SQLHSTMT; ColumnNumber : in SQL_Column_Number; TargetValue : access Unsigned; IndPtr : access SQLINTEGER) return SQLRETURN is function BindCol (StatementHandle : SQLHSTMT; ColumnNumber : SQL_Column_Number; TargetType : SQL_C_DATA_TYPE; TargetValue : access Unsigned; BufferLength : SQLINTEGER; pStrLen_or_Ind : access SQLINTEGER) return SQLRETURN; pragma Import ($CALLCONVENTION, BindCol, "SQLBindCol"); DT : SQL_C_DATA_TYPE; begin if Unsigned'Size = SQLTINYINT'Size then DT := SQL_C_UTINYINT; elsif Unsigned'Size = SQLSMALLINT'Size then DT := SQL_C_USHORT; elsif Unsigned'Size = SQLINTEGER'Size then DT := SQL_C_ULONG; elsif Unsigned'Size = SQLBIGINT'Size then DT := SQL_C_UBIGINT; else raise Constraint_Error; end if; return BindCol (StatementHandle, ColumnNumber, DT, TargetValue, SQLINTEGER (Unsigned'Size / 8), IndPtr); end SQLBindCol; procedure SQLBindCol (StatementHandle : in SQLHSTMT; ColumnNumber : in SQL_Column_Number; TargetValue : access Unsigned; IndPtr : access SQLINTEGER) is RC : constant SQLRETURN := SQLBindCol (StatementHandle, ColumnNumber, TargetValue, IndPtr); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLBindCol", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); end SQLBindCol; function SQLBindParameter (StatementHandle : in SQLHSTMT; ParameterNumber : in SQL_Parameter_Number; Value : access Unsigned; Indicator : access SQLINTEGER; InputOutputType : in SQL_Parameter_Type := SQL_PARAM_INPUT) return SQLRETURN is C_DataType : SQL_C_DATA_TYPE; SQL_DataType : SQL_DATA_TYPE; ColumnSize : SQLUINTEGER; begin if Unsigned'Size = SQLTINYINT'Size then C_DataType := SQL_C_UTINYINT; SQL_DataType := SQL_TINYINT; ColumnSize := 3; elsif Unsigned'Size = SQLSMALLINT'Size then C_DataType := SQL_C_USHORT; SQL_DataType := SQL_SMALLINT; ColumnSize := 5; elsif Unsigned'Size = SQLINTEGER'Size then C_DataType := SQL_C_ULONG; SQL_DataType := SQL_INTEGER; ColumnSize := 10; elsif Unsigned'Size = SQLBIGINT'Size then C_DataType := SQL_C_UBIGINT; SQL_DataType := SQL_BIGINT; ColumnSize := 20; else raise Constraint_Error; end if; return SQLBindParameter (StatementHandle, ParameterNumber, InputOutputType, ValueType => C_DataType, ParameterType => SQL_DataType, ColumnSize => ColumnSize, DecimalDigits => 0, Value => To_SQLPOINTER (Value.all'Address), BufferLength => 0, StrLen_Or_IndPtr => Indicator); end SQLBindParameter; procedure SQLBindParameter (StatementHandle : in SQLHSTMT; ParameterNumber : in SQL_Parameter_Number; Value : access Unsigned; Indicator : access SQLINTEGER; InputOutputType : in SQL_Parameter_Type := SQL_PARAM_INPUT) is RC : constant SQLRETURN := SQLBindParameter (StatementHandle, ParameterNumber, Value, Indicator, InputOutputType); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLBindParameter", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); end SQLBindParameter; end UnsignedBinding; package body FloatBinding is function SQLBindCol (StatementHandle : in SQLHSTMT; ColumnNumber : in SQL_Column_Number; TargetValue : access Flt; IndPtr : access SQLINTEGER) return SQLRETURN is function BindCol (StatementHandle : SQLHSTMT; ColumnNumber : SQL_Column_Number; TargetType : SQL_C_DATA_TYPE; TargetValue : access Flt; BufferLength : SQLINTEGER; pStrLen_or_Ind : access SQLINTEGER) return SQLRETURN; pragma Import ($CALLCONVENTION, BindCol, "SQLBindCol"); DT : SQL_C_DATA_TYPE; begin if Flt'Size = SQLDOUBLE'Size then DT := SQL_C_DOUBLE; elsif Flt'Size = SQLREAL'Size then DT := SQL_C_FLOAT; else raise Constraint_Error; end if; return BindCol (StatementHandle, ColumnNumber, DT, TargetValue, SQLINTEGER (Flt'Size / 8), IndPtr); end SQLBindCol; procedure SQLBindCol (StatementHandle : in SQLHSTMT; ColumnNumber : in SQL_Column_Number; TargetValue : access Flt; IndPtr : access SQLINTEGER) is RC : constant SQLRETURN := SQLBindCol (StatementHandle, ColumnNumber, TargetValue, IndPtr); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLBindCol", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); end SQLBindCol; function SQLBindParameter (StatementHandle : in SQLHSTMT; ParameterNumber : in SQL_Parameter_Number; Value : access Flt; Indicator : access SQLINTEGER; InputOutputType : in SQL_Parameter_Type := SQL_PARAM_INPUT) return SQLRETURN is C_DataType : SQL_C_DATA_TYPE; SQL_DataType : SQL_DATA_TYPE; begin if Flt'Size = SQLDOUBLE'Size then C_DataType := SQL_C_DOUBLE; SQL_DataType := SQL_DOUBLE; elsif Flt'Size = SQLREAL'Size then C_DataType := SQL_C_FLOAT; SQL_DataType := SQL_FLOAT; else raise Constraint_Error; end if; return SQLBindParameter (StatementHandle, ParameterNumber, InputOutputType, ValueType => C_DataType, ParameterType => SQL_DataType, ColumnSize => 15, DecimalDigits => 0, Value => To_SQLPOINTER (Value.all'Address), BufferLength => 0, StrLen_Or_IndPtr => Indicator); end SQLBindParameter; procedure SQLBindParameter (StatementHandle : in SQLHSTMT; ParameterNumber : in SQL_Parameter_Number; Value : access Flt; Indicator : access SQLINTEGER; InputOutputType : in SQL_Parameter_Type := SQL_PARAM_INPUT) is RC : constant SQLRETURN := SQLBindParameter (StatementHandle, ParameterNumber, Value, Indicator, InputOutputType); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLBindParameter", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); end SQLBindParameter; end FloatBinding; package body EnumBinding is function SQLBindCol (StatementHandle : in SQLHSTMT; ColumnNumber : in SQL_Column_Number; TargetValue : access Enum; IndPtr : access SQLINTEGER) return SQLRETURN is function BindCol (StatementHandle : SQLHSTMT; ColumnNumber : SQL_Column_Number; TargetType : SQL_C_DATA_TYPE; TargetValue : access Enum; BufferLength : SQLINTEGER; pStrLen_or_Ind : access SQLINTEGER) return SQLRETURN; pragma Import ($CALLCONVENTION, BindCol, "SQLBindCol"); DT : SQL_C_DATA_TYPE; begin if Enum'Size = SQLTINYINT'Size then DT := SQL_C_TINYINT; elsif Enum'Size = SQLSMALLINT'Size then DT := SQL_C_SHORT; elsif Enum'Size = SQLINTEGER'Size then DT := SQL_C_LONG; elsif Enum'Size = SQLBIGINT'Size then DT := SQL_C_SBIGINT; else raise Constraint_Error; end if; return BindCol (StatementHandle, ColumnNumber, DT, TargetValue, SQLINTEGER (Enum'Size / 8), IndPtr); end SQLBindCol; procedure SQLBindCol (StatementHandle : in SQLHSTMT; ColumnNumber : in SQL_Column_Number; TargetValue : access Enum; IndPtr : access SQLINTEGER) is RC : constant SQLRETURN := SQLBindCol (StatementHandle, ColumnNumber, TargetValue, IndPtr); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLBindCol", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); end SQLBindCol; function SQLBindParameter (StatementHandle : in SQLHSTMT; ParameterNumber : in SQL_Parameter_Number; Value : access Enum; Indicator : access SQLINTEGER; InputOutputType : in SQL_Parameter_Type := SQL_PARAM_INPUT) return SQLRETURN is C_DataType : SQL_C_DATA_TYPE; SQL_DataType : SQL_DATA_TYPE; ColumnSize : SQLUINTEGER; begin if Enum'Size = SQLTINYINT'Size then C_DataType := SQL_C_UTINYINT; SQL_DataType := SQL_TINYINT; ColumnSize := 3; elsif Enum'Size = SQLSMALLINT'Size then C_DataType := SQL_C_USHORT; SQL_DataType := SQL_SMALLINT; ColumnSize := 5; elsif Enum'Size = SQLINTEGER'Size then C_DataType := SQL_C_ULONG; SQL_DataType := SQL_INTEGER; ColumnSize := 10; elsif Enum'Size = SQLBIGINT'Size then C_DataType := SQL_C_UBIGINT; SQL_DataType := SQL_BIGINT; ColumnSize := 20; else raise Constraint_Error; end if; return SQLBindParameter (StatementHandle, ParameterNumber, InputOutputType, ValueType => C_DataType, ParameterType => SQL_DataType, ColumnSize => ColumnSize, DecimalDigits => 0, Value => To_SQLPOINTER (Value.all'Address), BufferLength => 0, StrLen_Or_IndPtr => Indicator); end SQLBindParameter; procedure SQLBindParameter (StatementHandle : in SQLHSTMT; ParameterNumber : in SQL_Parameter_Number; Value : access Enum; Indicator : access SQLINTEGER; InputOutputType : in SQL_Parameter_Type := SQL_PARAM_INPUT) is RC : constant SQLRETURN := SQLBindParameter (StatementHandle, ParameterNumber, Value, Indicator, InputOutputType); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLBindParameter", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); end SQLBindParameter; end EnumBinding; function SQLBindParameter (StatementHandle : in SQLHSTMT; ParameterNumber : in SQL_Parameter_Number; InputOutputType : in SQL_Parameter_Type; ValueType : in SQL_C_DATA_TYPE; ParameterType : in SQL_DATA_TYPE; ColumnSize : in SQLUINTEGER; DecimalDigits : in SQLSMALLINT; Value : in SQLPOINTER; BufferLength : in SQLINTEGER; StrLen_Or_IndPtr : access SQLINTEGER) return SQLRETURN is function BindParameter (StatementHandle : in SQLHSTMT; ParameterNumber : in SQL_Parameter_Number; InputOutputType : in SQL_Parameter_Type; ValueType : in SQL_C_DATA_TYPE; ParameterType : in SQL_DATA_TYPE; ColumnSize : in SQLUINTEGER; DecimalDigits : in SQLSMALLINT; Value : in SQLPOINTER; BufferLength : in SQLINTEGER; StrLen_Or_IndPtr : access SQLINTEGER) return SQLRETURN; pragma Import ($CALLCONVENTION, BindParameter, "SQLBindParameter"); begin return BindParameter (StatementHandle, ParameterNumber, InputOutputType, ValueType, ParameterType, ColumnSize, DecimalDigits, Value, BufferLength, StrLen_Or_IndPtr); end SQLBindParameter; procedure SQLBindParameter (StatementHandle : in SQLHSTMT; ParameterNumber : in SQL_Parameter_Number; InputOutputType : in SQL_Parameter_Type; ValueType : in SQL_C_DATA_TYPE; ParameterType : in SQL_DATA_TYPE; ColumnSize : in SQLUINTEGER; DecimalDigits : in SQLSMALLINT; Value : in SQLPOINTER; BufferLength : in SQLINTEGER; StrLen_Or_IndPtr : access SQLINTEGER) is RC : constant SQLRETURN := SQLBindParameter (StatementHandle, ParameterNumber, InputOutputType, ValueType, ParameterType, ColumnSize, DecimalDigits, Value, BufferLength, StrLen_Or_IndPtr); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLBindParameter", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); end SQLBindParameter; function SQLBindParameter (StatementHandle : in SQLHSTMT; ParameterNumber : in SQL_Parameter_Number; Value : access String; Length : access SQLINTEGER; InputOutputType : in SQL_Parameter_Type := SQL_PARAM_INPUT) return SQLRETURN is begin return SQLBindParameter (StatementHandle, ParameterNumber, InputOutputType, ValueType => SQL_C_CHAR, ParameterType => SQL_VARCHAR, ColumnSize => 0, DecimalDigits => 0, Value => To_SQLPOINTER (Value), BufferLength => Value.all'Length, StrLen_Or_IndPtr => Length); end SQLBindParameter; procedure SQLBindParameter (StatementHandle : in SQLHSTMT; ParameterNumber : in SQL_Parameter_Number; Value : access String; Length : access SQLINTEGER; InputOutputType : in SQL_Parameter_Type := SQL_PARAM_INPUT) is RC : constant SQLRETURN := SQLBindParameter (StatementHandle, ParameterNumber, Value, Length, InputOutputType); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLBindParameter", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); end SQLBindParameter; procedure SQLDescribeParam (StatementHandle : in SQLHSTMT; ParameterNumber : in SQL_Parameter_Number; ParameterType : out SQL_DATA_TYPE; ColumnSize : out SQLUINTEGER; DecimalDigits : out SQLSMALLINT; Nullable : out SQL_NULLABLE_INFO; RC : out SQLRETURN) is ProcName : constant String := "SQLDescribeParam"; function DescribeParam (StatementHandle : SQLHSTMT; ParameterNumber : SQL_Parameter_Number; ParameterType : access SQL_DATA_TYPE; ColumnSize : access SQLUINTEGER; DecimalDigits : access SQLSMALLINT; Nullable : access SQL_NULLABLE_INFO) return SQLRETURN; pragma Import ($CALLCONVENTION, DescribeParam, "SQLDescribeParam"); function SDT2Int is new Ada.Unchecked_Conversion (SQL_DATA_TYPE, SQLSMALLINT); function NU2Int is new Ada.Unchecked_Conversion (SQL_NULLABLE_INFO, SQLSMALLINT); DT : aliased SQL_DATA_TYPE; CS : aliased SQLUINTEGER; DD : aliased SQLSMALLINT; NU : aliased SQL_NULLABLE_INFO; EC : constant SQLRETURN := DescribeParam (StatementHandle, ParameterNumber, DT'Access, CS'Access, DD'Access, NU'Access); begin RC := EC; if Is_SQL_Ok (EC) then ColumnSize := CS; DecimalDigits := DD; if DT'Valid then ParameterType := DT; else Raise_Invalid_Enum (ProcName, "SQL_DATA_TYPE", SQLSMALLINT'Image (SDT2Int (DT))); end if; if NU'Valid then Nullable := NU; else Raise_Invalid_Enum (ProcName, "SQL_NULLABLE_INFO", SQLSMALLINT'Image (NU2Int (NU))); end if; end if; end SQLDescribeParam; procedure SQLDescribeParam (StatementHandle : in SQLHSTMT; ParameterNumber : in SQL_Parameter_Number; ParameterType : out SQL_DATA_TYPE; ColumnSize : out SQLUINTEGER; DecimalDigits : out SQLSMALLINT; Nullable : out SQL_NULLABLE_INFO) is RC : SQLRETURN; begin SQLDescribeParam (StatementHandle, ParameterNumber, ParameterType, ColumnSize, DecimalDigits, Nullable, RC); Check_SQL_Error (RC => RC, ProcedureName => "SQLDescribeParam", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); end SQLDescribeParam; function SQLCancel (StatementHandle : SQLHSTMT) return SQLRETURN is function Cancel (StatementHandle : SQLHSTMT) return SQLRETURN; pragma Import ($CALLCONVENTION, Cancel, "SQLCancel"); begin return Cancel (StatementHandle); end SQLCancel; procedure SQLCancel (StatementHandle : in SQLHSTMT) is RC : constant SQLRETURN := SQLCancel (StatementHandle); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLCancel", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); end SQLCancel; function SQLCloseCursor (StatementHandle : SQLHSTMT) return SQLRETURN is function CloseCursor (StatementHandle : SQLHSTMT) return SQLRETURN; pragma Import ($CALLCONVENTION, CloseCursor, "SQLCloseCursor"); begin return CloseCursor (StatementHandle); end SQLCloseCursor; procedure SQLCloseCursor (StatementHandle : in SQLHSTMT) is RC : constant SQLRETURN := SQLCloseCursor (StatementHandle); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLCloseCursor", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); end SQLCloseCursor; function SQLPrepare (StatementHandle : SQLHSTMT; StatementText : String) return SQLRETURN is function Prepare (StatementHandle : SQLHSTMT; StatementText : PTR_SQLCHAR; TextLength : SQLINTEGER) return SQLRETURN; pragma Import ($CALLCONVENTION, Prepare, "SQLPrepare"); begin return Prepare (StatementHandle, To_PTR_SQLCHAR (StatementText'Address), SQLINTEGER (StatementText'Length)); end SQLPrepare; procedure SQLPrepare (StatementHandle : SQLHSTMT; StatementText : String) is RC : constant SQLRETURN := SQLPrepare (StatementHandle, StatementText); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLPrepare", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); end SQLPrepare; function SQLPrepare (StatementHandle : SQLHSTMT; StatementText : Wide_String) return SQLRETURN is #if UNICODE then function Prepare (StatementHandle : SQLHSTMT; StatementText : PTR_SQLTCHAR; TextLength : SQLINTEGER) return SQLRETURN; pragma Import ($CALLCONVENTION, Prepare, "SQLPrepareW"); #else pragma Unreferenced (StatementHandle, StatementText); #end if; begin #if UNICODE then return Prepare (StatementHandle, To_PTR_SQLTCHAR (StatementText'Address), SQLINTEGER (StatementText'Length)); #else return SQL_ADA95_NO_UNICODE; #end if; end SQLPrepare; procedure SQLPrepare (StatementHandle : SQLHSTMT; StatementText : Wide_String) is RC : constant SQLRETURN := SQLPrepare (StatementHandle, StatementText); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLPrepare", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); end SQLPrepare; function SQLExecute (StatementHandle : SQLHSTMT) return SQLRETURN is function Execute (StatementHandle : SQLHSTMT) return SQLRETURN; pragma Import ($CALLCONVENTION, Execute, "SQLExecute"); begin return Execute (StatementHandle); end SQLExecute; procedure SQLExecute (StatementHandle : in SQLHSTMT) is RC : constant SQLRETURN := SQLExecute (StatementHandle); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLExecute", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); end SQLExecute; function SQLFetch (StatementHandle : SQLHSTMT) return SQLRETURN is function Fetch (StatementHandle : SQLHSTMT) return SQLRETURN; pragma Import ($CALLCONVENTION, Fetch, "SQLFetch"); begin return Fetch (StatementHandle); end SQLFetch; procedure SQLFetch (StatementHandle : in SQLHSTMT) is RC : constant SQLRETURN := SQLFetch (StatementHandle); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLFetch", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); end SQLFetch; function SQLFetchScroll (StatementHandle : SQLHSTMT; FetchDirection : FETCH_DIRECTION; FetchOffset : SQLINTEGER := 0) return SQLRETURN is function FetchScroll (StatementHandle : SQLHSTMT; FetchDirection : FETCH_DIRECTION; FetchOffset : SQLINTEGER) return SQLRETURN; pragma Import ($CALLCONVENTION, FetchScroll, "SQLFetchScroll"); begin return FetchScroll (StatementHandle, FetchDirection, FetchOffset); end SQLFetchScroll; procedure SQLFetchScroll (StatementHandle : in SQLHSTMT; FetchDirection : in FETCH_DIRECTION; FetchOffset : in SQLINTEGER := 0) is RC : constant SQLRETURN := SQLFetchScroll (StatementHandle, FetchDirection, FetchOffset); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLFetchScroll", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); end SQLFetchScroll; procedure SQLGetCursorName (StatementHandle : in SQLHSTMT; NameBuffer : out String; BufferLength : out SQLSMALLINT; ErrorCode : out SQLRETURN) is function GetCursorName (StatementHandle : SQLHSTMT; pCursorName : PTR_SQLCHAR; BufferLength : SQLSMALLINT; pNameLength : access SQLSMALLINT) return SQLRETURN; pragma Import ($CALLCONVENTION, GetCursorName, "SQLGetCursorName"); Len : aliased SQLSMALLINT := SQLSMALLINT (NameBuffer'Length); RC : constant SQLRETURN := GetCursorName (StatementHandle, To_PTR_SQLCHAR (NameBuffer'Address), Len, Len'Access); begin ErrorCode := RC; if Is_SQL_Ok (RC) then BufferLength := Len; for I in Natural (Len) .. (NameBuffer'Length - 1) loop NameBuffer (NameBuffer'First + I) := ' '; end loop; end if; end SQLGetCursorName; function SQLGetCursorName (StatementHandle : SQLHSTMT; MaxNameLength : SQLSMALLINT := 256) return String is pragma Assert (MaxNameLength > 0); Str : String (1 .. Positive (MaxNameLength)); RC : SQLRETURN; Len : SQLSMALLINT; begin SQLGetCursorName (StatementHandle, Str, Len, RC); Check_SQL_Error (RC => RC, ProcedureName => "SQLGetCursorName", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); if Len = 0 then return ""; else return Str (1 .. Positive (Len)); end if; end SQLGetCursorName; procedure SQLGetCursorName (StatementHandle : in SQLHSTMT; NameBuffer : out Wide_String; BufferLength : out SQLSMALLINT; ErrorCode : out SQLRETURN) is #if UNICODE then function GetCursorName (StatementHandle : SQLHSTMT; pCursorName : PTR_SQLTCHAR; BufferLength : SQLSMALLINT; pNameLength : access SQLSMALLINT) return SQLRETURN; pragma Import ($CALLCONVENTION, GetCursorName, "SQLGetCursorNameW"); Len : aliased SQLSMALLINT := SQLSMALLINT (NameBuffer'Length); RC : constant SQLRETURN := GetCursorName (StatementHandle, To_PTR_SQLTCHAR (NameBuffer'Address), Len, Len'Access); #else pragma Unreferenced (StatementHandle); #end if; begin #if UNICODE then ErrorCode := RC; if Is_SQL_Ok (RC) then BufferLength := Len; for I in Natural (Len) .. (NameBuffer'Length - 1) loop NameBuffer (NameBuffer'First + I) := Wide_Character'(' '); end loop; end if; #else ErrorCode := SQL_ADA95_NO_UNICODE; BufferLength := 0; for I in NameBuffer'Range loop NameBuffer (I) := Wide_Character'(' '); end loop; #end if; end SQLGetCursorName; function SQLGetCursorName (StatementHandle : SQLHSTMT; MaxNameLength : SQLSMALLINT := 256) return Wide_String is pragma Assert (MaxNameLength > 0); Str : Wide_String (1 .. Positive (MaxNameLength)); RC : SQLRETURN; Len : SQLSMALLINT; begin SQLGetCursorName (StatementHandle, Str, Len, RC); Check_SQL_Error (RC => RC, ProcedureName => "SQLGetCursorName", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); if Len = 0 then return Wide_String'(""); else return Str (1 .. Positive (Len)); end if; end SQLGetCursorName; function SQLSetCursorName (StatementHandle : SQLHSTMT; CursorName : String) return SQLRETURN is function SetCursorName (StatementHandle : SQLHSTMT; pCursorName : PTR_SQLCHAR; NameLength : SQLSMALLINT) return SQLRETURN; pragma Import ($CALLCONVENTION, SetCursorName, "SQLSetCursorName"); begin return SetCursorName (StatementHandle, To_PTR_SQLCHAR (CursorName'Address), SQLSMALLINT (CursorName'Length)); end SQLSetCursorName; procedure SQLSetCursorName (StatementHandle : in SQLHSTMT; CursorName : in String) is RC : constant SQLRETURN := SQLSetCursorName (StatementHandle, CursorName); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLSetCursorName", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); end SQLSetCursorName; function SQLSetCursorName (StatementHandle : SQLHSTMT; CursorName : Wide_String) return SQLRETURN is #if UNICODE then function SetCursorName (StatementHandle : SQLHSTMT; pCursorName : PTR_SQLTCHAR; NameLength : SQLSMALLINT) return SQLRETURN; pragma Import ($CALLCONVENTION, SetCursorName, "SQLSetCursorNameW"); #else pragma Unreferenced (CursorName); pragma Unreferenced (StatementHandle); #end if; begin #if UNICODE then return SetCursorName (StatementHandle, To_PTR_SQLTCHAR (CursorName'Address), SQLSMALLINT (CursorName'Length)); #else return SQL_ADA95_NO_UNICODE; #end if; end SQLSetCursorName; procedure SQLSetCursorName (StatementHandle : in SQLHSTMT; CursorName : in Wide_String) is RC : constant SQLRETURN := SQLSetCursorName (StatementHandle, CursorName); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLSetCursorName", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); end SQLSetCursorName; function SQLExecDirect (StatementHandle : SQLHSTMT; StatementText : String) return SQLRETURN is function ExecDirect (StatementHandle : SQLHSTMT; pStatementText : PTR_SQLCHAR; TextLength : SQLINTEGER) return SQLRETURN; pragma Import ($CALLCONVENTION, ExecDirect, "SQLExecDirect"); begin return ExecDirect (StatementHandle, To_PTR_SQLCHAR (StatementText'Address), SQLINTEGER (StatementText'Length)); end SQLExecDirect; procedure SQLExecDirect (StatementHandle : in SQLHSTMT; StatementText : in String) is RC : constant SQLRETURN := SQLExecDirect (StatementHandle, StatementText); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLExecDirect", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); end SQLExecDirect; function SQLExecDirect (StatementHandle : SQLHSTMT; StatementText : Wide_String) return SQLRETURN is #if UNICODE then function ExecDirect (StatementHandle : SQLHSTMT; pStatementText : PTR_SQLTCHAR; TextLength : SQLINTEGER) return SQLRETURN; pragma Import ($CALLCONVENTION, ExecDirect, "SQLExecDirectW"); #else pragma Unreferenced (StatementHandle, StatementText); #end if; begin #if UNICODE then return ExecDirect (StatementHandle, To_PTR_SQLTCHAR (StatementText'Address), SQLINTEGER (StatementText'Length)); #else return SQL_ADA95_NO_UNICODE; #end if; end SQLExecDirect; procedure SQLExecDirect (StatementHandle : in SQLHSTMT; StatementText : in Wide_String) is RC : constant SQLRETURN := SQLExecDirect (StatementHandle, StatementText); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLExecDirect", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); end SQLExecDirect; function SQLEndTran (HandleType : SQL_ENDTRAN_HANDLE_TYPE := SQL_HANDLE_DBC; Handle : SQLHANDLE; CompletionType : SQL_COMPLETION_TYPE := SQL_COMMIT) return SQLRETURN is function EndTran (HandleType : SQL_ENDTRAN_HANDLE_TYPE; Handle : SQLHANDLE; CompletionType : SQL_COMPLETION_TYPE) return SQLRETURN; pragma Import ($CALLCONVENTION, EndTran, "SQLEndTran"); begin return EndTran (HandleType, Handle, CompletionType); end SQLEndTran; procedure SQLEndTran (HandleType : in SQL_ENDTRAN_HANDLE_TYPE := SQL_HANDLE_DBC; Handle : in SQLHANDLE; CompletionType : in SQL_COMPLETION_TYPE := SQL_COMMIT) is RC : constant SQLRETURN := SQLEndTran (HandleType, Handle, CompletionType); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLEndTran", HandleType => SQL_HANDLE_TYPE (HandleType), Handle => Handle); end SQLEndTran; procedure SQLCommit (ConnectionHandle : SQLHDBC) is begin SQLEndTran (HandleType => SQL_HANDLE_DBC, Handle => ConnectionHandle, CompletionType => SQL_COMMIT); end SQLCommit; procedure SQLRollback (ConnectionHandle : SQLHDBC) is begin SQLEndTran (HandleType => SQL_HANDLE_DBC, Handle => ConnectionHandle, CompletionType => SQL_ROLLBACK); end SQLRollback; function SQLNumParams (StatementHandle : SQLHSTMT; pNum : access SQLSMALLINT) return SQLRETURN is function NumParams (StatementHandle : SQLHSTMT; pNum : access SQLSMALLINT) return SQLRETURN; pragma Import ($CALLCONVENTION, NumParams, "SQLNumParams"); begin return NumParams (StatementHandle, pNum); end SQLNumParams; function SQLNumParams (StatementHandle : SQLHSTMT) return SQLSMALLINT is R : aliased SQLSMALLINT; RC : constant SQLRETURN := SQLNumParams (StatementHandle, R'Access); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLNumParams", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); return R; end SQLNumParams; function SQLNumResultCols (StatementHandle : SQLHSTMT; pColumnCount : access SQL_Column_Number) return SQLRETURN is function NumResultCols (StatementHandle : SQLHSTMT; pColumnCount : access SQL_Column_Number) return SQLRETURN; pragma Import ($CALLCONVENTION, NumResultCols, "SQLNumResultCols"); begin return NumResultCols (StatementHandle, pColumnCount); end SQLNumResultCols; function SQLNumResultCols (StatementHandle : SQLHSTMT) return SQL_Column_Number is Count : aliased SQL_Column_Number; RC : constant SQLRETURN := SQLNumResultCols (StatementHandle, Count'Access); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLNumResultCols", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); return Count; end SQLNumResultCols; function SQLRowCount (StatementHandle : SQLHSTMT; pRowCount : access SQLINTEGER) return SQLRETURN is function RowCount (StatementHandle : SQLHSTMT; pRowCount : access SQLINTEGER) return SQLRETURN; pragma Import ($CALLCONVENTION, RowCount, "SQLRowCount"); begin return RowCount (StatementHandle, pRowCount); end SQLRowCount; function SQLRowCount (StatementHandle : SQLHSTMT) return SQLINTEGER is Count : aliased SQLINTEGER; RC : constant SQLRETURN := SQLRowCount (StatementHandle, Count'Access); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLRowCount", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); return Count; end SQLRowCount; function SQLGetData (StatementHandle : in SQLHSTMT; ColumnNumber : in SQL_Column_Number; TargetType : in SQL_C_DATA_TYPE; TargetValue : in SQLPOINTER; BufferLength : in SQLINTEGER; StrLen_Or_Ind : access SQLINTEGER) return SQLRETURN is function GetData (StatementHandle : in SQLHSTMT; ColumnNumber : in SQL_Column_Number; TargetType : in SQL_C_DATA_TYPE; TargetValue : in SQLPOINTER; BufferLength : in SQLINTEGER; StrLen_Or_Ind : access SQLINTEGER) return SQLRETURN; pragma Import ($CALLCONVENTION, GetData, "SQLGetData"); begin return GetData (StatementHandle, ColumnNumber, TargetType, TargetValue, BufferLength, StrLen_Or_Ind); end SQLGetData; procedure SQLGetData (StatementHandle : in SQLHSTMT; ColumnNumber : in SQL_Column_Number; TargetType : in SQL_C_DATA_TYPE; TargetValue : in SQLPOINTER; BufferLength : in SQLINTEGER; StrLen_Or_Ind : access SQLINTEGER) is RC : constant SQLRETURN := SQLGetData (StatementHandle, ColumnNumber, TargetType, TargetValue, BufferLength, StrLen_Or_Ind); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLGetData", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); end SQLGetData; function SQLPutData (StatementHandle : SQLHSTMT; Data : SQLPOINTER; StrLen_or_Ind : SQLINTEGER) return SQLRETURN is function PutData (StatementHandle : SQLHSTMT; Data : SQLPOINTER; StrLen_or_Ind : SQLINTEGER) return SQLRETURN; pragma Import ($CALLCONVENTION, PutData, "SQLPutData"); begin return PutData (StatementHandle, Data, StrLen_or_Ind); end SQLPutData; procedure SQLPutData (StatementHandle : in SQLHSTMT; Data : in SQLPOINTER; StrLen_Or_Ind : SQLINTEGER) is RC : constant SQLRETURN := SQLPutData (StatementHandle, Data, StrLen_Or_Ind); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLPutData", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); end SQLPutData; function SQLParamData (StatementHandle : SQLHSTMT; pValue : access SQLPOINTER) return SQLRETURN is function ParamData (StatementHandle : SQLHSTMT; pValue : access SQLPOINTER) return SQLRETURN; pragma Import ($CALLCONVENTION, ParamData, "SQLParamData"); begin return ParamData (StatementHandle, pValue); end SQLParamData; function SQLParamData (StatementHandle : in SQLHSTMT) return SQLPOINTER is Res : aliased SQLPOINTER; RC : constant SQLRETURN := SQLParamData (StatementHandle, Res'Access); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLParamData", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); return Res; end SQLParamData; function SQLCopyDesc (SourceHandle : SQLHDESC; TargetHandle : SQLHDESC) return SQLRETURN is function CopyDesc (SourceHandle : SQLHDESC; TargetHandle : SQLHDESC) return SQLRETURN; pragma Import ($CALLCONVENTION, CopyDesc, "SQLCopyDesc"); begin return CopyDesc (SourceHandle, TargetHandle); end SQLCopyDesc; procedure SQLCopyDesc (SourceHandle : in SQLHDESC; TargetHandle : in SQLHDESC) is RC : constant SQLRETURN := SQLCopyDesc (SourceHandle, TargetHandle); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLCopyDesc", HandleType => SQL_HANDLE_DESC, Handle => TargetHandle); end SQLCopyDesc; function SQLStatistics (StatementHandle : SQLHSTMT; CatalogName : String; SchemaName : String; TableName : String; Unique : SQL_STATISTICS_UNIQUE_OPTION := SQL_INDEX_ALL; PagesImportance : SQL_STATISTICS_PAGES_OPTION := SQL_QUICK) return SQLRETURN is function Statistics (StatementHandle : SQLHSTMT; pCatalogName : PTR_SQLCHAR; NameLength1 : SQLSMALLINT; pSchemaName : PTR_SQLCHAR; NameLength2 : SQLSMALLINT; pTableName : PTR_SQLCHAR; NameLength3 : SQLSMALLINT; Unique : SQL_STATISTICS_UNIQUE_OPTION; Reserved : SQL_STATISTICS_PAGES_OPTION) return SQLRETURN; pragma Import ($CALLCONVENTION, Statistics, "SQLStatistics"); begin return Statistics (StatementHandle, To_PTR_SQLCHAR (CatalogName'Address), SQLSMALLINT (CatalogName'Length), To_PTR_SQLCHAR (SchemaName'Address), SQLSMALLINT (SchemaName'Length), To_PTR_SQLCHAR (TableName'Address), SQLSMALLINT (TableName'Length), Unique, PagesImportance); end SQLStatistics; procedure SQLStatistics (StatementHandle : in SQLHSTMT; CatalogName : in String; SchemaName : in String; TableName : in String; Unique : in SQL_STATISTICS_UNIQUE_OPTION := SQL_INDEX_ALL; PagesImportance : in SQL_STATISTICS_PAGES_OPTION := SQL_QUICK) is RC : constant SQLRETURN := SQLStatistics (StatementHandle, CatalogName, SchemaName, TableName, Unique, PagesImportance); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLStatistics", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); end SQLStatistics; function SQLStatistics (StatementHandle : SQLHSTMT; CatalogName : Wide_String; SchemaName : Wide_String; TableName : Wide_String; Unique : SQL_STATISTICS_UNIQUE_OPTION := SQL_INDEX_ALL; PagesImportance : SQL_STATISTICS_PAGES_OPTION := SQL_QUICK) return SQLRETURN is #if UNICODE then function Statistics (StatementHandle : SQLHSTMT; pCatalogName : PTR_SQLTCHAR; NameLength1 : SQLSMALLINT; pSchemaName : PTR_SQLTCHAR; NameLength2 : SQLSMALLINT; pTableName : PTR_SQLTCHAR; NameLength3 : SQLSMALLINT; Unique : SQL_STATISTICS_UNIQUE_OPTION; Reserved : SQL_STATISTICS_PAGES_OPTION) return SQLRETURN; pragma Import ($CALLCONVENTION, Statistics, "SQLStatisticsW"); #else pragma Unreferenced (StatementHandle, CatalogName, SchemaName, TableName, Unique, PagesImportance); #end if; begin #if UNICODE then return Statistics (StatementHandle, To_PTR_SQLTCHAR (CatalogName'Address), SQLSMALLINT (CatalogName'Length), To_PTR_SQLTCHAR (SchemaName'Address), SQLSMALLINT (SchemaName'Length), To_PTR_SQLTCHAR (TableName'Address), SQLSMALLINT (TableName'Length), Unique, PagesImportance); #else return SQL_ADA95_NO_UNICODE; #end if; end SQLStatistics; procedure SQLStatistics (StatementHandle : in SQLHSTMT; CatalogName : in Wide_String; SchemaName : in Wide_String; TableName : in Wide_String; Unique : in SQL_STATISTICS_UNIQUE_OPTION := SQL_INDEX_ALL; PagesImportance : in SQL_STATISTICS_PAGES_OPTION := SQL_QUICK) is RC : constant SQLRETURN := SQLStatistics (StatementHandle, CatalogName, SchemaName, TableName, Unique, PagesImportance); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLStatistics", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); end SQLStatistics; function SQLTables (StatementHandle : SQLHSTMT; CatalogName : String := SQL_ALL_CATALOGS; SchemaName : String := SQL_ALL_SCHEMAS; TableName : String; TableType : String := SQL_ALL_TABLE_TYPES) return SQLRETURN is function Tables (StatementHandle : SQLHSTMT; pCatalogName : PTR_SQLCHAR; NameLength1 : SQLSMALLINT; pSchemaName : PTR_SQLCHAR; NameLength2 : SQLSMALLINT; pTableName : PTR_SQLCHAR; NameLength3 : SQLSMALLINT; pTableType : PTR_SQLCHAR; NameLength4 : SQLSMALLINT) return SQLRETURN; pragma Import ($CALLCONVENTION, Tables, "SQLTables"); begin return Tables (StatementHandle, To_PTR_SQLCHAR (CatalogName'Address), SQLSMALLINT (CatalogName'Length), To_PTR_SQLCHAR (SchemaName'Address), SQLSMALLINT (SchemaName'Length), To_PTR_SQLCHAR (TableName'Address), SQLSMALLINT (TableName'Length), To_PTR_SQLCHAR (TableType'Address), SQLSMALLINT (TableType'Length)); end SQLTables; procedure SQLTables (StatementHandle : in SQLHSTMT; CatalogName : in String := SQL_ALL_CATALOGS; SchemaName : in String := SQL_ALL_SCHEMAS; TableName : in String; TableType : in String := SQL_ALL_TABLE_TYPES) is RC : constant SQLRETURN := SQLTables (StatementHandle, CatalogName, SchemaName, TableName, TableType); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLTables", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); end SQLTables; function SQLTables (StatementHandle : SQLHSTMT; CatalogName : Wide_String := W_SQL_ALL_CATALOGS; SchemaName : Wide_String := W_SQL_ALL_SCHEMAS; TableName : Wide_String; TableType : Wide_String := W_SQL_ALL_TABLE_TYPES) return SQLRETURN is #if UNICODE then function Tables (StatementHandle : SQLHSTMT; pCatalogName : PTR_SQLTCHAR; NameLength1 : SQLSMALLINT; pSchemaName : PTR_SQLTCHAR; NameLength2 : SQLSMALLINT; pTableName : PTR_SQLTCHAR; NameLength3 : SQLSMALLINT; pTableType : PTR_SQLTCHAR; NameLength4 : SQLSMALLINT) return SQLRETURN; pragma Import ($CALLCONVENTION, Tables, "SQLTablesW"); #else pragma Unreferenced (StatementHandle, CatalogName, SchemaName, TableName, TableType); #end if; begin #if UNICODE then return Tables (StatementHandle, To_PTR_SQLTCHAR (CatalogName'Address), SQLSMALLINT (CatalogName'Length), To_PTR_SQLTCHAR (SchemaName'Address), SQLSMALLINT (SchemaName'Length), To_PTR_SQLTCHAR (TableName'Address), SQLSMALLINT (TableName'Length), To_PTR_SQLTCHAR (TableType'Address), SQLSMALLINT (TableType'Length)); #else return SQL_ADA95_NO_UNICODE; #end if; end SQLTables; procedure SQLTables (StatementHandle : in SQLHSTMT; CatalogName : in Wide_String := W_SQL_ALL_CATALOGS; SchemaName : in Wide_String := W_SQL_ALL_SCHEMAS; TableName : in Wide_String; TableType : in Wide_String := W_SQL_ALL_TABLE_TYPES) is RC : constant SQLRETURN := SQLTables (StatementHandle, CatalogName, SchemaName, TableName, TableType); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLTables", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); end SQLTables; function SQLProcedures (StatementHandle : SQLHSTMT; CatalogName : String; SchemaName : String := SQL_ALL_SCHEMAS; ProcName : String := SQL_ALL_PROCEDURES) return SQLRETURN is function Procedures (StatementHandle : SQLHSTMT; pCatalogName : PTR_SQLCHAR; NameLength1 : SQLSMALLINT; pSchemaName : PTR_SQLCHAR; NameLength2 : SQLSMALLINT; pProcName : PTR_SQLCHAR; NameLength3 : SQLSMALLINT) return SQLRETURN; pragma Import ($CALLCONVENTION, Procedures, "SQLProcedures"); begin return Procedures (StatementHandle, To_PTR_SQLCHAR (CatalogName'Address), SQLSMALLINT (CatalogName'Length), To_PTR_SQLCHAR (SchemaName'Address), SQLSMALLINT (SchemaName'Length), To_PTR_SQLCHAR (ProcName'Address), SQLSMALLINT (ProcName'Length)); end SQLProcedures; procedure SQLProcedures (StatementHandle : SQLHSTMT; CatalogName : String; SchemaName : String := SQL_ALL_SCHEMAS; ProcName : String := SQL_ALL_PROCEDURES) is RC : constant SQLRETURN := SQLProcedures (StatementHandle, CatalogName, SchemaName, ProcName); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLProcedures", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); end SQLProcedures; function SQLProcedures (StatementHandle : SQLHSTMT; CatalogName : Wide_String; SchemaName : Wide_String := W_SQL_ALL_SCHEMAS; ProcName : Wide_String := W_SQL_ALL_PROCEDURES) return SQLRETURN is #if UNICODE then function Procedures (StatementHandle : SQLHSTMT; pCatalogName : PTR_SQLTCHAR; NameLength1 : SQLSMALLINT; pSchemaName : PTR_SQLTCHAR; NameLength2 : SQLSMALLINT; pProcName : PTR_SQLTCHAR; NameLength3 : SQLSMALLINT) return SQLRETURN; pragma Import ($CALLCONVENTION, Procedures, "SQLProceduresW"); #else pragma Unreferenced (StatementHandle, CatalogName, SchemaName, ProcName); #end if; begin #if UNICODE then return Procedures (StatementHandle, To_PTR_SQLTCHAR (CatalogName'Address), SQLSMALLINT (CatalogName'Length), To_PTR_SQLTCHAR (SchemaName'Address), SQLSMALLINT (SchemaName'Length), To_PTR_SQLTCHAR (ProcName'Address), SQLSMALLINT (ProcName'Length)); #else return SQL_ADA95_NO_UNICODE; #end if; end SQLProcedures; procedure SQLProcedures (StatementHandle : SQLHSTMT; CatalogName : Wide_String; SchemaName : Wide_String := W_SQL_ALL_SCHEMAS; ProcName : Wide_String := W_SQL_ALL_PROCEDURES) is RC : constant SQLRETURN := SQLProcedures (StatementHandle, CatalogName, SchemaName, ProcName); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLProcedures", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); end SQLProcedures; function SQLProcedureColumns (StatementHandle : SQLHSTMT; CatalogName : String; SchemaName : String := SQL_ALL_SCHEMAS; ProcName : String := SQL_ALL_PROCEDURES; ColumnName : String := SQL_ALL_COLUMNS) return SQLRETURN is function ProcedureColumns (StatementHandle : SQLHSTMT; pCatalogName : PTR_SQLCHAR; NameLength1 : SQLSMALLINT; pSchemaName : PTR_SQLCHAR; NameLength2 : SQLSMALLINT; pProcName : PTR_SQLCHAR; NameLength3 : SQLSMALLINT; PColumnName : PTR_SQLCHAR; NameLength4 : SQLSMALLINT) return SQLRETURN; pragma Import ($CALLCONVENTION, ProcedureColumns, "SQLProcedureColumns"); begin return ProcedureColumns (StatementHandle, To_PTR_SQLCHAR (CatalogName'Address), SQLSMALLINT (CatalogName'Length), To_PTR_SQLCHAR (SchemaName'Address), SQLSMALLINT (SchemaName'Length), To_PTR_SQLCHAR (ProcName'Address), SQLSMALLINT (ProcName'Length), To_PTR_SQLCHAR (ColumnName'Address), SQLSMALLINT (ColumnName'Length)); end SQLProcedureColumns; procedure SQLProcedureColumns (StatementHandle : SQLHSTMT; CatalogName : String; SchemaName : String := SQL_ALL_SCHEMAS; ProcName : String := SQL_ALL_PROCEDURES; ColumnName : String := SQL_ALL_COLUMNS) is RC : constant SQLRETURN := SQLProcedureColumns (StatementHandle, CatalogName, SchemaName, ProcName, ColumnName); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLProcedureColumns", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); end SQLProcedureColumns; function SQLProcedureColumns (StatementHandle : SQLHSTMT; CatalogName : Wide_String; SchemaName : Wide_String := W_SQL_ALL_SCHEMAS; ProcName : Wide_String := W_SQL_ALL_PROCEDURES; ColumnName : Wide_String := W_SQL_ALL_COLUMNS) return SQLRETURN is #if UNICODE then function ProcedureColumns (StatementHandle : SQLHSTMT; pCatalogName : PTR_SQLTCHAR; NameLength1 : SQLSMALLINT; pSchemaName : PTR_SQLTCHAR; NameLength2 : SQLSMALLINT; pProcName : PTR_SQLTCHAR; NameLength3 : SQLSMALLINT; PColumnName : PTR_SQLTCHAR; NameLength4 : SQLSMALLINT) return SQLRETURN; pragma Import ($CALLCONVENTION, ProcedureColumns, "SQLProcedureColumnsW"); #else pragma Unreferenced (StatementHandle, CatalogName, SchemaName, ProcName, ColumnName); #end if; begin #if UNICODE then return ProcedureColumns (StatementHandle, To_PTR_SQLTCHAR (CatalogName'Address), SQLSMALLINT (CatalogName'Length), To_PTR_SQLTCHAR (SchemaName'Address), SQLSMALLINT (SchemaName'Length), To_PTR_SQLTCHAR (ProcName'Address), SQLSMALLINT (ProcName'Length), To_PTR_SQLTCHAR (ColumnName'Address), SQLSMALLINT (ColumnName'Length)); #else return SQL_ADA95_NO_UNICODE; #end if; end SQLProcedureColumns; procedure SQLProcedureColumns (StatementHandle : SQLHSTMT; CatalogName : Wide_String; SchemaName : Wide_String := W_SQL_ALL_SCHEMAS; ProcName : Wide_String := W_SQL_ALL_PROCEDURES; ColumnName : Wide_String := W_SQL_ALL_COLUMNS) is RC : constant SQLRETURN := SQLProcedureColumns (StatementHandle, CatalogName, SchemaName, ProcName, ColumnName); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLProcedureColumns", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); end SQLProcedureColumns; function SQLTablePrivileges (StatementHandle : SQLHSTMT; CatalogName : String; SchemaName : String := SQL_ALL_SCHEMAS; TableName : String := SQL_ALL_TABLES) return SQLRETURN is function TablePrivileges (StatementHandle : SQLHSTMT; pCatalogName : PTR_SQLCHAR; NameLength1 : SQLSMALLINT; pSchemaName : PTR_SQLCHAR; NameLength2 : SQLSMALLINT; pTableName : PTR_SQLCHAR; NameLength3 : SQLSMALLINT) return SQLRETURN; pragma Import ($CALLCONVENTION, TablePrivileges, "SQLTablePrivileges"); begin return TablePrivileges (StatementHandle, To_PTR_SQLCHAR (CatalogName'Address), SQLSMALLINT (CatalogName'Length), To_PTR_SQLCHAR (SchemaName'Address), SQLSMALLINT (SchemaName'Length), To_PTR_SQLCHAR (TableName'Address), SQLSMALLINT (TableName'Length)); end SQLTablePrivileges; procedure SQLTablePrivileges (StatementHandle : SQLHSTMT; CatalogName : String; SchemaName : String := SQL_ALL_SCHEMAS; TableName : String := SQL_ALL_TABLES) is RC : constant SQLRETURN := SQLTablePrivileges (StatementHandle, CatalogName, SchemaName, TableName); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLTablePrivileges", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); end SQLTablePrivileges; function SQLTablePrivileges (StatementHandle : SQLHSTMT; CatalogName : Wide_String; SchemaName : Wide_String := W_SQL_ALL_SCHEMAS; TableName : Wide_String := W_SQL_ALL_TABLES) return SQLRETURN is #if UNICODE then function TablePrivileges (StatementHandle : SQLHSTMT; pCatalogName : PTR_SQLTCHAR; NameLength1 : SQLSMALLINT; pSchemaName : PTR_SQLTCHAR; NameLength2 : SQLSMALLINT; pTableName : PTR_SQLTCHAR; NameLength3 : SQLSMALLINT) return SQLRETURN; pragma Import ($CALLCONVENTION, TablePrivileges, "SQLTablePrivilegesW"); #else pragma Unreferenced (StatementHandle, CatalogName, SchemaName, TableName); #end if; begin #if UNICODE then return TablePrivileges (StatementHandle, To_PTR_SQLTCHAR (CatalogName'Address), SQLSMALLINT (CatalogName'Length), To_PTR_SQLTCHAR (SchemaName'Address), SQLSMALLINT (SchemaName'Length), To_PTR_SQLTCHAR (TableName'Address), SQLSMALLINT (TableName'Length)); #else return SQL_ADA95_NO_UNICODE; #end if; end SQLTablePrivileges; procedure SQLTablePrivileges (StatementHandle : SQLHSTMT; CatalogName : Wide_String; SchemaName : Wide_String := W_SQL_ALL_SCHEMAS; TableName : Wide_String := W_SQL_ALL_TABLES) is RC : constant SQLRETURN := SQLTablePrivileges (StatementHandle, CatalogName, SchemaName, TableName); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLTablePrivileges", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); end SQLTablePrivileges; function SQLColumnPrivileges (StatementHandle : SQLHSTMT; CatalogName : String; SchemaName : String; TableName : String; ColumnName : String := SQL_ALL_COLUMNS) return SQLRETURN is function ColumnPrivileges (StatementHandle : SQLHSTMT; pCatalogName : PTR_SQLCHAR; NameLength1 : SQLSMALLINT; pSchemaName : PTR_SQLCHAR; NameLength2 : SQLSMALLINT; pTableName : PTR_SQLCHAR; NameLength3 : SQLSMALLINT; PColumnName : PTR_SQLCHAR; NameLength4 : SQLSMALLINT) return SQLRETURN; pragma Import ($CALLCONVENTION, ColumnPrivileges, "SQLColumnPrivileges"); begin return ColumnPrivileges (StatementHandle, To_PTR_SQLCHAR (CatalogName'Address), SQLSMALLINT (CatalogName'Length), To_PTR_SQLCHAR (SchemaName'Address), SQLSMALLINT (SchemaName'Length), To_PTR_SQLCHAR (TableName'Address), SQLSMALLINT (TableName'Length), To_PTR_SQLCHAR (ColumnName'Address), SQLSMALLINT (ColumnName'Length)); end SQLColumnPrivileges; procedure SQLColumnPrivileges (StatementHandle : SQLHSTMT; CatalogName : String; SchemaName : String; TableName : String; ColumnName : String := SQL_ALL_COLUMNS) is RC : constant SQLRETURN := SQLColumnPrivileges (StatementHandle, CatalogName, SchemaName, TableName, ColumnName); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLColumnPrivileges", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); end SQLColumnPrivileges; function SQLColumnPrivileges (StatementHandle : SQLHSTMT; CatalogName : Wide_String; SchemaName : Wide_String; TableName : Wide_String; ColumnName : Wide_String := W_SQL_ALL_COLUMNS) return SQLRETURN is #if UNICODE then function ColumnPrivileges (StatementHandle : SQLHSTMT; pCatalogName : PTR_SQLTCHAR; NameLength1 : SQLSMALLINT; pSchemaName : PTR_SQLTCHAR; NameLength2 : SQLSMALLINT; pTableName : PTR_SQLTCHAR; NameLength3 : SQLSMALLINT; PColumnName : PTR_SQLTCHAR; NameLength4 : SQLSMALLINT) return SQLRETURN; pragma Import ($CALLCONVENTION, ColumnPrivileges, "SQLColumnPrivilegesW"); #else pragma Unreferenced (StatementHandle, CatalogName, SchemaName, TableName, ColumnName); #end if; begin #if UNICODE then return ColumnPrivileges (StatementHandle, To_PTR_SQLTCHAR (CatalogName'Address), SQLSMALLINT (CatalogName'Length), To_PTR_SQLTCHAR (SchemaName'Address), SQLSMALLINT (SchemaName'Length), To_PTR_SQLTCHAR (TableName'Address), SQLSMALLINT (TableName'Length), To_PTR_SQLTCHAR (ColumnName'Address), SQLSMALLINT (ColumnName'Length)); #else return SQL_ADA95_NO_UNICODE; #end if; end SQLColumnPrivileges; procedure SQLColumnPrivileges (StatementHandle : SQLHSTMT; CatalogName : Wide_String; SchemaName : Wide_String; TableName : Wide_String; ColumnName : Wide_String := W_SQL_ALL_COLUMNS) is RC : constant SQLRETURN := SQLColumnPrivileges (StatementHandle, CatalogName, SchemaName, TableName, ColumnName); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLColumnPrivileges", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); end SQLColumnPrivileges; function SQLSpecialColumns (StatementHandle : in SQLHSTMT; IdentifierType : in Special_Column_Type; CatalogName : in String; SchemaName : in String; TableName : in String; Scope : in ROWID_SCOPE; Nullable : in SQL_NULLABLE_FIELD) return SQLRETURN is function SpecialColumns (StatementHandle : SQLHSTMT; IdentifierType : Special_Column_Type; pCatalogName : PTR_SQLCHAR; NameLength1 : SQLSMALLINT; pSchemaName : PTR_SQLCHAR; NameLength2 : SQLSMALLINT; pTableName : PTR_SQLCHAR; NameLength3 : SQLSMALLINT; Scope : ROWID_SCOPE; Nullable : SQL_NULLABLE_FIELD) return SQLRETURN; pragma Import ($CALLCONVENTION, SpecialColumns, "SQLSpecialColumns"); begin return SpecialColumns (StatementHandle, IdentifierType, To_PTR_SQLCHAR (CatalogName'Address), SQLSMALLINT (CatalogName'Length), To_PTR_SQLCHAR (SchemaName'Address), SQLSMALLINT (SchemaName'Length), To_PTR_SQLCHAR (TableName'Address), SQLSMALLINT (TableName'Length), Scope, Nullable); end SQLSpecialColumns; procedure SQLSpecialColumns (StatementHandle : in SQLHSTMT; IdentifierType : in Special_Column_Type; CatalogName : in String; SchemaName : in String; TableName : in String; Scope : in ROWID_SCOPE; Nullable : in SQL_NULLABLE_FIELD) is RC : constant SQLRETURN := SQLSpecialColumns (StatementHandle, IdentifierType, CatalogName, SchemaName, TableName, Scope, Nullable); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLSpecialColumns", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); end SQLSpecialColumns; function SQLSpecialColumns (StatementHandle : in SQLHSTMT; IdentifierType : in Special_Column_Type; CatalogName : in Wide_String; SchemaName : in Wide_String; TableName : in Wide_String; Scope : in ROWID_SCOPE; Nullable : in SQL_NULLABLE_FIELD) return SQLRETURN is #if UNICODE then function SpecialColumns (StatementHandle : SQLHSTMT; IdentifierType : Special_Column_Type; pCatalogName : PTR_SQLTCHAR; NameLength1 : SQLSMALLINT; pSchemaName : PTR_SQLTCHAR; NameLength2 : SQLSMALLINT; pTableName : PTR_SQLTCHAR; NameLength3 : SQLSMALLINT; Scope : ROWID_SCOPE; Nullable : SQL_NULLABLE_FIELD) return SQLRETURN; pragma Import ($CALLCONVENTION, SpecialColumns, "SQLSpecialColumnsW"); #else pragma Unreferenced (StatementHandle, IdentifierType, CatalogName, SchemaName, TableName, Scope, Nullable); #end if; begin #if UNICODE then return SpecialColumns (StatementHandle, IdentifierType, To_PTR_SQLTCHAR (CatalogName'Address), SQLSMALLINT (CatalogName'Length), To_PTR_SQLTCHAR (SchemaName'Address), SQLSMALLINT (SchemaName'Length), To_PTR_SQLTCHAR (TableName'Address), SQLSMALLINT (TableName'Length), Scope, Nullable); #else return SQL_ADA95_NO_UNICODE; #end if; end SQLSpecialColumns; procedure SQLSpecialColumns (StatementHandle : in SQLHSTMT; IdentifierType : in Special_Column_Type; CatalogName : in Wide_String; SchemaName : in Wide_String; TableName : in Wide_String; Scope : in ROWID_SCOPE; Nullable : in SQL_NULLABLE_FIELD) is RC : constant SQLRETURN := SQLSpecialColumns (StatementHandle, IdentifierType, CatalogName, SchemaName, TableName, Scope, Nullable); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLSpecialColumns", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); end SQLSpecialColumns; function SQLPrimaryKeys (StatementHandle : SQLHSTMT; CatalogName : String; SchemaName : String; TableName : String) return SQLRETURN is function PrimaryKeys (StatementHandle : SQLHSTMT; pCatalogName : PTR_SQLCHAR; NameLength1 : SQLSMALLINT; pSchemaName : PTR_SQLCHAR; NameLength2 : SQLSMALLINT; pTableName : PTR_SQLCHAR; NameLength3 : SQLSMALLINT) return SQLRETURN; pragma Import ($CALLCONVENTION, PrimaryKeys, "SQLPrimaryKeys"); begin return PrimaryKeys (StatementHandle, To_PTR_SQLCHAR (CatalogName'Address), SQLSMALLINT (CatalogName'Length), To_PTR_SQLCHAR (SchemaName'Address), SQLSMALLINT (SchemaName'Length), To_PTR_SQLCHAR (TableName'Address), SQLSMALLINT (TableName'Length)); end SQLPrimaryKeys; procedure SQLPrimaryKeys (StatementHandle : SQLHSTMT; CatalogName : String; SchemaName : String; TableName : String) is RC : constant SQLRETURN := SQLPrimaryKeys (StatementHandle, CatalogName, SchemaName, TableName); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLPrimaryKeys", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); end SQLPrimaryKeys; function SQLPrimaryKeys (StatementHandle : SQLHSTMT; CatalogName : Wide_String; SchemaName : Wide_String; TableName : Wide_String) return SQLRETURN is #if UNICODE then function PrimaryKeys (StatementHandle : SQLHSTMT; pCatalogName : PTR_SQLTCHAR; NameLength1 : SQLSMALLINT; pSchemaName : PTR_SQLTCHAR; NameLength2 : SQLSMALLINT; pTableName : PTR_SQLTCHAR; NameLength3 : SQLSMALLINT) return SQLRETURN; pragma Import ($CALLCONVENTION, PrimaryKeys, "SQLPrimaryKeysW"); #else pragma Unreferenced (StatementHandle, CatalogName, SchemaName, TableName); #end if; begin #if UNICODE then return PrimaryKeys (StatementHandle, To_PTR_SQLTCHAR (CatalogName'Address), SQLSMALLINT (CatalogName'Length), To_PTR_SQLTCHAR (SchemaName'Address), SQLSMALLINT (SchemaName'Length), To_PTR_SQLTCHAR (TableName'Address), SQLSMALLINT (TableName'Length)); #else return SQL_ADA95_NO_UNICODE; #end if; end SQLPrimaryKeys; procedure SQLPrimaryKeys (StatementHandle : SQLHSTMT; CatalogName : Wide_String; SchemaName : Wide_String; TableName : Wide_String) is RC : constant SQLRETURN := SQLPrimaryKeys (StatementHandle, CatalogName, SchemaName, TableName); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLPrimaryKeys", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); end SQLPrimaryKeys; function SQLForeignKeys (StatementHandle : SQLHSTMT; PrimaryCatalogName : String; PrimarySchemaName : String; PrimaryTableName : String; ForeignCatalogName : String; ForeignSchemaName : String; ForeignTableName : String) return SQLRETURN is function ForeignKeys (StatementHandle : SQLHSTMT; pCatalogName : PTR_SQLCHAR; NameLength1 : SQLSMALLINT; pSchemaName : PTR_SQLCHAR; NameLength2 : SQLSMALLINT; pTableName : PTR_SQLCHAR; NameLength3 : SQLSMALLINT; pCatalogName2 : PTR_SQLCHAR; NameLength4 : SQLSMALLINT; pSchemaName2 : PTR_SQLCHAR; NameLength5 : SQLSMALLINT; pTableName2 : PTR_SQLCHAR; NameLength6 : SQLSMALLINT) return SQLRETURN; pragma Import ($CALLCONVENTION, ForeignKeys, "SQLForeignKeys"); begin return ForeignKeys (StatementHandle, To_PTR_SQLCHAR (PrimaryCatalogName'Address), SQLSMALLINT (PrimaryCatalogName'Length), To_PTR_SQLCHAR (PrimarySchemaName'Address), SQLSMALLINT (PrimarySchemaName'Length), To_PTR_SQLCHAR (PrimaryTableName'Address), SQLSMALLINT (PrimaryTableName'Length), To_PTR_SQLCHAR (ForeignCatalogName'Address), SQLSMALLINT (ForeignCatalogName'Length), To_PTR_SQLCHAR (ForeignSchemaName'Address), SQLSMALLINT (ForeignSchemaName'Length), To_PTR_SQLCHAR (ForeignTableName'Address), SQLSMALLINT (ForeignTableName'Length)); end SQLForeignKeys; procedure SQLForeignKeys (StatementHandle : SQLHSTMT; PrimaryCatalogName : String; PrimarySchemaName : String; PrimaryTableName : String; ForeignCatalogName : String; ForeignSchemaName : String; ForeignTableName : String) is RC : constant SQLRETURN := SQLForeignKeys (StatementHandle, PrimaryCatalogName, PrimarySchemaName, PrimaryTableName, ForeignCatalogName, ForeignSchemaName, ForeignTableName); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLForeignKeys", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); end SQLForeignKeys; function SQLForeignKeys (StatementHandle : SQLHSTMT; PrimaryCatalogName : Wide_String; PrimarySchemaName : Wide_String; PrimaryTableName : Wide_String; ForeignCatalogName : Wide_String; ForeignSchemaName : Wide_String; ForeignTableName : Wide_String) return SQLRETURN is #if UNICODE then function ForeignKeys (StatementHandle : SQLHSTMT; pCatalogName : PTR_SQLTCHAR; NameLength1 : SQLSMALLINT; pSchemaName : PTR_SQLTCHAR; NameLength2 : SQLSMALLINT; pTableName : PTR_SQLTCHAR; NameLength3 : SQLSMALLINT; pCatalogName2 : PTR_SQLTCHAR; NameLength4 : SQLSMALLINT; pSchemaName2 : PTR_SQLTCHAR; NameLength5 : SQLSMALLINT; pTableName2 : PTR_SQLTCHAR; NameLength6 : SQLSMALLINT) return SQLRETURN; pragma Import ($CALLCONVENTION, ForeignKeys, "SQLForeignKeysW"); #else pragma Unreferenced (StatementHandle, PrimaryCatalogName, PrimarySchemaName, PrimaryTableName, ForeignCatalogName, ForeignSchemaName, ForeignTableName); #end if; begin #if UNICODE then return ForeignKeys (StatementHandle, To_PTR_SQLTCHAR (PrimaryCatalogName'Address), SQLSMALLINT (PrimaryCatalogName'Length), To_PTR_SQLTCHAR (PrimarySchemaName'Address), SQLSMALLINT (PrimarySchemaName'Length), To_PTR_SQLTCHAR (PrimaryTableName'Address), SQLSMALLINT (PrimaryTableName'Length), To_PTR_SQLTCHAR (ForeignCatalogName'Address), SQLSMALLINT (ForeignCatalogName'Length), To_PTR_SQLTCHAR (ForeignSchemaName'Address), SQLSMALLINT (ForeignSchemaName'Length), To_PTR_SQLTCHAR (ForeignTableName'Address), SQLSMALLINT (ForeignTableName'Length)); #else return SQL_ADA95_NO_UNICODE; #end if; end SQLForeignKeys; procedure SQLForeignKeys (StatementHandle : SQLHSTMT; PrimaryCatalogName : Wide_String; PrimarySchemaName : Wide_String; PrimaryTableName : Wide_String; ForeignCatalogName : Wide_String; ForeignSchemaName : Wide_String; ForeignTableName : Wide_String) is RC : constant SQLRETURN := SQLForeignKeys (StatementHandle, PrimaryCatalogName, PrimarySchemaName, PrimaryTableName, ForeignCatalogName, ForeignSchemaName, ForeignTableName); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLForeignKeys", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); end SQLForeignKeys; function SQLDescribeCol (StatementHandle : SQLHSTMT; ColumnNumber : SQL_Column_Number; MaxNameLength : SQLSMALLINT; DataType : access SQL_DATA_TYPE; ColumnSize : access SQLUINTEGER; DecimalDigits : access SQLSMALLINT; Nullable : access SQL_NULLABLE_INFO; ErrorCode : access SQLRETURN) return String is function DescribeCol (StatementHandle : SQLHSTMT; ColumnNumber : SQL_Column_Number; pColumnName : PTR_SQLCHAR; BufferLength : SQLSMALLINT; pNameLength : access SQLSMALLINT; pDataType : access SQL_DATA_TYPE; PColumnSize : access SQLUINTEGER; pDecimalDigits : access SQLSMALLINT; pNullable : access SQL_NULLABLE_INFO) return SQLRETURN; pragma Import ($CALLCONVENTION, DescribeCol, "SQLDescribeCol"); function Cvt_Type is new Ada.Unchecked_Conversion (SQL_DATA_TYPE, SQLSMALLINT); function Cvt_NI is new Ada.Unchecked_Conversion (SQL_NULLABLE_INFO, SQLSMALLINT); ProcName : constant String := "SQLDescribeCol"; pragma Assert (MaxNameLength > 0); pragma Warnings (Off); Str : String (1 .. Positive (MaxNameLength)); pragma Warnings (On); Len : aliased SQLSMALLINT := SQLSMALLINT (Str'Length); D_T : aliased SQL_DATA_TYPE; N_I : aliased SQL_NULLABLE_INFO; RC : constant SQLRETURN := DescribeCol (StatementHandle, ColumnNumber, To_PTR_SQLCHAR (Str'Address), Len, Len'Access, D_T'Access, ColumnSize, DecimalDigits, N_I'Access); begin ErrorCode.all := RC; if Is_SQL_Ok (RC) then if not D_T'Valid then Raise_Invalid_Enum (ProcedureName => ProcName, EnumName => "SQL_DATA_TYPE", EnumValue => SQLSMALLINT'Image (Cvt_Type (D_T))); elsif not N_I'Valid then Raise_Invalid_Enum (ProcedureName => ProcName, EnumName => "SQL_NULLABLE_INFO", EnumValue => SQLSMALLINT'Image (Cvt_NI (N_I))); else Nullable.all := N_I; DataType.all := D_T; if Len <= 0 then return ""; else return Str (1 .. Positive (Len)); end if; end if; else return ""; end if; end SQLDescribeCol; function SQLDescribeCol (StatementHandle : in SQLHSTMT; ColumnNumber : in SQL_Column_Number; MaxNameLength : in SQLSMALLINT; DataType : access SQL_DATA_TYPE; ColumnSize : access SQLUINTEGER; DecimalDigits : access SQLSMALLINT; Nullable : access SQL_NULLABLE_INFO) return String is ProcName : constant String := "SQLDescribeCol"; RC : aliased SQLRETURN; S : constant String := SQLDescribeCol (StatementHandle, ColumnNumber, MaxNameLength, DataType, ColumnSize, DecimalDigits, Nullable, RC'Access); begin Check_SQL_Error (RC => RC, ProcedureName => ProcName, HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); return S; end SQLDescribeCol; function SQLDescribeCol (StatementHandle : SQLHSTMT; ColumnNumber : SQL_Column_Number; MaxNameLength : SQLSMALLINT; DataType : access SQL_DATA_TYPE; ColumnSize : access SQLUINTEGER; DecimalDigits : access SQLSMALLINT; Nullable : access SQL_NULLABLE_INFO; ErrorCode : access SQLRETURN) return Wide_String is #if UNICODE then ProcName : constant String := "SQLDescribeCol"; function DescribeCol (StatementHandle : SQLHSTMT; ColumnNumber : SQL_Column_Number; pColumnName : PTR_SQLTCHAR; BufferLength : SQLSMALLINT; pNameLength : access SQLSMALLINT; pDataType : access SQL_DATA_TYPE; PColumnSize : access SQLUINTEGER; pDecimalDigits : access SQLSMALLINT; pNullable : access SQL_NULLABLE_INFO) return SQLRETURN; pragma Import ($CALLCONVENTION, DescribeCol, "SQLDescribeColW"); function Cvt_Type is new Ada.Unchecked_Conversion (SQL_DATA_TYPE, SQLSMALLINT); function Cvt_NI is new Ada.Unchecked_Conversion (SQL_NULLABLE_INFO, SQLSMALLINT); pragma Assert (MaxNameLength > 0); pragma Warnings (Off); Str : Wide_String (1 .. Positive (MaxNameLength)); pragma Warnings (On); Len : aliased SQLSMALLINT := SQLSMALLINT (Str'Length); D_T : aliased SQL_DATA_TYPE; N_I : aliased SQL_NULLABLE_INFO; RC : constant SQLRETURN := DescribeCol (StatementHandle, ColumnNumber, To_PTR_SQLTCHAR (Str'Address), Len, Len'Access, D_T'Access, ColumnSize, DecimalDigits, N_I'Access); #else pragma Unreferenced (StatementHandle, ColumnNumber, MaxNameLength, DataType, ColumnSize, DecimalDigits, Nullable); #end if; begin #if UNICODE then ErrorCode.all := RC; if Is_SQL_Ok (RC) then if not D_T'Valid then Raise_Invalid_Enum (ProcedureName => ProcName, EnumName => "SQL_DATA_TYPE", EnumValue => SQLSMALLINT'Image (Cvt_Type (D_T))); elsif not N_I'Valid then Raise_Invalid_Enum (ProcedureName => ProcName, EnumName => "SQL_NULLABLE_INFO", EnumValue => SQLSMALLINT'Image (Cvt_NI (N_I))); else Nullable.all := N_I; DataType.all := D_T; if Len <= 0 then return Wide_String'(""); else return Str (1 .. Positive (Len)); end if; end if; else return Wide_String'(""); end if; #else ErrorCode.all := SQL_ADA95_NO_UNICODE; return Wide_String'(""); #end if; end SQLDescribeCol; function SQLDescribeCol (StatementHandle : in SQLHSTMT; ColumnNumber : in SQL_Column_Number; MaxNameLength : in SQLSMALLINT; DataType : access SQL_DATA_TYPE; ColumnSize : access SQLUINTEGER; DecimalDigits : access SQLSMALLINT; Nullable : access SQL_NULLABLE_INFO) return Wide_String is ProcName : constant String := "SQLDescribeCol"; RC : aliased SQLRETURN; S : constant Wide_String := SQLDescribeCol (StatementHandle, ColumnNumber, MaxNameLength, DataType, ColumnSize, DecimalDigits, Nullable, RC'Access); begin Check_SQL_Error (RC => RC, ProcedureName => ProcName, HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); return S; end SQLDescribeCol; function SQLColumns (StatementHandle : in SQLHSTMT; CatalogName : in String; SchemaName : in String := SQL_ALL_SCHEMAS; TableName : in String := SQL_ALL_TABLES; ColumnName : in String := SQL_ALL_COLUMNS) return SQLRETURN is function Columns (StatementHandle : SQLHSTMT; pCatalogName : PTR_SQLCHAR; NameLength1 : SQLSMALLINT; pSchemaName : PTR_SQLCHAR; NameLength2 : SQLSMALLINT; pTableName : PTR_SQLCHAR; NameLength3 : SQLSMALLINT; pColumnName : PTR_SQLCHAR; NameLength4 : SQLSMALLINT) return SQLRETURN; pragma Import ($CALLCONVENTION, Columns, "SQLColumns"); begin return Columns (StatementHandle, To_PTR_SQLCHAR (CatalogName'Address), SQLSMALLINT (CatalogName'Length), To_PTR_SQLCHAR (SchemaName'Address), SQLSMALLINT (SchemaName'Length), To_PTR_SQLCHAR (TableName'Address), SQLSMALLINT (TableName'Length), To_PTR_SQLCHAR (ColumnName'Address), SQLSMALLINT (ColumnName'Length)); end SQLColumns; procedure SQLColumns (StatementHandle : in SQLHSTMT; CatalogName : in String; SchemaName : in String := SQL_ALL_SCHEMAS; TableName : in String := SQL_ALL_TABLES; ColumnName : in String := SQL_ALL_COLUMNS) is RC : constant SQLRETURN := SQLColumns (StatementHandle, CatalogName, SchemaName, TableName, ColumnName); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLColumns", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); end SQLColumns; function SQLColumns (StatementHandle : in SQLHSTMT; CatalogName : in Wide_String; SchemaName : in Wide_String := W_SQL_ALL_SCHEMAS; TableName : in Wide_String := W_SQL_ALL_TABLES; ColumnName : in Wide_String := W_SQL_ALL_COLUMNS) return SQLRETURN is #if UNICODE then function Columns (StatementHandle : SQLHSTMT; pCatalogName : PTR_SQLTCHAR; NameLength1 : SQLSMALLINT; pSchemaName : PTR_SQLTCHAR; NameLength2 : SQLSMALLINT; pTableName : PTR_SQLTCHAR; NameLength3 : SQLSMALLINT; pColumnName : PTR_SQLTCHAR; NameLength4 : SQLSMALLINT) return SQLRETURN; pragma Import ($CALLCONVENTION, Columns, "SQLColumnsW"); #else pragma Unreferenced (StatementHandle, CatalogName, SchemaName, TableName, ColumnName); #end if; begin #if UNICODE then return Columns (StatementHandle, To_PTR_SQLTCHAR (CatalogName'Address), SQLSMALLINT (CatalogName'Length), To_PTR_SQLTCHAR (SchemaName'Address), SQLSMALLINT (SchemaName'Length), To_PTR_SQLTCHAR (TableName'Address), SQLSMALLINT (TableName'Length), To_PTR_SQLTCHAR (ColumnName'Address), SQLSMALLINT (ColumnName'Length)); #else return SQL_ADA95_NO_UNICODE; #end if; end SQLColumns; procedure SQLColumns (StatementHandle : in SQLHSTMT; CatalogName : in Wide_String; SchemaName : in Wide_String := W_SQL_ALL_SCHEMAS; TableName : in Wide_String := W_SQL_ALL_TABLES; ColumnName : in Wide_String := W_SQL_ALL_COLUMNS) is RC : constant SQLRETURN := SQLColumns (StatementHandle, CatalogName, SchemaName, TableName, ColumnName); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLColumns", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); end SQLColumns; function SQLNativeSql (ConnectionHandle : SQLHDBC; StatementText : String; MaxLength : SQLINTEGER := 1024; ErrorCode : access SQLRETURN) return String is function NativeSql (ConnectionHandle : SQLHDBC; pszSqlStrIn : PTR_SQLCHAR; cbSqlStrIn : SQLINTEGER; pszSqlStr : PTR_SQLCHAR; cbSqlStrMax : SQLINTEGER; pcbSqlStr : access SQLINTEGER) return SQLRETURN; pragma Import ($CALLCONVENTION, NativeSql, "SQLNativeSql"); pragma Assert (MaxLength > 0); pragma Warnings (Off); Str : String (1 .. Positive (MaxLength)); pragma Warnings (On); Len : aliased SQLINTEGER := MaxLength; RC : constant SQLRETURN := NativeSql (ConnectionHandle, To_PTR_SQLCHAR (StatementText'Address), SQLINTEGER (StatementText'Length), To_PTR_SQLCHAR (Str'Address), Len, Len'Access); begin ErrorCode.all := RC; if Is_SQL_Ok (RC) then if Len <= 0 then return ""; else return Str (1 .. Positive (Len)); end if; else return ""; end if; end SQLNativeSql; function SQLNativeSql (ConnectionHandle : SQLHDBC; StatementText : String; MaxLength : SQLINTEGER := 1024) return String is RC : aliased SQLRETURN; S : constant String := SQLNativeSql (ConnectionHandle, StatementText, MaxLength, RC'Access); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLNativeSql", HandleType => SQL_HANDLE_DBC, Handle => ConnectionHandle); return S; end SQLNativeSql; function SQLNativeSql (ConnectionHandle : SQLHDBC; StatementText : Wide_String; MaxLength : SQLINTEGER := 1024; ErrorCode : access SQLRETURN) return Wide_String is #if UNICODE then function NativeSql (ConnectionHandle : SQLHDBC; pszSqlStrIn : PTR_SQLTCHAR; cbSqlStrIn : SQLINTEGER; pszSqlStr : PTR_SQLTCHAR; cbSqlStrMax : SQLINTEGER; pcbSqlStr : access SQLINTEGER) return SQLRETURN; pragma Import ($CALLCONVENTION, NativeSql, "SQLNativeSqlW"); pragma Assert (MaxLength > 0); pragma Warnings (Off); Str : Wide_String (1 .. Positive (MaxLength)); pragma Warnings (On); Len : aliased SQLINTEGER := MaxLength; RC : constant SQLRETURN := NativeSql (ConnectionHandle, To_PTR_SQLTCHAR (StatementText'Address), SQLINTEGER (StatementText'Length), To_PTR_SQLTCHAR (Str'Address), Len, Len'Access); #else pragma Unreferenced (ConnectionHandle, StatementText, MaxLength); #end if; begin #if UNICODE then ErrorCode.all := RC; if Is_SQL_Ok (RC) then if Len <= 0 then return Wide_String'(""); else return Str (1 .. Positive (Len)); end if; else return Wide_String'(""); end if; #else ErrorCode.all := SQL_ADA95_NO_UNICODE; return Wide_String'(""); #end if; end SQLNativeSql; function SQLNativeSql (ConnectionHandle : SQLHDBC; StatementText : Wide_String; MaxLength : SQLINTEGER := 1024) return Wide_String is RC : aliased SQLRETURN; S : constant Wide_String := SQLNativeSql (ConnectionHandle, StatementText, MaxLength, RC'Access); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLNativeSql", HandleType => SQL_HANDLE_DBC, Handle => ConnectionHandle); return S; end SQLNativeSql; function SQLBulkOperations (StatementHandle : SQLHSTMT; Operation : BULK_OPERATION) return SQLRETURN is function BulkOperations (StatementHandle : SQLHSTMT; Operation : BULK_OPERATION) return SQLRETURN; pragma Import ($CALLCONVENTION, BulkOperations, "SQLBulkOperations"); begin return BulkOperations (StatementHandle, Operation); end SQLBulkOperations; procedure SQLBulkOperations (StatementHandle : SQLHSTMT; Operation : BULK_OPERATION) is RC : constant SQLRETURN := SQLBulkOperations (StatementHandle, Operation); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLBulkOperations", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); end SQLBulkOperations; function SQLMoreResults (StatementHandle : SQLHSTMT) return SQLRETURN is function MoreResults (StatementHandle : SQLHSTMT) return SQLRETURN; pragma Import ($CALLCONVENTION, MoreResults, "SQLMoreResults"); begin return MoreResults (StatementHandle); end SQLMoreResults; function SQLSetPos (StatementHandle : in SQLHSTMT; RowNumber : in SQLUSMALLINT; Operation : in POSITION_OPERATION; LockType : in POSITION_LOCKTYPE) return SQLRETURN is function SetPos (StatementHandle : in SQLHSTMT; RowNumber : in SQLUSMALLINT; Operation : in POSITION_OPERATION; LockType : in POSITION_LOCKTYPE) return SQLRETURN; pragma Import ($CALLCONVENTION, SetPos, "SQLSetPos"); begin return SetPos (StatementHandle, RowNumber, Operation, LockType); end SQLSetPos; procedure SQLSetPos (StatementHandle : in SQLHSTMT; RowNumber : in SQLUSMALLINT; Operation : in POSITION_OPERATION; LockType : in POSITION_LOCKTYPE) is RC : constant SQLRETURN := SQLSetPos (StatementHandle, RowNumber, Operation, LockType); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLSetPos", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); end SQLSetPos; procedure SQLBrowseConnect (ConnectionHandle : in SQLHDBC; InConnectionString : in String; OutConnectionString : out String; OutConnectionStrLen : out SQLSMALLINT; RC : out SQLRETURN) is use Ada.Strings.Fixed; function BrowseConnect (ConnectionHandle : SQLHDBC; InConnectionString : PTR_SQLCHAR; Len1 : SQLSMALLINT; OutConnectionString : PTR_SQLCHAR; Len2 : SQLSMALLINT; pOutLen : access SQLSMALLINT) return SQLRETURN; pragma Import ($CALLCONVENTION, BrowseConnect, "SQLBrowseConnect"); Len : aliased SQLSMALLINT; IFill : Natural; EC : constant SQLRETURN := BrowseConnect (ConnectionHandle, To_PTR_SQLCHAR (InConnectionString'Address), SQLSMALLINT (InConnectionString'Length), To_PTR_SQLCHAR (OutConnectionString'Address), SQLSMALLINT (OutConnectionString'Length), Len'Access); begin RC := EC; if Is_SQL_Ok (EC) then OutConnectionStrLen := Len; if Len < OutConnectionString'Length then IFill := OutConnectionString'Length - Natural (Len); OutConnectionString ((OutConnectionString'First + Natural (Len)) .. OutConnectionString'Last) := IFill * ' '; end if; end if; end SQLBrowseConnect; procedure SQLBrowseConnect (ConnectionHandle : in SQLHDBC; InConnectionString : in String; OutConnectionString : out String; OutConnectionStrLen : out SQLSMALLINT) is RC : SQLRETURN; begin SQLBrowseConnect (ConnectionHandle, InConnectionString, OutConnectionString, OutConnectionStrLen, RC); Check_SQL_Error (RC => RC, ProcedureName => "SQLBrowseConnect", HandleType => SQL_HANDLE_DBC, Handle => ConnectionHandle); end SQLBrowseConnect; procedure SQLBrowseConnect (ConnectionHandle : in SQLHDBC; InConnectionString : in Wide_String; OutConnectionString : out Wide_String; OutConnectionStrLen : out SQLSMALLINT; RC : out SQLRETURN) is use Ada.Strings.Wide_Fixed; #if UNICODE then function BrowseConnect (ConnectionHandle : SQLHDBC; InConnectionString : PTR_SQLTCHAR; Len1 : SQLSMALLINT; OutConnectionString : PTR_SQLTCHAR; Len2 : SQLSMALLINT; pOutLen : access SQLSMALLINT) return SQLRETURN; pragma Import ($CALLCONVENTION, BrowseConnect, "SQLBrowseConnectW"); Len : aliased SQLSMALLINT; IFill : Natural; EC : constant SQLRETURN := BrowseConnect (ConnectionHandle, To_PTR_SQLTCHAR (InConnectionString'Address), SQLSMALLINT (InConnectionString'Length), To_PTR_SQLTCHAR (OutConnectionString'Address), SQLSMALLINT (OutConnectionString'Length), Len'Access); #else pragma Unreferenced (ConnectionHandle, InConnectionString); #end if; begin #if UNICODE then RC := EC; if Is_SQL_Ok (EC) then OutConnectionStrLen := Len; if Len < OutConnectionString'Length then IFill := OutConnectionString'Length - Natural (Len); OutConnectionString ((OutConnectionString'First + Natural (Len)) .. OutConnectionString'Last) := IFill * Wide_Character'(' '); end if; end if; #else RC := SQL_ADA95_NO_UNICODE; OutConnectionString := OutConnectionString'Length * Wide_Character'(' '); OutConnectionStrLen := 0; #end if; end SQLBrowseConnect; procedure SQLBrowseConnect (ConnectionHandle : in SQLHDBC; InConnectionString : in Wide_String; OutConnectionString : out Wide_String; OutConnectionStrLen : out SQLSMALLINT) is RC : SQLRETURN; begin SQLBrowseConnect (ConnectionHandle, InConnectionString, OutConnectionString, OutConnectionStrLen, RC); Check_SQL_Error (RC => RC, ProcedureName => "SQLBrowseConnect", HandleType => SQL_HANDLE_DBC, Handle => ConnectionHandle); end SQLBrowseConnect; procedure SQLDriverConnect (ConnectionHandle : in SQLHDBC; WindowHandle : in SQLHWND := SQL_NULL_HWND; Completion : in DRIVER_COMPLETION := SQL_DRIVER_NOPROMPT; InConnectionString : in String; OutConnectionString : out String; OutConnectionStrLen : out SQLSMALLINT; RC : out SQLRETURN) is use Ada.Strings.Fixed; function DriverConnect (ConnectionHandle : SQLHDBC; WindowHandle : SQLHWND; InConnectionString : PTR_SQLCHAR; Len1 : SQLSMALLINT; OutConnectionString : PTR_SQLCHAR; Len2 : SQLSMALLINT; pOutLen : access SQLSMALLINT; Completion : DRIVER_COMPLETION) return SQLRETURN; pragma Import ($CALLCONVENTION, DriverConnect, "SQLDriverConnect"); Len : aliased SQLSMALLINT; IFill : Natural; EC : constant SQLRETURN := DriverConnect (ConnectionHandle, WindowHandle, To_PTR_SQLCHAR (InConnectionString'Address), SQLSMALLINT (InConnectionString'Length), To_PTR_SQLCHAR (OutConnectionString'Address), SQLSMALLINT (OutConnectionString'Length), Len'Access, Completion); begin RC := EC; if Is_SQL_Ok (EC) then OutConnectionStrLen := Len; if Len < OutConnectionString'Length then IFill := OutConnectionString'Length - Natural (Len); OutConnectionString ((OutConnectionString'First + Natural (Len)) .. OutConnectionString'Last) := IFill * ' '; end if; end if; end SQLDriverConnect; procedure SQLDriverConnect (ConnectionHandle : in SQLHDBC; WindowHandle : in SQLHWND := SQL_NULL_HWND; Completion : in DRIVER_COMPLETION := SQL_DRIVER_NOPROMPT; InConnectionString : in String; OutConnectionString : out String; OutConnectionStrLen : out SQLSMALLINT) is RC : SQLRETURN; begin SQLDriverConnect (ConnectionHandle, WindowHandle, Completion, InConnectionString, OutConnectionString, OutConnectionStrLen, RC); Check_SQL_Error (RC => RC, ProcedureName => "SQLDriverConnect", HandleType => SQL_HANDLE_DBC, Handle => ConnectionHandle); end SQLDriverConnect; procedure SQLDriverConnect (ConnectionHandle : in SQLHDBC; WindowHandle : in SQLHWND := SQL_NULL_HWND; Completion : in DRIVER_COMPLETION := SQL_DRIVER_NOPROMPT; InConnectionString : in Wide_String; OutConnectionString : out Wide_String; OutConnectionStrLen : out SQLSMALLINT; RC : out SQLRETURN) is use Ada.Strings.Wide_Fixed; #if UNICODE then function DriverConnect (ConnectionHandle : SQLHDBC; WindowHandle : SQLHWND; InConnectionString : PTR_SQLTCHAR; Len1 : SQLSMALLINT; OutConnectionString : PTR_SQLTCHAR; Len2 : SQLSMALLINT; pOutLen : access SQLSMALLINT; Completion : DRIVER_COMPLETION) return SQLRETURN; pragma Import ($CALLCONVENTION, DriverConnect, "SQLDriverConnectW"); Len : aliased SQLSMALLINT; IFill : Natural; EC : constant SQLRETURN := DriverConnect (ConnectionHandle, WindowHandle, To_PTR_SQLTCHAR (InConnectionString'Address), SQLSMALLINT (InConnectionString'Length), To_PTR_SQLTCHAR (OutConnectionString'Address), SQLSMALLINT (OutConnectionString'Length), Len'Access, Completion); #else pragma Unreferenced (ConnectionHandle, WindowHandle, Completion, InConnectionString); #end if; begin #if UNICODE then RC := EC; if Is_SQL_Ok (EC) then OutConnectionStrLen := Len; if Len < OutConnectionString'Length then IFill := OutConnectionString'Length - Natural (Len); OutConnectionString ((OutConnectionString'First + Natural (Len)) .. OutConnectionString'Last) := IFill * Wide_Character'(' '); end if; end if; #else RC := SQL_ADA95_NO_UNICODE; OutConnectionString := OutConnectionString'Length * Wide_Character'(' '); OutConnectionStrLen := 0; #end if; end SQLDriverConnect; procedure SQLDriverConnect (ConnectionHandle : in SQLHDBC; WindowHandle : in SQLHWND := SQL_NULL_HWND; Completion : in DRIVER_COMPLETION := SQL_DRIVER_NOPROMPT; InConnectionString : in Wide_String; OutConnectionString : out Wide_String; OutConnectionStrLen : out SQLSMALLINT) is RC : SQLRETURN; begin SQLDriverConnect (ConnectionHandle, WindowHandle, Completion, InConnectionString, OutConnectionString, OutConnectionStrLen, RC); Check_SQL_Error (RC => RC, ProcedureName => "SQLDriverConnect", HandleType => SQL_HANDLE_DBC, Handle => ConnectionHandle); end SQLDriverConnect; procedure Raise_Invalid_Enum (ProcedureName : in String; EnumName : in String; EnumValue : in String) is begin Raise_SQL_Error (ProcedureName => ProcedureName, ErrorMessage => EnumName & " invalid value is " & EnumValue, RC => SQL_ADA95_INVALID_ENUM); end Raise_Invalid_Enum; function SQL_LEN_DATA_AT_EXEC (Length : SQLINTEGER) return SQLINTEGER is begin return SQL_LEN_DATA_AT_EXEC_OFFSET - Length; end SQL_LEN_DATA_AT_EXEC; function SQL_LEN_BINARY_ATTR (Length : SQLINTEGER) return SQLINTEGER is begin return SQL_LEN_BINARY_ATTR_OFFSET - Length; end SQL_LEN_BINARY_ATTR; procedure SQLFixNTS (Column : in out String; R_Index : SQLINTEGER := SQLINTEGER'Last; Pad : Character := ' ') is use Ada.Strings.Fixed; I : Integer := Integer (R_Index); begin if I = Integer (SQLINTEGER'Last) then I := Column'Last; elsif I <= 0 then Column := Column'Length * Pad; return; end if; if I in Column'First .. Column'Last then while I >= Column'First and then Column (I) = ASCII.NUL loop Column (I) := Pad; I := I - 1; end loop; I := I + 1; while I <= Column'Last loop Column (I) := Pad; I := I + 1; end loop; end if; end SQLFixNTS; procedure SQLFixNTS (Column : in out Wide_String; R_Index : SQLINTEGER := SQLINTEGER'Last; Pad : Wide_Character := Wide_Character'(' ')) is use Ada.Strings.Wide_Fixed; I : Integer := Integer (R_Index); begin if I = Integer (SQLINTEGER'Last) then I := Column'Last; elsif I <= 0 then Column := Column'Length * Pad; return; end if; if I in Column'First .. Column'Last then while I >= Column'First and then Wide_Character'Pos (Column (I)) = 0 loop Column (I) := Pad; I := I - 1; end loop; I := I + 1; while I <= Column'Last loop Column (I) := Pad; I := I + 1; end loop; end if; end SQLFixNTS; Attr_Init_Index : Natural := 0; type Attr_Initializer is array (1 .. 8) of Attr_Init; AI : Attr_Initializer; procedure Unicode_Attributes (Flag : in Boolean := True) is begin if Flag /= Unicode_Attr_Flag then Unicode_Attr_Flag := Flag; if Attr_Init_Index > 0 then for I in 1 .. Attr_Init_Index loop AI (I).all; end loop; end if; end if; end Unicode_Attributes; procedure Register_Initializer (Ini : in Attr_Init) is begin if Attr_Init_Index = Attr_Initializer'Last then raise Constraint_Error; else Attr_Init_Index := Attr_Init_Index + 1; AI (Attr_Init_Index) := Ini; end if; end Register_Initializer; end GNU.DB.SQLCLI; gnade-1.6.2.orig/dbi/odbc/Makefile.odbc0000644000175000017500000000654610027000434017411 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/dbi/odbc/Makefile.odbc,v $ -- ## Description : Makefile for the ODBC binding -- ## Author : Michael Erdmann -- ## Created On : 23-Feb-2004 -- ## Last Modified By: $Author: merdmann $ -- ## Last Modified On: $Date: 2004/03/20 08:30:20 $ -- ## Status : $State: Exp $ -- ## -- ## Copyright (C) 2000-2004 -- ## -- ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## This makefile builds the thin ODBC binding headers and libraries and ## copies them into the proper include resp. lib directory. We build a ## static as well as a shared version of the binding library. ## ## Restrictions ## ============ ## ## References ## ========== ## all build: $(MAKE) -C./ $@ gnade-1.6.2.orig/dbi/odbc/odbc.gpr0000644000175000017500000000246710663625727016512 0ustar lbrentalbrenta-- $Id: odbc.gpr,v 1.9 2007/08/24 19:04:55 merdmann Exp $ with "../../gnade"; with "../../support/support"; project Odbc is type Arch_Type is ("linux-gnu-i686"); for Languages use ("Ada"); for Source_Dirs use ("."); for Object_Dir use "."; ARCH : Arch_Type := external ("ARCH"); package Compiler is Release_Switches := ("-g", "-O3", "-gnatn", "-gnatf", "-gnatwa", "-gnatwL", "-gnaty3abefhiklM120prtn"); for Default_Switches ("ada") use Release_Switches; -- We need to suppress "warning not referenced" on the generic -- formals in these packages; they are referenced in the children. for Switches ("gnu-db-sqlcli-generic_attr.ads") use Release_Switches & ("-gnatwU"); case ARCH is when "linux-gnu-i686" => for Default_Switches ("ada") use ("-O3", "-gnatn", "-gnatf", "-g", "-gnat05", "-gnatwc", "-gnatwf", "-gnatwi", "-gnatwj", "-gnatwk", "-gnatwm", "-gnatwo", "-gnatwp", "-gnatwr", "-gnatwu", "-gnatwv", "-gnatwz", "-gnatya", "-gnatyb", "-gnatye", "-gnatyf", "-gnatyh", "-gnatyi", "-gnatyk", "-gnatyl", "-gnatyn", "-gnatyp", "-gnatyr", "-gnatyt", "-gnatyM120", "-gnatwL"); end case; end Compiler; package Builder is for Default_Switches ("ada") use ("-s", "-m", "-g", "-gnatQ", Gnade.Includeopt); end Builder; end Odbc; gnade-1.6.2.orig/dbi/odbc/gnade-odbc.gpr0000644000175000017500000000161610670060317017543 0ustar lbrentalbrenta-- $Id: gnade-odbc.gpr,v 1.1 2007/09/06 20:19:27 persan Exp $ with "../../gnade" ; with "../../support/gnade-support"; project Gnade.Odbc is for Languages use ("Ada"); for Source_Dirs use ("."); for Object_Dir use "lib-obj"; for Library_name use "gnadeodbc"; for Library_Kind use "static"; for Library_Dir use project'Object_Dir & "/lib"; package Builder is for Default_Switches ("Ada") use Gnade.Builder'Default_Switches ("Ada"); end Builder; package Compiler is for Default_Switches ("Ada") use Gnade.Compiler'Default_Switches ("Ada"); -- We need to suppress "warning not referenced" on the generic -- formals in these packages; they are referenced in the children. for Switches ("gnu-db-sqlcli-generic_attr.ads") use Compiler'Default_Switches ("Ada") & ("-gnatwU"); end Compiler; package IDE renames Gnade.Ide; end Gnade.Odbc; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-bind.adb0000644000175000017500000001361707735567063021117 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2002 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Unchecked_Conversion; package body GNU.DB.SQLCLI.Bind is function To_SQLPOINTER is new Ada.Unchecked_Conversion (Variable_Type_Pointer, SQLPOINTER); function SQLBindCol (StatementHandle : SQLHSTMT; ColumnNumber : SQL_Column_Number; TargetType : SQL_C_DATA_TYPE; TargetValue : Variable_Type_Pointer; BufferLength : SQLINTEGER; pStrLen_or_Ind : access SQLINTEGER) return SQLRETURN is begin return SQLBindCol (StatementHandle, ColumnNumber, TargetType, To_SQLPOINTER (TargetValue), BufferLength, pStrLen_or_Ind); end SQLBindCol; procedure SQLBindCol (StatementHandle : in SQLHSTMT; ColumnNumber : in SQL_Column_Number; TargetType : in SQL_C_DATA_TYPE; TargetValuePtr : in Variable_Type_Pointer; BufferLength : in SQLINTEGER; StrLen_Or_IndPtr : access SQLINTEGER) is begin SQLBindCol (StatementHandle, ColumnNumber, TargetType, To_SQLPOINTER (TargetValuePtr), BufferLength, StrLen_Or_IndPtr); end SQLBindCol; function SQLBindParameter (StatementHandle : in SQLHSTMT; ParameterNumber : in SQL_Parameter_Number; InputOutputType : in SQL_Parameter_Type; ValueType : in SQL_C_DATA_TYPE; ParameterType : in SQL_DATA_TYPE; ColumnSize : in SQLUINTEGER; DecimalDigits : in SQLSMALLINT; Value : in Variable_Type_Pointer; BufferLength : in SQLINTEGER; StrLen_Or_IndPtr : access SQLINTEGER) return SQLRETURN is begin return SQLBindParameter (StatementHandle, ParameterNumber, InputOutputType, ValueType, ParameterType, ColumnSize, DecimalDigits, To_SQLPOINTER (Value), BufferLength, StrLen_Or_IndPtr); end SQLBindParameter; procedure SQLBindParameter (StatementHandle : in SQLHSTMT; ParameterNumber : in SQL_Parameter_Number; InputOutputType : in SQL_Parameter_Type; ValueType : in SQL_C_DATA_TYPE; ParameterType : in SQL_DATA_TYPE; ColumnSize : in SQLUINTEGER; DecimalDigits : in SQLSMALLINT; Value : in Variable_Type_Pointer; BufferLength : in SQLINTEGER; StrLen_Or_IndPtr : access SQLINTEGER) is begin SQLBindParameter (StatementHandle, ParameterNumber, InputOutputType, ValueType, ParameterType, ColumnSize, DecimalDigits, To_SQLPOINTER (Value), BufferLength, StrLen_Or_IndPtr); end SQLBindParameter; end GNU.DB.SQLCLI.Bind; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-bind.ads0000644000175000017500000001100207227712011021077 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2001 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- generic type Variable_Type is limited private; type Variable_Type_Pointer is access all Variable_Type; package GNU.DB.SQLCLI.Bind is function SQLBindCol (StatementHandle : SQLHSTMT; ColumnNumber : SQL_Column_Number; TargetType : SQL_C_DATA_TYPE; TargetValue : Variable_Type_Pointer; BufferLength : SQLINTEGER; pStrLen_or_Ind : access SQLINTEGER) return SQLRETURN; procedure SQLBindCol (StatementHandle : in SQLHSTMT; ColumnNumber : in SQL_Column_Number; TargetType : in SQL_C_DATA_TYPE; TargetValuePtr : in Variable_Type_Pointer; BufferLength : in SQLINTEGER; StrLen_Or_IndPtr : access SQLINTEGER); pragma Inline_Always (SQLBindCol); function SQLBindParameter (StatementHandle : in SQLHSTMT; ParameterNumber : in SQL_Parameter_Number; InputOutputType : in SQL_Parameter_Type; ValueType : in SQL_C_DATA_TYPE; ParameterType : in SQL_DATA_TYPE; ColumnSize : in SQLUINTEGER; DecimalDigits : in SQLSMALLINT; Value : in Variable_Type_Pointer; BufferLength : in SQLINTEGER; StrLen_Or_IndPtr : access SQLINTEGER) return SQLRETURN; procedure SQLBindParameter (StatementHandle : in SQLHSTMT; ParameterNumber : in SQL_Parameter_Number; InputOutputType : in SQL_Parameter_Type; ValueType : in SQL_C_DATA_TYPE; ParameterType : in SQL_DATA_TYPE; ColumnSize : in SQLUINTEGER; DecimalDigits : in SQLSMALLINT; Value : in Variable_Type_Pointer; BufferLength : in SQLINTEGER; StrLen_Or_IndPtr : access SQLINTEGER); pragma Inline_Always (SQLBindParameter); end GNU.DB.SQLCLI.Bind; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-connection_attribute-debug.adb0000644000175000017500000000713107227712011025460 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2001 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Exceptions; package body GNU.DB.SQLCLI.Connection_Attribute.Debug is procedure Dump (File : in Ada.Text_IO.File_Type; ConnectionHandle : in SQLHDBC) is package CA_IO is new Ada.Text_IO.Enumeration_IO (SQL_CONNECTION_ATTRIBUTE); use Ada.Text_IO; use CA_IO; procedure Dump_Connection_Attr (A : in SQL_CONNECTION_ATTRIBUTE); procedure Dump_Connection_Attr (A : in SQL_CONNECTION_ATTRIBUTE) is AV : constant Connection_Attribute'Class := SQLGetConnectAttr (ConnectionHandle, A); begin Put (File, A, Debug_Label_Width); Put (File, ": "); Put (File, Connection_Attributes.To_String (AV)); New_Line (File); end Dump_Connection_Attr; begin for I in SQL_CONNECTION_ATTRIBUTE'Range loop declare begin Dump_Connection_Attr (I); exception when Event : others => Put (File, I, Debug_Label_Width); Put (File, ": ***** "); Put (File, Ada.Exceptions.Exception_Name (Event)); Put (File, ", "); Put (File, Ada.Exceptions.Exception_Message (Event)); New_Line (File); end; end loop; end Dump; procedure Dump (ConnectionHandle : in SQLHDBC) is begin Dump (Ada.Text_IO.Standard_Output, ConnectionHandle); end Dump; end GNU.DB.SQLCLI.Connection_Attribute.Debug; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-connection_attribute-debug.ads0000644000175000017500000000465507227712011025511 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2001 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Text_IO; package GNU.DB.SQLCLI.Connection_Attribute.Debug is procedure Dump (File : in Ada.Text_IO.File_Type; ConnectionHandle : in SQLHDBC); procedure Dump (ConnectionHandle : in SQLHDBC); end GNU.DB.SQLCLI.Connection_Attribute.Debug; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-connection_attribute.ads0000644000175000017500000003470707475446337024452 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2001 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with GNU.DB.SQLCLI.Generic_Attr; with GNU.DB.SQLCLI.Dispatch; with GNU.DB.SQLCLI.Dispatch.A_Unsigned; with GNU.DB.SQLCLI.Dispatch.A_String; with GNU.DB.SQLCLI.Dispatch.A_Wide_String; with GNU.DB.SQLCLI.Dispatch.A_Enumerated; with GNU.DB.SQLCLI.Dispatch.A_Boolean; pragma Elaborate_All (GNU.DB.SQLCLI.Dispatch); pragma Elaborate_All (GNU.DB.SQLCLI.Dispatch.A_Unsigned); pragma Elaborate_All (GNU.DB.SQLCLI.Dispatch.A_String); pragma Elaborate_All (GNU.DB.SQLCLI.Dispatch.A_Wide_String); pragma Elaborate_All (GNU.DB.SQLCLI.Dispatch.A_Enumerated); pragma Elaborate_All (GNU.DB.SQLCLI.Dispatch.A_Boolean); package GNU.DB.SQLCLI.Connection_Attribute is type SQL_CONNECTION_ATTRIBUTE is (SQL_ATTR_ASYNC_ENABLE, SQL_ATTR_ACCESS_MODE, SQL_ATTR_AUTOCOMMIT, SQL_ATTR_LOGIN_TIMEOUT, SQL_ATTR_TRACE, SQL_ATTR_TRACEFILE, SQL_ATTR_TRANSLATE_LIB, SQL_ATTR_TRANSLATE_OPTION, SQL_ATTR_TXN_ISOLATION, SQL_ATTR_CURRENT_CATALOG, SQL_ATTR_ODBC_CURSORS, SQL_ATTR_QUIET_MODE, SQL_ATTR_PACKET_SIZE, SQL_ATTR_CONNECTION_TIMEOUT, SQL_ATTR_DISCONNECT_BEHAVIOR, SQL_ATTR_ENLIST_IN_DTC, SQL_ATTR_ENLIST_IN_XA, SQL_ATTR_CONNECTION_DEAD, SQL_ATTR_AUTO_IPD, SQL_ATTR_METADATA_ID); for SQL_CONNECTION_ATTRIBUTE use (SQL_ATTR_ASYNC_ENABLE => 4, SQL_ATTR_ACCESS_MODE => 101, SQL_ATTR_AUTOCOMMIT => 102, SQL_ATTR_LOGIN_TIMEOUT => 103, SQL_ATTR_TRACE => 104, SQL_ATTR_TRACEFILE => 105, SQL_ATTR_TRANSLATE_LIB => 106, SQL_ATTR_TRANSLATE_OPTION => 107, SQL_ATTR_TXN_ISOLATION => 108, SQL_ATTR_CURRENT_CATALOG => 109, SQL_ATTR_ODBC_CURSORS => 110, SQL_ATTR_QUIET_MODE => 111, SQL_ATTR_PACKET_SIZE => 112, SQL_ATTR_CONNECTION_TIMEOUT => 113, SQL_ATTR_DISCONNECT_BEHAVIOR => 114, SQL_ATTR_ENLIST_IN_DTC => 1207, SQL_ATTR_ENLIST_IN_XA => 1208, SQL_ATTR_CONNECTION_DEAD => 1209, SQL_ATTR_AUTO_IPD => 10001, SQL_ATTR_METADATA_ID => 10014); for SQL_CONNECTION_ATTRIBUTE'Size use SQLINTEGER'Size; -- Some old names SQL_ACCESS_MODE : constant SQL_CONNECTION_ATTRIBUTE := SQL_ATTR_ACCESS_MODE; SQL_AUTOCOMMIT : constant SQL_CONNECTION_ATTRIBUTE := SQL_ATTR_AUTOCOMMIT; SQL_CURRENT_QUALIFIER : constant SQL_CONNECTION_ATTRIBUTE := SQL_ATTR_CURRENT_CATALOG; SQL_LOGIN_TIMEOUT : constant SQL_CONNECTION_ATTRIBUTE := SQL_ATTR_LOGIN_TIMEOUT; SQL_ODBC_CURSORS : constant SQL_CONNECTION_ATTRIBUTE := SQL_ATTR_ODBC_CURSORS; SQL_PACKET_SIZE : constant SQL_CONNECTION_ATTRIBUTE := SQL_ATTR_PACKET_SIZE; SQL_QUIET_MODE : constant SQL_CONNECTION_ATTRIBUTE := SQL_ATTR_QUIET_MODE; SQL_OPT_TRACE : constant SQL_CONNECTION_ATTRIBUTE := SQL_ATTR_TRACE; SQL_OPT_TRACEFILE : constant SQL_CONNECTION_ATTRIBUTE := SQL_ATTR_TRACEFILE; SQL_TRANSLATE_DLL : constant SQL_CONNECTION_ATTRIBUTE := SQL_ATTR_TRANSLATE_LIB; SQL_TRANSLATE_OPTION : constant SQL_CONNECTION_ATTRIBUTE := SQL_ATTR_TRANSLATE_OPTION; SQL_TXN_ISOLATION : constant SQL_CONNECTION_ATTRIBUTE := SQL_ATTR_TXN_ISOLATION; procedure Get_Connect_Attr (ConnectionHandle : in SQLHDBC; Attribute : in SQL_CONNECTION_ATTRIBUTE; Value : in SQLPOINTER; Length : in out SQLINTEGER; Data : in SQLSMALLINT; ErrorCode : access SQLRETURN); pragma Inline (Get_Connect_Attr); procedure Set_Connect_Attr (ConnectionHandle : in SQLHDBC; Attribute : in SQL_CONNECTION_ATTRIBUTE; Value : in SQLPOINTER; Length : in SQLINTEGER; Data : in SQLSMALLINT; ErrorCode : out SQLRETURN); pragma Inline (Set_Connect_Attr); package Connection_Attributes is new GNU.DB.SQLCLI.Generic_Attr (Context => SQLHDBC, T => SQL_CONNECTION_ATTRIBUTE, Base => SQLINTEGER, Aux => SQLSMALLINT, Get => Get_Connect_Attr, Set => Set_Connect_Attr, Default_Context => Null_Handle); subtype Connection_Attribute is Connection_Attributes.Attribute_Value_Pair; package Dispatch is new GNU.DB.SQLCLI.Dispatch (Connection_Attributes); package CA_String is new Dispatch.A_String; subtype Connection_Attribute_String is CA_String.Info; package CA_WString is new Dispatch.A_Wide_String; subtype Connection_Attribute_Wide_String is CA_WString.Info; function SQLGetConnectAttr (ConnectionHandle : SQLHDBC; Attribute : SQL_CONNECTION_ATTRIBUTE; MaxLength : SQLSMALLINT := SQL_MAX_OPTION_STRING_LENGTH; ErrorCode : access SQLRETURN) return Connection_Attribute'Class; function SQLGetConnectAttr (ConnectionHandle : SQLHDBC; Attribute : SQL_CONNECTION_ATTRIBUTE; MaxLength : SQLSMALLINT := SQL_MAX_OPTION_STRING_LENGTH) return Connection_Attribute'Class; function SQLSetConnectAttr (ConnectionHandle : in SQLHDBC; AttrRec : in Connection_Attribute'Class) return SQLRETURN; procedure SQLSetConnectAttr (ConnectionHandle : in SQLHDBC; AttrRec : in Connection_Attribute'Class); package CA_Unsigned is new Dispatch.A_Unsigned (SQLUINTEGER); subtype Connection_Attribute_Unsigned is CA_Unsigned.Info; package CA_Boolean is new Dispatch.A_Boolean (SQLUINTEGER); subtype Connection_Attribute_Boolean is CA_Boolean.Info; -- --------------------------------------------------------------------- -- SQL_ATTR_CONNECTION_DEAD Values SQL_CD_TRUE : constant Boolean := True; SQL_CD_FALSE : constant Boolean := False; -- SQL_LOGIN_TIMEOUT options SQL_LOGIN_TIMEOUT_DEFAULT : constant SQLUINTEGER := 15; -- ---------------------------------------------------------------------- -- SQL_ACCESS_MODE values type ACCESS_MODE is (SQL_MODE_READ_WRITE, SQL_MODE_READ_ONLY); for ACCESS_MODE'Size use SQLINTEGER'Size; SQL_MODE_DEFAULT : constant ACCESS_MODE := SQL_MODE_READ_WRITE; package Dsp_Access_Mode is new Dispatch.A_Enumerated (SQL_ATTR_ACCESS_MODE, ACCESS_MODE, SQLINTEGER, "ACCESS_MODE"); subtype Connection_Attribute_Mode is Dsp_Access_Mode.Info; -- ---------------------------------------------------------------------- type ASYNC_ENABLE is (SQL_ASYNC_ENABLE_OFF, SQL_ASYNC_ENABLE_ON); -- | -- | values for SQL_ATTR_ASYNC_ENABLE -- | for ASYNC_ENABLE'Size use SQLINTEGER'Size; SQL_ASYNC_ENABLE_DEFAULT : constant ASYNC_ENABLE := SQL_ASYNC_ENABLE_OFF; package Dsp_Async_Enable is new Dispatch.A_Enumerated (SQL_ATTR_ASYNC_ENABLE, ASYNC_ENABLE, SQLINTEGER, "ASYNC_ENABLE"); subtype Connection_Attribute_Async is Dsp_Async_Enable.Info; -- ---------------------------------------------------------------------- type AUTOCOMMIT is (SQL_AUTOCOMMIT_OFF, SQL_AUTOCOMMIT_ON); for AUTOCOMMIT'Size use SQLINTEGER'Size; SQL_AUTOCOMMIT_DEFAULT : constant AUTOCOMMIT := SQL_AUTOCOMMIT_ON; package Dsp_AutoCommit is new Dispatch.A_Enumerated (SQL_ATTR_AUTOCOMMIT, AUTOCOMMIT, SQLINTEGER, "AUTOCOMMIT"); subtype Connection_Attribute_AutoCommit is Dsp_AutoCommit.Info; -- ---------------------------------------------------------------------- type CURSOR_USE is (SQL_CUR_USE_IF_NEEDED, SQL_CUR_USE_ODBC, SQL_CUR_USE_DRIVER); for CURSOR_USE'Size use SQLINTEGER'Size; SQL_CUR_DEFAULT : constant CURSOR_USE := SQL_CUR_USE_DRIVER; package Dsp_Cursors is new Dispatch.A_Enumerated (SQL_ATTR_ODBC_CURSORS, CURSOR_USE, SQLINTEGER, "CURSOR_USE"); subtype Connection_Attribute_ODBC_Cursors is Dsp_Cursors.Info; -- ---------------------------------------------------------------------- type DISCONNECT_BEHAVIOR is (SQL_DB_RETURN_TO_POOL, SQL_DB_DISCONNECT); for DISCONNECT_BEHAVIOR'Size use SQLINTEGER'Size; SQL_DB_DEFAULT : constant DISCONNECT_BEHAVIOR := SQL_DB_RETURN_TO_POOL; package Dsp_Disconnect_Behavior is new Dispatch.A_Enumerated (SQL_ATTR_DISCONNECT_BEHAVIOR, DISCONNECT_BEHAVIOR, SQLINTEGER, "DISCONNECT_BEHAVIOR"); subtype Connection_Attribute_Disconnect_Behavior is Dsp_Disconnect_Behavior.Info; -- ---------------------------------------------------------------------- type OPT_TRACE is (SQL_OPT_TRACE_OFF, SQL_OPT_TRACE_ON); for OPT_TRACE'Size use SQLINTEGER'Size; SQL_OPT_TRACE_DEFAULT : constant OPT_TRACE := SQL_OPT_TRACE_OFF; package Dsp_Trace is new Dispatch.A_Enumerated (SQL_ATTR_TRACE, OPT_TRACE, SQLINTEGER, "OPT_TRACE"); subtype Connection_Attribute_Trace is Dsp_Trace.Info; -- ---------------------------------------------------------------------- type TXN_ISOLATION_OPTION is (SQL_TRANSACTION_READ_UNCOMMITTED, SQL_TRANSACTION_READ_COMMITTED, SQL_TRANSACTION_REPEATABLE_READ, SQL_TRANSACTION_SERIALIZABLE); for TXN_ISOLATION_OPTION use (SQL_TRANSACTION_READ_UNCOMMITTED => 1, SQL_TRANSACTION_READ_COMMITTED => 2, SQL_TRANSACTION_REPEATABLE_READ => 4, SQL_TRANSACTION_SERIALIZABLE => 8); for TXN_ISOLATION_OPTION'Size use SQLUINTEGER'Size; SQL_TXN_READ_UNCOMMITTED : constant TXN_ISOLATION_OPTION := SQL_TRANSACTION_READ_UNCOMMITTED; SQL_TXN_READ_COMMITTED : constant TXN_ISOLATION_OPTION := SQL_TRANSACTION_READ_COMMITTED; SQL_TXN_REPEATABLE_READ : constant TXN_ISOLATION_OPTION := SQL_TRANSACTION_REPEATABLE_READ; SQL_TXN_SERIALIZABLE : constant TXN_ISOLATION_OPTION := SQL_TRANSACTION_SERIALIZABLE; package Dsp_TXN_Isolation is new Dispatch.A_Enumerated (SQL_ATTR_TXN_ISOLATION, TXN_ISOLATION_OPTION, SQLINTEGER, "Info.TXN_ISOLATION_OPTION"); subtype Connection_Attribute_TXN_Isolation is Dsp_TXN_Isolation.Info; -- ---------------------------------------------------------------------- end GNU.DB.SQLCLI.Connection_Attribute; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-connection_attribute.gpb0000644000175000017500000002405307735567063024443 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2002 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- #if DEBUG then with GNU.DB.SQLCLI.Dispatch.Debug; pragma Elaborate_All (GNU.DB.SQLCLI.Dispatch.Debug); #end if; with GNU.DB.SQLCLI; pragma Elaborate_All (GNU.DB.SQLCLI); package body GNU.DB.SQLCLI.Connection_Attribute is #if DEBUG then package DD is new Dispatch.Debug; #end if; procedure Register_String_Attributes; procedure Get_Connect_Attr (ConnectionHandle : in SQLHDBC; Attribute : in SQL_CONNECTION_ATTRIBUTE; Value : in SQLPOINTER; Length : in out SQLINTEGER; Data : in SQLSMALLINT; ErrorCode : access SQLRETURN) is pragma Unreferenced (Data); function GetConnectAttr (ConnectionHandle : SQLHDBC; Attribute : SQL_CONNECTION_ATTRIBUTE; Value : SQLPOINTER; BufferLength : SQLINTEGER; pStringLength : access SQLINTEGER) return SQLRETURN; pragma Import ($CALLCONVENTION, GetConnectAttr, "SQLGetConnectAttr"); #if UNICODE then function GetConnectAttrW (ConnectionHandle : SQLHDBC; Attribute : SQL_CONNECTION_ATTRIBUTE; Value : SQLPOINTER; BufferLength : SQLINTEGER; pStringLength : access SQLINTEGER) return SQLRETURN; pragma Import ($CALLCONVENTION, GetConnectAttrW, "SQLGetConnectAttrW"); #end if; Len : aliased SQLINTEGER := Length; RC : SQLRETURN; begin if Unicode_Attr_Flag then #if UNICODE then RC := GetConnectAttrW (ConnectionHandle, Attribute, Value, Len, Len'Access); #else RC := SQL_ADA95_NO_UNICODE; Length := 0; #end if; else RC := GetConnectAttr (ConnectionHandle, Attribute, Value, Len, Len'Access); end if; ErrorCode.all := RC; if Is_SQL_Ok (RC) then Length := Len; end if; end Get_Connect_Attr; procedure Set_Connect_Attr (ConnectionHandle : in SQLHDBC; Attribute : in SQL_CONNECTION_ATTRIBUTE; Value : in SQLPOINTER; Length : in SQLINTEGER; Data : in SQLSMALLINT; ErrorCode : out SQLRETURN) is pragma Unreferenced (Data); function SetConnectAttr (ConnectionHandle : SQLHDBC; Attribute : SQL_CONNECTION_ATTRIBUTE; Value : SQLPOINTER; StringLength : SQLINTEGER) return SQLRETURN; pragma Import ($CALLCONVENTION, SetConnectAttr, "SQLSetConnectAttr"); #if UNICODE then function SetConnectAttrW (ConnectionHandle : SQLHDBC; Attribute : SQL_CONNECTION_ATTRIBUTE; Value : SQLPOINTER; StringLength : SQLINTEGER) return SQLRETURN; pragma Import ($CALLCONVENTION, SetConnectAttrW, "SQLSetConnectAttrW"); #end if; RC : SQLRETURN; begin if Unicode_Attr_Flag then #if UNICODE then RC := SetConnectAttrW (ConnectionHandle, Attribute, Value, Length); #else RC := SQL_ADA95_NO_UNICODE; #end if; else RC := SetConnectAttr (ConnectionHandle, Attribute, Value, Length); end if; ErrorCode := RC; end Set_Connect_Attr; function SQLGetConnectAttr (ConnectionHandle : SQLHDBC; Attribute : SQL_CONNECTION_ATTRIBUTE; MaxLength : SQLSMALLINT := SQL_MAX_OPTION_STRING_LENGTH; ErrorCode : access SQLRETURN) return Connection_Attribute'Class is use type Dispatch.Attr_Get_Func; F : constant Dispatch.Attr_Get_Func := Dispatch.Get_Func (Attribute); begin if F = null then Raise_SQL_Error ("SQLGetConnectAttr", SQL_CONNECTION_ATTRIBUTE'Image (Attribute) & Attr_Not_Supported_Msg); else return F.all (ConnectionHandle, Attribute, MaxLength, 0, ErrorCode); end if; end SQLGetConnectAttr; function SQLGetConnectAttr (ConnectionHandle : SQLHDBC; Attribute : SQL_CONNECTION_ATTRIBUTE; MaxLength : SQLSMALLINT := SQL_MAX_OPTION_STRING_LENGTH) return Connection_Attribute'Class is RC : aliased SQLRETURN; Result : constant Connection_Attribute'Class := SQLGetConnectAttr (ConnectionHandle, Attribute, MaxLength, RC'Access); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLGetConnectAttr", HandleType => SQL_HANDLE_DBC, Handle => ConnectionHandle); return Result; end SQLGetConnectAttr; function SQLSetConnectAttr (ConnectionHandle : SQLHDBC; AttrRec : Connection_Attribute'Class) return SQLRETURN is use type Dispatch.Attr_Set_Proc; F : constant Dispatch.Attr_Set_Proc := Dispatch.Set_Proc (AttrRec.Attribute); ProcName : constant String := "SQLSetConnectAttr"; ErrorCode : SQLRETURN; begin if F = null then Raise_SQL_Error (ProcName, SQL_CONNECTION_ATTRIBUTE'Image (AttrRec.Attribute) & Attr_Not_Supported_Msg); else F.all (ConnectionHandle, AttrRec, 0, ErrorCode); end if; return ErrorCode; end SQLSetConnectAttr; procedure SQLSetConnectAttr (ConnectionHandle : SQLHDBC; AttrRec : Connection_Attribute'Class) is RC : constant SQLRETURN := SQLSetConnectAttr (ConnectionHandle, AttrRec); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLSetConnectAttr", HandleType => SQL_HANDLE_DBC, Handle => ConnectionHandle); end SQLSetConnectAttr; procedure Register_String_Attributes is begin if Unicode_Attr_Flag then CA_WString.Register (SQL_ATTR_TRANSLATE_LIB); CA_WString.Register (SQL_ATTR_TRACEFILE); CA_WString.Register (SQL_ATTR_CURRENT_CATALOG); else CA_String.Register (SQL_ATTR_TRANSLATE_LIB); CA_String.Register (SQL_ATTR_TRACEFILE); CA_String.Register (SQL_ATTR_CURRENT_CATALOG); end if; end Register_String_Attributes; begin CA_Unsigned.Register (SQL_ATTR_CONNECTION_TIMEOUT); CA_Unsigned.Register (SQL_ATTR_LOGIN_TIMEOUT); CA_Unsigned.Register (SQL_ATTR_PACKET_SIZE); CA_Unsigned.Register (SQL_ATTR_TRANSLATE_OPTION); CA_Unsigned.Register (SQL_ATTR_ENLIST_IN_XA); CA_Unsigned.Register (SQL_ATTR_ENLIST_IN_DTC); CA_Unsigned.Register (SQL_ATTR_QUIET_MODE); CA_Boolean.Register (SQL_ATTR_CONNECTION_DEAD); CA_Boolean.Register (SQL_ATTR_METADATA_ID); CA_Boolean.Register (SQL_ATTR_AUTO_IPD); Register_String_Attributes; Register_Initializer (Register_String_Attributes'Access); #if DEBUG then DD.Verify; #end if; end GNU.DB.SQLCLI.Connection_Attribute; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-desc.ads0000644000175000017500000005575210663647575021151 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2001 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with GNU.DB.SQLCLI.Generic_Attr; with GNU.DB.SQLCLI.Dispatch; with GNU.DB.SQLCLI.Dispatch.A_Integer; with GNU.DB.SQLCLI.Dispatch.A_Unsigned; with GNU.DB.SQLCLI.Dispatch.A_Boolean; with GNU.DB.SQLCLI.Dispatch.A_Enumerated; with GNU.DB.SQLCLI.Dispatch.A_Array; with GNU.DB.SQLCLI.Dispatch.A_Pointer; with GNU.DB.SQLCLI.Dispatch.A_String; with GNU.DB.SQLCLI.Dispatch.A_Wide_String; package GNU.DB.SQLCLI.Desc is type SQL_DESC_FIELD_TYPE is (SQL_DESC_CONCISE_TYPE, SQL_DESC_DISPLAY_SIZE, SQL_DESC_UNSIGNED, SQL_DESC_FIXED_PREC_SCALE, SQL_DESC_UPDATABLE, SQL_DESC_AUTO_UNIQUE_VALUE, SQL_DESC_CASE_SENSITIVE, SQL_DESC_SEARCHABLE, SQL_DESC_TYPE_NAME, SQL_DESC_TABLE_NAME, SQL_DESC_SCHEMA_NAME, SQL_DESC_CATALOG_NAME, SQL_DESC_LABEL, SQL_DESC_ARRAY_SIZE, SQL_DESC_ARRAY_STATUS_PTR, SQL_DESC_BASE_COLUMN_NAME, SQL_DESC_BASE_TABLE_NAME, SQL_DESC_BIND_OFFSET_PTR, SQL_DESC_BIND_TYPE, SQL_DESC_DATETIME_INTERVAL_PRECISION, SQL_DESC_LITERAL_PREFIX, SQL_DESC_LITERAL_SUFFIX, SQL_DESC_LOCAL_TYPE_NAME, SQL_DESC_MAXIMUM_SCALE, SQL_DESC_MINIMUM_SCALE, SQL_DESC_NUM_PREC_RADIX, SQL_DESC_PARAMETER_TYPE, SQL_DESC_ROWS_PROCESSED_PTR, SQL_DESC_ROWVER, SQL_DESC_COUNT, SQL_DESC_TYPE, SQL_DESC_LENGTH, SQL_DESC_OCTET_LENGTH_PTR, SQL_DESC_PRECISION, SQL_DESC_SCALE, SQL_DESC_DATETIME_INTERVAL_CODE, SQL_DESC_NULLABLE, SQL_DESC_INDICATOR_PTR, SQL_DESC_DATA_PTR, SQL_DESC_NAME, SQL_DESC_UNNAMED, SQL_DESC_OCTET_LENGTH, SQL_DESC_ALLOC_TYPE); for SQL_DESC_FIELD_TYPE use (SQL_DESC_CONCISE_TYPE => 2, -- SQL_DESC_DISPLAY_SIZE => 6, -- SQL_DESC_UNSIGNED => 8, -- SQL_DESC_FIXED_PREC_SCALE => 9, -- SQL_DESC_UPDATABLE => 10, -- SQL_DESC_AUTO_UNIQUE_VALUE => 11, -- SQL_DESC_CASE_SENSITIVE => 12, -- SQL_DESC_SEARCHABLE => 13, -- SQL_DESC_TYPE_NAME => 14, -- SQL_DESC_TABLE_NAME => 15, -- SQL_DESC_SCHEMA_NAME => 16, -- SQL_DESC_CATALOG_NAME => 17, -- SQL_DESC_LABEL => 18, -- SQL_DESC_ARRAY_SIZE => 20, -- SQL_DESC_ARRAY_STATUS_PTR => 21, -- SQL_DESC_BASE_COLUMN_NAME => 22, -- SQL_DESC_BASE_TABLE_NAME => 23, -- SQL_DESC_BIND_OFFSET_PTR => 24, -- SQL_DESC_BIND_TYPE => 25, -- SQL_DESC_DATETIME_INTERVAL_PRECISION => 26, -- SQL_DESC_LITERAL_PREFIX => 27, -- SQL_DESC_LITERAL_SUFFIX => 28, -- SQL_DESC_LOCAL_TYPE_NAME => 29, -- SQL_DESC_MAXIMUM_SCALE => 30, SQL_DESC_MINIMUM_SCALE => 31, SQL_DESC_NUM_PREC_RADIX => 32, -- SQL_DESC_PARAMETER_TYPE => 33, -- SQL_DESC_ROWS_PROCESSED_PTR => 34, -- SQL_DESC_ROWVER => 35, -- SQL_DESC_COUNT => 1001, -- SQL_DESC_TYPE => 1002, -- SQL_DESC_LENGTH => 1003, -- SQL_DESC_OCTET_LENGTH_PTR => 1004, -- SQL_DESC_PRECISION => 1005, -- SQL_DESC_SCALE => 1006, -- SQL_DESC_DATETIME_INTERVAL_CODE => 1007, -- SQL_DESC_NULLABLE => 1008, -- SQL_DESC_INDICATOR_PTR => 1009, -- SQL_DESC_DATA_PTR => 1010, -- SQL_DESC_NAME => 1011, -- SQL_DESC_UNNAMED => 1012, -- SQL_DESC_OCTET_LENGTH => 1013, -- SQL_DESC_ALLOC_TYPE => 1099); -- for SQL_DESC_FIELD_TYPE'Size use SQLSMALLINT'Size; procedure Get_Desc_Field (DescriptorHandle : in SQLHDESC; Attribute : in SQL_DESC_FIELD_TYPE; Value : in SQLPOINTER; Length : in out SQLINTEGER; Data : in SQLSMALLINT; ErrorCode : access SQLRETURN); pragma Inline (Get_Desc_Field); procedure Set_Desc_Field (DescriptorHandle : in SQLHDESC; Attribute : in SQL_DESC_FIELD_TYPE; Value : in SQLPOINTER; Length : in SQLINTEGER; Data : in SQLSMALLINT; ErrorCode : out SQLRETURN); pragma Inline (Set_Desc_Field); package Descriptor_Fields is new GNU.DB.SQLCLI.Generic_Attr (Context => SQLHDESC, T => SQL_DESC_FIELD_TYPE, Base => SQLINTEGER, Aux => SQLSMALLINT, Get => Get_Desc_Field, Set => Set_Desc_Field, Default_Context => Null_Handle); subtype Descriptor_Field is Descriptor_Fields.Attribute_Value_Pair; package Dispatch is new GNU.DB.SQLCLI.Dispatch (Descriptor_Fields); package DF_SmallInt is new Dispatch.A_Integer (SQLSMALLINT); subtype Desc_Field_SmallInt is DF_SmallInt.Info; package DF_Int is new Dispatch.A_Integer (SQLINTEGER); subtype Desc_Field_Int is DF_Int.Info; package DF_Unsigned is new Dispatch.A_Unsigned (SQLUINTEGER); subtype Desc_Field_UInt is DF_Unsigned.Info; package DF_Boolean is new Dispatch.A_Boolean (SQLUINTEGER); subtype Desc_Field_Boolean is DF_Boolean.Info; package DF_SBoolean is new Dispatch.A_Boolean (SQLUSMALLINT); subtype Desc_Field_SBoolean is DF_SBoolean.Info; package DF_String is new Dispatch.A_String; subtype Desc_Field_String is DF_String.Info; package DF_WString is new Dispatch.A_Wide_String; subtype Desc_Field_WString is DF_WString.Info; function SQLSetDescField (DescriptorHandle : in SQLHDESC; RecNumber : in SQLSMALLINT; FieldIdentifier : in SQL_DESC_FIELD_TYPE; Data : in SQLPOINTER; Length : in SQLINTEGER) return SQLRETURN; procedure SQLSetDescField (DescriptorHandle : in SQLHDESC; RecNumber : in SQLSMALLINT; FieldIdentifier : in SQL_DESC_FIELD_TYPE; Data : in SQLPOINTER; Length : in SQLINTEGER); pragma Inline (SQLSetDescField); procedure SQLGetDescField (DescriptorHandle : in SQLHDESC; RecNumber : in SQLSMALLINT; FieldIdentifier : in SQL_DESC_FIELD_TYPE; Data : in SQLPOINTER; Length : in SQLINTEGER; StringLength : out SQLINTEGER; RC : out SQLRETURN); procedure SQLGetDescField (DescriptorHandle : in SQLHDESC; RecNumber : in SQLSMALLINT; FieldIdentifier : in SQL_DESC_FIELD_TYPE; Data : in SQLPOINTER; Length : in SQLINTEGER; StringLength : out SQLINTEGER); pragma Inline (SQLGetDescField); type SQL_DATETIME_SUBCODE is (SQL_CODE_YEAR, SQL_CODE_MONTH, SQL_CODE_DAY, SQL_CODE_HOUR, SQL_CODE_MINUTE, SQL_CODE_SECOND, SQL_CODE_YEAR_TO_MONTH, SQL_CODE_DAY_TO_HOUR, SQL_CODE_DAY_TO_MINUTE, SQL_CODE_DAY_TO_SECOND, SQL_CODE_HOUR_TO_MINUTE, SQL_CODE_HOUR_TO_SECOND, SQL_CODE_MINUTE_TO_SECOND); for SQL_DATETIME_SUBCODE use (SQL_CODE_YEAR => 1, SQL_CODE_MONTH => 2, SQL_CODE_DAY => 3, SQL_CODE_HOUR => 4, SQL_CODE_MINUTE => 5, SQL_CODE_SECOND => 6, SQL_CODE_YEAR_TO_MONTH => 7, SQL_CODE_DAY_TO_HOUR => 8, SQL_CODE_DAY_TO_MINUTE => 9, SQL_CODE_DAY_TO_SECOND => 10, SQL_CODE_HOUR_TO_MINUTE => 11, SQL_CODE_HOUR_TO_SECOND => 12, SQL_CODE_MINUTE_TO_SECOND => 13); for SQL_DATETIME_SUBCODE'Size use SQLSMALLINT'Size; procedure SQLSetDescRec (DescriptorHandle : in SQLHDESC; RecNumber : in SQLSMALLINT; SQLType : in SQL_DATA_TYPE; DateTime_SubType : in SQL_DATETIME_SUBCODE; Length : in SQLINTEGER; Precision : in SQLSMALLINT; Scale : in SQLSMALLINT; Data : in SQLPOINTER; StringLength : out SQLINTEGER; Indicator : out SQLINTEGER; RC : out SQLRETURN); procedure SQLSetDescRec (DescriptorHandle : in SQLHDESC; RecNumber : in SQLSMALLINT; SQLType : in SQL_DATA_TYPE; DateTime_SubType : in SQL_DATETIME_SUBCODE; Length : in SQLINTEGER; Precision : in SQLSMALLINT; Scale : in SQLSMALLINT; Data : in SQLPOINTER; StringLength : out SQLINTEGER; Indicator : out SQLINTEGER); pragma Inline (SQLSetDescRec); procedure SQLGetDescRec (DescriptorHandle : in SQLHDESC; RecNumber : in SQLSMALLINT; Name : out String; StringLength : out SQLSMALLINT; SQLType : out SQL_DATA_TYPE; DateTime_SubType : out SQL_DATETIME_SUBCODE; Length : out SQLINTEGER; Precision : out SQLSMALLINT; Scale : out SQLSMALLINT; Nullable : out SQL_NULLABLE_INFO; RC : out SQLRETURN); procedure SQLGetDescRec (DescriptorHandle : in SQLHDESC; RecNumber : in SQLSMALLINT; Name : out String; StringLength : out SQLSMALLINT; SQLType : out SQL_DATA_TYPE; DateTime_SubType : out SQL_DATETIME_SUBCODE; Length : out SQLINTEGER; Precision : out SQLSMALLINT; Scale : out SQLSMALLINT; Nullable : out SQL_NULLABLE_INFO); procedure SQLGetDescRec (DescriptorHandle : in SQLHDESC; RecNumber : in SQLSMALLINT; Name : out Wide_String; StringLength : out SQLSMALLINT; SQLType : out SQL_DATA_TYPE; DateTime_SubType : out SQL_DATETIME_SUBCODE; Length : out SQLINTEGER; Precision : out SQLSMALLINT; Scale : out SQLSMALLINT; Nullable : out SQL_NULLABLE_INFO; RC : out SQLRETURN); procedure SQLGetDescRec (DescriptorHandle : in SQLHDESC; RecNumber : in SQLSMALLINT; Name : out Wide_String; StringLength : out SQLSMALLINT; SQLType : out SQL_DATA_TYPE; DateTime_SubType : out SQL_DATETIME_SUBCODE; Length : out SQLINTEGER; Precision : out SQLSMALLINT; Scale : out SQLSMALLINT; Nullable : out SQL_NULLABLE_INFO); procedure SQLColAttribute (StatementHandle : in SQLHSTMT; ColumnNumber : in SQLUSMALLINT; FieldIdentifier : in SQL_DESC_FIELD_TYPE; CharacterAttribute : out String; NumericAttribute : out SQLINTEGER; RC : out SQLRETURN); -- This version doesn't raise an exception but returns a SQLRETURN procedure SQLColAttribute (StatementHandle : in SQLHSTMT; ColumnNumber : in SQLUSMALLINT; FieldIdentifier : in SQL_DESC_FIELD_TYPE; CharacterAttribute : out String; NumericAttribute : out SQLINTEGER); -- This version raises an exception if the SQLRETURN indicates an error procedure SQLColAttribute (StatementHandle : in SQLHSTMT; ColumnNumber : in SQLUSMALLINT; FieldIdentifier : in SQL_DESC_FIELD_TYPE; CharacterAttribute : out Wide_String; NumericAttribute : out SQLINTEGER; RC : out SQLRETURN); -- This version doesn't raise an exception but returns a SQLRETURN procedure SQLColAttribute (StatementHandle : in SQLHSTMT; ColumnNumber : in SQLUSMALLINT; FieldIdentifier : in SQL_DESC_FIELD_TYPE; CharacterAttribute : out Wide_String; NumericAttribute : out SQLINTEGER); -- This version raises an exception if the SQLRETURN indicates an error pragma Inline (SQLColAttribute); -- ---------------------------------------------------------------------- type DESC_ALLOC is (SQL_DESC_ALLOC_AUTO, SQL_DESC_ALLOC_USER); for DESC_ALLOC use (SQL_DESC_ALLOC_AUTO => 1, SQL_DESC_ALLOC_USER => 2); for DESC_ALLOC'Size use SQLSMALLINT'Size; package Dsp_DescAlloc is new Dispatch.A_Enumerated (SQL_DESC_ALLOC_TYPE, DESC_ALLOC, SQLSMALLINT, "DESC_ALLOC"); subtype Desc_Alloc_Type is Dsp_DescAlloc.Info; -- ---------------------------------------------------------------------- package Dsp_Desc_Array_Status is new Dispatch.A_Array (ROW_STATUS, Natural, RowStatusArray, RowStatusArrayPtr); subtype Desc_Array_Status_Info is Dsp_Desc_Array_Status.Info; -- ---------------------------------------------------------------------- type Desc_Bind_Offsets is array (Natural) of aliased SQLINTEGER; pragma Convention (C, Desc_Bind_Offsets); type Desc_Bind_Offset_Ptr is access all Desc_Bind_Offsets; pragma No_Strict_Aliasing (Desc_Bind_Offset_Ptr); -- this is a non-fat pointer package Dsp_Bind_Offsets is new Dispatch.A_Array (SQLINTEGER, Natural, Desc_Bind_Offsets, Desc_Bind_Offset_Ptr); subtype Desc_Bind_Offset_Info is Dsp_Bind_Offsets.Info; -- ---------------------------------------------------------------------- package Dsp_Rows_Processed is new Dispatch.A_Pointer (SQLUINTEGER, PTR_SQLUINTEGER); subtype Desc_Rows_Processed is Dsp_Rows_Processed.Info; -- ---------------------------------------------------------------------- type DataPtr is access all SQLPOINTER; pragma No_Strict_Aliasing (DataPtr); package Dsp_Data_Ptr is new Dispatch.A_Pointer (SQLPOINTER, DataPtr); subtype Desc_Data_Ptr is Dsp_Data_Ptr.Info; -- ---------------------------------------------------------------------- package Dsp_DateTime_Interval_Code is new Dispatch.A_Enumerated (SQL_DESC_DATETIME_INTERVAL_CODE, SQL_DATETIME_SUBCODE, SQLSMALLINT, "SQL_DATETIME_SUBCODE"); subtype Desc_DateTime_Interval_Code is Dsp_DateTime_Interval_Code.Info; -- ---------------------------------------------------------------------- package Dsp_Int_Pointer is new Dispatch.A_Pointer (SQLINTEGER, PTR_SQLINTEGER); subtype Desc_Int_Pointer is Dsp_Int_Pointer.Info; -- ---------------------------------------------------------------------- package Dsp_Nullable is new Dispatch.A_Enumerated (SQL_DESC_NULLABLE, SQL_NULLABLE_INFO, SQLSMALLINT, "SQL_NULLABLE_INFO"); subtype Desc_Nullable is Dsp_Nullable.Info; -- ---------------------------------------------------------------------- package Dsp_Param_Type is new Dispatch.A_Enumerated (SQL_DESC_PARAMETER_TYPE, SQL_Parameter_Type, SQLSMALLINT, "SQL_Parameter_Type"); subtype Desc_Parameter_Type is Dsp_Param_Type.Info; -- ---------------------------------------------------------------------- type SEARCHABLE_ATTRIBUTE is (SQL_UNSEARCHABLE, SQL_LIKE_ONLY, SQL_ALL_EXCEPT_LIKE, SQL_SEARCHABLE); for SEARCHABLE_ATTRIBUTE'Size use SQLSMALLINT'Size; SQL_PRED_SEARCHABLE : constant SEARCHABLE_ATTRIBUTE := SQL_SEARCHABLE; SQL_PRED_CHAR : constant SEARCHABLE_ATTRIBUTE := SQL_LIKE_ONLY; SQL_PRED_BASIC : constant SEARCHABLE_ATTRIBUTE := SQL_ALL_EXCEPT_LIKE; package Dsp_Searchable is new Dispatch.A_Enumerated (SQL_DESC_SEARCHABLE, SEARCHABLE_ATTRIBUTE, SQLSMALLINT, "SEARCHABLE_ATTRIBUTE"); subtype Desc_Searchable is Dsp_Searchable.Info; -- ---------------------------------------------------------------------- type NAMED_ATTRIBUTE is (SQL_NAMED, SQL_UNNAMED); for NAMED_ATTRIBUTE'Size use SQLSMALLINT'Size; package Dsp_UnNamed is new Dispatch.A_Enumerated (SQL_DESC_UNNAMED, NAMED_ATTRIBUTE, SQLSMALLINT, "NAMED_ATTRIBUTE"); subtype Desc_UnNamed is Dsp_UnNamed.Info; -- ---------------------------------------------------------------------- type UPDATABLE_ATTRIBUTE is (SQL_ATTR_READONLY, SQL_ATTR_WRITE, SQL_ATTR_READWRITE_UNKNOWN); for UPDATABLE_ATTRIBUTE'Size use SQLSMALLINT'Size; package Dsp_Updatable is new Dispatch.A_Enumerated (SQL_DESC_UPDATABLE, UPDATABLE_ATTRIBUTE, SQLSMALLINT, "UPDATABLE_ATTRIBUTE"); subtype Desc_Updatable is Dsp_Updatable.Info; -- ---------------------------------------------------------------------- -- SQL_BIND_TYPE options SQL_BIND_BY_COLUMN : constant Desc_Field_Int := (Attribute => SQL_DESC_BIND_TYPE, Value => 0); SQL_BIND_TYPE_DEFAULT : constant Desc_Field_Int := SQL_BIND_BY_COLUMN; end GNU.DB.SQLCLI.Desc; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-desc.gpb0000644000175000017500000010164210663647575021140 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2002 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Unchecked_Conversion; with Ada.Strings.Fixed; with Ada.Strings.Wide_Fixed; #if DEBUG then with GNU.DB.SQLCLI.Dispatch.Debug; pragma Elaborate_All (GNU.DB.SQLCLI.Dispatch.Debug); #end if; package body GNU.DB.SQLCLI.Desc is #if DEBUG then package DD is new Dispatch.Debug; #end if; procedure Register_String_Attributes; procedure SQLSetDescRec (DescriptorHandle : in SQLHDESC; RecNumber : in SQLSMALLINT; SQLType : in SQL_DATA_TYPE; DateTime_SubType : in SQL_DATETIME_SUBCODE; Length : in SQLINTEGER; Precision : in SQLSMALLINT; Scale : in SQLSMALLINT; Data : in SQLPOINTER; StringLength : out SQLINTEGER; Indicator : out SQLINTEGER; RC : out SQLRETURN) is function SetDescRec (DescriptorHandle : SQLHDESC; RecNumber : SQLSMALLINT; SQLType : SQL_DATA_TYPE; DateTime_SubType : SQL_DATETIME_SUBCODE; Length : SQLINTEGER; Precision : SQLSMALLINT; Scale : SQLSMALLINT; Data : SQLPOINTER; StringLength : access SQLINTEGER; Indicator : access SQLINTEGER) return SQLRETURN; pragma Import ($CALLCONVENTION, SetDescRec, "SQLSetDescRec"); SL : aliased SQLINTEGER; IC : aliased SQLINTEGER; ER : SQLRETURN; begin ER := SetDescRec (DescriptorHandle, RecNumber, SQLType, DateTime_SubType, Length, Precision, Scale, Data, SL'Access, IC'Access); RC := ER; if Is_SQL_Ok (ER) then StringLength := SL; Indicator := IC; end if; end SQLSetDescRec; procedure SQLSetDescRec (DescriptorHandle : in SQLHDESC; RecNumber : in SQLSMALLINT; SQLType : in SQL_DATA_TYPE; DateTime_SubType : in SQL_DATETIME_SUBCODE; Length : in SQLINTEGER; Precision : in SQLSMALLINT; Scale : in SQLSMALLINT; Data : in SQLPOINTER; StringLength : out SQLINTEGER; Indicator : out SQLINTEGER) is RC : SQLRETURN; begin SQLSetDescRec (DescriptorHandle, RecNumber, SQLType, DateTime_SubType, Length, Precision, Scale, Data, StringLength, Indicator, RC); Check_SQL_Error (RC => RC, ProcedureName => "SQLSetDescRec", HandleType => SQL_HANDLE_DESC, Handle => DescriptorHandle); end SQLSetDescRec; procedure SQLGetDescRec (DescriptorHandle : in SQLHDESC; RecNumber : in SQLSMALLINT; Name : out String; StringLength : out SQLSMALLINT; SQLType : out SQL_DATA_TYPE; DateTime_SubType : out SQL_DATETIME_SUBCODE; Length : out SQLINTEGER; Precision : out SQLSMALLINT; Scale : out SQLSMALLINT; Nullable : out SQL_NULLABLE_INFO; RC : out SQLRETURN) is use Ada.Strings.Fixed; function GetDescRec (DescriptorHandle : SQLHDESC; RecNumber : SQLSMALLINT; pName : PTR_SQLCHAR; BufferLength : SQLSMALLINT; pStringLength : access SQLSMALLINT; pType : access SQL_DATA_TYPE; pSubType : access SQL_DATETIME_SUBCODE; pLength : access SQLINTEGER; pPrecision : access SQLSMALLINT; pScale : access SQLSMALLINT; pNullable : access SQL_NULLABLE_INFO) return SQLRETURN; pragma Import ($CALLCONVENTION, GetDescRec, "SQLGetDescRec"); function Cvt_Type is new Ada.Unchecked_Conversion (SQL_DATA_TYPE, SQLSMALLINT); function Cvt_SubType is new Ada.Unchecked_Conversion (SQL_DATETIME_SUBCODE, SQLSMALLINT); function Cvt_NI is new Ada.Unchecked_Conversion (SQL_NULLABLE_INFO, SQLSMALLINT); StrLen : aliased SQLSMALLINT := SQLSMALLINT (Name'Length); pType : aliased SQL_DATA_TYPE := SQL_DATA_TYPE'First; pSubType : aliased SQL_DATETIME_SUBCODE := SQL_DATETIME_SUBCODE'First; pLength : aliased SQLINTEGER := 0; pPrecision : aliased SQLSMALLINT := 0; pScale : aliased SQLSMALLINT := 0; pNullable : aliased SQL_NULLABLE_INFO := SQL_NULLABLE_INFO'First; ProcName : constant String := "SQLGetDescRec"; IFill : Positive; EC : constant SQLRETURN := GetDescRec (DescriptorHandle, RecNumber, To_PTR_SQLCHAR (Name'Address), StrLen, StrLen'Access, pType'Access, pSubType'Access, pLength'Access, pPrecision'Access, pScale'Access, pNullable'Access); begin RC := EC; if Is_SQL_Ok (EC) then if not pType'Valid then Raise_Invalid_Enum (ProcedureName => ProcName, EnumName => "SQL_DATA_TYPE", EnumValue => SQLSMALLINT'Image (Cvt_Type (pType))); elsif not pSubType'Valid then Raise_Invalid_Enum (ProcedureName => ProcName, EnumName => "SQL_DATETIME_SUBCODE", EnumValue => SQLSMALLINT'Image (Cvt_SubType (pSubType))); elsif not pNullable'Valid then Raise_Invalid_Enum (ProcedureName => ProcName, EnumName => "SQL_NULLABLE_INFO", EnumValue => SQLSMALLINT'Image (Cvt_NI (pNullable))); else StringLength := StrLen; SQLType := pType; DateTime_SubType := pSubType; Length := pLength; Precision := pPrecision; Scale := pScale; Nullable := pNullable; if StrLen > 0 and then StrLen < Name'Length then IFill := Name'Length - Positive (StrLen); Name ((Name'First + Positive (StrLen)) .. Name'Last) := IFill * ' '; end if; end if; end if; end SQLGetDescRec; procedure SQLGetDescRec (DescriptorHandle : in SQLHDESC; RecNumber : in SQLSMALLINT; Name : out String; StringLength : out SQLSMALLINT; SQLType : out SQL_DATA_TYPE; DateTime_SubType : out SQL_DATETIME_SUBCODE; Length : out SQLINTEGER; Precision : out SQLSMALLINT; Scale : out SQLSMALLINT; Nullable : out SQL_NULLABLE_INFO) is RC : SQLRETURN; begin SQLGetDescRec (DescriptorHandle, RecNumber, Name, StringLength, SQLType, DateTime_SubType, Length, Precision, Scale, Nullable, RC); Check_SQL_Error (RC => RC, ProcedureName => "SQLGetDescRec", HandleType => SQL_HANDLE_DESC, Handle => DescriptorHandle); end SQLGetDescRec; procedure SQLGetDescRec (DescriptorHandle : in SQLHDESC; RecNumber : in SQLSMALLINT; Name : out Wide_String; StringLength : out SQLSMALLINT; SQLType : out SQL_DATA_TYPE; DateTime_SubType : out SQL_DATETIME_SUBCODE; Length : out SQLINTEGER; Precision : out SQLSMALLINT; Scale : out SQLSMALLINT; Nullable : out SQL_NULLABLE_INFO; RC : out SQLRETURN) is use Ada.Strings.Wide_Fixed; #if UNICODE then function GetDescRec (DescriptorHandle : SQLHDESC; RecNumber : SQLSMALLINT; pName : PTR_SQLTCHAR; BufferLength : SQLSMALLINT; pStringLength : access SQLSMALLINT; pType : access SQL_DATA_TYPE; pSubType : access SQL_DATETIME_SUBCODE; pLength : access SQLINTEGER; pPrecision : access SQLSMALLINT; pScale : access SQLSMALLINT; pNullable : access SQL_NULLABLE_INFO) return SQLRETURN; pragma Import ($CALLCONVENTION, GetDescRec, "SQLGetDescRecW"); function Cvt_Type is new Ada.Unchecked_Conversion (SQL_DATA_TYPE, SQLSMALLINT); function Cvt_SubType is new Ada.Unchecked_Conversion (SQL_DATETIME_SUBCODE, SQLSMALLINT); function Cvt_NI is new Ada.Unchecked_Conversion (SQL_NULLABLE_INFO, SQLSMALLINT); StrLen : aliased SQLSMALLINT := SQLSMALLINT (Name'Length); pType : aliased SQL_DATA_TYPE := SQL_DATA_TYPE'First; pSubType : aliased SQL_DATETIME_SUBCODE := SQL_DATETIME_SUBCODE'First; pLength : aliased SQLINTEGER := 0; pPrecision : aliased SQLSMALLINT := 0; pScale : aliased SQLSMALLINT := 0; pNullable : aliased SQL_NULLABLE_INFO := SQL_NULLABLE_INFO'First; ProcName : constant String := "SQLGetDescRec"; IFill : Positive; EC : constant SQLRETURN := GetDescRec (DescriptorHandle, RecNumber, To_PTR_SQLTCHAR (Name'Address), StrLen, StrLen'Access, pType'Access, pSubType'Access, pLength'Access, pPrecision'Access, pScale'Access, pNullable'Access); #else pragma Unreferenced (DescriptorHandle, RecNumber); #end if; begin #if UNICODE then RC := EC; if Is_SQL_Ok (EC) then if not pType'Valid then Raise_Invalid_Enum (ProcedureName => ProcName, EnumName => "SQL_DATA_TYPE", EnumValue => SQLSMALLINT'Image (Cvt_Type (pType))); elsif not pSubType'Valid then Raise_Invalid_Enum (ProcedureName => ProcName, EnumName => "SQL_DATETIME_SUBCODE", EnumValue => SQLSMALLINT'Image (Cvt_SubType (pSubType))); elsif not pNullable'Valid then Raise_Invalid_Enum (ProcedureName => ProcName, EnumName => "SQL_NULLABLE_INFO", EnumValue => SQLSMALLINT'Image (Cvt_NI (pNullable))); else StringLength := StrLen; SQLType := pType; DateTime_SubType := pSubType; Length := pLength; Precision := pPrecision; Scale := pScale; Nullable := pNullable; if StrLen > 0 and then StrLen < Name'Length then IFill := Name'Length - Positive (StrLen); Name ((Name'First + Positive (StrLen)) .. Name'Last) := IFill * Wide_Character'(' '); end if; end if; end if; #else RC := SQL_ADA95_NO_UNICODE; Name := Name'Length * Wide_Character'(' '); StringLength := 0; SQLType := SQL_DATA_TYPE'First; -- Just to assign something DateTime_SubType := SQL_DATETIME_SUBCODE'First; Length := 0; Precision := 0; Scale := 0; Nullable := SQL_NULLABLE_INFO'First; #end if; end SQLGetDescRec; procedure SQLGetDescRec (DescriptorHandle : in SQLHDESC; RecNumber : in SQLSMALLINT; Name : out Wide_String; StringLength : out SQLSMALLINT; SQLType : out SQL_DATA_TYPE; DateTime_SubType : out SQL_DATETIME_SUBCODE; Length : out SQLINTEGER; Precision : out SQLSMALLINT; Scale : out SQLSMALLINT; Nullable : out SQL_NULLABLE_INFO) is RC : SQLRETURN; begin SQLGetDescRec (DescriptorHandle, RecNumber, Name, StringLength, SQLType, DateTime_SubType, Length, Precision, Scale, Nullable, RC); Check_SQL_Error (RC => RC, ProcedureName => "SQLGetDescRec", HandleType => SQL_HANDLE_DESC, Handle => DescriptorHandle); end SQLGetDescRec; procedure Get_Desc_Field (DescriptorHandle : in SQLHDESC; Attribute : in SQL_DESC_FIELD_TYPE; Value : in SQLPOINTER; Length : in out SQLINTEGER; Data : in SQLSMALLINT; ErrorCode : access SQLRETURN) is function GetDescField (DescriptorHandle : SQLHDESC; RecNumber : SQLSMALLINT; FieldIdentifier : SQL_DESC_FIELD_TYPE; Value : SQLPOINTER; BufferLength : SQLINTEGER; pStringLength : access SQLINTEGER) return SQLRETURN; pragma Import ($CALLCONVENTION, GetDescField, "SQLGetDescField"); #if UNICODE then function GetDescFieldW (DescriptorHandle : SQLHDESC; RecNumber : SQLSMALLINT; FieldIdentifier : SQL_DESC_FIELD_TYPE; Value : SQLPOINTER; BufferLength : SQLINTEGER; pStringLength : access SQLINTEGER) return SQLRETURN; pragma Import ($CALLCONVENTION, GetDescFieldW, "SQLGetDescFieldW"); #end if; RC : SQLRETURN; Len : aliased SQLINTEGER := Length; begin if Unicode_Attr_Flag then #if UNICODE then RC := GetDescFieldW (DescriptorHandle, Data, Attribute, Value, Len, Len'Access); #else RC := SQL_ADA95_NO_UNICODE; Length := 0; #end if; else RC := GetDescField (DescriptorHandle, Data, Attribute, Value, Len, Len'Access); end if; ErrorCode.all := RC; if Is_SQL_Ok (RC) then Length := Len; end if; end Get_Desc_Field; function SetDescField (DescriptorHandle : SQLHDESC; RecNumber : SQLSMALLINT; FieldIdentifier : SQL_DESC_FIELD_TYPE; Value : SQLPOINTER; BufferLength : SQLINTEGER) return SQLRETURN; pragma Import ($CALLCONVENTION, SetDescField, "SQLSetDescField"); procedure Set_Desc_Field (DescriptorHandle : in SQLHDESC; Attribute : in SQL_DESC_FIELD_TYPE; Value : in SQLPOINTER; Length : in SQLINTEGER; Data : in SQLSMALLINT; ErrorCode : out SQLRETURN) is #if UNICODE then function SetDescFieldW (DescriptorHandle : SQLHDESC; RecNumber : SQLSMALLINT; FieldIdentifier : SQL_DESC_FIELD_TYPE; Value : SQLPOINTER; BufferLength : SQLINTEGER) return SQLRETURN; pragma Import ($CALLCONVENTION, SetDescFieldW, "SQLSetDescFieldW"); #end if; RC : SQLRETURN; begin if Unicode_Attr_Flag then #if UNICODE then RC := SetDescFieldW (DescriptorHandle, Data, Attribute, Value, Length); #else RC := SQL_ADA95_NO_UNICODE; #end if; else RC := SetDescField (DescriptorHandle, Data, Attribute, Value, Length); end if; ErrorCode := RC; end Set_Desc_Field; procedure SQLGetDescField (DescriptorHandle : in SQLHDESC; RecNumber : in SQLSMALLINT; FieldIdentifier : in SQL_DESC_FIELD_TYPE; Data : in SQLPOINTER; Length : in SQLINTEGER; StringLength : out SQLINTEGER; RC : out SQLRETURN) is function GetDescField (DescriptorHandle : SQLHDESC; RecNumber : SQLSMALLINT; FieldIdentifier : SQL_DESC_FIELD_TYPE; Value : SQLPOINTER; BufferLength : SQLINTEGER; pStringLength : access SQLINTEGER) return SQLRETURN; pragma Import ($CALLCONVENTION, GetDescField, "SQLGetDescField"); Len : aliased SQLINTEGER; EC : constant SQLRETURN := GetDescField (DescriptorHandle, RecNumber, FieldIdentifier, Data, Length, Len'Access); begin RC := EC; if Is_SQL_Ok (EC) then StringLength := Len; end if; end SQLGetDescField; procedure SQLGetDescField (DescriptorHandle : in SQLHDESC; RecNumber : in SQLSMALLINT; FieldIdentifier : in SQL_DESC_FIELD_TYPE; Data : in SQLPOINTER; Length : in SQLINTEGER; StringLength : out SQLINTEGER) is RC : SQLRETURN; begin SQLGetDescField (DescriptorHandle, RecNumber, FieldIdentifier, Data, Length, StringLength, RC); Check_SQL_Error (RC => RC, ProcedureName => "SQLGetDescField", HandleType => SQL_HANDLE_DESC, Handle => DescriptorHandle); end SQLGetDescField; function SQLSetDescField (DescriptorHandle : SQLHDESC; RecNumber : SQLSMALLINT; FieldIdentifier : SQL_DESC_FIELD_TYPE; Data : SQLPOINTER; Length : SQLINTEGER) return SQLRETURN is RC : constant SQLRETURN := SetDescField (DescriptorHandle, RecNumber, FieldIdentifier, Data, Length); begin return RC; end SQLSetDescField; procedure SQLSetDescField (DescriptorHandle : SQLHDESC; RecNumber : SQLSMALLINT; FieldIdentifier : SQL_DESC_FIELD_TYPE; Data : SQLPOINTER; Length : SQLINTEGER) is RC : constant SQLRETURN := SQLSetDescField (DescriptorHandle, RecNumber, FieldIdentifier, Data, Length); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLSetDescField", HandleType => SQL_HANDLE_DESC, Handle => DescriptorHandle); end SQLSetDescField; procedure SQLColAttribute (StatementHandle : in SQLHSTMT; ColumnNumber : in SQLUSMALLINT; FieldIdentifier : in SQL_DESC_FIELD_TYPE; CharacterAttribute : out String; NumericAttribute : out SQLINTEGER; RC : out SQLRETURN) is -- This version doesn't raise an exception but returns a SQLRETURN use Ada.Strings.Fixed; function ColAttribute (StatementHandle : SQLHSTMT; ColumnNumber : SQLUSMALLINT; FieldIdentifier : SQL_DESC_FIELD_TYPE; CharacterAttribute : SQLPOINTER; BufferLength : SQLSMALLINT; pStringLength : access SQLSMALLINT; NumericAttribute : access SQLINTEGER) return SQLRETURN; pragma Import ($CALLCONVENTION, ColAttribute, "SQLColAttribute"); StringLength : aliased SQLSMALLINT; IFill : Integer; NA : aliased SQLINTEGER := 0; begin RC := ColAttribute (StatementHandle, ColumnNumber, FieldIdentifier, To_SQLPOINTER (CharacterAttribute'Address), SQLSMALLINT (CharacterAttribute'Length), StringLength'Access, NA'Access); if Is_SQL_Ok (RC) then NumericAttribute := NA; IFill := CharacterAttribute'Length - Integer (StringLength); if IFill > 0 then CharacterAttribute ((CharacterAttribute'First + Integer (StringLength)) .. CharacterAttribute'Last) := IFill * ' '; end if; end if; end SQLColAttribute; procedure SQLColAttribute (StatementHandle : in SQLHSTMT; ColumnNumber : in SQLUSMALLINT; FieldIdentifier : in SQL_DESC_FIELD_TYPE; CharacterAttribute : out String; NumericAttribute : out SQLINTEGER) is RC : SQLRETURN; begin SQLColAttribute (StatementHandle, ColumnNumber, FieldIdentifier, CharacterAttribute, NumericAttribute, RC); Check_SQL_Error (RC => RC, ProcedureName => "SQLColAttribute", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); end SQLColAttribute; procedure SQLColAttribute (StatementHandle : in SQLHSTMT; ColumnNumber : in SQLUSMALLINT; FieldIdentifier : in SQL_DESC_FIELD_TYPE; CharacterAttribute : out Wide_String; NumericAttribute : out SQLINTEGER; RC : out SQLRETURN) is use Ada.Strings.Wide_Fixed; #if UNICODE then function ColAttribute (StatementHandle : SQLHSTMT; ColumnNumber : SQLUSMALLINT; FieldIdentifier : SQL_DESC_FIELD_TYPE; CharacterAttribute : SQLPOINTER; BufferLength : SQLSMALLINT; pStringLength : access SQLSMALLINT; NumericAttribute : access SQLINTEGER) return SQLRETURN; pragma Import ($CALLCONVENTION, ColAttribute, "SQLColAttributeW"); StringLength : aliased SQLSMALLINT; IFill : Integer; NA : aliased SQLINTEGER := 0; #else pragma Unreferenced (StatementHandle, ColumnNumber, FieldIdentifier); #end if; begin #if UNICODE then RC := ColAttribute (StatementHandle, ColumnNumber, FieldIdentifier, To_SQLPOINTER (CharacterAttribute'Address), SQLSMALLINT (CharacterAttribute'Length), StringLength'Access, NA'Access); if Is_SQL_Ok (RC) then NumericAttribute := NA; IFill := CharacterAttribute'Length - Integer (StringLength); if IFill > 0 then CharacterAttribute ((CharacterAttribute'First + Integer(StringLength)) .. CharacterAttribute'Last) := IFill * Wide_Character'(' '); end if; end if; #else RC := SQL_ADA95_NO_UNICODE; NumericAttribute := 0; CharacterAttribute := CharacterAttribute'Length * Wide_Character'(' '); #end if; end SQLColAttribute; procedure SQLColAttribute (StatementHandle : in SQLHSTMT; ColumnNumber : in SQLUSMALLINT; FieldIdentifier : in SQL_DESC_FIELD_TYPE; CharacterAttribute : out Wide_String; NumericAttribute : out SQLINTEGER) is RC : SQLRETURN; begin SQLColAttribute (StatementHandle, ColumnNumber, FieldIdentifier, CharacterAttribute, NumericAttribute, RC); Check_SQL_Error (RC => RC, ProcedureName => "SQLColAttribute", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); end SQLColAttribute; procedure Register_String_Attributes is begin if Unicode_Attr_Flag then DF_WString.Register (SQL_DESC_BASE_COLUMN_NAME); DF_WString.Register (SQL_DESC_BASE_TABLE_NAME); DF_WString.Register (SQL_DESC_CATALOG_NAME); DF_WString.Register (SQL_DESC_LABEL); DF_WString.Register (SQL_DESC_LITERAL_PREFIX); DF_WString.Register (SQL_DESC_LITERAL_SUFFIX); DF_WString.Register (SQL_DESC_LOCAL_TYPE_NAME); DF_WString.Register (SQL_DESC_NAME); DF_WString.Register (SQL_DESC_SCHEMA_NAME); DF_WString.Register (SQL_DESC_TABLE_NAME); DF_WString.Register (SQL_DESC_TYPE_NAME); else DF_String.Register (SQL_DESC_BASE_COLUMN_NAME); DF_String.Register (SQL_DESC_BASE_TABLE_NAME); DF_String.Register (SQL_DESC_CATALOG_NAME); DF_String.Register (SQL_DESC_LABEL); DF_String.Register (SQL_DESC_LITERAL_PREFIX); DF_String.Register (SQL_DESC_LITERAL_SUFFIX); DF_String.Register (SQL_DESC_LOCAL_TYPE_NAME); DF_String.Register (SQL_DESC_NAME); DF_String.Register (SQL_DESC_SCHEMA_NAME); DF_String.Register (SQL_DESC_TABLE_NAME); DF_String.Register (SQL_DESC_TYPE_NAME); end if; end Register_String_Attributes; begin DF_SmallInt.Register (SQL_DESC_TYPE); DF_SmallInt.Register (SQL_DESC_COUNT); DF_SmallInt.Register (SQL_DESC_CONCISE_TYPE); DF_SmallInt.Register (SQL_DESC_FIXED_PREC_SCALE); DF_SmallInt.Register (SQL_DESC_PRECISION); DF_SmallInt.Register (SQL_DESC_SCALE); DF_SmallInt.Register (SQL_DESC_MAXIMUM_SCALE); DF_SmallInt.Register (SQL_DESC_MINIMUM_SCALE); DF_Int.Register (SQL_DESC_BIND_TYPE); DF_Int.Register (SQL_DESC_DATETIME_INTERVAL_PRECISION); DF_Int.Register (SQL_DESC_DISPLAY_SIZE); DF_Int.Register (SQL_DESC_NUM_PREC_RADIX); DF_Int.Register (SQL_DESC_OCTET_LENGTH); DF_Unsigned.Register (SQL_DESC_ARRAY_SIZE); DF_Unsigned.Register (SQL_DESC_LENGTH); DF_Boolean.Register (SQL_DESC_AUTO_UNIQUE_VALUE); DF_Boolean.Register (SQL_DESC_CASE_SENSITIVE); DF_SBoolean.Register (SQL_DESC_ROWVER); DF_SBoolean.Register (SQL_DESC_UNSIGNED); -- Array attributes Dsp_Desc_Array_Status.Register (SQL_DESC_ARRAY_STATUS_PTR); Dsp_Bind_Offsets.Register (SQL_DESC_BIND_OFFSET_PTR); -- Pointer attributes Dsp_Rows_Processed.Register (SQL_DESC_ROWS_PROCESSED_PTR); Dsp_Data_Ptr.Register (SQL_DESC_DATA_PTR); Dsp_Int_Pointer.Register (SQL_DESC_INDICATOR_PTR); Dsp_Int_Pointer.Register (SQL_DESC_OCTET_LENGTH_PTR); Register_String_Attributes; Register_Initializer (Register_String_Attributes'Access); #if DEBUG then DD.Verify; #end if; end GNU.DB.SQLCLI.Desc; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-diag.ads0000644000175000017500000002266307467277262021132 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2001 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with GNU.DB.SQLCLI.Generic_Attr; with GNU.DB.SQLCLI.Dispatch; with GNU.DB.SQLCLI.Dispatch.A_Integer; with GNU.DB.SQLCLI.Dispatch.A_String; with GNU.DB.SQLCLI.Dispatch.A_Wide_String; with GNU.DB.SQLCLI.Dispatch.A_Enumerated; package GNU.DB.SQLCLI.Diag is function SQLGetDiagRec (HandleType : SQL_HANDLE_TYPE := SQL_HANDLE_STMT; Handle : SQLHANDLE; RecNumber : SQLSMALLINT := 1; State : access SQLSTATE; NativeError : access SQLINTEGER) return String; function SQLGetDiagRec (HandleType : SQL_HANDLE_TYPE := SQL_HANDLE_STMT; Handle : SQLHANDLE; RecNumber : SQLSMALLINT := 1; State : access WIDE_SQLSTATE; NativeError : access SQLINTEGER) return Wide_String; -- defines for diagnostics fields type SQL_DIAGNOSTIC_IDENTIFIER is (SQL_DIAG_CURSOR_ROW_COUNT, SQL_DIAG_ROW_NUMBER, SQL_DIAG_COLUMN_NUMBER, SQL_DIAG_RETURNCODE, SQL_DIAG_NUMBER, SQL_DIAG_ROW_COUNT, SQL_DIAG_SQLSTATE, SQL_DIAG_NATIVE, SQL_DIAG_MESSAGE_TEXT, SQL_DIAG_DYNAMIC_FUNCTION, SQL_DIAG_CLASS_ORIGIN, SQL_DIAG_SUBCLASS_ORIGIN, SQL_DIAG_CONNECTION_NAME, SQL_DIAG_SERVER_NAME, SQL_DIAG_DYNAMIC_FUNCTION_CODE); for SQL_DIAGNOSTIC_IDENTIFIER use (SQL_DIAG_CURSOR_ROW_COUNT => -1249, SQL_DIAG_ROW_NUMBER => -1248, SQL_DIAG_COLUMN_NUMBER => -1247, SQL_DIAG_RETURNCODE => 1, SQL_DIAG_NUMBER => 2, SQL_DIAG_ROW_COUNT => 3, SQL_DIAG_SQLSTATE => 4, SQL_DIAG_NATIVE => 5, SQL_DIAG_MESSAGE_TEXT => 6, SQL_DIAG_DYNAMIC_FUNCTION => 7, SQL_DIAG_CLASS_ORIGIN => 8, SQL_DIAG_SUBCLASS_ORIGIN => 9, SQL_DIAG_CONNECTION_NAME => 10, SQL_DIAG_SERVER_NAME => 11, SQL_DIAG_DYNAMIC_FUNCTION_CODE => 12); for SQL_DIAGNOSTIC_IDENTIFIER'Size use SQLSMALLINT'Size; type Diagnostic_Context_Record is private; type Diagnostic_Context is access all Diagnostic_Context_Record; function Default_Context return Diagnostic_Context; procedure Get_Diag_Field (Ctx : Diagnostic_Context; AttrType : SQL_DIAGNOSTIC_IDENTIFIER; Value : SQLPOINTER; Length : in out SQLSMALLINT; Data : in SQLSMALLINT; ErrorCode : access SQLRETURN); procedure Set_Diag_Field (Ctx : Diagnostic_Context; AttrType : SQL_DIAGNOSTIC_IDENTIFIER; Value : SQLPOINTER; Length : in SQLSMALLINT; Data : in SQLSMALLINT; ErrorCode : out SQLRETURN); package Diagnostic_Fields is new GNU.DB.SQLCLI.Generic_Attr (Context => Diagnostic_Context, T => SQL_DIAGNOSTIC_IDENTIFIER, Base => SQLSMALLINT, Aux => SQLSMALLINT, Get => Get_Diag_Field, Set => Set_Diag_Field, Default_Context => Default_Context); subtype Diagnostic_Field is Diagnostic_Fields.Attribute_Value_Pair; package Dispatch is new GNU.DB.SQLCLI.Dispatch (Diagnostic_Fields); package DF_String is new Dispatch.A_String; subtype Diagnostic_Field_String is DF_String.Info; package DF_WString is new Dispatch.A_Wide_String; subtype Diagnostic_Field_Wide_String is DF_WString.Info; package DF_Integer is new Dispatch.A_Integer (SQLINTEGER); subtype Diagnostic_Field_Int is DF_Integer.Info; package DF_SmallInteger is new Dispatch.A_Integer (SQLSMALLINT); subtype Diagnostic_Field_SmallInt is DF_SmallInteger.Info; type SQL_DYNAMIC_FUNCTION_CODE is (SQL_DIAG_DROP_INDEX, SQL_DIAG_CREATE_INDEX, SQL_DIAG_UNKNOWN_STATEMENT, SQL_DIAG_ALTER_DOMAIN, SQL_DIAG_ALTER_TABLE, SQL_DIAG_CREATE_ASSERTION, SQL_DIAG_CALL, SQL_DIAG_CREATE_CHARACTER_SET, SQL_DIAG_CREATE_COLLATION, SQL_DIAG_DELETE_WHERE, SQL_DIAG_CREATE_DOMAIN, SQL_DIAG_DROP_ASSERTION, SQL_DIAG_DROP_CHARACTER_SET, SQL_DIAG_DROP_COLLATION, SQL_DIAG_DROP_DOMAIN, SQL_DIAG_DROP_SCHEMA, SQL_DIAG_DROP_TABLE, SQL_DIAG_DROP_TRANSLATION, SQL_DIAG_DROP_VIEW, SQL_DIAG_DYNAMIC_DELETE_CURSOR, SQL_DIAG_GRANT, SQL_DIAG_INSERT, SQL_DIAG_REVOKE, SQL_DIAG_CREATE_TABLE, SQL_DIAG_DYNAMIC_UPDATE_CURSOR, SQL_DIAG_UPDATE_WHERE, SQL_DIAG_CREATE_VIEW, SQL_DIAG_SELECT_CURSOR); for SQL_DYNAMIC_FUNCTION_CODE use (SQL_DIAG_DROP_INDEX => -2, SQL_DIAG_CREATE_INDEX => -1, SQL_DIAG_UNKNOWN_STATEMENT => 0, SQL_DIAG_ALTER_DOMAIN => 3, SQL_DIAG_ALTER_TABLE => 4, SQL_DIAG_CREATE_ASSERTION => 6, SQL_DIAG_CALL => 7, SQL_DIAG_CREATE_CHARACTER_SET => 8, SQL_DIAG_CREATE_COLLATION => 10, SQL_DIAG_DELETE_WHERE => 19, SQL_DIAG_CREATE_DOMAIN => 23, SQL_DIAG_DROP_ASSERTION => 24, SQL_DIAG_DROP_CHARACTER_SET => 25, SQL_DIAG_DROP_COLLATION => 26, SQL_DIAG_DROP_DOMAIN => 27, SQL_DIAG_DROP_SCHEMA => 31, SQL_DIAG_DROP_TABLE => 32, SQL_DIAG_DROP_TRANSLATION => 33, SQL_DIAG_DROP_VIEW => 36, SQL_DIAG_DYNAMIC_DELETE_CURSOR => 38, SQL_DIAG_GRANT => 48, SQL_DIAG_INSERT => 50, SQL_DIAG_REVOKE => 59, SQL_DIAG_CREATE_TABLE => 77, SQL_DIAG_DYNAMIC_UPDATE_CURSOR => 81, SQL_DIAG_UPDATE_WHERE => 82, SQL_DIAG_CREATE_VIEW => 84, SQL_DIAG_SELECT_CURSOR => 85); for SQL_DYNAMIC_FUNCTION_CODE'Size use SQLINTEGER'Size; package Dsp_Dynamic_Function_Code is new Dispatch.A_Enumerated (SQL_DIAG_DYNAMIC_FUNCTION_CODE, SQL_DYNAMIC_FUNCTION_CODE, SQLINTEGER, "SQL_DYNAMIC_FUNCTION_CODE"); subtype Diagnostic_Field_Dynamic_Function_Code is Dsp_Dynamic_Function_Code.Info; function SQLGetDiagField (HandleType : SQL_HANDLE_TYPE; Handle : SQLHANDLE; RecordNumber : SQLSMALLINT; Field : SQL_DIAGNOSTIC_IDENTIFIER; MaxLength : SQLSMALLINT := 1024) return Diagnostic_Field'Class; private pragma Inline (Default_Context); type Diagnostic_Context_Record is record Handle : SQLHANDLE; HandleType : SQL_HANDLE_TYPE; RecordNumber : SQLSMALLINT; end record; end GNU.DB.SQLCLI.Diag; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-diag.gpb0000644000175000017500000003332607735567063021130 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2002 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Unchecked_Deallocation; #if DEBUG then with GNU.DB.SQLCLI.Dispatch.Debug; pragma Elaborate_All (GNU.DB.SQLCLI.Dispatch.Debug); #end if; package body GNU.DB.SQLCLI.Diag is #if DEBUG then package DD is new Dispatch.Debug; #end if; procedure Register_String_Attributes; function SQLGetDiagRec (HandleType : SQL_HANDLE_TYPE := SQL_HANDLE_STMT; Handle : SQLHANDLE; RecNumber : SQLSMALLINT := 1; State : access SQLSTATE; NativeError : access SQLINTEGER) return String is function GetDiagRec (HandleType : SQL_HANDLE_TYPE; Handle : SQLHANDLE; RecNumber : SQLSMALLINT; pSqlstate : access C_SQLSTATE; pNativeError : access SQLINTEGER; pMessageText : PTR_SQLCHAR; BufferLength : SQLSMALLINT; pTextLength : access SQLSMALLINT) return SQLRETURN; pragma Import ($CALLCONVENTION, GetDiagRec, "SQLGetDiagRec"); Len : aliased SQLSMALLINT := SQLSMALLINT (SQL_MAX_MESSAGE_SIZE); pragma Warnings (Off); Str : String (1 .. Positive (SQL_MAX_MESSAGE_SIZE)); pragma Warnings (On); C_State : aliased C_SQLSTATE; RC : constant SQLRETURN := GetDiagRec (HandleType, Handle, RecNumber, C_State'Access, NativeError, To_PTR_SQLCHAR (Str'Address), Len, Len'Access); begin State.all := GNU.DB.SQLCLI.To_Ada (C_State); if Is_SQL_Ok (RC) then if Len > 0 then return Str (1 .. Positive (Len)); else return ""; end if; else if RC = SQL_ERROR then return "Invalid Record Number"; elsif RC = SQL_INVALID_HANDLE then return "Invalid Handle"; elsif RC = SQL_NO_DATA then return "No diagnostic data available"; else return "Unknown error return from SQLGetDiagRec"; end if; end if; end SQLGetDiagRec; function SQLGetDiagRec (HandleType : SQL_HANDLE_TYPE := SQL_HANDLE_STMT; Handle : SQLHANDLE; RecNumber : SQLSMALLINT := 1; State : access WIDE_SQLSTATE; NativeError : access SQLINTEGER) return Wide_String is #if UNICODE then function GetDiagRec (HandleType : SQL_HANDLE_TYPE; Handle : SQLHANDLE; RecNumber : SQLSMALLINT; pSqlstate : access C_WSQLSTATE; pNativeError : access SQLINTEGER; pMessageText : PTR_SQLTCHAR; BufferLength : SQLSMALLINT; pTextLength : access SQLSMALLINT) return SQLRETURN; pragma Import ($CALLCONVENTION, GetDiagRec, "SQLGetDiagRecW"); Len : aliased SQLSMALLINT := SQLSMALLINT (SQL_MAX_MESSAGE_SIZE); pragma Warnings (Off); Str : Wide_String (1 .. Positive (SQL_MAX_MESSAGE_SIZE)); pragma Warnings (On); C_State : aliased C_WSQLSTATE; RC : constant SQLRETURN := GetDiagRec (HandleType, Handle, RecNumber, C_State'Access, NativeError, To_PTR_SQLTCHAR (Str'Address), Len, Len'Access); #end if; begin #if UNICODE then State.all := C_State; if Is_SQL_Ok (RC) then if Len > 0 then return Str (1 .. Positive (Len)); else return Wide_String'(""); end if; else if RC = SQL_ERROR then return Wide_String'("Invalid Record Number"); elsif RC = SQL_INVALID_HANDLE then return Wide_String'("Invalid Handle"); elsif RC = SQL_NO_DATA then return Wide_String'("No diagnostic data available"); else return Wide_String'("Unknown error return from SQLGetDiagRec"); end if; end if; #else Raise_SQL_Error ("SQLGetDiagRec", ErrorMessage => "The binding has'nt been built with UNICODE Support.", RC => SQL_ADA95_NO_UNICODE); return Wide_String'(""); #end if; end SQLGetDiagRec; procedure Get_Diag_Field (Ctx : Diagnostic_Context; AttrType : SQL_DIAGNOSTIC_IDENTIFIER; Value : SQLPOINTER; Length : in out SQLSMALLINT; Data : in SQLSMALLINT; ErrorCode : access SQLRETURN) is pragma Unreferenced (Data); function GetDiagField (HandleType : SQL_HANDLE_TYPE; Handle : SQLHANDLE; RecNumber : SQLSMALLINT; DiagIdentifier : SQL_DIAGNOSTIC_IDENTIFIER; DiagInfo : SQLPOINTER; BufferLength : SQLSMALLINT; pStringLength : access SQLSMALLINT) return SQLRETURN; pragma Import ($CALLCONVENTION, GetDiagField, "SQLGetDiagField"); #if UNICODE then function GetDiagFieldW (HandleType : SQL_HANDLE_TYPE; Handle : SQLHANDLE; RecNumber : SQLSMALLINT; DiagIdentifier : SQL_DIAGNOSTIC_IDENTIFIER; DiagInfo : SQLPOINTER; BufferLength : SQLSMALLINT; pStringLength : access SQLSMALLINT) return SQLRETURN; pragma Import ($CALLCONVENTION, GetDiagFieldW, "SQLGetDiagFieldW"); #end if; pragma Assert (Ctx /= null); Name : constant String := "SQLGetDiagField"; Len : aliased SQLSMALLINT := Length; RC : SQLRETURN; begin if Unicode_Attr_Flag then #if UNICODE then RC := GetDiagFieldW (Ctx.HandleType, Ctx.Handle, Ctx.RecordNumber, AttrType, Value, Len, Len'Access); #else RC := SQL_ADA95_NO_UNICODE; Length := 0; #end if; else RC := GetDiagField (Ctx.HandleType, Ctx.Handle, Ctx.RecordNumber, AttrType, Value, Len, Len'Access); end if; ErrorCode.all := RC; if Is_SQL_Ok (RC) then Length := Len; else if RC = SQL_ERROR then Raise_SQL_Error (ProcedureName => Name, ErrorMessage => "Invalid Field request"); elsif RC = SQL_INVALID_HANDLE then Raise_SQL_Error (ProcedureName => Name, ErrorMessage => "Invalid Handle"); elsif RC = SQL_NO_DATA then Raise_SQL_Error (ProcedureName => Name, ErrorMessage => "No diagnostic data available"); else Raise_SQL_Error (ProcedureName => Name, ErrorMessage => "Unknown error return"); end if; end if; end Get_Diag_Field; procedure Set_Diag_Field (Ctx : Diagnostic_Context; AttrType : SQL_DIAGNOSTIC_IDENTIFIER; Value : SQLPOINTER; Length : in SQLSMALLINT; Data : in SQLSMALLINT; ErrorCode : out SQLRETURN) is pragma Unreferenced (Data); pragma Unreferenced (Length); pragma Unreferenced (Value); pragma Unreferenced (AttrType); pragma Unreferenced (Ctx); begin ErrorCode := -1; Raise_SQL_Error (ProcedureName => "Set_Diag_Field", ErrorMessage => "Set Value not allowed"); end Set_Diag_Field; function Default_Context return Diagnostic_Context is begin return null; end Default_Context; function SQLGetDiagField (HandleType : SQL_HANDLE_TYPE; Handle : SQLHANDLE; RecordNumber : SQLSMALLINT; Field : SQL_DIAGNOSTIC_IDENTIFIER; MaxLength : SQLSMALLINT := 1024) return Diagnostic_Field'Class is use type Dispatch.Attr_Get_Func; procedure Free is new Ada.Unchecked_Deallocation (Diagnostic_Context_Record, Diagnostic_Context); Ctx : Diagnostic_Context := new Diagnostic_Context_Record' (Handle => Handle, HandleType => HandleType, RecordNumber => RecordNumber); ErrorCode : aliased SQLRETURN; F : constant Dispatch.Attr_Get_Func := Dispatch.Get_Func (Field); begin if F = null then Free (Ctx); Raise_SQL_Error ("SQLGetDiagField", SQL_DIAGNOSTIC_IDENTIFIER'Image (Field) & Attr_Not_Supported_Msg); else declare Res : constant Diagnostic_Field'Class := F.all (Ctx, Field, MaxLength, 0, ErrorCode'Access); begin Free (Ctx); return Res; end; end if; end SQLGetDiagField; procedure Register_String_Attributes is begin if Unicode_Attr_Flag then DF_WString.Register (SQL_DIAG_SUBCLASS_ORIGIN); DF_WString.Register (SQL_DIAG_SQLSTATE); DF_WString.Register (SQL_DIAG_SERVER_NAME); DF_WString.Register (SQL_DIAG_MESSAGE_TEXT); DF_WString.Register (SQL_DIAG_CONNECTION_NAME); DF_WString.Register (SQL_DIAG_CLASS_ORIGIN); DF_WString.Register (SQL_DIAG_DYNAMIC_FUNCTION); else DF_String.Register (SQL_DIAG_SUBCLASS_ORIGIN); DF_String.Register (SQL_DIAG_SQLSTATE); DF_String.Register (SQL_DIAG_SERVER_NAME); DF_String.Register (SQL_DIAG_MESSAGE_TEXT); DF_String.Register (SQL_DIAG_CONNECTION_NAME); DF_String.Register (SQL_DIAG_CLASS_ORIGIN); DF_String.Register (SQL_DIAG_DYNAMIC_FUNCTION); end if; end Register_String_Attributes; begin DF_Integer.Register (SQL_DIAG_NATIVE); DF_Integer.Register (SQL_DIAG_ROW_NUMBER); DF_Integer.Register (SQL_DIAG_COLUMN_NUMBER); DF_Integer.Register (SQL_DIAG_ROW_COUNT); DF_Integer.Register (SQL_DIAG_NUMBER); DF_Integer.Register (SQL_DIAG_CURSOR_ROW_COUNT); DF_SmallInteger.Register (SQL_DIAG_RETURNCODE); Register_String_Attributes; Register_Initializer (Register_String_Attributes'Access); #if DEBUG then DD.Verify; #end if; end GNU.DB.SQLCLI.Diag; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-dispatch-a_array.adb0000644000175000017500000000662110537477634023411 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2001 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- package body GNU.DB.SQLCLI.Dispatch.A_Array is function Get (Handle : Ctx; Attribute : Attr.T; MaxLength : SQLSMALLINT := 0; Data : Attr.Aux; ErrorCode : access SQLRETURN) return Attr.Attribute_Value_Pair'Class is begin return Derived.GetAttr (Handle, Attribute, Data, MaxLength, ErrorCode); end Get; procedure Set (Handle : in Ctx; AV_Pair : in Attr.Attribute_Value_Pair'Class; Data : in Attr.Aux; ErrorCode : out SQLRETURN) is begin if not (AV_Pair in Info'Class) then Raise_SQL_Error (ProcedureName => "SetAttr", ErrorMessage => "Attribute value is not an Array", RC => SQL_ADA95_TYPE_ERROR); end if; Derived.SetAttr (Handle, Info (AV_Pair), Data, ErrorCode); end Set; procedure Register (Index : in Attr.T) is begin Get_Dispatch_Array (Index) := Get'Unrestricted_Access; Set_Dispatch_Array (Index) := Set'Unrestricted_Access; end Register; end GNU.DB.SQLCLI.Dispatch.A_Array; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-dispatch-a_array.ads0000644000175000017500000000624207475446337023434 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2002 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with GNU.DB.SQLCLI.Generic_Attr.Array_Attribute; pragma Elaborate_All (GNU.DB.SQLCLI.Generic_Attr.Array_Attribute); generic type Item is private; type Index is range <>; type Elements is array (Index) of aliased Item; type ElementsPtr is access all Elements; package GNU.DB.SQLCLI.Dispatch.A_Array is package Derived is new Attr.Array_Attribute (Item, Index, Elements, ElementsPtr); subtype Info is Derived.Attribute_Value_Pair_Array; procedure Register (Index : in Attr.T); pragma Inline_Always (Register); private function Get (Handle : Ctx; Attribute : Attr.T; MaxLength : SQLSMALLINT := 0; Data : Attr.Aux; ErrorCode : access SQLRETURN) return Attr.Attribute_Value_Pair'Class; procedure Set (Handle : in Ctx; AV_Pair : in Attr.Attribute_Value_Pair'Class; Data : in Attr.Aux; ErrorCode : out SQLRETURN); end GNU.DB.SQLCLI.Dispatch.A_Array; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-dispatch-a_bitmap.adb0000644000175000017500000000666710537477634023561 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2001 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- package body GNU.DB.SQLCLI.Dispatch.A_Bitmap is function Get (Handle : Ctx; Attribute : Attr.T; MaxLength : SQLSMALLINT := 0; Data : Attr.Aux; ErrorCode : access SQLRETURN) return Attr.Attribute_Value_Pair'Class is begin return Derived.GetAttr (Handle, Attribute, Data, MaxLength, ErrorCode); end Get; procedure Set (Handle : in Ctx; AV_Pair : in Attr.Attribute_Value_Pair'Class; Data : in Attr.Aux; ErrorCode : out SQLRETURN) is begin if not (AV_Pair in Info'Class) then Raise_SQL_Error (ProcedureName => "SetAttr", ErrorMessage => "Attribute value is not a Bitmap", RC => SQL_ADA95_TYPE_ERROR); end if; Derived.SetAttr (Handle, Info (AV_Pair), Data, ErrorCode); end Set; procedure Register (Index : in Attr.T) is begin Get_Dispatch_Array (Index) := Get'Unrestricted_Access; Set_Dispatch_Array (Index) := Set'Unrestricted_Access; end Register; begin Register (Default_Index); end GNU.DB.SQLCLI.Dispatch.A_Bitmap; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-dispatch-a_bitmap.ads0000644000175000017500000000612107475446337023566 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2002 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with GNU.DB.SQLCLI.Generic_Attr.Bitmap_Attribute; pragma Elaborate_All (GNU.DB.SQLCLI.Generic_Attr.Bitmap_Attribute); generic Default_Index : Attr.T; type E is (<>); type E_Bitmap is array (E) of Boolean; package GNU.DB.SQLCLI.Dispatch.A_Bitmap is package Derived is new Attr.Bitmap_Attribute (E, E_Bitmap); subtype Info is Derived.Attribute_Value_Pair_Bitmap; procedure Register (Index : in Attr.T); pragma Inline_Always (Register); private function Get (Handle : Ctx; Attribute : Attr.T; MaxLength : SQLSMALLINT := 0; Data : Attr.Aux; ErrorCode : access SQLRETURN) return Attr.Attribute_Value_Pair'Class; procedure Set (Handle : in Ctx; AV_Pair : in Attr.Attribute_Value_Pair'Class; Data : in Attr.Aux; ErrorCode : out SQLRETURN); end GNU.DB.SQLCLI.Dispatch.A_Bitmap; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-dispatch-a_boolean.adb0000644000175000017500000000662610537477634023717 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2001 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- package body GNU.DB.SQLCLI.Dispatch.A_Boolean is function Get (Handle : Ctx; Attribute : Attr.T; MaxLength : SQLSMALLINT := 0; Data : Attr.Aux; ErrorCode : access SQLRETURN) return Attr.Attribute_Value_Pair'Class is begin return Derived.GetAttr (Handle, Attribute, Data, MaxLength, ErrorCode); end Get; procedure Set (Handle : in Ctx; AV_Pair : in Attr.Attribute_Value_Pair'Class; Data : in Attr.Aux; ErrorCode : out SQLRETURN) is begin if not (AV_Pair in Info'Class) then Raise_SQL_Error (ProcedureName => "SetAttr", ErrorMessage => "Attribute value is not a Boolean", RC => SQL_ADA95_TYPE_ERROR); end if; Derived.SetAttr (Handle, Info (AV_Pair), Data, ErrorCode); end Set; procedure Register (Index : in Attr.T) is begin Get_Dispatch_Array (Index) := Get'Unrestricted_Access; Set_Dispatch_Array (Index) := Set'Unrestricted_Access; end Register; end GNU.DB.SQLCLI.Dispatch.A_Boolean; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-dispatch-a_boolean.ads0000644000175000017500000000604107475446337023732 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2002 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with GNU.DB.SQLCLI.Generic_Attr.Boolean_Attribute; pragma Elaborate_All (GNU.DB.SQLCLI.Generic_Attr.Boolean_Attribute); generic type Bool_Type is mod <>; package GNU.DB.SQLCLI.Dispatch.A_Boolean is package Derived is new Attr.Boolean_Attribute (Bool_Type); subtype Info is Derived.Attribute_Value_Pair_Boolean_Scalar; procedure Register (Index : in Attr.T); pragma Inline_Always (Register); private function Get (Handle : Ctx; Attribute : Attr.T; MaxLength : SQLSMALLINT := 0; Data : Attr.Aux; ErrorCode : access SQLRETURN) return Attr.Attribute_Value_Pair'Class; procedure Set (Handle : in Ctx; AV_Pair : in Attr.Attribute_Value_Pair'Class; Data : in Attr.Aux; ErrorCode : out SQLRETURN); end GNU.DB.SQLCLI.Dispatch.A_Boolean; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-dispatch-a_boolean_string.adb0000644000175000017500000000665310537477634025305 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2001 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- package body GNU.DB.SQLCLI.Dispatch.A_Boolean_String is function Get (Handle : Ctx; Attribute : Attr.T; MaxLength : SQLSMALLINT := 0; Data : Attr.Aux; ErrorCode : access SQLRETURN) return Attr.Attribute_Value_Pair'Class is begin return Derived.GetAttr (Handle, Attribute, Data, MaxLength, ErrorCode); end Get; procedure Set (Handle : in Ctx; AV_Pair : in Attr.Attribute_Value_Pair'Class; Data : in Attr.Aux; ErrorCode : out SQLRETURN) is begin if not (AV_Pair in Info'Class) then Raise_SQL_Error (ProcedureName => "SetAttr", ErrorMessage => "Attribute value is not a boolean String", RC => SQL_ADA95_TYPE_ERROR); end if; Derived.SetAttr (Handle, Info (AV_Pair), Data, ErrorCode); end Set; procedure Register (Index : in Attr.T) is begin Get_Dispatch_Array (Index) := Get'Unrestricted_Access; Set_Dispatch_Array (Index) := Set'Unrestricted_Access; end Register; end GNU.DB.SQLCLI.Dispatch.A_Boolean_String; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-dispatch-a_boolean_string.ads0000644000175000017500000000603307475446337025321 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2002 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with GNU.DB.SQLCLI.Generic_Attr.Boolean_String_Attribute; pragma Elaborate_All (GNU.DB.SQLCLI.Generic_Attr.Boolean_String_Attribute); generic package GNU.DB.SQLCLI.Dispatch.A_Boolean_String is package Derived is new Attr.Boolean_String_Attribute; subtype Info is Derived.Attribute_Value_Pair_Boolean_String; procedure Register (Index : in Attr.T); pragma Inline_Always (Register); private function Get (Handle : Ctx; Attribute : Attr.T; MaxLength : SQLSMALLINT := 0; Data : Attr.Aux; ErrorCode : access SQLRETURN) return Attr.Attribute_Value_Pair'Class; procedure Set (Handle : in Ctx; AV_Pair : in Attr.Attribute_Value_Pair'Class; Data : in Attr.Aux; ErrorCode : out SQLRETURN); end GNU.DB.SQLCLI.Dispatch.A_Boolean_String; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-dispatch-a_context.adb0000644000175000017500000000662610537477634023764 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2001 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- package body GNU.DB.SQLCLI.Dispatch.A_Context is function Get (Handle : Ctx; Attribute : Attr.T; MaxLength : SQLSMALLINT := 0; Data : Attr.Aux; ErrorCode : access SQLRETURN) return Attr.Attribute_Value_Pair'Class is begin return Derived.GetAttr (Handle, Attribute, Data, MaxLength, ErrorCode); end Get; procedure Set (Handle : in Ctx; AV_Pair : in Attr.Attribute_Value_Pair'Class; Data : in Attr.Aux; ErrorCode : out SQLRETURN) is begin if not (AV_Pair in Info'Class) then Raise_SQL_Error (ProcedureName => "SetAttr", ErrorMessage => "Attribute value is not a Context", RC => SQL_ADA95_TYPE_ERROR); end if; Derived.SetAttr (Handle, Info (AV_Pair), Data, ErrorCode); end Set; procedure Register (Index : in Attr.T) is begin Get_Dispatch_Array (Index) := Get'Unrestricted_Access; Set_Dispatch_Array (Index) := Set'Unrestricted_Access; end Register; end GNU.DB.SQLCLI.Dispatch.A_Context; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-dispatch-a_context.ads0000644000175000017500000000576107475446337024007 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2002 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with GNU.DB.SQLCLI.Generic_Attr.Context_Attribute; pragma Elaborate_All (GNU.DB.SQLCLI.Generic_Attr.Context_Attribute); generic package GNU.DB.SQLCLI.Dispatch.A_Context is package Derived is new Attr.Context_Attribute; subtype Info is Derived.Attribute_Value_Pair_Context; procedure Register (Index : in Attr.T); pragma Inline_Always (Register); private function Get (Handle : Ctx; Attribute : Attr.T; MaxLength : SQLSMALLINT := 0; Data : Attr.Aux; ErrorCode : access SQLRETURN) return Attr.Attribute_Value_Pair'Class; procedure Set (Handle : in Ctx; AV_Pair : in Attr.Attribute_Value_Pair'Class; Data : in Attr.Aux; ErrorCode : out SQLRETURN); end GNU.DB.SQLCLI.Dispatch.A_Context; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-dispatch-a_enumerated.adb0000644000175000017500000000670510537477634024427 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2001 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- package body GNU.DB.SQLCLI.Dispatch.A_Enumerated is function Get (Handle : Ctx; Attribute : Attr.T; MaxLength : SQLSMALLINT := 0; Data : Attr.Aux; ErrorCode : access SQLRETURN) return Attr.Attribute_Value_Pair'Class is begin return Derived.GetAttr (Handle, Attribute, Data, MaxLength, ErrorCode); end Get; procedure Set (Handle : in Ctx; AV_Pair : in Attr.Attribute_Value_Pair'Class; Data : in Attr.Aux; ErrorCode : out SQLRETURN) is begin if not (AV_Pair in Info'Class) then Raise_SQL_Error (ProcedureName => "SetAttr", ErrorMessage => "Attribute value is not an Enumeration", RC => SQL_ADA95_TYPE_ERROR); end if; Derived.SetAttr (Handle, Info (AV_Pair), Data, ErrorCode); end Set; procedure Register (Index : in Attr.T) is begin Get_Dispatch_Array (Index) := Get'Unrestricted_Access; Set_Dispatch_Array (Index) := Set'Unrestricted_Access; end Register; begin Register (Default_Index); end GNU.DB.SQLCLI.Dispatch.A_Enumerated; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-dispatch-a_enumerated.ads0000644000175000017500000000616010047251270024421 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2002 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with GNU.DB.SQLCLI.Generic_Attr.Enumerated_Attribute; pragma Elaborate_All (GNU.DB.SQLCLI.Generic_Attr.Enumerated_Attribute); generic Default_Index : Attr.T; type E is (<>); type E_Base is range <>; E_Name : String; package GNU.DB.SQLCLI.Dispatch.A_Enumerated is package Derived is new Attr.Enumerated_Attribute (E, E_Base, E_Name); subtype Info is Derived.Attribute_Value_Pair_Enum; procedure Register (Index : in Attr.T); pragma Inline_Always (Register); private function Get (Handle : Ctx; Attribute : Attr.T; MaxLength : SQLSMALLINT := 0; Data : Attr.Aux; ErrorCode : access SQLRETURN) return Attr.Attribute_Value_Pair'Class; procedure Set (Handle : in Ctx; AV_Pair : in Attr.Attribute_Value_Pair'Class; Data : in Attr.Aux; ErrorCode : out SQLRETURN); end GNU.DB.SQLCLI.Dispatch.A_Enumerated; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-dispatch-a_integer.adb0000644000175000017500000000662710537477634023736 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2001 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- package body GNU.DB.SQLCLI.Dispatch.A_Integer is function Get (Handle : Ctx; Attribute : Attr.T; MaxLength : SQLSMALLINT := 0; Data : Attr.Aux; ErrorCode : access SQLRETURN) return Attr.Attribute_Value_Pair'Class is begin return Derived.GetAttr (Handle, Attribute, Data, MaxLength, ErrorCode); end Get; procedure Set (Handle : in Ctx; AV_Pair : in Attr.Attribute_Value_Pair'Class; Data : in Attr.Aux; ErrorCode : out SQLRETURN) is begin if not (AV_Pair in Info'Class) then Raise_SQL_Error (ProcedureName => "SetAttr", ErrorMessage => "Attribute value is not an Integer", RC => SQL_ADA95_TYPE_ERROR); end if; Derived.SetAttr (Handle, Info (AV_Pair), Data, ErrorCode); end Set; procedure Register (Index : in Attr.T) is begin Get_Dispatch_Array (Index) := Get'Unrestricted_Access; Set_Dispatch_Array (Index) := Set'Unrestricted_Access; end Register; end GNU.DB.SQLCLI.Dispatch.A_Integer; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-dispatch-a_integer.ads0000644000175000017500000000602607475446337023753 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2002 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with GNU.DB.SQLCLI.Generic_Attr.Integer_Attribute; pragma Elaborate_All (GNU.DB.SQLCLI.Generic_Attr.Integer_Attribute); generic type Int_Type is range <>; package GNU.DB.SQLCLI.Dispatch.A_Integer is package Derived is new Attr.Integer_Attribute (Int_Type); subtype Info is Derived.Attribute_Value_Pair_Int; procedure Register (Index : in Attr.T); pragma Inline_Always (Register); private function Get (Handle : Ctx; Attribute : Attr.T; MaxLength : SQLSMALLINT := 0; Data : Attr.Aux; ErrorCode : access SQLRETURN) return Attr.Attribute_Value_Pair'Class; procedure Set (Handle : in Ctx; AV_Pair : in Attr.Attribute_Value_Pair'Class; Data : in Attr.Aux; ErrorCode : out SQLRETURN); end GNU.DB.SQLCLI.Dispatch.A_Integer; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-dispatch-a_pointer.adb0000644000175000017500000000662610537477634023760 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2001 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- package body GNU.DB.SQLCLI.Dispatch.A_Pointer is function Get (Handle : Ctx; Attribute : Attr.T; MaxLength : SQLSMALLINT := 0; Data : Attr.Aux; ErrorCode : access SQLRETURN) return Attr.Attribute_Value_Pair'Class is begin return Derived.GetAttr (Handle, Attribute, Data, MaxLength, ErrorCode); end Get; procedure Set (Handle : in Ctx; AV_Pair : in Attr.Attribute_Value_Pair'Class; Data : in Attr.Aux; ErrorCode : out SQLRETURN) is begin if not (AV_Pair in Info'Class) then Raise_SQL_Error (ProcedureName => "SetAttr", ErrorMessage => "Attribute value is not a Pointer", RC => SQL_ADA95_TYPE_ERROR); end if; Derived.SetAttr (Handle, Info (AV_Pair), Data, ErrorCode); end Set; procedure Register (Index : in Attr.T) is begin Get_Dispatch_Array (Index) := Get'Unrestricted_Access; Set_Dispatch_Array (Index) := Set'Unrestricted_Access; end Register; end GNU.DB.SQLCLI.Dispatch.A_Pointer; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-dispatch-a_pointer.ads0000644000175000017500000000610607475446337023775 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2002 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with GNU.DB.SQLCLI.Generic_Attr.Pointer_Attribute; pragma Elaborate_All (GNU.DB.SQLCLI.Generic_Attr.Pointer_Attribute); generic type Object is private; type P_Object is access all Object; package GNU.DB.SQLCLI.Dispatch.A_Pointer is package Derived is new Attr.Pointer_Attribute (Object, P_Object); subtype Info is Derived.Attribute_Value_Pair_Pointer; procedure Register (Index : in Attr.T); pragma Inline_Always (Register); private function Get (Handle : Ctx; Attribute : Attr.T; MaxLength : SQLSMALLINT := 0; Data : Attr.Aux; ErrorCode : access SQLRETURN) return Attr.Attribute_Value_Pair'Class; procedure Set (Handle : in Ctx; AV_Pair : in Attr.Attribute_Value_Pair'Class; Data : in Attr.Aux; ErrorCode : out SQLRETURN); end GNU.DB.SQLCLI.Dispatch.A_Pointer; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-dispatch-a_string.adb0000644000175000017500000000666210537477634023606 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2001 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- package body GNU.DB.SQLCLI.Dispatch.A_String is function Get (Handle : Ctx; Attribute : Attr.T; MaxLength : SQLSMALLINT := 0; Data : Attr.Aux; ErrorCode : access SQLRETURN) return Attr.Attribute_Value_Pair'Class is begin return Info (Derived.GetAttr (Handle, Attribute, Data, MaxLength, ErrorCode)); end Get; procedure Set (Handle : in Ctx; AV_Pair : in Attr.Attribute_Value_Pair'Class; Data : in Attr.Aux; ErrorCode : out SQLRETURN) is begin if not (AV_Pair in Info'Class) then Raise_SQL_Error (ProcedureName => "SetAttr", ErrorMessage => "Attribute value is not a String", RC => SQL_ADA95_TYPE_ERROR); end if; Derived.SetAttr (Handle, Info (AV_Pair), Data, ErrorCode); end Set; procedure Register (Index : in Attr.T) is begin Get_Dispatch_Array (Index) := Get'Unrestricted_Access; Set_Dispatch_Array (Index) := Set'Unrestricted_Access; end Register; end GNU.DB.SQLCLI.Dispatch.A_String; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-dispatch-a_string.ads0000644000175000017500000000575307475446337023632 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2002 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with GNU.DB.SQLCLI.Generic_Attr.String_Attribute; pragma Elaborate_All (GNU.DB.SQLCLI.Generic_Attr.String_Attribute); generic package GNU.DB.SQLCLI.Dispatch.A_String is package Derived is new Attr.String_Attribute; subtype Info is Derived.Attribute_Value_Pair_String; procedure Register (Index : in Attr.T); pragma Inline_Always (Register); private function Get (Handle : Ctx; Attribute : Attr.T; MaxLength : SQLSMALLINT := 0; Data : Attr.Aux; ErrorCode : access SQLRETURN) return Attr.Attribute_Value_Pair'Class; procedure Set (Handle : in Ctx; AV_Pair : in Attr.Attribute_Value_Pair'Class; Data : in Attr.Aux; ErrorCode : out SQLRETURN); end GNU.DB.SQLCLI.Dispatch.A_String; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-dispatch-a_unsigned.adb0000644000175000017500000000664110537477634024111 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2001 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- package body GNU.DB.SQLCLI.Dispatch.A_Unsigned is function Get (Handle : Ctx; Attribute : Attr.T; MaxLength : SQLSMALLINT := 0; Data : Attr.Aux; ErrorCode : access SQLRETURN) return Attr.Attribute_Value_Pair'Class is begin return Derived.GetAttr (Handle, Attribute, Data, MaxLength, ErrorCode); end Get; procedure Set (Handle : in Ctx; AV_Pair : in Attr.Attribute_Value_Pair'Class; Data : in Attr.Aux; ErrorCode : out SQLRETURN) is begin if not (AV_Pair in Info'Class) then Raise_SQL_Error (ProcedureName => "SetAttr", ErrorMessage => "Attribute value is not an unsigned number", RC => SQL_ADA95_TYPE_ERROR); end if; Derived.SetAttr (Handle, Info (AV_Pair), Data, ErrorCode); end Set; procedure Register (Index : in Attr.T) is begin Get_Dispatch_Array (Index) := Get'Unrestricted_Access; Set_Dispatch_Array (Index) := Set'Unrestricted_Access; end Register; end GNU.DB.SQLCLI.Dispatch.A_Unsigned; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-dispatch-a_unsigned.ads0000644000175000017500000000603607475446337024133 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2002 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with GNU.DB.SQLCLI.Generic_Attr.Unsigned_Attribute; pragma Elaborate_All (GNU.DB.SQLCLI.Generic_Attr.Unsigned_Attribute); generic type Mod_Type is mod <>; package GNU.DB.SQLCLI.Dispatch.A_Unsigned is package Derived is new Attr.Unsigned_Attribute (Mod_Type); subtype Info is Derived.Attribute_Value_Pair_Unsigned; procedure Register (Index : in Attr.T); pragma Inline_Always (Register); private function Get (Handle : Ctx; Attribute : Attr.T; MaxLength : SQLSMALLINT := 0; Data : Attr.Aux; ErrorCode : access SQLRETURN) return Attr.Attribute_Value_Pair'Class; procedure Set (Handle : in Ctx; AV_Pair : in Attr.Attribute_Value_Pair'Class; Data : in Attr.Aux; ErrorCode : out SQLRETURN); end GNU.DB.SQLCLI.Dispatch.A_Unsigned; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-dispatch-a_wide_string.adb0000644000175000017500000000670210537477634024611 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2001 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- package body GNU.DB.SQLCLI.Dispatch.A_Wide_String is function Get (Handle : Ctx; Attribute : Attr.T; MaxLength : SQLSMALLINT := 0; Data : Attr.Aux; ErrorCode : access SQLRETURN) return Attr.Attribute_Value_Pair'Class is begin return Info (Derived.GetAttr (Handle, Attribute, Data, MaxLength, ErrorCode)); end Get; procedure Set (Handle : in Ctx; AV_Pair : in Attr.Attribute_Value_Pair'Class; Data : in Attr.Aux; ErrorCode : out SQLRETURN) is begin if not (AV_Pair in Info'Class) then Raise_SQL_Error (ProcedureName => "SetAttr", ErrorMessage => "Attribute value is not a Wide_String", RC => SQL_ADA95_TYPE_ERROR); end if; Derived.SetAttr (Handle, Info (AV_Pair), Data, ErrorCode); end Set; procedure Register (Index : in Attr.T) is begin Get_Dispatch_Array (Index) := Get'Unrestricted_Access; Set_Dispatch_Array (Index) := Set'Unrestricted_Access; end Register; end GNU.DB.SQLCLI.Dispatch.A_Wide_String; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-dispatch-a_wide_string.ads0000644000175000017500000000601007475446337024625 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2002 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with GNU.DB.SQLCLI.Generic_Attr.Wide_String_Attribute; pragma Elaborate_All (GNU.DB.SQLCLI.Generic_Attr.Wide_String_Attribute); generic package GNU.DB.SQLCLI.Dispatch.A_Wide_String is package Derived is new Attr.Wide_String_Attribute; subtype Info is Derived.Attribute_Value_Pair_Wide_String; procedure Register (Index : in Attr.T); pragma Inline_Always (Register); private function Get (Handle : Ctx; Attribute : Attr.T; MaxLength : SQLSMALLINT := 0; Data : Attr.Aux; ErrorCode : access SQLRETURN) return Attr.Attribute_Value_Pair'Class; procedure Set (Handle : in Ctx; AV_Pair : in Attr.Attribute_Value_Pair'Class; Data : in Attr.Aux; ErrorCode : out SQLRETURN); end GNU.DB.SQLCLI.Dispatch.A_Wide_String; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-dispatch-debug.adb0000644000175000017500000000554207735567063023064 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2002 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Text_IO; use Ada.Text_IO; package body GNU.DB.SQLCLI.Dispatch.Debug is package DF_IO is new Ada.Text_IO.Enumeration_IO (Attr.T); use DF_IO; procedure Verify is G : Attr_Get_Func; S : Attr_Set_Proc; Stop : Boolean := False; begin for I in Attr.T'Range loop G := Get_Func (I); S := Set_Proc (I); if G = null then Put (I); Put (" has no 'Get' function"); New_Line; Stop := True; end if; if S = null then Put (I); Put (" has no 'Set' funktion"); New_Line; Stop := True; end if; end loop; pragma Assert (not Stop); end Verify; end GNU.DB.SQLCLI.Dispatch.Debug; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-dispatch-debug.ads0000644000175000017500000000437007467277262023104 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2002 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- generic package GNU.DB.SQLCLI.Dispatch.Debug is procedure Verify; end GNU.DB.SQLCLI.Dispatch.Debug; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-dispatch.adb0000644000175000017500000000473007467277262021777 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2002 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- package body GNU.DB.SQLCLI.Dispatch is function Get_Func (Index : Attr.T) return Attr_Get_Func is begin return Get_Dispatch_Array (Index); end Get_Func; function Set_Proc (Index : Attr.T) return Attr_Set_Proc is begin return Set_Dispatch_Array (Index); end Set_Proc; end GNU.DB.SQLCLI.Dispatch; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-dispatch.ads0000644000175000017500000000637410047251315022001 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2001 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with GNU.DB.SQLCLI.Generic_Attr; generic with package Attr is new GNU.DB.SQLCLI.Generic_Attr (<>); package GNU.DB.SQLCLI.Dispatch is subtype Ctx is Attr.Context; type Attr_Get_Func is access function (Handle : Ctx; Attribute : Attr.T; MaxLength : SQLSMALLINT := 0; Data : Attr.Aux; ErrorCode : access SQLRETURN) return Attr.Attribute_Value_Pair'Class; function Get_Func (Index : Attr.T) return Attr_Get_Func; pragma Inline_Always (Get_Func); type Attr_Set_Proc is access procedure (Handle : in Ctx; AV_Pair : in Attr.Attribute_Value_Pair'Class; Data : in Attr.Aux; ErrorCode : out SQLRETURN); function Set_Proc (Index : Attr.T) return Attr_Set_Proc; pragma Inline_Always (Set_Proc); private type Get_Dispatch is array (Attr.T) of Attr_Get_Func; type Set_Dispatch is array (Attr.T) of Attr_Set_Proc; Get_Dispatch_Array : Get_Dispatch := (others => null); Set_Dispatch_Array : Set_Dispatch := (others => null); end GNU.DB.SQLCLI.Dispatch; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-environment_attribute-debug.adb0000644000175000017500000000714510663647575025716 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2001 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Exceptions; package body GNU.DB.SQLCLI.Environment_Attribute.Debug is procedure Dump (File : in Ada.Text_IO.File_Type; EnvironmentHandle : in SQLHENV) is package EV_IO is new Ada.Text_IO.Enumeration_IO (SQL_ENVIRONMENT_ATTRIBUTE); use Ada.Text_IO; use EV_IO; procedure Dump_Environment_Attr (A : in SQL_ENVIRONMENT_ATTRIBUTE); procedure Dump_Environment_Attr (A : in SQL_ENVIRONMENT_ATTRIBUTE) is AV : constant Environment_Attribute'Class := SQLGetEnvAttr (EnvironmentHandle, A); begin Put (File, A, Debug_Label_Width); Put (File, ": "); Put (File, Environment_Attributes.To_String (AV)); New_Line (File); end Dump_Environment_Attr; begin for I in SQL_ENVIRONMENT_ATTRIBUTE'Range loop declare begin Dump_Environment_Attr (I); exception when Event : others => Put (File, I, Debug_Label_Width); Put (File, ": ***** "); Put (File, Ada.Exceptions.Exception_Name (Event)); Put (File, ", "); Put (File, Ada.Exceptions.Exception_Message (Event)); New_Line (File); end; end loop; end Dump; procedure Dump (EnvironmentHandle : in SQLHENV) is begin Dump (Ada.Text_IO.Standard_Output, EnvironmentHandle); end Dump; end GNU.DB.SQLCLI.Environment_Attribute.Debug; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-environment_attribute-debug.ads0000644000175000017500000000466407227712011025716 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2001 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Text_IO; package GNU.DB.SQLCLI.Environment_Attribute.Debug is procedure Dump (File : in Ada.Text_IO.File_Type; EnvironmentHandle : in SQLHSTMT); procedure Dump (EnvironmentHandle : in SQLHSTMT); end GNU.DB.SQLCLI.Environment_Attribute.Debug; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-environment_attribute.ads0000644000175000017500000002052610047251337024630 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2002 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with GNU.DB.SQLCLI; with GNU.DB.SQLCLI.Generic_Attr; with GNU.DB.SQLCLI.Dispatch; with GNU.DB.SQLCLI.Dispatch.A_Unsigned; with GNU.DB.SQLCLI.Dispatch.A_String; with GNU.DB.SQLCLI.Dispatch.A_Enumerated; with GNU.DB.SQLCLI.Dispatch.A_Boolean; pragma Elaborate_All (GNU.DB.SQLCLI.Generic_Attr); pragma Elaborate_All (GNU.DB.SQLCLI.Dispatch); pragma Elaborate_All (GNU.DB.SQLCLI.Dispatch.A_Unsigned); pragma Elaborate_All (GNU.DB.SQLCLI.Dispatch.A_String); pragma Elaborate_All (GNU.DB.SQLCLI.Dispatch.A_Enumerated); pragma Elaborate_All (GNU.DB.SQLCLI.Dispatch.A_Boolean); package GNU.DB.SQLCLI.Environment_Attribute is type SQL_ENVIRONMENT_ATTRIBUTE is (SQL_ATTR_ODBC_VERSION, SQL_ATTR_CONNECTION_POOLING, SQL_ATTR_CP_MATCH, SQL_ATTR_OUTPUT_NTS); for SQL_ENVIRONMENT_ATTRIBUTE use (SQL_ATTR_ODBC_VERSION => 200, SQL_ATTR_CONNECTION_POOLING => 201, SQL_ATTR_CP_MATCH => 202, SQL_ATTR_OUTPUT_NTS => 10001); for SQL_ENVIRONMENT_ATTRIBUTE'Size use SQLINTEGER'Size; procedure Get_Env_Attr (EnvironmentHandle : in SQLHENV; Attribute : in SQL_ENVIRONMENT_ATTRIBUTE; Value : in SQLPOINTER; Length : in out SQLINTEGER; Data : in SQLSMALLINT; ErrorCode : access SQLRETURN); pragma Inline (Get_Env_Attr); procedure Set_Env_Attr (EnvironmentHandle : in SQLHENV; Attribute : in SQL_ENVIRONMENT_ATTRIBUTE; Value : in SQLPOINTER; Length : in SQLINTEGER; Data : in SQLSMALLINT; ErrorCode : out SQLRETURN); pragma Inline (Set_Env_Attr); -- Despite what the ODBC API says, apparently 'Value' must be the -- _value_ of the attribute, not a pointer to the value! However, -- we must use SQLPOINTER here to match the profile for -- GNU.DB.SQLCLI.Generic_Attr. There's a hack in -- GNU.DB.SQLCLI.Generic_Attr.Enumerated_Attribute.SetAttr to pass -- the value as SQLPOINTER (FIXME!). package Environment_Attributes is new GNU.DB.SQLCLI.Generic_Attr (Context => SQLHENV, T => SQL_ENVIRONMENT_ATTRIBUTE, Base => SQLINTEGER, Aux => SQLSMALLINT, Get => Get_Env_Attr, Set => Set_Env_Attr, Default_Context => Null_Handle); subtype Environment_Attribute is Environment_Attributes.Attribute_Value_Pair; package Dispatch is new GNU.DB.SQLCLI.Dispatch (Environment_Attributes); package EA_String is new Dispatch.A_String; subtype Environment_Attribute_String is EA_String.Info; package EA_Unsigned is new Dispatch.A_Unsigned (SQLUINTEGER); subtype Environment_Attribute_Unsigned is EA_Unsigned.Info; package EA_Boolean is new Dispatch.A_Boolean (SQLUINTEGER); subtype Environment_Attribute_Boolean is EA_Boolean.Info; -- ---------------------------------------------------------------------- type CONNECTION_POOLING is (SQL_CP_OFF, SQL_CP_ONE_PER_DRIVER, SQL_CP_ONE_PER_HENV); for CONNECTION_POOLING'Size use SQLINTEGER'Size; SQL_CP_DEFAULT : constant CONNECTION_POOLING := SQL_CP_OFF; package Dsp_Connection_Pooling is new Dispatch.A_Enumerated (SQL_ATTR_CONNECTION_POOLING, CONNECTION_POOLING, SQLINTEGER, "CONNECTION_POOLING"); subtype Environment_Attribute_Pooling is Dsp_Connection_Pooling.Info; -- ---------------------------------------------------------------------- type CONNECTION_POOLING_MATCH is (SQL_CP_STRICT_MATCH, SQL_CP_RELAXED_MATCH); for CONNECTION_POOLING_MATCH'Size use SQLINTEGER'Size; SQL_CP_MATCH_DEFAULT : constant CONNECTION_POOLING_MATCH := SQL_CP_STRICT_MATCH; package Dsp_Connection_Pooling_Match is new Dispatch.A_Enumerated (SQL_ATTR_CP_MATCH, CONNECTION_POOLING_MATCH, SQLINTEGER, "CONNECTION_POOLING_MATCH"); subtype Environment_Attribute_Pooling_Match is Dsp_Connection_Pooling_Match.Info; -- ---------------------------------------------------------------------- type SQL_ODBC_VERSION is (SQL_OV_ODBC2, SQL_OV_ODBC3); for SQL_ODBC_VERSION use (SQL_OV_ODBC2 => 2, SQL_OV_ODBC3 => 3); for SQL_ODBC_VERSION'Size use SQLINTEGER'Size; package Dsp_SQL_ODBC_Version is new Dispatch.A_Enumerated (SQL_ATTR_ODBC_VERSION, SQL_ODBC_VERSION, SQLINTEGER, "SQL_ODBC_VERSION"); subtype Environment_Attribute_ODBC_Version is Dsp_SQL_ODBC_Version.Info; -- ---------------------------------------------------------------------- function SQLSetEnvAttr (EnvironmentHandle : SQLHENV; AttrRec : Environment_Attribute'Class) return SQLRETURN; procedure SQLSetEnvAttr (EnvironmentHandle : in SQLHENV; AttrRec : in Environment_Attribute'Class); -- Sets an environment attribute. function SQLGetEnvAttr (EnvironmentHandle : SQLHENV; Attribute : SQL_ENVIRONMENT_ATTRIBUTE; MaxLength : SQLSMALLINT := SQL_MAX_OPTION_STRING_LENGTH; ErrorCode : access SQLRETURN) return Environment_Attribute'Class; -- This version returns an ErrorCode when an ODBC error occurs function SQLGetEnvAttr (EnvironmentHandle : SQLHENV; Attribute : SQL_ENVIRONMENT_ATTRIBUTE; MaxLength : SQLSMALLINT := SQL_MAX_OPTION_STRING_LENGTH) return Environment_Attribute'Class; -- This version raises an exception when an ODBC error occurs end GNU.DB.SQLCLI.Environment_Attribute; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-environment_attribute.gpb0000644000175000017500000001577307735567063024661 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2002 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- package body GNU.DB.SQLCLI.Environment_Attribute is procedure Get_Env_Attr (EnvironmentHandle : in SQLHENV; Attribute : in SQL_ENVIRONMENT_ATTRIBUTE; Value : in SQLPOINTER; Length : in out SQLINTEGER; Data : in SQLSMALLINT; ErrorCode : access SQLRETURN) is pragma Unreferenced (Data); function GetEnvAttr (EnvironmentHandle : SQLHENV; Env_Type : SQL_ENVIRONMENT_ATTRIBUTE; ValuePtr : SQLPOINTER; Buffer_Length : SQLINTEGER; P_Length : access SQLINTEGER) return SQLRETURN; pragma Import ($CALLCONVENTION, GetEnvAttr, "SQLGetEnvAttr"); Len : aliased SQLINTEGER := Length; RC : constant SQLRETURN := GetEnvAttr (EnvironmentHandle, Attribute, Value, Len, Len'Access); begin ErrorCode.all := RC; if Is_SQL_Ok (RC) then Length := Len; end if; end Get_Env_Attr; procedure Set_Env_Attr (EnvironmentHandle : in SQLHENV; Attribute : in SQL_ENVIRONMENT_ATTRIBUTE; Value : in SQLPOINTER; Length : in SQLINTEGER; Data : in SQLSMALLINT; ErrorCode : out SQLRETURN) is pragma Unreferenced (Data); function SetEnvAttr (EnvironmentHandle : SQLHENV; Attribute : SQL_ENVIRONMENT_ATTRIBUTE; Value : SQLPOINTER; StringLength : SQLINTEGER) return SQLRETURN; pragma Import ($CALLCONVENTION, SetEnvAttr, "SQLSetEnvAttr"); begin ErrorCode := SetEnvAttr (EnvironmentHandle, Attribute, Value, Length); end Set_Env_Attr; function SQLGetEnvAttr (EnvironmentHandle : SQLHENV; Attribute : SQL_ENVIRONMENT_ATTRIBUTE; MaxLength : SQLSMALLINT := SQL_MAX_OPTION_STRING_LENGTH; ErrorCode : access SQLRETURN) return Environment_Attribute'Class is use type Dispatch.Attr_Get_Func; F : constant Dispatch.Attr_Get_Func := Dispatch.Get_Func (Attribute); begin if F = null then Raise_SQL_Error ("SQLGetEnvAttr", SQL_ENVIRONMENT_ATTRIBUTE'Image (Attribute) & Attr_Not_Supported_Msg); else return F.all (EnvironmentHandle, Attribute, MaxLength, 0, ErrorCode); end if; end SQLGetEnvAttr; function SQLGetEnvAttr (EnvironmentHandle : SQLHENV; Attribute : SQL_ENVIRONMENT_ATTRIBUTE; MaxLength : SQLSMALLINT := SQL_MAX_OPTION_STRING_LENGTH) return Environment_Attribute'Class is RC : aliased SQLRETURN; Result : constant Environment_Attribute'Class := SQLGetEnvAttr (EnvironmentHandle, Attribute, MaxLength, RC'Access); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLGetEnvAttr", HandleType => SQL_HANDLE_ENV, Handle => EnvironmentHandle); return Result; end SQLGetEnvAttr; function SQLSetEnvAttr (EnvironmentHandle : in SQLHENV; AttrRec : in Environment_Attribute'Class) return SQLRETURN is use type Dispatch.Attr_Set_Proc; F : constant Dispatch.Attr_Set_Proc := Dispatch.Set_Proc (AttrRec.Attribute); RC : SQLRETURN; begin if F = null then Raise_SQL_Error ("SQLSetEnvAttr", SQL_ENVIRONMENT_ATTRIBUTE'Image (AttrRec.Attribute) & Attr_Not_Supported_Msg); else F.all (EnvironmentHandle, AttrRec, 0, RC); end if; return RC; end SQLSetEnvAttr; procedure SQLSetEnvAttr (EnvironmentHandle : in SQLHENV; AttrRec : in Environment_Attribute'Class) is RC : constant SQLRETURN := SQLSetEnvAttr (EnvironmentHandle, AttrRec); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLSetEnvAttr", HandleType => SQL_HANDLE_ENV, Handle => EnvironmentHandle); end SQLSetEnvAttr; begin EA_Boolean.Register (SQL_ATTR_OUTPUT_NTS); end GNU.DB.SQLCLI.Environment_Attribute; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-generic_attr-array_attribute.adb0000644000175000017500000000766207735567063026053 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2003 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with System.Address_To_Access_Conversions; with Ada.Unchecked_Conversion; package body GNU.DB.SQLCLI.Generic_Attr.Array_Attribute is function To_String (Object : Attribute_Value_Pair_Array) return String is pragma Unreferenced (Object); begin return "Arr(...)"; end To_String; function GetAttr (Handle : Context; Attribute : T; Data : Aux; MaxLength : SQLSMALLINT := 0; ErrorCode : access SQLRETURN) return Attribute_Value_Pair_Array is package P is new System.Address_To_Access_Conversions (ElementsPtr); function Cvt is new Ada.Unchecked_Conversion (P.Object_Pointer, ElementsPtr); Value : aliased System.Address; Len : Base := Base (MaxLength); begin Get (Handle, Attribute, To_SQLPOINTER (Value'Address), Len, Data, ErrorCode); return Attribute_Value_Pair_Array' (Attribute => Attribute, Value => Cvt (P.To_Pointer (Value))); end GetAttr; procedure SetAttr (Handle : in Context; AV_Pair : in Attribute_Value_Pair_Array; Data : in Aux; ErrorCode : out SQLRETURN) is package P is new System.Address_To_Access_Conversions (ElementsPtr); Len : constant Base := SQL_IS_POINTER; AVP : Attribute_Value_Pair_Array := AV_Pair; begin Set (Handle, AV_Pair.Attribute, To_SQLPOINTER (P.To_Address (P.Object_Pointer'(AVP.Value'Access))), Len, Data, ErrorCode); end SetAttr; end GNU.DB.SQLCLI.Generic_Attr.Array_Attribute; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-generic_attr-array_attribute.ads0000644000175000017500000000611707735567063026066 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2002 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- generic type Item is private; type Index is range <>; type Elements is array (Index) of aliased Item; type ElementsPtr is access all Elements; package GNU.DB.SQLCLI.Generic_Attr.Array_Attribute is type Attribute_Value_Pair_Array is new Attribute_Value_Pair with record Value : aliased ElementsPtr; end record; function To_String (Object : Attribute_Value_Pair_Array) return String; function GetAttr (Handle : Context; Attribute : T; Data : Aux; MaxLength : SQLSMALLINT := 0; ErrorCode : access SQLRETURN) return Attribute_Value_Pair_Array; procedure SetAttr (Handle : in Context; AV_Pair : in Attribute_Value_Pair_Array; Data : in Aux; ErrorCode : out SQLRETURN); end GNU.DB.SQLCLI.Generic_Attr.Array_Attribute; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-generic_attr-bitmap_attribute.ads0000644000175000017500000000575407330016117026206 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2001 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- generic type E is (<>); type E_Bitmap is array (E) of Boolean; package GNU.DB.SQLCLI.Generic_Attr.Bitmap_Attribute is type Attribute_Value_Pair_Bitmap is new Attribute_Value_Pair with record Value : E_Bitmap; end record; function To_String (Object : Attribute_Value_Pair_Bitmap) return String; function GetAttr (Handle : Context; Attribute : T; Data : Aux; MaxLength : SQLSMALLINT := 0; ErrorCode : access SQLRETURN) return Attribute_Value_Pair_Bitmap; procedure SetAttr (Handle : in Context; AV_Pair : in Attribute_Value_Pair_Bitmap; Data : in Aux; ErrorCode : out SQLRETURN); end GNU.DB.SQLCLI.Generic_Attr.Bitmap_Attribute; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-generic_attr-bitmap_attribute.gpb0000644000175000017500000001206710663647575026227 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2001, 2003 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with System.Address_To_Access_Conversions; with Ada.Unchecked_Conversion; with Ada.Unchecked_Deallocation; package body GNU.DB.SQLCLI.Generic_Attr.Bitmap_Attribute is function To_String (Object : Attribute_Value_Pair_Bitmap) return String is type Str_Pointer is access String; procedure Append (X : in String); procedure Free is new Ada.Unchecked_Deallocation (String, Str_Pointer); S : Str_Pointer; F : Boolean := True; procedure Append (X : in String) is O : Str_Pointer; begin O := S; S := new String'(O.all & X); Free (O); end Append; begin S := new String'("{"); for I in E'Range loop if Object.Value (I) then if F then Append (E'Image (I)); F := False; else Append ("," & E'Image (I)); end if; end if; end loop; Append ("}"); declare Str : constant String := S.all; begin Free (S); return Str; end; end To_String; function GetAttr (Handle : Context; Attribute : T; Data : Aux; MaxLength : SQLSMALLINT := 0; ErrorCode : access SQLRETURN) return Attribute_Value_Pair_Bitmap is package P_SQLUI is new System.Address_To_Access_Conversions (SQLUINTEGER); use System; use P_SQLUI; Value : aliased SQLUINTEGER; Len : Base := Base (MaxLength); Set : E_Bitmap := (others => False); begin Get (Handle, Attribute, To_Integer (To_Address (Object_Pointer'(Value'Access))), Len, Data, ErrorCode); for I in E_Bitmap'Range loop exit when Value = 0; if (Value / 2) /= 0 then Set (I) := True; end if; Value := Value / 2; end loop; return Attribute_Value_Pair_Bitmap'(Attribute => Attribute, Value => Set); end GetAttr; procedure SetAttr (Handle : in Context; AV_Pair : in Attribute_Value_Pair_Bitmap; Data : in Aux; ErrorCode : out SQLRETURN) is use System; function Cvt is new Ada.Unchecked_Conversion (SQLUINTEGER, SQLPOINTER); Len : constant Base := SQL_IS_UINTEGER; Val : aliased SQLUINTEGER := 0; Bit : SQLUINTEGER := 1; begin for I in E_Bitmap'Range loop if AV_Pair.Value (I) then Val := Val + Bit; end if; Bit := Bit + Bit; end loop; Set (Handle, AV_Pair.Attribute, Cvt (Val), Len, Data, ErrorCode); end SetAttr; end GNU.DB.SQLCLI.Generic_Attr.Bitmap_Attribute; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-generic_attr-boolean_attribute.adb0000644000175000017500000000771507735567063026353 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2003 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Unchecked_Conversion; with System.Address_To_Access_Conversions; package body GNU.DB.SQLCLI.Generic_Attr.Boolean_Attribute is function To_String (Object : Attribute_Value_Pair_Boolean_Scalar) return String is begin return Boolean'Image (Object.Value); end To_String; function GetAttr (Handle : Context; Attribute : T; Data : Aux; MaxLength : SQLSMALLINT := 0; ErrorCode : access SQLRETURN) return Attribute_Value_Pair_Boolean_Scalar is pragma Unreferenced (MaxLength); package P is new System.Address_To_Access_Conversions (Bool_Type); Value : aliased Bool_Type; Len : Base := Default_Len; Res : Boolean := False; begin Get (Handle, Attribute, To_SQLPOINTER (P.To_Address (P.Object_Pointer'(Value'Access))), Len, Data, ErrorCode); if Value /= 0 then Res := True; end if; return Attribute_Value_Pair_Boolean_Scalar' (Attribute => Attribute, Value => Res); end GetAttr; procedure SetAttr (Handle : in Context; AV_Pair : in Attribute_Value_Pair_Boolean_Scalar; Data : in Aux; ErrorCode : out SQLRETURN) is function Cvt is new Ada.Unchecked_Conversion (SQLINTEGER, SQLPOINTER); Len : constant Base := Default_Len; Val : aliased Bool_Type := 0; begin if AV_Pair.Value then Val := 1; end if; Set (Handle, AV_Pair.Attribute, Cvt (SQLINTEGER (Val)), Len, Data, ErrorCode); end SetAttr; end GNU.DB.SQLCLI.Generic_Attr.Boolean_Attribute; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-generic_attr.ads0000644000175000017500000001153307330016117022641 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2001 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- -- -- A large amount of functions in the ODBC API deal with getting/setting -- of attribute values from a ODBC resource (i.e. statement attributes, -- connection attributes etc.). -- -- For that purpose ODBC has a quite generic mechanism: most of the -- ODBC resources are represented by so called "Handles" to the -- application and there are Set/Get routines that take such a handle -- and an enumeration value indicating the attribute type as well as -- a description of the location where the attribute is or should be -- stored. We reflect this genericity of the ODBC API design in the -- Ada95 binding by using generic packages and tagged types to represent -- the Attribute/Value concept and the various ODBC resources. -- generic type Context is private; -- The "type of handle" to be used type T is (<>); -- The enum of the attributes type Base is range <>; -- The integer type used for length info type Aux is range <>; -- The integer type used for Aux data with procedure Get (Ctx : in Context; AttrType : in T; Value : in SQLPOINTER; Length : in out Base; Data : in Aux; ErrorCode : access SQLRETURN); with procedure Set (Ctx : in Context; AttrType : in T; Value : in SQLPOINTER; Length : in Base; Data : in Aux; ErrorCode : out SQLRETURN); with function Default_Context return Context; package GNU.DB.SQLCLI.Generic_Attr is -- This is the abstract base type for Attribute/Value pairs. -- As different attributes have different types for their values, -- we use child packages that extent this type with record components -- according to the type of the attribute defined by ODBC. type Attribute_Value_Pair is abstract tagged record Attribute : T; end record; -- Any attribute value should be representable as string, mostly for -- debugging purposes. function To_String (Object : Attribute_Value_Pair) return String is abstract; function GetAttr (Handle : Context; Attribute : T; Data : Aux; MaxLength : SQLSMALLINT := 0; ErrorCode : access SQLRETURN) return Attribute_Value_Pair is abstract; procedure SetAttr (Handle : in Context; AV_Pair : in Attribute_Value_Pair; Data : in Aux; ErrorCode : out SQLRETURN) is abstract; end GNU.DB.SQLCLI.Generic_Attr; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-generic_attr-boolean_attribute.ads0000644000175000017500000000613607330016117026344 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2001 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- generic type Bool_Type is mod <>; package GNU.DB.SQLCLI.Generic_Attr.Boolean_Attribute is type Attribute_Value_Pair_Boolean_Scalar is new Attribute_Value_Pair with record Value : Boolean; end record; function To_String (Object : Attribute_Value_Pair_Boolean_Scalar) return String; function GetAttr (Handle : Context; Attribute : T; Data : Aux; MaxLength : SQLSMALLINT := 0; ErrorCode : access SQLRETURN) return Attribute_Value_Pair_Boolean_Scalar; procedure SetAttr (Handle : in Context; AV_Pair : in Attribute_Value_Pair_Boolean_Scalar; Data : in Aux; ErrorCode : out SQLRETURN); private Default_Len : constant Base := Base (Length_Indicator (Bool_Type'Size)); end GNU.DB.SQLCLI.Generic_Attr.Boolean_Attribute; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-generic_attr-boolean_string_attribute.adb0000644000175000017500000001100107735567063027720 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2003 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- package body GNU.DB.SQLCLI.Generic_Attr.Boolean_String_Attribute is function To_String (Object : Attribute_Value_Pair_Boolean_String) return String is begin if Object.Value then return "Y"; else return "N"; end if; end To_String; function GetAttr (Handle : Context; Attribute : T; Data : Aux; MaxLength : SQLSMALLINT := 0; ErrorCode : access SQLRETURN) return Attribute_Value_Pair_Boolean_String is pragma Assert (MaxLength > 0); pragma Warnings (Off); Str : String (1 .. Positive (MaxLength)); pragma Warnings (On); Len : Base := Base (Str'Length); Res : Boolean := False; begin Get (Handle, Attribute, To_SQLPOINTER (Str'Address), Len, Data, ErrorCode); if Is_SQL_Ok (ErrorCode.all) then if Len > 1 then Raise_SQL_Error (ProcedureName => "", ErrorMessage => "UnexpectedLength"); else if Len = 1 then if Str (1) = 'Y' or else Str (1) = 'y' or else Str (1) = 'F' then Res := True; else if Str (1) /= 'N' and then Str (1) /= 'n' then Raise_SQL_Error (ProcedureName => "", ErrorMessage => "'Y' or 'N' expected"); end if; end if; end if; end if; end if; return Attribute_Value_Pair_Boolean_String'(Attribute => Attribute, Value => Res); end GetAttr; procedure SetAttr (Handle : in Context; AV_Pair : in Attribute_Value_Pair_Boolean_String; Data : in Aux; ErrorCode : out SQLRETURN) is Str : aliased String (1 .. 1); Length : constant Base := Base (Str'Length); begin if AV_Pair.Value then Str (1) := 'Y'; else Str (1) := 'N'; end if; Set (Handle, AV_Pair.Attribute, To_SQLPOINTER (Str'Address), Length, Data, ErrorCode); end SetAttr; end GNU.DB.SQLCLI.Generic_Attr.Boolean_String_Attribute; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-generic_attr-boolean_string_attribute.ads0000644000175000017500000000576707330016117027743 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2001 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- generic package GNU.DB.SQLCLI.Generic_Attr.Boolean_String_Attribute is type Attribute_Value_Pair_Boolean_String is new Attribute_Value_Pair with record Value : Boolean; end record; function To_String (Object : Attribute_Value_Pair_Boolean_String) return String; function GetAttr (Handle : Context; Attribute : T; Data : Aux; MaxLength : SQLSMALLINT := 0; ErrorCode : access SQLRETURN) return Attribute_Value_Pair_Boolean_String; procedure SetAttr (Handle : in Context; AV_Pair : in Attribute_Value_Pair_Boolean_String; Data : in Aux; ErrorCode : out SQLRETURN); end GNU.DB.SQLCLI.Generic_Attr.Boolean_String_Attribute; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-generic_attr-context_attribute.adb0000644000175000017500000001011707735567063026406 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2001, 2003 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with System.Address_To_Access_Conversions; with Ada.Unchecked_Conversion; with GNAT.Debug_Utilities; package body GNU.DB.SQLCLI.Generic_Attr.Context_Attribute is package D renames GNAT.Debug_Utilities; function To_String (Object : Attribute_Value_Pair_Context) return String is function Cvt is new Ada.Unchecked_Conversion (Context, System.Address); begin return "Hdl@(" & D.Image (Cvt (Object.Value)) & ")"; end To_String; function GetAttr (Handle : Context; Attribute : T; Data : Aux; MaxLength : SQLSMALLINT := 0; ErrorCode : access SQLRETURN) return Attribute_Value_Pair_Context is package P is new System.Address_To_Access_Conversions (Context); Value : aliased Context := Default_Context; Len : Base := Base (MaxLength); begin Get (Handle, Attribute, To_SQLPOINTER (P.To_Address (P.Object_Pointer'(Value'Access))), Len, Data, ErrorCode); return Attribute_Value_Pair_Context'(Attribute => Attribute, Value => Value); end GetAttr; procedure SetAttr (Handle : in Context; AV_Pair : in Attribute_Value_Pair_Context; Data : in Aux; ErrorCode : out SQLRETURN) is package P is new System.Address_To_Access_Conversions (Context); Len : constant Base := SQL_IS_POINTER; AVP : aliased Attribute_Value_Pair_Context := AV_Pair; begin Set (Handle, AV_Pair.Attribute, To_SQLPOINTER (P.To_Address (P.Object_Pointer'(AVP.Value'Access))), Len, Data, ErrorCode); end SetAttr; end GNU.DB.SQLCLI.Generic_Attr.Context_Attribute; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-generic_attr-context_attribute.ads0000644000175000017500000000567707330016117026422 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2001 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- generic package GNU.DB.SQLCLI.Generic_Attr.Context_Attribute is type Attribute_Value_Pair_Context is new Attribute_Value_Pair with record Value : aliased Context; end record; function To_String (Object : Attribute_Value_Pair_Context) return String; function GetAttr (Handle : Context; Attribute : T; Data : Aux; MaxLength : SQLSMALLINT := 0; ErrorCode : access SQLRETURN) return Attribute_Value_Pair_Context; procedure SetAttr (Handle : in Context; AV_Pair : in Attribute_Value_Pair_Context; Data : in Aux; ErrorCode : out SQLRETURN); end GNU.DB.SQLCLI.Generic_Attr.Context_Attribute; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-generic_attr-enumerated_attribute.adb0000644000175000017500000001134307735567063027055 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2003 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with System.Address_To_Access_Conversions; with Ada.Unchecked_Conversion; package body GNU.DB.SQLCLI.Generic_Attr.Enumerated_Attribute is function To_String (Object : Attribute_Value_Pair_Enum) return String is begin return E'Image (Object.Value); end To_String; function To_E is new Ada.Unchecked_Conversion (E_Base, E); function To_Base is new Ada.Unchecked_Conversion (E, E_Base); function GetAttr (Handle : Context; Attribute : T; Data : Aux; MaxLength : SQLSMALLINT := 0; ErrorCode : access SQLRETURN) return Attribute_Value_Pair_Enum is pragma Unreferenced (MaxLength); package P is new System.Address_To_Access_Conversions (E_Base); Value : aliased E_Base; AttrVal : E; Len : Base := Default_Len; begin Get (Handle, Attribute, To_SQLPOINTER (P.To_Address (P.Object_Pointer'(Value'Access))), Len, Data, ErrorCode); AttrVal := To_E (Value); if Is_SQL_Ok (ErrorCode.all) then if not AttrVal'Valid then Raise_Invalid_Enum (ProcedureName => "EnumeratedAttribute.GetAttr", EnumName => E_Name, EnumValue => E_Base'Image (To_Base (AttrVal))); end if; else -- we have to make sure to return a valid value, so in case -- of an error and an invalid enumeration value we set it to -- the first value of the enumeration if not AttrVal'Valid then AttrVal := E'First; end if; end if; return Attribute_Value_Pair_Enum'(Attribute => Attribute, Value => AttrVal); end GetAttr; procedure SetAttr (Handle : in Context; AV_Pair : in Attribute_Value_Pair_Enum; Data : in Aux; ErrorCode : out SQLRETURN) is Len : constant Base := Default_Len; Val : aliased constant E_Base := To_Base (AV_Pair.Value); use System.Storage_Elements; begin -- Despite what the ODBC API says, in this case 'Value' must be -- the _value_ of the attribute, not a pointer to the value! Set (Handle, AV_Pair.Attribute, To_SQLPOINTER (To_Address (Integer_Address (Val))), Len, Data, ErrorCode); end SetAttr; end GNU.DB.SQLCLI.Generic_Attr.Enumerated_Attribute; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-generic_attr-enumerated_attribute.ads0000644000175000017500000000613607330016117027056 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2001 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- generic type E is (<>); type E_Base is range <>; E_Name : String; package GNU.DB.SQLCLI.Generic_Attr.Enumerated_Attribute is type Attribute_Value_Pair_Enum is new Attribute_Value_Pair with record Value : E; end record; function To_String (Object : Attribute_Value_Pair_Enum) return String; pragma Inline (To_String); function GetAttr (Handle : Context; Attribute : T; Data : Aux; MaxLength : SQLSMALLINT := 0; ErrorCode : access SQLRETURN) return Attribute_Value_Pair_Enum; procedure SetAttr (Handle : in Context; AV_Pair : in Attribute_Value_Pair_Enum; Data : in Aux; ErrorCode : out SQLRETURN); private Default_Len : constant Base := Base (Length_Indicator (E_Base'Size)); end GNU.DB.SQLCLI.Generic_Attr.Enumerated_Attribute; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-generic_attr-integer_attribute.adb0000644000175000017500000000730307735567063026362 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2001, 2003 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Unchecked_Conversion; with System.Address_To_Access_Conversions; package body GNU.DB.SQLCLI.Generic_Attr.Integer_Attribute is function To_String (Object : Attribute_Value_Pair_Int) return String is begin return Int_Type'Image (Object.Value); end To_String; function GetAttr (Handle : Context; Attribute : T; Data : Aux; MaxLength : SQLSMALLINT := 0; ErrorCode : access SQLRETURN) return Attribute_Value_Pair_Int is package P is new System.Address_To_Access_Conversions (Int_Type); Value : aliased Int_Type; Len : Base := Base (MaxLength); begin Get (Handle, Attribute, To_SQLPOINTER (P.To_Address (P.Object_Pointer'(Value'Access))), Len, Data, ErrorCode); return Attribute_Value_Pair_Int'(Attribute => Attribute, Value => Value); end GetAttr; procedure SetAttr (Handle : in Context; AV_Pair : in Attribute_Value_Pair_Int; Data : in Aux; ErrorCode : out SQLRETURN) is function Cvt is new Ada.Unchecked_Conversion (SQLINTEGER, SQLPOINTER); Len : constant Base := Default_Len; begin Set (Handle, AV_Pair.Attribute, Cvt (SQLINTEGER (AV_Pair.Value)), Len, Data, ErrorCode); end SetAttr; end GNU.DB.SQLCLI.Generic_Attr.Integer_Attribute; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-generic_attr-integer_attribute.ads0000644000175000017500000000616307330016117026362 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2001 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- generic type Int_Type is range <>; package GNU.DB.SQLCLI.Generic_Attr.Integer_Attribute is type Attribute_Value_Pair_Int is new Attribute_Value_Pair with record Value : Int_Type; end record; function To_String (Object : Attribute_Value_Pair_Int) return String; pragma Inline (To_String); function GetAttr (Handle : Context; Attribute : T; Data : Aux; MaxLength : SQLSMALLINT := 0; ErrorCode : access SQLRETURN) return Attribute_Value_Pair_Int; pragma Inline (GetAttr); procedure SetAttr (Handle : in Context; AV_Pair : in Attribute_Value_Pair_Int; Data : in Aux; ErrorCode : out SQLRETURN); pragma Inline (SetAttr); private Default_Len : constant Base := Base (Length_Indicator (Int_Type'Size)); end GNU.DB.SQLCLI.Generic_Attr.Integer_Attribute; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-generic_attr-pointer_attribute.adb0000644000175000017500000001025507735567063026405 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2001, 2003 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with System.Address_To_Access_Conversions; with Ada.Unchecked_Conversion; with GNAT.Debug_Utilities; package body GNU.DB.SQLCLI.Generic_Attr.Pointer_Attribute is package D renames GNAT.Debug_Utilities; function To_String (Object : Attribute_Value_Pair_Pointer) return String is function Cvt is new Ada.Unchecked_Conversion (P_Object, System.Address); begin return "Ptr@(" & D.Image (Cvt (Object.Value)) & ")"; end To_String; function GetAttr (Handle : Context; Attribute : T; Data : Aux; MaxLength : SQLSMALLINT := 0; ErrorCode : access SQLRETURN) return Attribute_Value_Pair_Pointer is package P is new System.Address_To_Access_Conversions (P_Object); function Cvt is new Ada.Unchecked_Conversion (P.Object_Pointer, P_Object); Value : aliased System.Address; Len : Base := Base (MaxLength); begin Get (Handle, Attribute, To_SQLPOINTER (Value'Address), -- this is ok here Len, Data, ErrorCode); return Attribute_Value_Pair_Pointer' (Attribute => Attribute, Value => Cvt (P.To_Pointer (Value))); end GetAttr; procedure SetAttr (Handle : in Context; AV_Pair : in Attribute_Value_Pair_Pointer; Data : in Aux; ErrorCode : out SQLRETURN) is package P is new System.Address_To_Access_Conversions (P_Object); Len : constant Base := SQL_IS_POINTER; AVP : Attribute_Value_Pair_Pointer := AV_Pair; begin Set (Handle, AV_Pair.Attribute, To_SQLPOINTER (P.To_Address (P.Object_Pointer'(AVP.Value'Access))), Len, Data, ErrorCode); end SetAttr; end GNU.DB.SQLCLI.Generic_Attr.Pointer_Attribute; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-generic_attr-pointer_attribute.ads0000644000175000017500000000600607330016117026401 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2001 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- generic type Object is private; type P_Object is access all Object; package GNU.DB.SQLCLI.Generic_Attr.Pointer_Attribute is type Attribute_Value_Pair_Pointer is new Attribute_Value_Pair with record Value : aliased P_Object; end record; function To_String (Object : Attribute_Value_Pair_Pointer) return String; function GetAttr (Handle : Context; Attribute : T; Data : Aux; MaxLength : SQLSMALLINT := 0; ErrorCode : access SQLRETURN) return Attribute_Value_Pair_Pointer; procedure SetAttr (Handle : in Context; AV_Pair : in Attribute_Value_Pair_Pointer; Data : in Aux; ErrorCode : out SQLRETURN); end GNU.DB.SQLCLI.Generic_Attr.Pointer_Attribute; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-generic_attr-string_attribute.adb0000644000175000017500000000756307735567063026243 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2003 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- package body GNU.DB.SQLCLI.Generic_Attr.String_Attribute is function To_String (Object : Attribute_Value_Pair_String) return String is begin return Object.Value; end To_String; function GetAttr (Handle : Context; Attribute : T; Data : Aux; MaxLength : SQLSMALLINT := 0; ErrorCode : access SQLRETURN) return Attribute_Value_Pair_String is pragma Assert (MaxLength > 0); pragma Warnings (Off); Str : aliased String (1 .. Positive (MaxLength)); pragma Warnings (On); Len : Base := Base (Str'Length); begin Get (Handle, Attribute, To_SQLPOINTER (Str'Address), Len, Data, ErrorCode); if Len <= 0 or else Str (Str'First) = ASCII.NUL then return Attribute_Value_Pair_String'(Attribute => Attribute, Len => 0, Value => ""); else return Attribute_Value_Pair_String' (Attribute => Attribute, Len => Natural (Len), Value => Str (1 .. Natural (Len))); end if; end GetAttr; procedure SetAttr (Handle : in Context; AV_Pair : in Attribute_Value_Pair_String; Data : in Aux; ErrorCode : out SQLRETURN) is Length : constant Base := Base (AV_Pair.Value'Length); begin Set (Handle, AV_Pair.Attribute, To_SQLPOINTER (AV_Pair.Value'Address), Length, Data, ErrorCode); end SetAttr; end GNU.DB.SQLCLI.Generic_Attr.String_Attribute; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-generic_attr-string_attribute.ads0000644000175000017500000000604207330016117026227 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2001 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- generic package GNU.DB.SQLCLI.Generic_Attr.String_Attribute is type Attribute_Value_Pair_String (Len : Natural) is new Attribute_Value_Pair with record Value : String (1 .. Len); end record; function To_String (Object : Attribute_Value_Pair_String) return String; pragma Inline (To_String); function GetAttr (Handle : Context; Attribute : T; Data : Aux; MaxLength : SQLSMALLINT := 0; ErrorCode : access SQLRETURN) return Attribute_Value_Pair_String; pragma Inline (GetAttr); procedure SetAttr (Handle : in Context; AV_Pair : in Attribute_Value_Pair_String; Data : in Aux; ErrorCode : out SQLRETURN); pragma Inline (SetAttr); end GNU.DB.SQLCLI.Generic_Attr.String_Attribute; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-generic_attr-unsigned_attribute.adb0000644000175000017500000000770510047251356026530 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2002 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Unchecked_Conversion; with System.Address_To_Access_Conversions; package body GNU.DB.SQLCLI.Generic_Attr.Unsigned_Attribute is function To_String (Object : Attribute_Value_Pair_Unsigned) return String is begin return Mod_Type'Image (Object.Value); end To_String; function GetAttr (Handle : Context; Attribute : T; Data : Aux; MaxLength : SQLSMALLINT := 0; ErrorCode : access SQLRETURN) return Attribute_Value_Pair_Unsigned is pragma Unreferenced (MaxLength); package P is new System.Address_To_Access_Conversions (Mod_Type); Value : aliased Mod_Type; Len : Base := SQL_IS_UINTEGER; begin if Mod_Type'Size = SQLUSMALLINT'Size then Len := SQL_IS_USMALLINT; end if; Get (Handle, Attribute, To_SQLPOINTER (P.To_Address (P.Object_Pointer'(Value'Access))), Len, Data, ErrorCode); return Attribute_Value_Pair_Unsigned'(Attribute => Attribute, Value => Value); end GetAttr; procedure SetAttr (Handle : in Context; AV_Pair : in Attribute_Value_Pair_Unsigned; Data : in Aux; ErrorCode : out SQLRETURN) is function Cvt is new Ada.Unchecked_Conversion (SQLUINTEGER, SQLPOINTER); Len : Base := SQL_IS_UINTEGER; begin if Mod_Type'Size = SQLUSMALLINT'Size then Len := SQL_IS_USMALLINT; end if; Set (Handle, AV_Pair.Attribute, Cvt (SQLUINTEGER (AV_Pair.Value)), Len, Data, ErrorCode); end SetAttr; end GNU.DB.SQLCLI.Generic_Attr.Unsigned_Attribute; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-generic_attr-unsigned_attribute.ads0000644000175000017500000000576207330016117026545 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2001 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- generic type Mod_Type is mod <>; package GNU.DB.SQLCLI.Generic_Attr.Unsigned_Attribute is type Attribute_Value_Pair_Unsigned is new Attribute_Value_Pair with record Value : Mod_Type; end record; function To_String (Object : Attribute_Value_Pair_Unsigned) return String; function GetAttr (Handle : Context; Attribute : T; Data : Aux; MaxLength : SQLSMALLINT := 0; ErrorCode : access SQLRETURN) return Attribute_Value_Pair_Unsigned; procedure SetAttr (Handle : in Context; AV_Pair : in Attribute_Value_Pair_Unsigned; Data : in Aux; ErrorCode : out SQLRETURN); end GNU.DB.SQLCLI.Generic_Attr.Unsigned_Attribute; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-generic_attr-wide_string_attribute.adb0000644000175000017500000001023407735567063027240 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2003 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with System.WCh_Con; use System.WCh_Con; pragma Warnings (Off); -- System.WCh_Wts is an internal GNAT unit with System.WCh_WtS; use System.WCh_WtS; pragma Warnings (On); package body GNU.DB.SQLCLI.Generic_Attr.Wide_String_Attribute is function To_String (Object : Attribute_Value_Pair_Wide_String) return String is begin return Wide_String_To_String (Object.Value, WCEM_Hex); end To_String; function GetAttr (Handle : Context; Attribute : T; Data : Aux; MaxLength : SQLSMALLINT := 0; ErrorCode : access SQLRETURN) return Attribute_Value_Pair_Wide_String is pragma Assert (MaxLength > 0); pragma Warnings (Off); Str : aliased Wide_String (1 .. Positive (MaxLength)); pragma Warnings (On); Len : Base := Base (Str'Length); begin Get (Handle, Attribute, To_SQLPOINTER (Str'Address), Len, Data, ErrorCode); if Len <= 0 or else Wide_Character'Pos (Str (Str'First)) = 0 then return Attribute_Value_Pair_Wide_String'(Attribute => Attribute, Len => 0, Value => Wide_String'("")); else return Attribute_Value_Pair_Wide_String' (Attribute => Attribute, Len => Natural (Len), Value => Str (1 .. Natural (Len))); end if; end GetAttr; procedure SetAttr (Handle : in Context; AV_Pair : in Attribute_Value_Pair_Wide_String; Data : in Aux; ErrorCode : out SQLRETURN) is Length : constant Base := Base (AV_Pair.Value'Length); begin Set (Handle, AV_Pair.Attribute, To_SQLPOINTER (AV_Pair.Value'Address), Length, Data, ErrorCode); end SetAttr; end GNU.DB.SQLCLI.Generic_Attr.Wide_String_Attribute; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-generic_attr-wide_string_attribute.ads0000644000175000017500000000613307330016117027240 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2001 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- generic package GNU.DB.SQLCLI.Generic_Attr.Wide_String_Attribute is type Attribute_Value_Pair_Wide_String (Len : Natural) is new Attribute_Value_Pair with record Value : Wide_String (1 .. Len); end record; function To_String (Object : Attribute_Value_Pair_Wide_String) return String; pragma Inline (To_String); function GetAttr (Handle : Context; Attribute : T; Data : Aux; MaxLength : SQLSMALLINT := 0; ErrorCode : access SQLRETURN) return Attribute_Value_Pair_Wide_String; pragma Inline (GetAttr); procedure SetAttr (Handle : in Context; AV_Pair : in Attribute_Value_Pair_Wide_String; Data : in Aux; ErrorCode : out SQLRETURN); pragma Inline (SetAttr); end GNU.DB.SQLCLI.Generic_Attr.Wide_String_Attribute; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-info-debug.adb0000644000175000017500000001040710663647575022215 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2001 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Exceptions; package body GNU.DB.SQLCLI.Info.Debug is procedure Dump (File : in Ada.Text_IO.File_Type; ConnectionHandle : in SQLHDBC) is package DI renames GNU.DB.SQLCLI.Info.Driver_Information; package I_IO is new Ada.Text_IO.Enumeration_IO (SQL_INFO_TYPE); package SF_IO is new Ada.Text_IO.Enumeration_IO (SQL_API_FUNCTION); procedure Dump_Info (T : in SQL_INFO_TYPE); use I_IO; use SF_IO; use Ada.Text_IO; procedure Dump_Info (T : in SQL_INFO_TYPE) is I : constant Driver_Info'Class := SQLGetInfo (ConnectionHandle, T); begin Put (File, T, Debug_Label_Width); Put (File, ": "); Put (File, DI.To_String (I)); New_Line (File); end Dump_Info; Fct_Bitmap : SQL_API_FUNCTION_BITMAP; begin for I in SQL_INFO_TYPE'Range loop declare begin Dump_Info (I); exception when Event : others => Put (File, I, Debug_Label_Width); Put (File, ": ***** "); Put (File, Ada.Exceptions.Exception_Name (Event)); Put (File, ", "); Put (File, Ada.Exceptions.Exception_Message (Event)); New_Line (File); end; end loop; SQLGetFunctions (ConnectionHandle, Fct_Bitmap); for I in SQL_API_FUNCTION'Range loop declare begin Put (File, I, Debug_Label_Width); Put (File, ": "); Put (File, Boolean'Image (SQLGetFunctions (Fct_Bitmap, I))); New_Line (File); exception when Event : others => Put (File, I, Debug_Label_Width); Put (File, ": ***** "); Put (File, Ada.Exceptions.Exception_Name (Event)); Put (File, ", "); Put (File, Ada.Exceptions.Exception_Message (Event)); New_Line (File); end; end loop; end Dump; procedure Dump (ConnectionHandle : in SQLHDBC) is begin Dump (Ada.Text_IO.Standard_Output, ConnectionHandle); end Dump; end GNU.DB.SQLCLI.Info.Debug; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-info-debug.ads0000644000175000017500000000461507227712011022216 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2001 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Text_IO; package GNU.DB.SQLCLI.Info.Debug is procedure Dump (File : in Ada.Text_IO.File_Type; ConnectionHandle : in SQLHDBC); procedure Dump (ConnectionHandle : in SQLHDBC); end GNU.DB.SQLCLI.Info.Debug; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-info.ads0000644000175000017500000031172007475446340021146 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2001 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with GNU.DB.SQLCLI.Connection_Attribute; with GNU.DB.SQLCLI.Statement_Attribute; with GNU.DB.SQLCLI.Generic_Attr; with GNU.DB.SQLCLI.Dispatch; with GNU.DB.SQLCLI.Dispatch.A_Unsigned; with GNU.DB.SQLCLI.Dispatch.A_String; with GNU.DB.SQLCLI.Dispatch.A_Wide_String; with GNU.DB.SQLCLI.Dispatch.A_Enumerated; with GNU.DB.SQLCLI.Dispatch.A_Bitmap; with GNU.DB.SQLCLI.Dispatch.A_Context; with GNU.DB.SQLCLI.Dispatch.A_Boolean_String; pragma Elaborate_All (GNU.DB.SQLCLI.Generic_Attr); pragma Elaborate_All (GNU.DB.SQLCLI.Dispatch); pragma Elaborate_All (GNU.DB.SQLCLI.Dispatch.A_Unsigned); pragma Elaborate_All (GNU.DB.SQLCLI.Dispatch.A_String); pragma Elaborate_All (GNU.DB.SQLCLI.Dispatch.A_Wide_String); pragma Elaborate_All (GNU.DB.SQLCLI.Dispatch.A_Enumerated); pragma Elaborate_All (GNU.DB.SQLCLI.Dispatch.A_Bitmap); pragma Elaborate_All (GNU.DB.SQLCLI.Dispatch.A_Context); pragma Elaborate_All (GNU.DB.SQLCLI.Dispatch.A_Boolean_String); package GNU.DB.SQLCLI.Info is type SQL_INFO_TYPE is (SQL_MAXIMUM_DRIVER_CONNECTIONS, SQL_MAXIMUM_CONCURRENT_ACTIVITIES, SQL_DATA_SOURCE_NAME, SQL_DRIVER_HDBC, SQL_DRIVER_HENV, SQL_DRIVER_HSTMT, SQL_DRIVER_NAME, SQL_DRIVER_VER, SQL_FETCH_DIRECTION, SQL_ODBC_API_CONFORMANCE, SQL_ODBC_VER, SQL_ROW_UPDATES, SQL_ODBC_SAG_CLI_CONFORMANCE, SQL_SERVER_NAME, SQL_SEARCH_PATTERN_ESCAPE, SQL_ODBC_SQL_CONFORMANCE, SQL_DATABASE_NAME, SQL_DBMS_NAME, SQL_DBMS_VER, SQL_ACCESSIBLE_TABLES, SQL_ACCESSIBLE_PROCEDURES, SQL_PROCEDURES, SQL_CONCAT_NULL_BEHAVIOR, SQL_CURSOR_COMMIT_BEHAVIOR, SQL_CURSOR_ROLLBACK_BEHAVIOR, SQL_DATA_SOURCE_READ_ONLY, SQL_DEFAULT_TRANSACTION_ISOLATION, SQL_EXPRESSIONS_IN_ORDERBY, SQL_IDENTIFIER_CASE, SQL_IDENTIFIER_QUOTE_CHAR, SQL_MAXIMUM_COLUMN_NAME_LENGTH, SQL_MAXIMUM_CURSOR_NAME_LENGTH, SQL_MAXIMUM_SCHEMA_NAME_LENGTH, SQL_MAXIMUM_PROCEDURE_NAME_LENGTH, SQL_MAXIMUM_CATALOG_NAME_LENGTH, SQL_MAXIMUM_TABLE_NAME_LENGTH, SQL_MULTIPLE_RESULT_SETS, SQL_MULTIPLE_ACTIVE_TRANSACTIONS, SQL_OUTER_JOINS, SQL_SCHEMA_TERM, SQL_PROCEDURE_TERM, SQL_QUALIFIER_NAME_SEPARATOR, SQL_QUALIFIER_TERM, SQL_SCROLL_CONCURRENCY, SQL_SCROLL_OPTIONS, SQL_TABLE_TERM, SQL_TRANSACTION_CAPABLE, SQL_USER_NAME, SQL_CONVERT_FUNCTIONS, SQL_NUMERIC_FUNCTIONS, SQL_STRING_FUNCTIONS, SQL_SYSTEM_FUNCTIONS, SQL_TIMEDATE_FUNCTIONS, SQL_CONVERT_BIGINT, SQL_CONVERT_BINARY, SQL_CONVERT_BIT, SQL_CONVERT_CHAR, SQL_CONVERT_DATE, SQL_CONVERT_DECIMAL, SQL_CONVERT_DOUBLE, SQL_CONVERT_FLOAT, SQL_CONVERT_INTEGER, SQL_CONVERT_LONGVARCHAR, SQL_CONVERT_NUMERIC, SQL_CONVERT_REAL, SQL_CONVERT_SMALLINT, SQL_CONVERT_TIME, SQL_CONVERT_TIMESTAMP, SQL_CONVERT_TINYINT, SQL_CONVERT_VARBINARY, SQL_CONVERT_VARCHAR, SQL_CONVERT_LONGVARBINARY, SQL_TRANSACTION_ISOLATION_OPTION, SQL_INTEGRITY, SQL_CORRELATION_NAME, SQL_NON_NULLABLE_COLUMNS, SQL_DRIVER_HLIB, SQL_DRIVER_ODBC_VER, SQL_LOCK_TYPES, SQL_POS_OPERATIONS, SQL_POSITIONED_STATEMENTS, SQL_GETDATA_EXTENSIONS, SQL_BOOKMARK_PERSISTENCE, SQL_STATIC_SENSITIVITY, SQL_FILE_USAGE, SQL_NULL_COLLATION, SQL_ALTER_TABLE, SQL_COLUMN_ALIAS, SQL_GROUP_BY, SQL_KEYWORDS, SQL_ORDER_BY_COLUMNS_IN_SELECT, SQL_SCHEMA_USAGE, SQL_QUALIFIER_USAGE, SQL_QUOTED_IDENTIFIER_CASE, SQL_SPECIAL_CHARACTERS, SQL_SUBQUERIES, SQL_UNION_STATEMENT, SQL_MAXIMUM_COLUMNS_IN_GROUP_BY, SQL_MAXIMUM_COLUMNS_IN_INDEX, SQL_MAXIMUM_COLUMNS_IN_ORDER_BY, SQL_MAXIMUM_COLUMNS_IN_SELECT, SQL_MAXIMUM_COLUMNS_IN_TABLE, SQL_MAXIMUM_INDEX_SIZE, SQL_MAXIMUM_ROW_SIZE_INCLUDES_LONG, SQL_MAXIMUM_ROW_SIZE, SQL_MAXIMUM_STATEMENT_LENGTH, SQL_MAXIMUM_TABLES_IN_SELECT, SQL_MAXIMUM_USER_NAME_LENGTH, SQL_MAXIMUM_CHAR_LITERAL_LENGTH, SQL_TIMEDATE_ADD_INTERVALS, SQL_TIMEDATE_DIFF_INTERVALS, SQL_NEED_LONG_DATA_LEN, SQL_MAX_BINARY_LITERAL_LEN, SQL_LIKE_ESCAPE_CLAUSE, SQL_QUALIFIER_LOCATION, SQL_OUTER_JOIN_CAPABILITIES, SQL_ACTIVE_ENVIRONMENTS, SQL_ALTER_DOMAIN, SQL_SQL_CONFORMANCE, SQL_DATETIME_LITERALS, SQL_BATCH_ROW_COUNT, SQL_BATCH_SUPPORT, SQL_CONVERT_WCHAR, SQL_CONVERT_INTERVAL_DAY_TIME, SQL_CONVERT_INTERVAL_YEAR_MONTH, SQL_CONVERT_WLONGVARCHAR, SQL_CONVERT_WVARCHAR, SQL_CREATE_ASSERTION, SQL_CREATE_CHARACTER_SET, SQL_CREATE_COLLATION, SQL_CREATE_DOMAIN, SQL_CREATE_SCHEMA, SQL_CREATE_TABLE, SQL_CREATE_TRANSLATION, SQL_CREATE_VIEW, SQL_DRIVER_HDESC, SQL_DROP_ASSERTION, SQL_DROP_CHARACTER_SET, SQL_DROP_COLLATION, SQL_DROP_DOMAIN, SQL_DROP_SCHEMA, SQL_DROP_TABLE, SQL_DROP_TRANSLATION, SQL_DROP_VIEW, SQL_DYNAMIC_CURSOR_ATTRIBUTES1, SQL_DYNAMIC_CURSOR_ATTRIBUTES2, SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1, SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2, SQL_INDEX_KEYWORDS, SQL_INFO_SCHEMA_VIEWS, SQL_KEYSET_CURSOR_ATTRIBUTES1, SQL_KEYSET_CURSOR_ATTRIBUTES2, SQL_ODBC_INTERFACE_CONFORMANCE, SQL_PARAM_ARRAY_ROW_COUNTS, SQL_PARAM_ARRAY_SELECTS, SQL_SQL92_DATETIME_FUNCTIONS, SQL_SQL92_FOREIGN_KEY_DELETE_RULE, SQL_SQL92_FOREIGN_KEY_UPDATE_RULE, SQL_SQL92_GRANT, SQL_SQL92_NUMERIC_VALUE_FUNCTIONS, SQL_SQL92_PREDICATES, SQL_SQL92_RELATIONAL_JOIN_OPERATORS, SQL_SQL92_REVOKE, SQL_SQL92_ROW_VALUE_CONSTRUCTOR, SQL_SQL92_STRING_FUNCTIONS, SQL_SQL92_VALUE_EXPRESSIONS, SQL_STANDARD_CLI_CONFORMANCE, SQL_STATIC_CURSOR_ATTRIBUTES1, SQL_STATIC_CURSOR_ATTRIBUTES2, SQL_AGGREGATE_FUNCTIONS, SQL_DDL_INDEX, SQL_DM_VER, SQL_INSERT_STATEMENT, SQL_XOPEN_CLI_YEAR, SQL_CURSOR_SENSITIVITY, SQL_DESCRIBE_PARAMETER, SQL_CATALOG_NAME, SQL_COLLATION_SEQ, SQL_MAXIMUM_IDENTIFIER_LENGTH, SQL_ASYNC_MODE, SQL_MAX_ASYNC_CONCURRENT_STATEMENTS); for SQL_INFO_TYPE use (SQL_MAXIMUM_DRIVER_CONNECTIONS => 0, SQL_MAXIMUM_CONCURRENT_ACTIVITIES => 1, SQL_DATA_SOURCE_NAME => 2, SQL_DRIVER_HDBC => 3, SQL_DRIVER_HENV => 4, SQL_DRIVER_HSTMT => 5, SQL_DRIVER_NAME => 6, SQL_DRIVER_VER => 7, SQL_FETCH_DIRECTION => 8, SQL_ODBC_API_CONFORMANCE => 9, SQL_ODBC_VER => 10, SQL_ROW_UPDATES => 11, SQL_ODBC_SAG_CLI_CONFORMANCE => 12, SQL_SERVER_NAME => 13, SQL_SEARCH_PATTERN_ESCAPE => 14, SQL_ODBC_SQL_CONFORMANCE => 15, SQL_DATABASE_NAME => 16, SQL_DBMS_NAME => 17, SQL_DBMS_VER => 18, SQL_ACCESSIBLE_TABLES => 19, SQL_ACCESSIBLE_PROCEDURES => 20, SQL_PROCEDURES => 21, SQL_CONCAT_NULL_BEHAVIOR => 22, SQL_CURSOR_COMMIT_BEHAVIOR => 23, SQL_CURSOR_ROLLBACK_BEHAVIOR => 24, SQL_DATA_SOURCE_READ_ONLY => 25, SQL_DEFAULT_TRANSACTION_ISOLATION => 26, SQL_EXPRESSIONS_IN_ORDERBY => 27, SQL_IDENTIFIER_CASE => 28, SQL_IDENTIFIER_QUOTE_CHAR => 29, SQL_MAXIMUM_COLUMN_NAME_LENGTH => 30, SQL_MAXIMUM_CURSOR_NAME_LENGTH => 31, SQL_MAXIMUM_SCHEMA_NAME_LENGTH => 32, SQL_MAXIMUM_PROCEDURE_NAME_LENGTH => 33, SQL_MAXIMUM_CATALOG_NAME_LENGTH => 34, SQL_MAXIMUM_TABLE_NAME_LENGTH => 35, SQL_MULTIPLE_RESULT_SETS => 36, SQL_MULTIPLE_ACTIVE_TRANSACTIONS => 37, SQL_OUTER_JOINS => 38, SQL_SCHEMA_TERM => 39, SQL_PROCEDURE_TERM => 40, SQL_QUALIFIER_NAME_SEPARATOR => 41, SQL_QUALIFIER_TERM => 42, SQL_SCROLL_CONCURRENCY => 43, SQL_SCROLL_OPTIONS => 44, SQL_TABLE_TERM => 45, SQL_TRANSACTION_CAPABLE => 46, SQL_USER_NAME => 47, SQL_CONVERT_FUNCTIONS => 48, SQL_NUMERIC_FUNCTIONS => 49, SQL_STRING_FUNCTIONS => 50, SQL_SYSTEM_FUNCTIONS => 51, SQL_TIMEDATE_FUNCTIONS => 52, SQL_CONVERT_BIGINT => 53, SQL_CONVERT_BINARY => 54, SQL_CONVERT_BIT => 55, SQL_CONVERT_CHAR => 56, SQL_CONVERT_DATE => 57, SQL_CONVERT_DECIMAL => 58, SQL_CONVERT_DOUBLE => 59, SQL_CONVERT_FLOAT => 60, SQL_CONVERT_INTEGER => 61, SQL_CONVERT_LONGVARCHAR => 62, SQL_CONVERT_NUMERIC => 63, SQL_CONVERT_REAL => 64, SQL_CONVERT_SMALLINT => 65, SQL_CONVERT_TIME => 66, SQL_CONVERT_TIMESTAMP => 67, SQL_CONVERT_TINYINT => 68, SQL_CONVERT_VARBINARY => 69, SQL_CONVERT_VARCHAR => 70, SQL_CONVERT_LONGVARBINARY => 71, SQL_TRANSACTION_ISOLATION_OPTION => 72, SQL_INTEGRITY => 73, SQL_CORRELATION_NAME => 74, SQL_NON_NULLABLE_COLUMNS => 75, SQL_DRIVER_HLIB => 76, SQL_DRIVER_ODBC_VER => 77, SQL_LOCK_TYPES => 78, SQL_POS_OPERATIONS => 79, SQL_POSITIONED_STATEMENTS => 80, SQL_GETDATA_EXTENSIONS => 81, SQL_BOOKMARK_PERSISTENCE => 82, SQL_STATIC_SENSITIVITY => 83, SQL_FILE_USAGE => 84, SQL_NULL_COLLATION => 85, SQL_ALTER_TABLE => 86, SQL_COLUMN_ALIAS => 87, SQL_GROUP_BY => 88, SQL_KEYWORDS => 89, SQL_ORDER_BY_COLUMNS_IN_SELECT => 90, SQL_SCHEMA_USAGE => 91, SQL_QUALIFIER_USAGE => 92, SQL_QUOTED_IDENTIFIER_CASE => 93, SQL_SPECIAL_CHARACTERS => 94, SQL_SUBQUERIES => 95, SQL_UNION_STATEMENT => 96, SQL_MAXIMUM_COLUMNS_IN_GROUP_BY => 97, SQL_MAXIMUM_COLUMNS_IN_INDEX => 98, SQL_MAXIMUM_COLUMNS_IN_ORDER_BY => 99, SQL_MAXIMUM_COLUMNS_IN_SELECT => 100, SQL_MAXIMUM_COLUMNS_IN_TABLE => 101, SQL_MAXIMUM_INDEX_SIZE => 102, SQL_MAXIMUM_ROW_SIZE_INCLUDES_LONG => 103, SQL_MAXIMUM_ROW_SIZE => 104, SQL_MAXIMUM_STATEMENT_LENGTH => 105, SQL_MAXIMUM_TABLES_IN_SELECT => 106, SQL_MAXIMUM_USER_NAME_LENGTH => 107, SQL_MAXIMUM_CHAR_LITERAL_LENGTH => 108, SQL_TIMEDATE_ADD_INTERVALS => 109, SQL_TIMEDATE_DIFF_INTERVALS => 110, SQL_NEED_LONG_DATA_LEN => 111, SQL_MAX_BINARY_LITERAL_LEN => 112, SQL_LIKE_ESCAPE_CLAUSE => 113, SQL_QUALIFIER_LOCATION => 114, SQL_OUTER_JOIN_CAPABILITIES => 115, SQL_ACTIVE_ENVIRONMENTS => 116, SQL_ALTER_DOMAIN => 117, SQL_SQL_CONFORMANCE => 118, SQL_DATETIME_LITERALS => 119, SQL_BATCH_ROW_COUNT => 120, SQL_BATCH_SUPPORT => 121, SQL_CONVERT_WCHAR => 122, SQL_CONVERT_INTERVAL_DAY_TIME => 123, SQL_CONVERT_INTERVAL_YEAR_MONTH => 124, SQL_CONVERT_WLONGVARCHAR => 125, SQL_CONVERT_WVARCHAR => 126, SQL_CREATE_ASSERTION => 127, SQL_CREATE_CHARACTER_SET => 128, SQL_CREATE_COLLATION => 129, SQL_CREATE_DOMAIN => 130, SQL_CREATE_SCHEMA => 131, SQL_CREATE_TABLE => 132, SQL_CREATE_TRANSLATION => 133, SQL_CREATE_VIEW => 134, SQL_DRIVER_HDESC => 135, SQL_DROP_ASSERTION => 136, SQL_DROP_CHARACTER_SET => 137, SQL_DROP_COLLATION => 138, SQL_DROP_DOMAIN => 139, SQL_DROP_SCHEMA => 140, SQL_DROP_TABLE => 141, SQL_DROP_TRANSLATION => 142, SQL_DROP_VIEW => 143, SQL_DYNAMIC_CURSOR_ATTRIBUTES1 => 144, SQL_DYNAMIC_CURSOR_ATTRIBUTES2 => 145, SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1 => 146, SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2 => 147, SQL_INDEX_KEYWORDS => 148, SQL_INFO_SCHEMA_VIEWS => 149, SQL_KEYSET_CURSOR_ATTRIBUTES1 => 150, SQL_KEYSET_CURSOR_ATTRIBUTES2 => 151, SQL_ODBC_INTERFACE_CONFORMANCE => 152, SQL_PARAM_ARRAY_ROW_COUNTS => 153, SQL_PARAM_ARRAY_SELECTS => 154, SQL_SQL92_DATETIME_FUNCTIONS => 155, SQL_SQL92_FOREIGN_KEY_DELETE_RULE => 156, SQL_SQL92_FOREIGN_KEY_UPDATE_RULE => 157, SQL_SQL92_GRANT => 158, SQL_SQL92_NUMERIC_VALUE_FUNCTIONS => 159, SQL_SQL92_PREDICATES => 160, SQL_SQL92_RELATIONAL_JOIN_OPERATORS => 161, SQL_SQL92_REVOKE => 162, SQL_SQL92_ROW_VALUE_CONSTRUCTOR => 163, SQL_SQL92_STRING_FUNCTIONS => 164, SQL_SQL92_VALUE_EXPRESSIONS => 165, SQL_STANDARD_CLI_CONFORMANCE => 166, SQL_STATIC_CURSOR_ATTRIBUTES1 => 167, SQL_STATIC_CURSOR_ATTRIBUTES2 => 168, SQL_AGGREGATE_FUNCTIONS => 169, SQL_DDL_INDEX => 170, SQL_DM_VER => 171, SQL_INSERT_STATEMENT => 172, SQL_XOPEN_CLI_YEAR => 10000, SQL_CURSOR_SENSITIVITY => 10001, SQL_DESCRIBE_PARAMETER => 10002, SQL_CATALOG_NAME => 10003, SQL_COLLATION_SEQ => 10004, SQL_MAXIMUM_IDENTIFIER_LENGTH => 10005, SQL_ASYNC_MODE => 10021, SQL_MAX_ASYNC_CONCURRENT_STATEMENTS => 10022); for SQL_INFO_TYPE'Size use SQLSMALLINT'Size; -- Various aliases for compatibility reasons SQL_MAX_DRIVER_CONNECTIONS : constant SQL_INFO_TYPE := SQL_MAXIMUM_DRIVER_CONNECTIONS; SQL_MAX_COLUMN_NAME_LEN : constant SQL_INFO_TYPE := SQL_MAXIMUM_COLUMN_NAME_LENGTH; SQL_MAX_CURSOR_NAME_LEN : constant SQL_INFO_TYPE := SQL_MAXIMUM_CURSOR_NAME_LENGTH; SQL_MAX_SCHEMA_NAME_LEN : constant SQL_INFO_TYPE := SQL_MAXIMUM_SCHEMA_NAME_LENGTH; SQL_TXN_CAPABLE : constant SQL_INFO_TYPE := SQL_TRANSACTION_CAPABLE; SQL_TXN_ISOLATION_OPTION : constant SQL_INFO_TYPE := SQL_TRANSACTION_ISOLATION_OPTION; SQL_MAX_COLUMNS_IN_GROUP_BY : constant SQL_INFO_TYPE := SQL_MAXIMUM_COLUMNS_IN_GROUP_BY; SQL_MAX_COLUMNS_IN_INDEX : constant SQL_INFO_TYPE := SQL_MAXIMUM_COLUMNS_IN_INDEX; SQL_MAX_COLUMNS_IN_ORDER_BY : constant SQL_INFO_TYPE := SQL_MAXIMUM_COLUMNS_IN_ORDER_BY; SQL_MAX_COLUMNS_IN_SELECT : constant SQL_INFO_TYPE := SQL_MAXIMUM_COLUMNS_IN_SELECT; SQL_MAX_INDEX_SIZE : constant SQL_INFO_TYPE := SQL_MAXIMUM_INDEX_SIZE; SQL_MAX_ROW_SIZE : constant SQL_INFO_TYPE := SQL_MAXIMUM_ROW_SIZE; SQL_MAX_STATEMENT_LEN : constant SQL_INFO_TYPE := SQL_MAXIMUM_STATEMENT_LENGTH; SQL_MAX_TABLES_IN_SELECT : constant SQL_INFO_TYPE := SQL_MAXIMUM_TABLES_IN_SELECT; SQL_MAX_USER_NAME_LEN : constant SQL_INFO_TYPE := SQL_MAXIMUM_USER_NAME_LENGTH; SQL_OJ_CAPABILITIES : constant SQL_INFO_TYPE := SQL_OUTER_JOIN_CAPABILITIES; SQL_MAX_IDENTIFIER_LEN : constant SQL_INFO_TYPE := SQL_MAXIMUM_IDENTIFIER_LENGTH; SQL_CATALOG_LOCATION : constant SQL_INFO_TYPE := SQL_QUALIFIER_LOCATION; SQL_CATALOG_NAME_SEPARATOR : constant SQL_INFO_TYPE := SQL_QUALIFIER_NAME_SEPARATOR; SQL_CATALOG_TERM : constant SQL_INFO_TYPE := SQL_QUALIFIER_TERM; SQL_CATALOG_USAGE : constant SQL_INFO_TYPE := SQL_QUALIFIER_USAGE; SQL_OWNER_TERM : constant SQL_INFO_TYPE := SQL_SCHEMA_TERM; SQL_OWNER_USAGE : constant SQL_INFO_TYPE := SQL_SCHEMA_USAGE; SQL_UNION : constant SQL_INFO_TYPE := SQL_UNION_STATEMENT; procedure Get_Info (ConnectionHandle : in SQLHDBC; InfoType : in SQL_INFO_TYPE; Value : in SQLPOINTER; Length : in out SQLSMALLINT; Data : in SQLSMALLINT; ErrorCode : access SQLRETURN); pragma Inline (Get_Info); procedure Set_Info (ConnectionHandle : in SQLHDBC; InfoType : in SQL_INFO_TYPE; Value : in SQLPOINTER; Length : in SQLSMALLINT; Data : in SQLSMALLINT; ErrorCode : out SQLRETURN); pragma Inline (Set_Info); package Driver_Information is new GNU.DB.SQLCLI.Generic_Attr (Context => SQLHDBC, T => SQL_INFO_TYPE, Base => SQLSMALLINT, Aux => SQLSMALLINT, Get => Get_Info, Set => Set_Info, Default_Context => Null_Handle); subtype Driver_Info is Driver_Information.Attribute_Value_Pair; package Dispatch is new GNU.DB.SQLCLI.Dispatch (Driver_Information); -- Instantiate the dispatcher package that manages to map the -- proper derived types to the ODBC enumeration SQL_INFO_TYPE package DI_String is new Dispatch.A_String; subtype Driver_Info_String is DI_String.Info; package DI_WString is new Dispatch.A_Wide_String; subtype Driver_Info_Wide_String is DI_WString.Info; package DI_Boolean_String is new Dispatch.A_Boolean_String; subtype Driver_Info_Boolean is DI_Boolean_String.Info; package DI_Context is new Dispatch.A_Context; subtype Driver_Info_Handle is DI_Context.Info; package DI_USmallint is new Dispatch.A_Unsigned (SQLUSMALLINT); subtype Driver_Info_Small_Unsigned is DI_USmallint.Info; package DI_UInteger is new Dispatch.A_Unsigned (SQLUINTEGER); subtype Driver_Info_Unsigned is DI_UInteger.Info; function SQLGetInfo (ConnectionHandle : SQLHDBC; InfoType : SQL_INFO_TYPE; MaxLength : SQLSMALLINT := 1024; ErrorCode : access SQLRETURN) return Driver_Info'Class; -- This version returns the ErrorCode in case of an ODBC error function SQLGetInfo (ConnectionHandle : SQLHDBC; InfoType : SQL_INFO_TYPE; MaxLength : SQLSMALLINT := 1024) return Driver_Info'Class; -- This version raises an exception in case of an ODBC error -- ---------------------------------------------------------------------- type AGGREGATE_FUNCTION is (SQL_AF_AVG, SQL_AF_COUNT, SQL_AF_MAX, SQL_AF_MIN, SQL_AF_SUM, SQL_AF_DISTINCT); type AGGREGATE_FUNCTION_BITMAP is array (AGGREGATE_FUNCTION) of Boolean; SQL_AF_ALL : constant AGGREGATE_FUNCTION_BITMAP := (AGGREGATE_FUNCTION'Range => True); package Dsp_Aggregate_Function is new Dispatch.A_Bitmap (SQL_AGGREGATE_FUNCTIONS, AGGREGATE_FUNCTION, AGGREGATE_FUNCTION_BITMAP); subtype Aggregate_Function_Info is Dsp_Aggregate_Function.Info; -- ---------------------------------------------------------------------- type ALTER_DOMAIN is (SQL_AD_CONSTRAINT_NAME_DEFINITION, SQL_AD_ADD_DOMAIN_CONSTRAINT, SQL_AD_DROP_DOMAIN_CONSTRAINT, SQL_AD_ADD_DOMAIN_DEFAULT, SQL_AD_DROP_DOMAIN_DEFAULT, SQL_AD_ADD_CONSTRAINT_INITIALLY_DEFERRED, SQL_AD_ADD_CONSTRAINT_INITIALLY_IMMEDIATE, SQL_AD_ADD_CONSTRAINT_DEFERRABLE, SQL_AD_ADD_CONSTRAINT_NON_DEFERRABLE); type ALTER_DOMAIN_BITMAP is array (ALTER_DOMAIN) of Boolean; package Dsp_Alter_Domain is new Dispatch.A_Bitmap (SQL_ALTER_DOMAIN, ALTER_DOMAIN, ALTER_DOMAIN_BITMAP); subtype Alter_Domain_Info is Dsp_Alter_Domain.Info; -- ---------------------------------------------------------------------- type ALTER_TABLE is (SQL_AT_ADD_COLUMN, SQL_AT_DROP_COLUMN, SQL_AT_RESERVED1, SQL_AT_ADD_CONSTRAINT, SQL_AT_RESERVED2, SQL_AT_ADD_COLUMN_SINGLE, SQL_AT_ADD_COLUMN_DEFAULT, SQL_AT_ADD_COLUMN_COLLATION, SQL_AT_SET_COLUMN_DEFAULT, SQL_AT_DROP_COLUMN_DEFAULT, SQL_AT_DROP_COLUMN_CASCADE, SQL_AT_DROP_COLUMN_RESTRICT, SQL_AT_ADD_TABLE_CONSTRAINT, SQL_AT_DROP_TABLE_CONSTRAINT_CASCADE, SQL_AT_DROP_TABLE_CONSTRAINT_RESTRICT, SQL_AT_CONSTRAINT_NAME_DEFINITION, SQL_AT_CONSTRAINT_INITIALLY_DEFERRED, SQL_AT_CONSTRAINT_INITIALLY_IMMEDIATE, SQL_AT_CONSTRAINT_DEFERRABLE, SQL_AT_CONSTRAINT_NON_DEFERRABLE); type ALTER_TABLE_BITMAP is array (ALTER_TABLE) of Boolean; package Dsp_Alter_Table is new Dispatch.A_Bitmap (SQL_ALTER_TABLE, ALTER_TABLE, ALTER_TABLE_BITMAP); subtype Alter_Table_Info is Dsp_Alter_Table.Info; -- ---------------------------------------------------------------------- type ASYNC_MODE is (SQL_AM_NONE, SQL_AM_CONNECTION, SQL_AM_STATEMENT); for ASYNC_MODE'Size use SQLINTEGER'Size; package Dsp_Async_Mode is new Dispatch.A_Enumerated (SQL_ASYNC_MODE, ASYNC_MODE, SQLINTEGER, "ASYNC_MODE"); subtype Async_Mode_Info is Dsp_Async_Mode.Info; -- ---------------------------------------------------------------------- type BATCH_ROW_COUNT is (SQL_BRC_PROCEDURES, SQL_BRC_EXPLICIT, SQL_BRC_ROLLED_UP); type BATCH_ROW_COUNT_BITMAP is array (BATCH_ROW_COUNT) of Boolean; package Dsp_Batch_Row_Count is new Dispatch.A_Bitmap (SQL_BATCH_ROW_COUNT, BATCH_ROW_COUNT, BATCH_ROW_COUNT_BITMAP); subtype Batch_Row_Count_Info is Dsp_Batch_Row_Count.Info; -- ---------------------------------------------------------------------- type BATCH_SUPPORT is (SQL_BS_SELECT_EXPLICIT, SQL_BS_ROW_COUNT_EXPLICIT, SQL_BS_SELECT_PROC, SQL_BS_ROW_COUNT_PROC); type BATCH_SUPPORT_BITMAP is array (BATCH_SUPPORT) of Boolean; package Dsp_Batch_Support is new Dispatch.A_Bitmap (SQL_BATCH_SUPPORT, BATCH_SUPPORT, BATCH_SUPPORT_BITMAP); subtype Batch_Support_Info is Dsp_Batch_Support.Info; -- ---------------------------------------------------------------------- type BOOKMARK_PERSISTENCE is (SQL_BP_CLOSE, SQL_BP_DELETE, SQL_BP_DROP, SQL_BP_TRANSACTION, SQL_BP_UPDATE, SQL_BP_OTHER_HSTMT, SQL_BP_SCROLL); type BOOKMARK_PERSISTENCE_BITMAP is array (BOOKMARK_PERSISTENCE) of Boolean; package Dsp_Bookmark_Per is new Dispatch.A_Bitmap (SQL_BOOKMARK_PERSISTENCE, BOOKMARK_PERSISTENCE, BOOKMARK_PERSISTENCE_BITMAP); subtype Bookmark_Persistence_Info is Dsp_Bookmark_Per.Info; -- ---------------------------------------------------------------------- type POSITION_LOCKTYPE_BITMAP is array (POSITION_LOCKTYPE) of Boolean; package Dsp_LockType is new Dispatch.A_Bitmap (SQL_LOCK_TYPES, POSITION_LOCKTYPE, POSITION_LOCKTYPE_BITMAP); subtype Position_LockType_Info is Dsp_LockType.Info; -- ---------------------------------------------------------------------- type POSITION_OPERATION_BITMAP is array (POSITION_OPERATION) of Boolean; package Dsp_PosOperation is new Dispatch.A_Bitmap (SQL_POS_OPERATIONS, POSITION_OPERATION, POSITION_OPERATION_BITMAP); subtype Position_Operation_Info is Dsp_PosOperation.Info; -- ---------------------------------------------------------------------- type POSITIONED_STATEMENT is (POSITIONED_DELETE, POSITIONED_UPDATE, SELECT_FOR_UPDATE); type POSITIONED_STATEMENT_BITMAP is array (POSITIONED_STATEMENT) of Boolean; package Dsp_PosStatements is new Dispatch.A_Bitmap (SQL_POSITIONED_STATEMENTS, POSITIONED_STATEMENT, POSITIONED_STATEMENT_BITMAP); subtype Positioned_Statement_Info is Dsp_PosStatements.Info; -- ---------------------------------------------------------------------- type FETCH_DIRECTION_BITMAP is array (FETCH_DIRECTION) of Boolean; package Dsp_FetchDirection is new Dispatch.A_Bitmap (SQL_FETCH_DIRECTION, FETCH_DIRECTION, FETCH_DIRECTION_BITMAP); subtype Fetch_Direction_Info is Dsp_FetchDirection.Info; -- ---------------------------------------------------------------------- type CONCAT_NULL_BEHAVIOR is (SQL_CB_NULL, SQL_CB_NON_NULL); for CONCAT_NULL_BEHAVIOR'Size use SQLSMALLINT'Size; package Dsp_Concat_Null_Behavior is new Dispatch.A_Enumerated (SQL_CONCAT_NULL_BEHAVIOR, CONCAT_NULL_BEHAVIOR, SQLSMALLINT, "CONCAT_NULL_BEHAVIOR"); subtype Concat_Null_Behaviour_Info is Dsp_Concat_Null_Behavior.Info; -- ---------------------------------------------------------------------- type CONVERSION_TARGET is (SQL_CVT_CHAR, SQL_CVT_NUMERIC, SQL_CVT_DECIMAL, SQL_CVT_INTEGER, SQL_CVT_SMALLINT, SQL_CVT_FLOAT, SQL_CVT_REAL, SQL_CVT_DOUBLE, SQL_CVT_VARCHAR, SQL_CVT_LONGVARCHAR, SQL_CVT_BINARY, SQL_CVT_VARBINARY, SQL_CVT_BIT, SQL_CVT_TINYINT, SQL_CVT_BIGINT, SQL_CVT_DATE, SQL_CVT_TIME, SQL_CVT_TIMESTAMP, SQL_CVT_LONGVARBINARY, SQL_CVT_INTERVAL_YEAR_MONTH, SQL_CVT_INTERVAL_DAY_TIME, SQL_CVT_WCHAR, SQL_CVT_WLONGVARCHAR, SQL_CVT_WVARCHAR); type CONVERSION_TARGET_BITMAP is array (CONVERSION_TARGET) of Boolean; package Dsp_Conversion_Target is new Dispatch.A_Bitmap (SQL_CONVERT_BIGINT, CONVERSION_TARGET, CONVERSION_TARGET_BITMAP); subtype Conversion_Target_Info is Dsp_Conversion_Target.Info; -- ---------------------------------------------------------------------- type CONVERT_FUNCTION is (SQL_FN_CVT_CONVERT, SQL_FN_CVT_CAST); type CONVERT_FUNCTION_BITMAP is array (CONVERT_FUNCTION) of Boolean; package Dsp_Convert_Functions is new Dispatch.A_Bitmap (SQL_CONVERT_FUNCTIONS, CONVERT_FUNCTION, CONVERT_FUNCTION_BITMAP); subtype Convert_Functions_Info is Dsp_Convert_Functions.Info; -- ---------------------------------------------------------------------- type CORRELATION_NAME is (SQL_CN_NONE, SQL_CN_DIFFERENT, SQL_CN_ANY); for CORRELATION_NAME'Size use SQLSMALLINT'Size; package Dsp_Correlation_Name is new Dispatch.A_Enumerated (SQL_CORRELATION_NAME, CORRELATION_NAME, SQLSMALLINT, "CORRELATION_NAME"); subtype Correlation_Name_Info is Dsp_Correlation_Name.Info; -- ---------------------------------------------------------------------- type CREATE_ASSERTION is (SQL_CA_CREATE_ASSERTION, SQL_CA_RESERVED1, SQL_CA_RESERVED2, SQL_CA_RESERVED3, SQL_CA_CONSTRAINT_INITIALLY_DEFERRED, SQL_CA_CONSTRAINT_INITIALLY_IMMEDIATE, SQL_CA_CONSTRAINT_DEFERRABLE, SQL_CA_CONSTRAINT_NON_DEFERRABLE); type CREATE_ASSERTION_BITMAP is array (CREATE_ASSERTION) of Boolean; package Dsp_Create_Assertion is new Dispatch.A_Bitmap (SQL_CREATE_ASSERTION, CREATE_ASSERTION, CREATE_ASSERTION_BITMAP); subtype Create_Assertion_Info is Dsp_Create_Assertion.Info; -- ---------------------------------------------------------------------- type CREATE_CHARACTER_SET is (SQL_CCS_CREATE_CHARACTER_SET, SQL_CCS_COLLATE_CLAUSE, SQL_CCS_LIMITED_COLLATION); type CREATE_CHARACTER_SET_BITMAP is array (CREATE_CHARACTER_SET) of Boolean; package Dsp_Create_Character_Set is new Dispatch.A_Bitmap (SQL_CREATE_CHARACTER_SET, CREATE_CHARACTER_SET, CREATE_CHARACTER_SET_BITMAP); subtype Create_Character_Set_Info is Dsp_Create_Character_Set.Info; -- ---------------------------------------------------------------------- type CREATE_COLLATION is (SQL_CCOL_CREATE_COLLATION); type CREATE_COLLATION_BITMAP is array (CREATE_COLLATION) of Boolean; package Dsp_Create_Collation is new Dispatch.A_Bitmap (SQL_CREATE_COLLATION, CREATE_COLLATION, CREATE_COLLATION_BITMAP); subtype Create_Collation_Info is Dsp_Create_Collation.Info; -- ---------------------------------------------------------------------- type CREATE_DOMAIN is (SQL_CDO_CREATE_DOMAIN, SQL_CDO_DEFAULT, SQL_CDO_CONSTRAINT, SQL_CDO_COLLATION, SQL_CDO_CONSTRAINT_NAME_DEFINITION, SQL_CDO_CONSTRAINT_INITIALLY_DEFERRED, SQL_CDO_CONSTRAINT_INITIALLY_IMMEDIATE, SQL_CDO_CONSTRAINT_DEFERRABLE, SQL_CDO_CONSTRAINT_NON_DEFERRABLE); type CREATE_DOMAIN_BITMAP is array (CREATE_DOMAIN) of Boolean; package Dsp_Create_Domain is new Dispatch.A_Bitmap (SQL_CREATE_DOMAIN, CREATE_DOMAIN, CREATE_DOMAIN_BITMAP); subtype Create_Domain_Info is Dsp_Create_Domain.Info; -- ---------------------------------------------------------------------- type CREATE_SCHEMA is (SQL_CS_CREATE_SCHEMA, SQL_CS_AUTHORIZATION, SQL_CS_DEFAULT_CHARACTER_SET); type CREATE_SCHEMA_BITMAP is array (CREATE_SCHEMA) of Boolean; package Dsp_Create_Schema is new Dispatch.A_Bitmap (SQL_CREATE_SCHEMA, CREATE_SCHEMA, CREATE_SCHEMA_BITMAP); subtype Create_Schema_Info is Dsp_Create_Schema.Info; -- ---------------------------------------------------------------------- type CREATE_TABLE is (SQL_CT_CREATE_TABLE, SQL_CT_COMMIT_PRESERVE, SQL_CT_COMMIT_DELETE, SQL_CT_GLOBAL_TEMPORARY, SQL_CT_LOCAL_TEMPORARY, SQL_CT_CONSTRAINT_INITIALLY_DEFERRED, SQL_CT_CONSTRAINT_INITIALLY_IMMEDIATE, SQL_CT_CONSTRAINT_DEFERRABLE, SQL_CT_CONSTRAINT_NON_DEFERRABLE, SQL_CT_COLUMN_CONSTRAINT, SQL_CT_COLUMN_DEFAULT, SQL_CT_COLUMN_COLLATION, SQL_CT_TABLE_CONSTRAINT, SQL_CT_CONSTRAINT_NAME_DEFINITION); type CREATE_TABLE_BITMAP is array (CREATE_TABLE) of Boolean; package Dsp_Create_Table is new Dispatch.A_Bitmap (SQL_CREATE_TABLE, CREATE_TABLE, CREATE_TABLE_BITMAP); subtype Create_Table_Info is Dsp_Create_Table.Info; -- ---------------------------------------------------------------------- type CREATE_TRANSLATION is (SQL_CTR_CREATE_TRANSLATION); type CREATE_TRANSLATION_BITMAP is array (CREATE_TRANSLATION) of Boolean; package Dsp_Create_Translation is new Dispatch.A_Bitmap (SQL_CREATE_TRANSLATION, CREATE_TRANSLATION, CREATE_TRANSLATION_BITMAP); subtype Create_Translation_Info is Dsp_Create_Translation.Info; -- ---------------------------------------------------------------------- type CREATE_VIEW is (SQL_CV_CREATE_VIEW, SQL_CV_CHECK_OPTION, SQL_CV_CASCADED, SQL_CV_LOCAL); type CREATE_VIEW_BITMAP is array (CREATE_VIEW) of Boolean; package Dsp_Create_View is new Dispatch.A_Bitmap (SQL_CREATE_VIEW, CREATE_VIEW, CREATE_VIEW_BITMAP); subtype Create_View_Info is Dsp_Create_View.Info; -- ---------------------------------------------------------------------- type STATIC_SENSITIVITY is (SQL_SS_ADDITIONS, SQL_SS_DELETIONS, SQL_SS_UPDATES); type STATIC_SENSITIVITY_BITMAP is array (STATIC_SENSITIVITY) of Boolean; package Dsp_StaticSensitivity is new Dispatch.A_Bitmap (SQL_STATIC_SENSITIVITY, STATIC_SENSITIVITY, STATIC_SENSITIVITY_BITMAP); subtype Static_Sensitivity_Info is Dsp_StaticSensitivity.Info; -- ---------------------------------------------------------------------- type SCROLL_CONCURRENCY is (SQL_SCCO_READ_ONLY, SQL_SCCO_LOCK, SQL_SCCO_OPT_ROWVER, SQL_SCCO_OPT_VALUES); type SCROLL_CONCURRENCY_BITMAP is array (SCROLL_CONCURRENCY) of Boolean; package Dsp_ScrollConcurrency is new Dispatch.A_Bitmap (SQL_SCROLL_CONCURRENCY, SCROLL_CONCURRENCY, SCROLL_CONCURRENCY_BITMAP); subtype Scroll_Concurrency_Info is Dsp_ScrollConcurrency.Info; -- ---------------------------------------------------------------------- -- Bitmasks for -- SQL_DYNAMIC_CURSOR_ATTRIBUTES1, -- SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1, -- SQL_KEYSET_CURSOR_ATTRIBUTES1 -- SQL_STATIC_CURSOR_ATTRIBUTES1 type CURSOR_ATTRIBUTES1 is (SQL_CA1_NEXT, SQL_CA1_ABSOLUTE, SQL_CA1_RELATIVE, SQL_CA1_BOOKMARK, SQL_CA1_RESERVED1, SQL_CA1_RESERVED2, SQL_CA1_LOCK_NO_CHANGE, SQL_CA1_LOCK_EXCLUSIVE, SQL_CA1_LOCK_UNLOCK, SQL_CA1_POS_POSITION, SQL_CA1_POS_UPDATE, SQL_CA1_POS_DELETE, SQL_CA1_POS_REFRESH, SQL_CA1_POSITIONED_UPDATE, SQL_CA1_POSITIONED_DELETE, SQL_CA1_SELECT_FOR_UPDATE, SQL_CA1_BULK_ADD, SQL_CA1_BULK_UPDATE_BY_BOOKMARK, SQL_CA1_BULK_DELETE_BY_BOOKMARK, SQL_CA1_BULK_FETCH_BY_BOOKMARK); type CURSOR_ATTRIBUTES1_BITMAP is array (CURSOR_ATTRIBUTES1) of Boolean; subtype SUPPORTED_FETCH_ORIENTATIONS is CURSOR_ATTRIBUTES1 range SQL_CA1_NEXT .. SQL_CA1_BOOKMARK; subtype SUPPORTED_SETPOS_LOCKS is CURSOR_ATTRIBUTES1 range SQL_CA1_LOCK_NO_CHANGE .. SQL_CA1_LOCK_UNLOCK; subtype SUPPORTED_SETPOS_OPERATIONS is CURSOR_ATTRIBUTES1 range SQL_CA1_POS_POSITION .. SQL_CA1_POS_REFRESH; subtype SUPPORTED_POSITIONED_UPDATED is CURSOR_ATTRIBUTES1 range SQL_CA1_POSITIONED_UPDATE .. SQL_CA1_SELECT_FOR_UPDATE; subtype SUPPORTED_BULK_OPERATIONS is CURSOR_ATTRIBUTES1 range SQL_CA1_BULK_ADD .. SQL_CA1_BULK_FETCH_BY_BOOKMARK; package Dsp_Cursor_Attribute1 is new Dispatch.A_Bitmap (SQL_DYNAMIC_CURSOR_ATTRIBUTES1, CURSOR_ATTRIBUTES1, CURSOR_ATTRIBUTES1_BITMAP); -- --------------------------------------------------------------------- -- Bitmasks for -- SQL_DYNAMIC_CURSOR_ATTRIBUTES2, -- SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2, -- SQL_KEYSET_CURSOR_ATTRIBUTES2 -- SQL_STATIC_CURSOR_ATTRIBUTES2 type CURSOR_ATTRIBUTES2 is (SQL_CA2_READ_ONLY_CONCURRENCY, SQL_CA2_LOCK_CONCURRENCY, SQL_CA2_OPT_ROWVER_CONCURRENCY, SQL_CA2_OPT_VALUES_CONCURRENCY, SQL_CA2_SENSITIVITY_ADDITIONS, SQL_CA2_SENSITIVITY_DELETIONS, SQL_CA2_SENSITIVITY_UPDATES, SQL_CA2_MAX_ROWS_SELECT, SQL_CA2_MAX_ROWS_INSERT, SQL_CA2_MAX_ROWS_DELETE, SQL_CA2_MAX_ROWS_UPDATE, SQL_CA2_MAX_ROWS_CATALOG, SQL_CA2_CRC_EXACT, SQL_CA2_CRC_APPROXIMATE, SQL_CA2_SIMULATE_NON_UNIQUE, SQL_CA2_SIMULATE_TRY_UNIQUE, SQL_CA2_SIMULATE_UNIQUE); type CURSOR_ATTRIBUTES2_BITMAP is array (CURSOR_ATTRIBUTES2) of Boolean; subtype SUPPORTED_SCROLL_CONCURRENCY is CURSOR_ATTRIBUTES2 range SQL_CA2_READ_ONLY_CONCURRENCY .. SQL_CA2_OPT_VALUES_CONCURRENCY; subtype CURSORS_OWN_SENSITIVITY is CURSOR_ATTRIBUTES2 range SQL_CA2_SENSITIVITY_ADDITIONS .. SQL_CA2_SENSITIVITY_UPDATES; subtype MAX_ROWS_SEMANTICS is CURSOR_ATTRIBUTES2 range SQL_CA2_MAX_ROWS_SELECT .. SQL_CA2_MAX_ROWS_CATALOG; SQL_CA2_MAX_ROWS_AFFECTS_ALL : constant CURSOR_ATTRIBUTES2_BITMAP := (MAX_ROWS_SEMANTICS'Range => True, others => False); subtype DIAG_CURSOR_ROW_COUNT_SEMANTIC is CURSOR_ATTRIBUTES2 range SQL_CA2_CRC_EXACT .. SQL_CA2_CRC_APPROXIMATE; subtype SIMULATABLE_POSITIONED_STATEMENTS is CURSOR_ATTRIBUTES2 range SQL_CA2_SIMULATE_NON_UNIQUE .. SQL_CA2_SIMULATE_UNIQUE; package Dsp_Cursor_Attribute2 is new Dispatch.A_Bitmap (SQL_DYNAMIC_CURSOR_ATTRIBUTES2, CURSOR_ATTRIBUTES2, CURSOR_ATTRIBUTES2_BITMAP); subtype Cursor_Attribute_Info1 is Dsp_Cursor_Attribute1.Info; subtype Cursor_Attribute_Info2 is Dsp_Cursor_Attribute2.Info; -- ---------------------------------------------------------------------- type CURSOR_COMMIT_BEHAVIOR is (SQL_CB_DELETE, SQL_CB_CLOSE, SQL_CB_PRESERVE); for CURSOR_COMMIT_BEHAVIOR'Size use SQLSMALLINT'Size; package Dsp_Cursor_Commit_Behavior is new Dispatch.A_Enumerated (SQL_CURSOR_COMMIT_BEHAVIOR, CURSOR_COMMIT_BEHAVIOR, SQLSMALLINT, "CURSOR_COMMIT_BEHAVIOR"); subtype Cursor_Commit_Behavior_Info is Dsp_Cursor_Commit_Behavior.Info; subtype Cursor_Rollback_Behavior_Info is Dsp_Cursor_Commit_Behavior.Info; -- ---------------------------------------------------------------------- package Dsp_Cursor_Sensitivity is new Dispatch.A_Enumerated (SQL_CURSOR_SENSITIVITY, GNU.DB.SQLCLI.Statement_Attribute.CURSOR_SENSITIVITY, SQLINTEGER, "CURSOR_SENSITIVITY"); subtype Cursor_Sensitivity_Info is Dsp_Cursor_Sensitivity.Info; -- ---------------------------------------------------------------------- type DATETIME_LITERAL is (SQL_DL_SQL92_DATE, SQL_DL_SQL92_TIME, SQL_DL_SQL92_TIMESTAMP, SQL_DL_SQL92_INTERVAL_YEAR, SQL_DL_SQL92_INTERVAL_MONTH, SQL_DL_SQL92_INTERVAL_DAY, SQL_DL_SQL92_INTERVAL_HOUR, SQL_DL_SQL92_INTERVAL_MINUTE, SQL_DL_SQL92_INTERVAL_SECOND, SQL_DL_SQL92_INTERVAL_YEAR_TO_MONTH, SQL_DL_SQL92_INTERVAL_DAY_TO_HOUR, SQL_DL_SQL92_INTERVAL_DAY_TO_MINUTE, SQL_DL_SQL92_INTERVAL_DAY_TO_SECOND, SQL_DL_SQL92_INTERVAL_HOUR_TO_MINUTE, SQL_DL_SQL92_INTERVAL_HOUR_TO_SECOND, SQL_DL_SQL92_INTERVAL_MINUTE_TO_SECOND); type DATETIME_LITERAL_BITMAP is array (DATETIME_LITERAL) of Boolean; package Dsp_DateTime_Literals is new Dispatch.A_Bitmap (SQL_DATETIME_LITERALS, DATETIME_LITERAL, DATETIME_LITERAL_BITMAP); subtype DateTime_Literals_Info is Dsp_DateTime_Literals.Info; -- ---------------------------------------------------------------------- type DDL_INDEX is (SQL_DI_CREATE_INDEX, SQL_DI_DROP_INDEX); type DDL_INDEX_BITMAP is array (DDL_INDEX) of Boolean; package Dsp_DDL_Index is new Dispatch.A_Bitmap (SQL_DDL_INDEX, DDL_INDEX, DDL_INDEX_BITMAP); subtype DDL_Index_Info is Dsp_DDL_Index.Info; -- ---------------------------------------------------------------------- type DROP_ASSERTION is (SQL_DA_DROP_ASSERTION); type DROP_ASSERTION_BITMAP is array (DROP_ASSERTION) of Boolean; package Dsp_Drop_Assertion is new Dispatch.A_Bitmap (SQL_DROP_ASSERTION, DROP_ASSERTION, DROP_ASSERTION_BITMAP); subtype Drop_Assertion_Info is Dsp_Drop_Assertion.Info; -- ---------------------------------------------------------------------- type DROP_CHARACTER_SET is (SQL_DCS_DROP_CHARACTER_SET); type DROP_CHARACTER_SET_BITMAP is array (DROP_CHARACTER_SET) of Boolean; package Dsp_Drop_Character_Set is new Dispatch.A_Bitmap (SQL_DROP_CHARACTER_SET, DROP_CHARACTER_SET, DROP_CHARACTER_SET_BITMAP); subtype Drop_Character_Set_Info is Dsp_Drop_Character_Set.Info; -- ---------------------------------------------------------------------- type DROP_COLLATION is (SQL_DC_DROP_COLLATION); type DROP_COLLATION_BITMAP is array (DROP_COLLATION) of Boolean; package Dsp_Drop_Collation is new Dispatch.A_Bitmap (SQL_DROP_COLLATION, DROP_COLLATION, DROP_COLLATION_BITMAP); subtype Drop_Collation_Info is Dsp_Drop_Collation.Info; -- ---------------------------------------------------------------------- type DROP_DOMAIN is (SQL_DD_DROP_DOMAIN, SQL_DD_RESTRICT, SQL_DD_CASCADE); type DROP_DOMAIN_BITMAP is array (DROP_DOMAIN) of Boolean; package Dsp_Drop_Domain is new Dispatch.A_Bitmap (SQL_DROP_DOMAIN, DROP_DOMAIN, DROP_DOMAIN_BITMAP); subtype Drop_Domain_Info is Dsp_Drop_Domain.Info; -- ---------------------------------------------------------------------- type DROP_SCHEMA is (SQL_DS_DROP_SCHEMA, SQL_DS_RESTRICT, SQL_DS_CASCADE); type DROP_SCHEMA_BITMAP is array (DROP_SCHEMA) of Boolean; package Dsp_Drop_Schema is new Dispatch.A_Bitmap (SQL_DROP_SCHEMA, DROP_SCHEMA, DROP_SCHEMA_BITMAP); subtype Drop_Schema_Info is Dsp_Drop_Schema.Info; -- ---------------------------------------------------------------------- type DROP_TABLE is (SQL_DT_DROP_TABLE, SQL_DT_RESTRICT, SQL_DT_CASCADE); type DROP_TABLE_BITMAP is array (DROP_TABLE) of Boolean; package Dsp_Drop_Table is new Dispatch.A_Bitmap (SQL_DROP_TABLE, DROP_TABLE, DROP_TABLE_BITMAP); subtype Drop_Table_Info is Dsp_Drop_Table.Info; -- ---------------------------------------------------------------------- type DROP_TRANSLATION is (SQL_DTR_DROP_TRANSLATION); type DROP_TRANSLATION_BITMAP is array (DROP_TRANSLATION) of Boolean; package Dsp_Drop_Translation is new Dispatch.A_Bitmap (SQL_DROP_TRANSLATION, DROP_TRANSLATION, DROP_TRANSLATION_BITMAP); subtype Drop_Translation_Info is Dsp_Drop_Translation.Info; -- ---------------------------------------------------------------------- type DROP_VIEW is (SQL_DV_DROP_VIEW, SQL_DV_RESTRICT, SQL_DV_CASCADE); type DROP_VIEW_BITMAP is array (DROP_VIEW) of Boolean; package Dsp_Drop_View is new Dispatch.A_Bitmap (SQL_DROP_VIEW, DROP_VIEW, DROP_VIEW_BITMAP); subtype Drop_View_Info is Dsp_Drop_View.Info; -- ---------------------------------------------------------------------- type FILE_USAGE is (SQL_FILE_NOT_SUPPORTED, SQL_FILE_TABLE, SQL_FILE_CATALOG); for FILE_USAGE'Size use SQLSMALLINT'Size; SQL_FILE_QUALIFIER : constant FILE_USAGE := SQL_FILE_CATALOG; package Dsp_File_Usage is new Dispatch.A_Enumerated (SQL_FILE_USAGE, FILE_USAGE, SQLSMALLINT, "FILE_USAGE"); subtype File_Usage_Info is Dsp_File_Usage.Info; -- ---------------------------------------------------------------------- type GETDATA_EXTENSION is (SQL_GD_ANY_COLUMN, SQL_GD_ANY_ORDER, SQL_GD_BLOCK, SQL_GD_BOUND); type GETDATA_EXTENSION_BITMAP is array (GETDATA_EXTENSION) of Boolean; package Dsp_GetData_Extension is new Dispatch.A_Bitmap (SQL_GETDATA_EXTENSIONS, GETDATA_EXTENSION, GETDATA_EXTENSION_BITMAP); subtype GetData_Extension_Info is Dsp_GetData_Extension.Info; -- ---------------------------------------------------------------------- type GROUP_BY is (SQL_GB_NOT_SUPPORTED, SQL_GB_GROUP_BY_EQUALS_SELECT, SQL_GB_GROUP_BY_CONTAINS_SELECT, SQL_GB_NO_RELATION, SQL_GB_COLLATE); for GROUP_BY'Size use SQLSMALLINT'Size; package Dsp_Group_By is new Dispatch.A_Enumerated (SQL_GROUP_BY, GROUP_BY, SQLSMALLINT, "GROUP_BY"); subtype Group_By_Info is Dsp_Group_By.Info; -- ---------------------------------------------------------------------- type IDENTIFIER_CASE is (SQL_IC_UPPER, SQL_IC_LOWER, SQL_IC_SENSITIVE, SQL_IC_MIXED); for IDENTIFIER_CASE'Size use SQLSMALLINT'Size; for IDENTIFIER_CASE use (SQL_IC_UPPER => 1, SQL_IC_LOWER => 2, SQL_IC_SENSITIVE => 3, SQL_IC_MIXED => 4); package Dsp_Identifier_Case is new Dispatch.A_Enumerated (SQL_IDENTIFIER_CASE, IDENTIFIER_CASE, SQLSMALLINT, "IDENTIFIER_CASE"); subtype Identifier_Case_Info is Dsp_Identifier_Case.Info; subtype Identifier_Quoted_Case_Info is Dsp_Identifier_Case.Info; -- ---------------------------------------------------------------------- type INDEX_KEYWORD is (SQL_IK_NONE, SQL_IK_ASC, SQL_IK_DESC); type INDEX_KEYWORD_BITMAP is array (INDEX_KEYWORD) of Boolean; SQL_IK_ALL : constant INDEX_KEYWORD_BITMAP := (INDEX_KEYWORD'Range => True); package Dsp_Index_Keyword is new Dispatch.A_Bitmap (SQL_INDEX_KEYWORDS, INDEX_KEYWORD, INDEX_KEYWORD_BITMAP); subtype Index_Keyword_Info is Dsp_Index_Keyword.Info; -- ---------------------------------------------------------------------- type INFO_SCHEMA_VIEW is (SQL_ISV_ASSERTIONS, SQL_ISV_CHARACTER_SETS, SQL_ISV_CHECK_CONSTRAINTS, SQL_ISV_COLLATIONS, SQL_ISV_COLUMN_DOMAIN_USAGE, SQL_ISV_COLUMN_PRIVILEGES, SQL_ISV_COLUMNS, SQL_ISV_CONSTRAINT_COLUMN_USAGE, SQL_ISV_CONSTRAINT_TABLE_USAGE, SQL_ISV_DOMAIN_CONSTRAINTS, SQL_ISV_DOMAINS, SQL_ISV_KEY_COLUMN_USAGE, SQL_ISV_REFERENTIAL_CONSTRAINTS, SQL_ISV_SCHEMATA, SQL_ISV_SQL_LANGUAGES, SQL_ISV_TABLE_CONSTRAINTS, SQL_ISV_TABLE_PRIVILEGES, SQL_ISV_TABLES, SQL_ISV_TRANSLATIONS, SQL_ISV_USAGE_PRIVILEGES, SQL_ISV_VIEW_COLUMN_USAGE, SQL_ISV_VIEW_TABLE_USAGE, SQL_ISV_VIEWS); type INFO_SCHEMA_VIEW_BITMAP is array (INFO_SCHEMA_VIEW) of Boolean; package Dsp_Info_Schema_Views is new Dispatch.A_Bitmap (SQL_INFO_SCHEMA_VIEWS, INFO_SCHEMA_VIEW, INFO_SCHEMA_VIEW_BITMAP); subtype Info_Schema_Views_Info is Dsp_Info_Schema_Views.Info; -- ---------------------------------------------------------------------- type INSERT_STATEMENT is (SQL_IS_INSERT_LITERALS, SQL_IS_INSERT_SEARCHED, SQL_IS_SELECT_INTO); type INSERT_STATEMENT_BITMAP is array (INSERT_STATEMENT) of Boolean; package Dsp_Insert_Statement is new Dispatch.A_Bitmap (SQL_INSERT_STATEMENT, INSERT_STATEMENT, INSERT_STATEMENT_BITMAP); subtype Insert_Statement_Info is Dsp_Insert_Statement.Info; -- ---------------------------------------------------------------------- type NON_NULLABLE_COLUMNS is (SQL_NNC_NULL, SQL_NNC_NON_NULL); for NON_NULLABLE_COLUMNS'Size use SQLSMALLINT'Size; package Dsp_Non_Nullable_Columns is new Dispatch.A_Enumerated (SQL_NON_NULLABLE_COLUMNS, NON_NULLABLE_COLUMNS, SQLSMALLINT, "NON_NULLABLE_COLUMNS"); subtype Non_Nullable_Columns_Info is Dsp_Non_Nullable_Columns.Info; -- ---------------------------------------------------------------------- type NULL_COLLATION is (SQL_NC_HIGH, SQL_NC_LOW, SQL_NC_START, SQL_NC_END); for NULL_COLLATION use (SQL_NC_HIGH => 0, SQL_NC_LOW => 1, SQL_NC_START => 2, SQL_NC_END => 4); for NULL_COLLATION'Size use SQLSMALLINT'Size; package Dsp_Null_Collation is new Dispatch.A_Enumerated (SQL_NULL_COLLATION, NULL_COLLATION, SQLSMALLINT, "NULL_COLLATION"); subtype Null_Collation_Info is Dsp_Null_Collation.Info; -- ---------------------------------------------------------------------- -- --------------------------------------------------------------------- -- SQL_NUMERIC_FUNCTIONS functions type NUMERIC_FUNCTION is (SQL_FN_NUM_ABS, SQL_FN_NUM_ACOS, SQL_FN_NUM_ASIN, SQL_FN_NUM_ATAN, SQL_FN_NUM_ATAN2, SQL_FN_NUM_CEILING, SQL_FN_NUM_COS, SQL_FN_NUM_COT, SQL_FN_NUM_EXP, SQL_FN_NUM_FLOOR, SQL_FN_NUM_LOG, SQL_FN_NUM_MOD, SQL_FN_NUM_SIGN, SQL_FN_NUM_SIN, SQL_FN_NUM_SQRT, SQL_FN_NUM_TAN, SQL_FN_NUM_PI, SQL_FN_NUM_RAND, SQL_FN_NUM_DEGREES, SQL_FN_NUM_LOG10, SQL_FN_NUM_POWER, SQL_FN_NUM_RADIANS, SQL_FN_NUM_ROUND, SQL_FN_NUM_TRUNCATE); type NUMERIC_FUNCTION_BITMAP is array (NUMERIC_FUNCTION) of Boolean; package Dsp_Numeric_Function is new Dispatch.A_Bitmap (SQL_NUMERIC_FUNCTIONS, NUMERIC_FUNCTION, NUMERIC_FUNCTION_BITMAP); subtype Numeric_Function_Info is Dsp_Numeric_Function.Info; -- ---------------------------------------------------------------------- type OJ_CAPABILITY is (SQL_OJ_LEFT, SQL_OJ_RIGHT, SQL_OJ_FULL, SQL_OJ_NESTED, SQL_OJ_NOT_ORDERED, SQL_OJ_INNER, SQL_OJ_ALL_COMPARISON_OPS); type OJ_CAPABILITY_BITMAP is array (OJ_CAPABILITY) of Boolean; package Dsp_Outer_Join_Capability is new Dispatch.A_Bitmap (SQL_OUTER_JOIN_CAPABILITIES, OJ_CAPABILITY, OJ_CAPABILITY_BITMAP); subtype Outer_Join_Capability_Info is Dsp_Outer_Join_Capability.Info; -- ---------------------------------------------------------------------- type PARAM_ARRAY_ROW_COUNTS is (SQL_PARC_BATCH, SQL_PARC_NO_BATCH); for PARAM_ARRAY_ROW_COUNTS use (SQL_PARC_BATCH => 1, SQL_PARC_NO_BATCH => 2); for PARAM_ARRAY_ROW_COUNTS'Size use SQLINTEGER'Size; package Dsp_Param_Array_Row_Counts is new Dispatch.A_Enumerated (SQL_PARAM_ARRAY_ROW_COUNTS, PARAM_ARRAY_ROW_COUNTS, SQLINTEGER, "PARAM_ARRAY_ROW_COUNTS"); subtype Param_Array_Row_Counts_Info is Dsp_Param_Array_Row_Counts.Info; -- ---------------------------------------------------------------------- type PARAM_ARRAY_SELECT_BATCH is (SQL_PAS_BATCH, SQL_PAS_NO_BATCH, SQL_PAS_NO_SELECT); for PARAM_ARRAY_SELECT_BATCH use (SQL_PAS_BATCH => 1, SQL_PAS_NO_BATCH => 2, SQL_PAS_NO_SELECT => 3); for PARAM_ARRAY_SELECT_BATCH'Size use SQLINTEGER'Size; package Dsp_Param_Array_Select_Batch is new Dispatch.A_Enumerated (SQL_PARAM_ARRAY_SELECTS, PARAM_ARRAY_SELECT_BATCH, SQLINTEGER, "PARAM_ARRAY_SELECT_BATCH"); subtype Param_Array_Select_Batch_Info is Dsp_Param_Array_Select_Batch.Info; -- ---------------------------------------------------------------------- type QUALIFIER_LOCATION is (SQL_QL_START, SQL_QL_END); for QUALIFIER_LOCATION use (SQL_QL_START => 1, SQL_QL_END => 2); for QUALIFIER_LOCATION'Size use SQLSMALLINT'Size; package Dsp_Qualifier_Location is new Dispatch.A_Enumerated (SQL_QUALIFIER_LOCATION, QUALIFIER_LOCATION, SQLSMALLINT, "QUALIFIER_LOCATION"); subtype Qualifier_Location_Info is Dsp_Qualifier_Location.Info; -- ---------------------------------------------------------------------- type QUALIFIER_USAGE is (SQL_QU_DML_STATEMENTS, SQL_QU_PROCEDURE_INVOCATION, SQL_QU_TABLE_DEFINITION, SQL_QU_INDEX_DEFINITION, SQL_QU_PRIVILEGE_DEFINITION); SQL_CU_DML_STATEMENTS : constant QUALIFIER_USAGE := SQL_QU_DML_STATEMENTS; SQL_CU_PROCEDURE_INVOCATION : constant QUALIFIER_USAGE := SQL_QU_PROCEDURE_INVOCATION; SQL_CU_TABLE_DEFINITION : constant QUALIFIER_USAGE := SQL_QU_TABLE_DEFINITION; SQL_CU_INDEX_DEFINITION : constant QUALIFIER_USAGE := SQL_QU_INDEX_DEFINITION; SQL_CU_PRIVILEGE_DEFINITION : constant QUALIFIER_USAGE := SQL_QU_PRIVILEGE_DEFINITION; type QUALIFIER_USAGE_BITMAP is array (QUALIFIER_USAGE) of Boolean; package Dsp_Qualifier_Usage is new Dispatch.A_Bitmap (SQL_QUALIFIER_USAGE, QUALIFIER_USAGE, QUALIFIER_USAGE_BITMAP); subtype Qualifier_Usage_Info is Dsp_Qualifier_Usage.Info; -- ---------------------------------------------------------------------- type SCHEMA_USAGE is (SQL_SU_DML_STATEMENTS, SQL_SU_PROCEDURE_INVOCATION, SQL_SU_TABLE_DEFINITION, SQL_SU_INDEX_DEFINITION, SQL_SU_PRIVILEGE_DEFINITION); SQL_OU_DML_STATEMENTS : constant SCHEMA_USAGE := SQL_SU_DML_STATEMENTS; SQL_OU_PROCEDURE_INVOCATION : constant SCHEMA_USAGE := SQL_SU_PROCEDURE_INVOCATION; SQL_OU_TABLE_DEFINITION : constant SCHEMA_USAGE := SQL_SU_TABLE_DEFINITION; SQL_OU_INDEX_DEFINITION : constant SCHEMA_USAGE := SQL_SU_INDEX_DEFINITION; SQL_OU_PRIVILEGE_DEFINITION : constant SCHEMA_USAGE := SQL_SU_PRIVILEGE_DEFINITION; type SCHEMA_USAGE_BITMAP is array (SCHEMA_USAGE) of Boolean; package Dsp_Schema_Usage is new Dispatch.A_Bitmap (SQL_SCHEMA_USAGE, SCHEMA_USAGE, SCHEMA_USAGE_BITMAP); subtype Schema_Usage_Info is Dsp_Schema_Usage.Info; -- ---------------------------------------------------------------------- type SCROLL_OPTION is (SQL_SO_FORWARD_ONLY, SQL_SO_KEYSET_DRIVEN, SQL_SO_DYNAMIC, SQL_SO_MIXED, SQL_SO_STATIC); type SCROLL_OPTION_BITMAP is array (SCROLL_OPTION) of Boolean; package Dsp_Scroll_Option is new Dispatch.A_Bitmap (SQL_SCROLL_OPTIONS, SCROLL_OPTION, SCROLL_OPTION_BITMAP); subtype Scroll_Option_Info is Dsp_Scroll_Option.Info; -- ---------------------------------------------------------------------- type SQL92_DATETIME_FUNCTION is (SQL_SDF_CURRENT_DATE, SQL_SDF_CURRENT_TIME, SQL_SDF_CURRENT_TIMESTAMP); type SQL92_DATETIME_FUNCTION_BITMAP is array (SQL92_DATETIME_FUNCTION) of Boolean; package Dsp_SQL92_DateTime_Function is new Dispatch.A_Bitmap (SQL_SQL92_DATETIME_FUNCTIONS, SQL92_DATETIME_FUNCTION, SQL92_DATETIME_FUNCTION_BITMAP); subtype SQL92_DateTime_Function_Info is Dsp_SQL92_DateTime_Function.Info; -- ---------------------------------------------------------------------- type SQL92_FOREIGN_KEY_DELETE_RULE is (SQL_SFKD_CASCADE, SQL_SFKD_NO_ACTION, SQL_SFKD_SET_DEFAULT, SQL_SFKD_SET_NULL); type SQL92_FOREIGN_KEY_DELETE_RULE_BITMAP is array (SQL92_FOREIGN_KEY_DELETE_RULE) of Boolean; package Dsp_SQL92_Foreign_Key_Delete_Rule is new Dispatch.A_Bitmap (SQL_SQL92_FOREIGN_KEY_DELETE_RULE, SQL92_FOREIGN_KEY_DELETE_RULE, SQL92_FOREIGN_KEY_DELETE_RULE_BITMAP); subtype SQL92_Foreign_Key_Delete_Rule_Info is Dsp_SQL92_Foreign_Key_Delete_Rule.Info; -- ---------------------------------------------------------------------- type SQL92_FOREIGN_KEY_UPDATE_RULE is (SQL_SFKU_CASCADE, SQL_SFKU_NO_ACTION, SQL_SFKU_SET_DEFAULT, SQL_SFKU_SET_NULL); type SQL92_FOREIGN_KEY_UPDATE_RULE_BITMAP is array (SQL92_FOREIGN_KEY_UPDATE_RULE) of Boolean; package Dsp_SQL92_Foreign_Key_Update_Rule is new Dispatch.A_Bitmap (SQL_SQL92_FOREIGN_KEY_UPDATE_RULE, SQL92_FOREIGN_KEY_UPDATE_RULE, SQL92_FOREIGN_KEY_UPDATE_RULE_BITMAP); subtype SQL92_Foreign_Key_Update_Rule_Info is Dsp_SQL92_Foreign_Key_Update_Rule.Info; -- ---------------------------------------------------------------------- type SQL92_GRANT is (SQL_SG_USAGE_ON_DOMAIN, SQL_SG_USAGE_ON_CHARACTER_SET, SQL_SG_USAGE_ON_COLLATION, SQL_SG_USAGE_ON_TRANSLATION, SQL_SG_WITH_GRANT_OPTION, SQL_SG_DELETE_TABLE, SQL_SG_INSERT_TABLE, SQL_SG_INSERT_COLUMN, SQL_SG_REFERENCES_TABLE, SQL_SG_REFERENCES_COLUMN, SQL_SG_SELECT_TABLE, SQL_SG_UPDATE_TABLE, SQL_SG_UPDATE_COLUMN); type SQL92_GRANT_BITMAP is array (SQL92_GRANT) of Boolean; package Dsp_SQL92_Grant is new Dispatch.A_Bitmap (SQL_SQL92_GRANT, SQL92_GRANT, SQL92_GRANT_BITMAP); subtype SQL92_Grant_Info is Dsp_SQL92_Grant.Info; -- ---------------------------------------------------------------------- type SQL92_NUMERIC_VALUE_FUNCTION is (SQL_SNVF_BIT_LENGTH, SQL_SNVF_CHAR_LENGTH, SQL_SNVF_CHARACTER_LENGTH, SQL_SNVF_EXTRACT, SQL_SNVF_OCTET_LENGTH, SQL_SNVF_POSITION); type SQL92_NUMERIC_VALUE_FUNCTION_BITMAP is array (SQL92_NUMERIC_VALUE_FUNCTION) of Boolean; package Dsp_SQL92_Numeric_Value_Function is new Dispatch.A_Bitmap (SQL_SQL92_NUMERIC_VALUE_FUNCTIONS, SQL92_NUMERIC_VALUE_FUNCTION, SQL92_NUMERIC_VALUE_FUNCTION_BITMAP); subtype SQL92_Numeric_Value_Function_Info is Dsp_SQL92_Numeric_Value_Function.Info; -- ---------------------------------------------------------------------- type SQL92_PREDICATE is (SQL_SP_EXISTS, SQL_SP_ISNOTNULL, SQL_SP_ISNULL, SQL_SP_MATCH_FULL, SQL_SP_MATCH_PARTIAL, SQL_SP_MATCH_UNIQUE_FULL, SQL_SP_MATCH_UNIQUE_PARTIAL, SQL_SP_OVERLAPS, SQL_SP_UNIQUE, SQL_SP_LIKE, SQL_SP_IN, SQL_SP_BETWEEN, SQL_SP_COMPARISON, SQL_SP_QUANTIFIED_COMPARISON); type SQL92_PREDICATE_BITMAP is array (SQL92_PREDICATE) of Boolean; package Dsp_SQL92_Predicate is new Dispatch.A_Bitmap (SQL_SQL92_PREDICATES, SQL92_PREDICATE, SQL92_PREDICATE_BITMAP); subtype SQL92_Predicate_Info is Dsp_SQL92_Predicate.Info; -- ---------------------------------------------------------------------- type SQL92_RELATIONAL_JOIN_OPERATOR is (SQL_SRJO_CORRESPONDING_CLAUSE, SQL_SRJO_CROSS_JOIN, SQL_SRJO_EXCEPT_JOIN, SQL_SRJO_FULL_OUTER_JOIN, SQL_SRJO_INNER_JOIN, SQL_SRJO_INTERSECT_JOIN, SQL_SRJO_LEFT_OUTER_JOIN, SQL_SRJO_NATURAL_JOIN, SQL_SRJO_RIGHT_OUTER_JOIN, SQL_SRJO_UNION_JOIN); type SQL92_RELATIONAL_JOIN_OPERATOR_BITMAP is array (SQL92_RELATIONAL_JOIN_OPERATOR) of Boolean; package Dsp_SQL92_Relational_Join_Operator is new Dispatch.A_Bitmap (SQL_SQL92_RELATIONAL_JOIN_OPERATORS, SQL92_RELATIONAL_JOIN_OPERATOR, SQL92_RELATIONAL_JOIN_OPERATOR_BITMAP); subtype SQL92_Relational_Join_Operator_Info is Dsp_SQL92_Relational_Join_Operator.Info; -- ---------------------------------------------------------------------- type SQL92_REVOKE is (SQL_SR_USAGE_ON_DOMAIN, SQL_SR_USAGE_ON_CHARACTER_SET, SQL_SR_USAGE_ON_COLLATION, SQL_SR_USAGE_ON_TRANSLATION, SQL_SR_GRANT_OPTION_FOR, SQL_SR_CASCADE, SQL_SR_RESTRICT, SQL_SR_DELETE_TABLE, SQL_SR_INSERT_TABLE, SQL_SR_INSERT_COLUMN, SQL_SR_REFERENCES_TABLE, SQL_SR_REFERENCES_COLUMN, SQL_SR_SELECT_TABLE, SQL_SR_UPDATE_TABLE, SQL_SR_UPDATE_COLUMN); type SQL92_REVOKE_BITMAP is array (SQL92_REVOKE) of Boolean; package Dsp_SQL92_Revoke is new Dispatch.A_Bitmap (SQL_SQL92_REVOKE, SQL92_REVOKE, SQL92_REVOKE_BITMAP); subtype SQL92_Revoke_Info is Dsp_SQL92_Revoke.Info; -- ---------------------------------------------------------------------- type SQL92_ROW_VALUE_CONSTRUCTOR is (SQL_SRVC_VALUE_EXPRESSION, SQL_SRVC_NULL, SQL_SRVC_DEFAULT, SQL_SRVC_ROW_SUBQUERY); type SQL92_ROW_VALUE_CONSTRUCTOR_BITMAP is array (SQL92_ROW_VALUE_CONSTRUCTOR) of Boolean; package Dsp_SQL92_Row_Value_Constructor is new Dispatch.A_Bitmap (SQL_SQL92_ROW_VALUE_CONSTRUCTOR, SQL92_ROW_VALUE_CONSTRUCTOR, SQL92_ROW_VALUE_CONSTRUCTOR_BITMAP); subtype SQL92_Row_Value_Constructor_Info is Dsp_SQL92_Row_Value_Constructor.Info; -- ---------------------------------------------------------------------- type SQL92_STRING_FUNCTION is (SQL_SSF_CONVERT, SQL_SSF_LOWER, SQL_SSF_UPPER, SQL_SSF_SUBSTRING, SQL_SSF_TRANSLATE, SQL_SSF_TRIM_BOTH, SQL_SSF_TRIM_LEADING, SQL_SSF_TRIM_TRAILING); type SQL92_STRING_FUNCTION_BITMAP is array (SQL92_STRING_FUNCTION) of Boolean; package Dsp_SQL92_String_Function is new Dispatch.A_Bitmap (SQL_SQL92_STRING_FUNCTIONS, SQL92_STRING_FUNCTION, SQL92_STRING_FUNCTION_BITMAP); subtype SQL92_String_Function_Info is Dsp_SQL92_String_Function.Info; -- ---------------------------------------------------------------------- type SQL92_VALUE_EXPRESSION is (SQL_SVE_CASE, SQL_SVE_CAST, SQL_SVE_COALESCE, SQL_SVE_NULLIF); type SQL92_VALUE_EXPRESSION_BITMAP is array (SQL92_VALUE_EXPRESSION) of Boolean; package Dsp_SQL92_Value_Expression is new Dispatch.A_Bitmap (SQL_SQL92_VALUE_EXPRESSIONS, SQL92_VALUE_EXPRESSION, SQL92_VALUE_EXPRESSION_BITMAP); subtype SQL92_Value_Expression_Info is Dsp_SQL92_Value_Expression.Info; -- ---------------------------------------------------------------------- type ODBC_SAG_CLI_CONFORMANCE is (SQL_OSCC_NOT_COMPLIANT, SQL_OSCC_COMPLIANT); for ODBC_SAG_CLI_CONFORMANCE'Size use SQLSMALLINT'Size; package Dsp_ODBC_SAG_CLI_Conformance is new Dispatch.A_Enumerated (SQL_ODBC_SAG_CLI_CONFORMANCE, ODBC_SAG_CLI_CONFORMANCE, SQLSMALLINT, "SQL_ODBC_SAG_CLI_CONFORMANCE"); subtype ODBC_SAG_CLI_Conformance_Info is Dsp_ODBC_SAG_CLI_Conformance.Info; -- ---------------------------------------------------------------------- type ODBC_API_CONFORMANCE is (SQL_OAC_NONE, SQL_OAC_LEVEL1, SQL_OAC_LEVEL2); for ODBC_API_CONFORMANCE'Size use SQLSMALLINT'Size; package Dsp_ODBC_API_Conformance is new Dispatch.A_Enumerated (SQL_ODBC_API_CONFORMANCE, ODBC_API_CONFORMANCE, SQLSMALLINT, "SQL_ODBC_API_CONFORMANCE"); subtype ODBC_API_Conformance_Info is Dsp_ODBC_API_Conformance.Info; -- ---------------------------------------------------------------------- type ODBC_SQL_CONFORMANCE is (SQL_OSC_MINIMUM, SQL_OSC_CORE, SQL_OSC_EXTENDED); for ODBC_SQL_CONFORMANCE'Size use SQLSMALLINT'Size; package Dsp_ODBC_SQL_Conformance is new Dispatch.A_Enumerated (SQL_ODBC_SQL_CONFORMANCE, ODBC_SQL_CONFORMANCE, SQLSMALLINT, "SQL_ODBC_SQL_CONFORMANCE"); subtype ODBC_SQL_Conformance_Info is Dsp_ODBC_SQL_Conformance.Info; -- ---------------------------------------------------------------------- type SQL_CONFORMANCE is (SQL_SC_SQL92_ENTRY, SQL_SC_FIPS127_2_TRANSITIONAL, SQL_SC_SQL92_INTERMEDIATE, SQL_SC_SQL92_FULL); type SQL_CONFORMANCE_BITMAP is array (SQL_CONFORMANCE) of Boolean; package Dsp_SQL_Conformance is new Dispatch.A_Bitmap (SQL_SQL_CONFORMANCE, SQL_CONFORMANCE, SQL_CONFORMANCE_BITMAP); subtype SQL_Conformance_Info is Dsp_SQL_Conformance.Info; -- ---------------------------------------------------------------------- type SQL_INTERFACE_CONFORMANCE is (SQL_OIC_CORE, SQL_OIC_LEVEL1, SQL_OIC_LEVEL2); for SQL_INTERFACE_CONFORMANCE use (SQL_OIC_CORE => 1, SQL_OIC_LEVEL1 => 2, SQL_OIC_LEVEL2 => 3); for SQL_INTERFACE_CONFORMANCE'Size use SQLINTEGER'Size; package Dsp_SQL_Interface_Conformance is new Dispatch.A_Enumerated (SQL_ODBC_INTERFACE_CONFORMANCE, SQL_INTERFACE_CONFORMANCE, SQLINTEGER, "SQL_INTERFACE_CONFORMANCE"); subtype SQL_Interface_Conformance_Info is Dsp_SQL_Interface_Conformance.Info; -- ---------------------------------------------------------------------- type STANDARD_CLI_CONFORMANCE is (SQL_SCC_XOPEN_CLI_VERSION1, SQL_SCC_ISO92_CLI); type STANDARD_CLI_CONFORMANCE_BITMAP is array (STANDARD_CLI_CONFORMANCE) of Boolean; package Dsp_Standard_CLI_Conformace is new Dispatch.A_Bitmap (SQL_STANDARD_CLI_CONFORMANCE, STANDARD_CLI_CONFORMANCE, STANDARD_CLI_CONFORMANCE_BITMAP); subtype Standard_CLI_Conformace_Info is Dsp_Standard_CLI_Conformace.Info; -- ---------------------------------------------------------------------- type STRING_FUNCTION is (SQL_FN_STR_CONCAT, SQL_FN_STR_INSERT, SQL_FN_STR_LEFT, SQL_FN_STR_LTRIM, SQL_FN_STR_LENGTH, SQL_FN_STR_LOCATE, SQL_FN_STR_LCASE, SQL_FN_STR_REPEAT, SQL_FN_STR_REPLACE, SQL_FN_STR_RIGHT, SQL_FN_STR_RTRIM, SQL_FN_STR_SUBSTRING, SQL_FN_STR_UCASE, SQL_FN_STR_ASCII, SQL_FN_STR_CHAR, SQL_FN_STR_DIFFERENCE, SQL_FN_STR_LOCATE_2, SQL_FN_STR_SOUNDEX, SQL_FN_STR_SPACE, SQL_FN_STR_BIT_LENGTH, SQL_FN_STR_CHAR_LENGTH, SQL_FN_STR_CHARACTER_LENGTH, SQL_FN_STR_OCTET_LENGTH, SQL_FN_STR_POSITION); type STRING_FUNCTION_BITMAP is array (STRING_FUNCTION) of Boolean; package Dsp_String_Function is new Dispatch.A_Bitmap (SQL_STRING_FUNCTIONS, STRING_FUNCTION, STRING_FUNCTION_BITMAP); subtype String_Function_Info is Dsp_String_Function.Info; -- ---------------------------------------------------------------------- type SUBQUERY is (SQL_SQ_COMPARISON, SQL_SQ_EXISTS, SQL_SQ_IN, SQL_SQ_QUANTIFIED, SQL_SQ_CORRELATED_SUBQUERIES); type SUBQUERY_BITMAP is array (SUBQUERY) of Boolean; package Dsp_SubQuery is new Dispatch.A_Bitmap (SQL_SUBQUERIES, SUBQUERY, SUBQUERY_BITMAP); subtype SubQuery_Info is Dsp_SubQuery.Info; -- ---------------------------------------------------------------------- type SYSTEM_FUNCTION is (SQL_FN_SYS_USERNAME, SQL_FN_SYS_DBNAME, SQL_FN_SYS_IFNULL); type SYSTEM_FUNCTION_BITMAP is array (SYSTEM_FUNCTION) of Boolean; package Dsp_System_Function is new Dispatch.A_Bitmap (SQL_SYSTEM_FUNCTIONS, SYSTEM_FUNCTION, SYSTEM_FUNCTION_BITMAP); subtype System_Function_Info is Dsp_System_Function.Info; -- ---------------------------------------------------------------------- type TIME_INTERVAL_FUNCTION is (SQL_FN_TSI_FRAC_SECOND, SQL_FN_TSI_SECOND, SQL_FN_TSI_MINUTE, SQL_FN_TSI_HOUR, SQL_FN_TSI_DAY, SQL_FN_TSI_WEEK, SQL_FN_TSI_MONTH, SQL_FN_TSI_QUARTER, SQL_FN_TSI_YEAR); type TIME_INTERVAL_FUNCTION_BITMAP is array (TIME_INTERVAL_FUNCTION) of Boolean; package Dsp_Time_Interval_Function is new Dispatch.A_Bitmap (SQL_TIMEDATE_ADD_INTERVALS, TIME_INTERVAL_FUNCTION, TIME_INTERVAL_FUNCTION_BITMAP); subtype Time_Interval_Function_Info is Dsp_Time_Interval_Function.Info; -- ---------------------------------------------------------------------- type TIMEDATE_FUNCTION is (SQL_FN_TD_NOW, SQL_FN_TD_CURDATE, SQL_FN_TD_DAYOFMONTH, SQL_FN_TD_DAYOFWEEK, SQL_FN_TD_DAYOFYEAR, SQL_FN_TD_MONTH, SQL_FN_TD_QUARTER, SQL_FN_TD_WEEK, SQL_FN_TD_YEAR, SQL_FN_TD_CURTIME, SQL_FN_TD_HOUR, SQL_FN_TD_MINUTE, SQL_FN_TD_SECOND, SQL_FN_TD_TIMESTAMPADD, SQL_FN_TD_TIMESTAMPDIFF, SQL_FN_TD_DAYNAME, SQL_FN_TD_MONTHNAME, SQL_FN_TD_CURRENT_DATE, SQL_FN_TD_CURRENT_TIME, SQL_FN_TD_CURRENT_TIMESTAMP, SQL_FN_TD_EXTRACT); type TIMEDATE_FUNCTION_BITMAP is array (TIMEDATE_FUNCTION) of Boolean; package Dsp_TimeDate_Function is new Dispatch.A_Bitmap (SQL_TIMEDATE_FUNCTIONS, TIMEDATE_FUNCTION, TIMEDATE_FUNCTION_BITMAP); subtype TimeDate_Function_Info is Dsp_TimeDate_Function.Info; -- ---------------------------------------------------------------------- type TXN_CAPABLE is (SQL_TC_NONE, SQL_TC_DML, SQL_TC_ALL, SQL_TC_DDL_COMMIT, SQL_TC_DDL_IGNORE); for TXN_CAPABLE'Size use SQLSMALLINT'Size; package Dsp_TXN_Capable is new Dispatch.A_Enumerated (SQL_TRANSACTION_CAPABLE, TXN_CAPABLE, SQLSMALLINT, "TXN_CAPABLE"); subtype TXN_Capable_Info is Dsp_TXN_Capable.Info; -- ---------------------------------------------------------------------- type TXN_ISOLATION_OPTION_BITMAP is array (GNU.DB.SQLCLI.Connection_Attribute.TXN_ISOLATION_OPTION) of Boolean; package Dsp_TXN_Isolation is new Dispatch.A_Bitmap (SQL_TRANSACTION_ISOLATION_OPTION, GNU.DB.SQLCLI.Connection_Attribute.TXN_ISOLATION_OPTION, TXN_ISOLATION_OPTION_BITMAP); subtype TXN_Isolation_Info is Dsp_TXN_Isolation.Info; package Dsp_TXN_Isolation_Default is new Dispatch.A_Enumerated (SQL_DEFAULT_TRANSACTION_ISOLATION, GNU.DB.SQLCLI.Connection_Attribute.TXN_ISOLATION_OPTION, SQLINTEGER, "TXN_ISOLATION_OPTION"); subtype TXN_Default_Isolation_Info is Dsp_TXN_Isolation_Default.Info; -- ---------------------------------------------------------------------- type UNION is (SQL_U_UNION, SQL_U_UNION_ALL); type UNION_BITMAP is array (UNION) of Boolean; package Dsp_Union is new Dispatch.A_Bitmap (SQL_UNION_STATEMENT, UNION, UNION_BITMAP); subtype Union_Info is Dsp_Union.Info; -- --------------------------------------------------------------------- -- SQLGetFunctions() values to identify ODBC APIs type SQL_API_FUNCTION is (SQL_API_SQLALLOCCONNECT, SQL_API_SQLALLOCENV, SQL_API_SQLALLOCSTMT, SQL_API_SQLBINDCOL, SQL_API_SQLCANCEL, SQL_API_SQLCOLATTRIBUTE, SQL_API_SQLCONNECT, SQL_API_SQLDESCRIBECOL, SQL_API_SQLDISCONNECT, SQL_API_SQLERROR, SQL_API_SQLEXECDIRECT, SQL_API_SQLEXECUTE, SQL_API_SQLFETCH, SQL_API_SQLFREECONNECT, SQL_API_SQLFREEENV, SQL_API_SQLFREESTMT, SQL_API_SQLGETCURSORNAME, SQL_API_SQLNUMRESULTCOLS, SQL_API_SQLPREPARE, SQL_API_SQLROWCOUNT, SQL_API_SQLSETCURSORNAME, SQL_API_SQLSETPARAM, SQL_API_SQLTRANSACT, SQL_API_SQLBULKOPERATIONS, SQL_API_SQLCOLUMNS, SQL_API_SQLDRIVERCONNECT, SQL_API_SQLGETCONNECTOPTION, SQL_API_SQLGETDATA, SQL_API_SQLGETFUNCTIONS, SQL_API_SQLGETINFO, SQL_API_SQLGETSTMTOPTION, SQL_API_SQLGETTYPEINFO, SQL_API_SQLPARAMDATA, SQL_API_SQLPUTDATA, SQL_API_SQLSETCONNECTOPTION, SQL_API_SQLSETSTMTOPTION, SQL_API_SQLSPECIALCOLUMNS, SQL_API_SQLSTATISTICS, SQL_API_SQLTABLES, SQL_API_SQLBROWSECONNECT, SQL_API_SQLCOLUMNPRIVILEGES, SQL_API_SQLDATASOURCES, SQL_API_SQLDESCRIBEPARAM, SQL_API_SQLEXTENDEDFETCH, SQL_API_SQLFOREIGNKEYS, SQL_API_SQLMORERESULTS, SQL_API_SQLNATIVESQL, SQL_API_SQLNUMPARAMS, SQL_API_SQLPARAMOPTIONS, SQL_API_SQLPRIMARYKEYS, SQL_API_SQLPROCEDURECOLUMNS, SQL_API_SQLPROCEDURES, SQL_API_SQLSETPOS, SQL_API_SQLSETSCROLLOPTIONS, SQL_API_SQLTABLEPRIVILEGES, SQL_API_SQLDRIVERS, SQL_API_SQLBINDPARAMETER, SQL_API_SQLALLOCHANDLESTD, SQL_API_SQLALLOCHANDLE, SQL_API_SQLBINDPARAM, SQL_API_SQLCLOSECURSOR, SQL_API_SQLCOPYDESC, SQL_API_SQLENDTRAN, SQL_API_SQLFREEHANDLE, SQL_API_SQLGETCONNECTATTR, SQL_API_SQLGETDESCFIELD, SQL_API_SQLGETDESCREC, SQL_API_SQLGETDIAGFIELD, SQL_API_SQLGETDIAGREC, SQL_API_SQLGETENVATTR, SQL_API_SQLGETSTMTATTR, SQL_API_SQLSETCONNECTATTR, SQL_API_SQLSETDESCFIELD, SQL_API_SQLSETDESCREC, SQL_API_SQLSETENVATTR, SQL_API_SQLSETSTMTATTR, SQL_API_SQLFETCHSCROLL); for SQL_API_FUNCTION use (SQL_API_SQLALLOCCONNECT => 1, SQL_API_SQLALLOCENV => 2, SQL_API_SQLALLOCSTMT => 3, SQL_API_SQLBINDCOL => 4, SQL_API_SQLCANCEL => 5, SQL_API_SQLCOLATTRIBUTE => 6, SQL_API_SQLCONNECT => 7, SQL_API_SQLDESCRIBECOL => 8, SQL_API_SQLDISCONNECT => 9, SQL_API_SQLERROR => 10, SQL_API_SQLEXECDIRECT => 11, SQL_API_SQLEXECUTE => 12, SQL_API_SQLFETCH => 13, SQL_API_SQLFREECONNECT => 14, SQL_API_SQLFREEENV => 15, SQL_API_SQLFREESTMT => 16, SQL_API_SQLGETCURSORNAME => 17, SQL_API_SQLNUMRESULTCOLS => 18, SQL_API_SQLPREPARE => 19, SQL_API_SQLROWCOUNT => 20, SQL_API_SQLSETCURSORNAME => 21, SQL_API_SQLSETPARAM => 22, SQL_API_SQLTRANSACT => 23, SQL_API_SQLBULKOPERATIONS => 24, SQL_API_SQLCOLUMNS => 40, SQL_API_SQLDRIVERCONNECT => 41, SQL_API_SQLGETCONNECTOPTION => 42, SQL_API_SQLGETDATA => 43, SQL_API_SQLGETFUNCTIONS => 44, SQL_API_SQLGETINFO => 45, SQL_API_SQLGETSTMTOPTION => 46, SQL_API_SQLGETTYPEINFO => 47, SQL_API_SQLPARAMDATA => 48, SQL_API_SQLPUTDATA => 49, SQL_API_SQLSETCONNECTOPTION => 50, SQL_API_SQLSETSTMTOPTION => 51, SQL_API_SQLSPECIALCOLUMNS => 52, SQL_API_SQLSTATISTICS => 53, SQL_API_SQLTABLES => 54, SQL_API_SQLBROWSECONNECT => 55, SQL_API_SQLCOLUMNPRIVILEGES => 56, SQL_API_SQLDATASOURCES => 57, SQL_API_SQLDESCRIBEPARAM => 58, SQL_API_SQLEXTENDEDFETCH => 59, SQL_API_SQLFOREIGNKEYS => 60, SQL_API_SQLMORERESULTS => 61, SQL_API_SQLNATIVESQL => 62, SQL_API_SQLNUMPARAMS => 63, SQL_API_SQLPARAMOPTIONS => 64, SQL_API_SQLPRIMARYKEYS => 65, SQL_API_SQLPROCEDURECOLUMNS => 66, SQL_API_SQLPROCEDURES => 67, SQL_API_SQLSETPOS => 68, SQL_API_SQLSETSCROLLOPTIONS => 69, SQL_API_SQLTABLEPRIVILEGES => 70, SQL_API_SQLDRIVERS => 71, SQL_API_SQLBINDPARAMETER => 72, SQL_API_SQLALLOCHANDLESTD => 73, SQL_API_SQLALLOCHANDLE => 1001, SQL_API_SQLBINDPARAM => 1002, SQL_API_SQLCLOSECURSOR => 1003, SQL_API_SQLCOPYDESC => 1004, SQL_API_SQLENDTRAN => 1005, SQL_API_SQLFREEHANDLE => 1006, SQL_API_SQLGETCONNECTATTR => 1007, SQL_API_SQLGETDESCFIELD => 1008, SQL_API_SQLGETDESCREC => 1009, SQL_API_SQLGETDIAGFIELD => 1010, SQL_API_SQLGETDIAGREC => 1011, SQL_API_SQLGETENVATTR => 1012, SQL_API_SQLGETSTMTATTR => 1014, SQL_API_SQLSETCONNECTATTR => 1016, SQL_API_SQLSETDESCFIELD => 1017, SQL_API_SQLSETDESCREC => 1018, SQL_API_SQLSETENVATTR => 1019, SQL_API_SQLSETSTMTATTR => 1020, SQL_API_SQLFETCHSCROLL => 1021); for SQL_API_FUNCTION'Size use SQLUSMALLINT'Size; type SQL_API_FUNCTION_BITMAP is private; function SQLGetFunctions (ConnectionHandle : SQLHDBC; Func : SQL_API_FUNCTION) return Boolean; procedure SQLGetFunctions (ConnectionHandle : in SQLHDBC; Bitmap : out SQL_API_FUNCTION_BITMAP); function SQLGetFunctions (Bitmap : SQL_API_FUNCTION_BITMAP; Func : SQL_API_FUNCTION) return Boolean; pragma Inline (SQLGetFunctions); private SQL_API_ODBC3_ALL_FUNCTIONS : constant SQLUSMALLINT := 999; SQL_API_ODBC3_ALL_FUNCTIONS_SIZE : constant := 250; -- array of 250 words type SAFSA_Element is mod 2 ** SQLUSMALLINT'Size; type SQL_API_FUNCTION_BITMAP is array (0 .. (SQL_API_ODBC3_ALL_FUNCTIONS_SIZE - 1)) of SAFSA_Element; pragma Pack (SQL_API_FUNCTION_BITMAP); pragma Assert (SQL_API_FUNCTION_BITMAP'Size = 4000); end GNU.DB.SQLCLI.Info; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-info.gpb0000644000175000017500000004004307735567063021151 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2002 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Unchecked_Conversion; #if DEBUG then with GNU.DB.SQLCLI.Dispatch.Debug; pragma Elaborate_All (GNU.DB.SQLCLI.Dispatch.Debug); #end if; with GNU.DB.SQLCLI; pragma Elaborate_All (GNU.DB.SQLCLI); package body GNU.DB.SQLCLI.Info is #if DEBUG then package DD is new Dispatch.Debug; #end if; procedure Register_String_Attributes; ProcName : constant String := "SQLGetInfo"; ProcName2 : constant String := "SQLGetFunctions"; procedure Get_Info (ConnectionHandle : in SQLHDBC; InfoType : in SQL_INFO_TYPE; Value : in SQLPOINTER; Length : in out SQLSMALLINT; Data : in SQLSMALLINT; ErrorCode : access SQLRETURN) is pragma Unreferenced (Data); function GetInfo (ConnectionHandle : SQLHDBC; InfoType : SQL_INFO_TYPE; InfoValue : SQLPOINTER; BufferLength : SQLSMALLINT; StringLength : access SQLSMALLINT) return SQLRETURN; pragma Import ($CALLCONVENTION, GetInfo, "SQLGetInfo"); #if UNICODE then function GetInfoW (ConnectionHandle : SQLHDBC; InfoType : SQL_INFO_TYPE; InfoValue : SQLPOINTER; BufferLength : SQLSMALLINT; StringLength : access SQLSMALLINT) return SQLRETURN; pragma Import ($CALLCONVENTION, GetInfoW, "SQLGetInfoW"); #end if; Len : aliased SQLSMALLINT := Length; RC : SQLRETURN; begin if Len < 0 then Len := 0; end if; if Unicode_Attr_Flag then #if UNICODE then RC := GetInfoW (ConnectionHandle, InfoType, Value, Len, Len'Access); #else RC := SQL_ADA95_NO_UNICODE; Length := 0; #end if; else RC := GetInfo (ConnectionHandle, InfoType, Value, Len, Len'Access); end if; ErrorCode.all := RC; if Is_SQL_Ok (RC) then Length := Len; end if; end Get_Info; procedure Set_Info (ConnectionHandle : in SQLHDBC; InfoType : in SQL_INFO_TYPE; Value : in SQLPOINTER; Length : in SQLSMALLINT; Data : in SQLSMALLINT; ErrorCode : out SQLRETURN) is pragma Unreferenced (Data); pragma Unreferenced (Length); pragma Unreferenced (Value); pragma Unreferenced (InfoType); pragma Unreferenced (ConnectionHandle); begin ErrorCode := -1; Raise_SQL_Error (ProcedureName => "", ErrorMessage => "Set Value not allowed"); end Set_Info; function SQLGetInfo (ConnectionHandle : SQLHDBC; InfoType : SQL_INFO_TYPE; MaxLength : SQLSMALLINT := 1024; ErrorCode : access SQLRETURN) return Driver_Info'Class is use type Dispatch.Attr_Get_Func; F : constant Dispatch.Attr_Get_Func := Dispatch.Get_Func (InfoType); begin if F = null then Raise_SQL_Error (ProcName, SQL_INFO_TYPE'Image (InfoType) & Attr_Not_Supported_Msg); else return F.all (ConnectionHandle, InfoType, MaxLength, 0, ErrorCode); end if; end SQLGetInfo; function SQLGetInfo (ConnectionHandle : SQLHDBC; InfoType : SQL_INFO_TYPE; MaxLength : SQLSMALLINT := 1024) return Driver_Info'Class is RC : aliased SQLRETURN; Result : constant Driver_Info'Class := SQLGetInfo (ConnectionHandle, InfoType, MaxLength, RC'Access); begin Check_SQL_Error (RC => RC, ProcedureName => ProcName, HandleType => SQL_HANDLE_DBC, Handle => ConnectionHandle); return Result; end SQLGetInfo; function SQLGetFunctions (ConnectionHandle : SQLHDBC; Func : SQL_API_FUNCTION) return Boolean is function GetFunctions (ConnectionHandle : SQLHDBC; FunctionId : SQL_API_FUNCTION; pSupported : access SQL_BOOLEAN) return SQLRETURN; pragma Import ($CALLCONVENTION, GetFunctions, "SQLGetFunctions"); Supported : aliased SQL_BOOLEAN; RC : constant SQLRETURN := GetFunctions (ConnectionHandle, Func, Supported'Access); begin Check_SQL_Error (RC => RC, ProcedureName => ProcName2, HandleType => SQL_HANDLE_DBC, Handle => ConnectionHandle); if Supported = SQL_TRUE then return True; else return False; end if; end SQLGetFunctions; procedure SQLGetFunctions (ConnectionHandle : in SQLHDBC; Bitmap : out SQL_API_FUNCTION_BITMAP) is function GetFunctions (ConnectionHandle : SQLHDBC; FunctionId : SQLUSMALLINT; pSupported : access SQL_API_FUNCTION_BITMAP) return SQLRETURN; pragma Import ($CALLCONVENTION, GetFunctions, "SQLGetFunctions"); BM : aliased SQL_API_FUNCTION_BITMAP; RC : constant SQLRETURN := GetFunctions (ConnectionHandle, SQL_API_ODBC3_ALL_FUNCTIONS, BM'Access); begin Check_SQL_Error (RC => RC, ProcedureName => ProcName2, HandleType => SQL_HANDLE_DBC, Handle => ConnectionHandle); Bitmap := BM; end SQLGetFunctions; function SQLGetFunctions (Bitmap : SQL_API_FUNCTION_BITMAP; Func : SQL_API_FUNCTION) return Boolean is function To_Int is new Ada.Unchecked_Conversion (SQL_API_FUNCTION, SQLUSMALLINT); I : constant SQLUSMALLINT := To_Int (Func) / SQLUSMALLINT'Size; J : constant SAFSA_Element := 2 ** Natural ((To_Int (Func) mod SQLUSMALLINT'Size)); E : constant SAFSA_Element := Bitmap (Natural (I)) and J; begin if E = 0 then return False; else return True; end if; end SQLGetFunctions; procedure Register_String_Attributes is begin if Unicode_Attr_Flag then DI_WString.Register (SQL_DATA_SOURCE_NAME); DI_WString.Register (SQL_DRIVER_NAME); DI_WString.Register (SQL_DRIVER_VER); DI_WString.Register (SQL_ODBC_VER); DI_WString.Register (SQL_SERVER_NAME); DI_WString.Register (SQL_SEARCH_PATTERN_ESCAPE); DI_WString.Register (SQL_DATABASE_NAME); DI_WString.Register (SQL_DBMS_NAME); DI_WString.Register (SQL_DBMS_VER); DI_WString.Register (SQL_IDENTIFIER_QUOTE_CHAR); DI_WString.Register (SQL_SCHEMA_TERM); DI_WString.Register (SQL_PROCEDURE_TERM); DI_WString.Register (SQL_QUALIFIER_NAME_SEPARATOR); DI_WString.Register (SQL_QUALIFIER_TERM); DI_WString.Register (SQL_TABLE_TERM); DI_WString.Register (SQL_USER_NAME); DI_WString.Register (SQL_DRIVER_ODBC_VER); DI_WString.Register (SQL_KEYWORDS); DI_WString.Register (SQL_SPECIAL_CHARACTERS); DI_WString.Register (SQL_DM_VER); DI_WString.Register (SQL_XOPEN_CLI_YEAR); DI_WString.Register (SQL_COLLATION_SEQ); else DI_String.Register (SQL_DATA_SOURCE_NAME); DI_String.Register (SQL_DRIVER_NAME); DI_String.Register (SQL_DRIVER_VER); DI_String.Register (SQL_ODBC_VER); DI_String.Register (SQL_SERVER_NAME); DI_String.Register (SQL_SEARCH_PATTERN_ESCAPE); DI_String.Register (SQL_DATABASE_NAME); DI_String.Register (SQL_DBMS_NAME); DI_String.Register (SQL_DBMS_VER); DI_String.Register (SQL_IDENTIFIER_QUOTE_CHAR); DI_String.Register (SQL_SCHEMA_TERM); DI_String.Register (SQL_PROCEDURE_TERM); DI_String.Register (SQL_QUALIFIER_NAME_SEPARATOR); DI_String.Register (SQL_QUALIFIER_TERM); DI_String.Register (SQL_TABLE_TERM); DI_String.Register (SQL_USER_NAME); DI_String.Register (SQL_DRIVER_ODBC_VER); DI_String.Register (SQL_KEYWORDS); DI_String.Register (SQL_SPECIAL_CHARACTERS); DI_String.Register (SQL_DM_VER); DI_String.Register (SQL_XOPEN_CLI_YEAR); DI_String.Register (SQL_COLLATION_SEQ); end if; end Register_String_Attributes; begin -- All String attributes Register_String_Attributes; Register_Initializer (Register_String_Attributes'Access); -- All SQLUSMALLINT attributes DI_USmallint.Register (SQL_MAXIMUM_DRIVER_CONNECTIONS); DI_USmallint.Register (SQL_MAXIMUM_CONCURRENT_ACTIVITIES); DI_USmallint.Register (SQL_MAXIMUM_COLUMN_NAME_LENGTH); DI_USmallint.Register (SQL_MAXIMUM_CURSOR_NAME_LENGTH); DI_USmallint.Register (SQL_MAXIMUM_SCHEMA_NAME_LENGTH); DI_USmallint.Register (SQL_MAXIMUM_PROCEDURE_NAME_LENGTH); DI_USmallint.Register (SQL_MAXIMUM_CATALOG_NAME_LENGTH); DI_USmallint.Register (SQL_MAXIMUM_TABLE_NAME_LENGTH); DI_USmallint.Register (SQL_MAXIMUM_COLUMNS_IN_GROUP_BY); DI_USmallint.Register (SQL_MAXIMUM_COLUMNS_IN_INDEX); DI_USmallint.Register (SQL_MAXIMUM_COLUMNS_IN_ORDER_BY); DI_USmallint.Register (SQL_MAXIMUM_COLUMNS_IN_SELECT); DI_USmallint.Register (SQL_MAXIMUM_COLUMNS_IN_TABLE); DI_USmallint.Register (SQL_MAXIMUM_TABLES_IN_SELECT); DI_USmallint.Register (SQL_MAXIMUM_USER_NAME_LENGTH); DI_USmallint.Register (SQL_ACTIVE_ENVIRONMENTS); DI_USmallint.Register (SQL_MAXIMUM_IDENTIFIER_LENGTH); -- All Context attributes DI_Context.Register (SQL_DRIVER_HDBC); DI_Context.Register (SQL_DRIVER_HENV); DI_Context.Register (SQL_DRIVER_HSTMT); DI_Context.Register (SQL_DRIVER_HLIB); DI_Context.Register (SQL_DRIVER_HDESC); -- All SQLUINTEGER Attributes DI_UInteger.Register (SQL_MAXIMUM_INDEX_SIZE); DI_UInteger.Register (SQL_MAXIMUM_ROW_SIZE); DI_UInteger.Register (SQL_MAXIMUM_STATEMENT_LENGTH); DI_UInteger.Register (SQL_MAXIMUM_CHAR_LITERAL_LENGTH); DI_UInteger.Register (SQL_MAX_BINARY_LITERAL_LEN); DI_UInteger.Register (SQL_MAX_ASYNC_CONCURRENT_STATEMENTS); -- All Boolean_String Attributes (Y/N) DI_Boolean_String.Register (SQL_OUTER_JOINS); DI_Boolean_String.Register (SQL_ROW_UPDATES); DI_Boolean_String.Register (SQL_ACCESSIBLE_TABLES); DI_Boolean_String.Register (SQL_ACCESSIBLE_PROCEDURES); DI_Boolean_String.Register (SQL_PROCEDURES); DI_Boolean_String.Register (SQL_DATA_SOURCE_READ_ONLY); DI_Boolean_String.Register (SQL_EXPRESSIONS_IN_ORDERBY); DI_Boolean_String.Register (SQL_MULTIPLE_RESULT_SETS); DI_Boolean_String.Register (SQL_MULTIPLE_ACTIVE_TRANSACTIONS); DI_Boolean_String.Register (SQL_INTEGRITY); DI_Boolean_String.Register (SQL_COLUMN_ALIAS); DI_Boolean_String.Register (SQL_ORDER_BY_COLUMNS_IN_SELECT); DI_Boolean_String.Register (SQL_MAXIMUM_ROW_SIZE_INCLUDES_LONG); DI_Boolean_String.Register (SQL_NEED_LONG_DATA_LEN); DI_Boolean_String.Register (SQL_LIKE_ESCAPE_CLAUSE); DI_Boolean_String.Register (SQL_DESCRIBE_PARAMETER); DI_Boolean_String.Register (SQL_CATALOG_NAME); Dsp_Conversion_Target.Register (SQL_CONVERT_BINARY); Dsp_Conversion_Target.Register (SQL_CONVERT_BIT); Dsp_Conversion_Target.Register (SQL_CONVERT_CHAR); Dsp_Conversion_Target.Register (SQL_CONVERT_DATE); Dsp_Conversion_Target.Register (SQL_CONVERT_DECIMAL); Dsp_Conversion_Target.Register (SQL_CONVERT_DOUBLE); Dsp_Conversion_Target.Register (SQL_CONVERT_FLOAT); Dsp_Conversion_Target.Register (SQL_CONVERT_INTEGER); Dsp_Conversion_Target.Register (SQL_CONVERT_LONGVARCHAR); Dsp_Conversion_Target.Register (SQL_CONVERT_NUMERIC); Dsp_Conversion_Target.Register (SQL_CONVERT_REAL); Dsp_Conversion_Target.Register (SQL_CONVERT_SMALLINT); Dsp_Conversion_Target.Register (SQL_CONVERT_TIME); Dsp_Conversion_Target.Register (SQL_CONVERT_TIMESTAMP); Dsp_Conversion_Target.Register (SQL_CONVERT_TINYINT); Dsp_Conversion_Target.Register (SQL_CONVERT_VARBINARY); Dsp_Conversion_Target.Register (SQL_CONVERT_VARCHAR); Dsp_Conversion_Target.Register (SQL_CONVERT_WCHAR); Dsp_Conversion_Target.Register (SQL_CONVERT_INTERVAL_DAY_TIME); Dsp_Conversion_Target.Register (SQL_CONVERT_INTERVAL_YEAR_MONTH); Dsp_Conversion_Target.Register (SQL_CONVERT_WLONGVARCHAR); Dsp_Conversion_Target.Register (SQL_CONVERT_WVARCHAR); Dsp_Conversion_Target.Register (SQL_CONVERT_LONGVARBINARY); Dsp_Cursor_Attribute1.Register (SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1); Dsp_Cursor_Attribute1.Register (SQL_KEYSET_CURSOR_ATTRIBUTES1); Dsp_Cursor_Attribute1.Register (SQL_STATIC_CURSOR_ATTRIBUTES1); Dsp_Cursor_Attribute2.Register (SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2); Dsp_Cursor_Attribute2.Register (SQL_KEYSET_CURSOR_ATTRIBUTES2); Dsp_Cursor_Attribute2.Register (SQL_STATIC_CURSOR_ATTRIBUTES2); Dsp_Cursor_Commit_Behavior.Register (SQL_CURSOR_ROLLBACK_BEHAVIOR); Dsp_Identifier_Case.Register (SQL_QUOTED_IDENTIFIER_CASE); Dsp_Time_Interval_Function.Register (SQL_TIMEDATE_DIFF_INTERVALS); #if DEBUG then DD.Verify; #end if; end GNU.DB.SQLCLI.Info; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-raise_sql_error.adb0000644000175000017500000002346007333265652023364 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2001 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Exceptions; separate (GNU.DB.SQLCLI) procedure Raise_SQL_Error (ProcedureName : in String; ErrorMessage : in String := ""; RC : in SQLRETURN := SQL_ADA95_BINDING_ERROR; State : in SQLSTATE := EMPTY_SQLSTATE) is use Ada; Group : constant String := State (1 .. 2); Code : constant String := State (3 .. 5); function Msg return String; procedure Check_State; function Msg return String is begin return "[Proc=" & ProcedureName & "]" & ErrorMessage; end Msg; procedure Check_State is begin if Group /= "00" and then Group /= "01" and then Group /= " " then if Group = "07" then if Code = "001" then Ada.Exceptions.Raise_Exception (Wrong_Parameter_Count'Identity, Msg); elsif Code = "002" then Ada.Exceptions.Raise_Exception (Invalid_Count_Field'Identity, Msg); elsif Code = "005" then Ada.Exceptions.Raise_Exception (Prepared_Stmt_Not_Cursor'Identity, Msg); elsif Code = "006" then Ada.Exceptions.Raise_Exception (Restricted_Type_Violation'Identity, Msg); elsif Code = "009" then Ada.Exceptions.Raise_Exception (Invalid_Descriptor_Index'Identity, Msg); elsif Code = "S01" then Ada.Exceptions.Raise_Exception (Invalid_Default_Parameter'Identity, Msg); end if; elsif Group = "08" then Ada.Exceptions.Raise_Exception (Connection_Error'Identity, Msg); elsif Group = "21" then Ada.Exceptions.Raise_Exception (Column_List_Mismatch'Identity, Msg); elsif Group = "22" then Ada.Exceptions.Raise_Exception (Format_Error'Identity, Msg); elsif Group = "23" then Ada.Exceptions.Raise_Exception (Integrity_Violation'Identity, Msg); elsif Group = "24" then Ada.Exceptions.Raise_Exception (Invalid_Cursor_State'Identity, Msg); elsif Group = "25" then Ada.Exceptions.Raise_Exception (Invalid_Transaction_State'Identity, Msg); elsif Group = "28" then Ada.Exceptions.Raise_Exception (Invalid_Auth_Spec'Identity, Msg); elsif Group = "34" then Ada.Exceptions.Raise_Exception (Invalid_Cursor_Name'Identity, Msg); elsif Group = "3C" then Ada.Exceptions.Raise_Exception (Duplicate_Cursor_Name'Identity, Msg); elsif Group = "3D" then Ada.Exceptions.Raise_Exception (Invalid_Catalog_Name'Identity, Msg); elsif Group = "3F" then Ada.Exceptions.Raise_Exception (Invalid_Schema_Name'Identity, Msg); elsif Group = "40" then if Code = "001" then Ada.Exceptions.Raise_Exception (Serialization_Failure'Identity, Msg); elsif Code = "002" then Ada.Exceptions.Raise_Exception (Integrity_Violation'Identity, Msg); elsif Code = "003" then Ada.Exceptions.Raise_Exception (Unknown_Stmt_Completion'Identity, Msg); end if; elsif Group = "42" then if Code = "000" then if ProcedureName = "SQLConnect" then Ada.Exceptions.Raise_Exception (Connection_Error'Identity, Msg); else Ada.Exceptions.Raise_Exception (Syntax_Error'Identity, Msg); end if; elsif Code = "S01" then Ada.Exceptions.Raise_Exception (Table_Already_Exists'Identity, Msg); elsif Code = "S02" then Ada.Exceptions.Raise_Exception (Table_Not_Found'Identity, Msg); elsif Code = "S11" then Ada.Exceptions.Raise_Exception (Index_Already_Exists'Identity, Msg); elsif Code = "S12" then Ada.Exceptions.Raise_Exception (Index_Not_Found'Identity, Msg); elsif Code = "S21" then Ada.Exceptions.Raise_Exception (Column_Already_Exists'Identity, Msg); elsif Code = "S22" then Ada.Exceptions.Raise_Exception (Column_Not_Found'Identity, Msg); end if; elsif Group = "44" then Ada.Exceptions.Raise_Exception (With_Check_Violation'Identity, Msg); elsif Group = "HY" then if Code = "001" then Ada.Exceptions.Raise_Exception (Operation_Canceled'Identity, Msg); elsif Code = "003" then Ada.Exceptions.Raise_Exception (Invalid_App_Buffer'Identity, Msg); elsif Code = "004" then Ada.Exceptions.Raise_Exception (Memory_Allocation_Error'Identity, Msg); elsif Code = "007" then Ada.Exceptions.Raise_Exception (Statement_Not_Prepared'Identity, Msg); elsif Code = "008" then Ada.Exceptions.Raise_Exception (Operation_Canceled'Identity, Msg); elsif Code = "009" then Ada.Exceptions.Raise_Exception (Invalid_Null_Pointer'Identity, Msg); elsif Code = "010" then Ada.Exceptions.Raise_Exception (Invalid_Function_Sequence'Identity, Msg); elsif Code = "090" then Ada.Exceptions.Raise_Exception (Invalid_Buffer_Length'Identity, Msg); elsif Code = "095" then Ada.Exceptions.Raise_Exception (Functiontype_Out_Of_Range'Identity, Msg); elsif Code = "096" then Ada.Exceptions.Raise_Exception (Invalid_Information_Type'Identity, Msg); elsif Code = "C00" then Ada.Exceptions.Raise_Exception (Not_Implemented'Identity, Msg); elsif Code = "T00" then Ada.Exceptions.Raise_Exception (Timeout_Expired'Identity, Msg); end if; elsif Group = "IM" then if Code = "001" then Ada.Exceptions.Raise_Exception (Not_Implemented'Identity, Msg); else Ada.Exceptions.Raise_Exception (Driver_Error'Identity, Msg); end if; end if; end if; end Check_State; begin case RC is when SQL_STILL_EXECUTING => Ada.Exceptions.Raise_Exception (Still_Executing'Identity, Msg); when SQL_NO_DATA => raise No_Data; when SQL_NEED_DATA => raise Need_Data; when SQL_INVALID_HANDLE => Ada.Exceptions.Raise_Exception (Invalid_Handle'Identity, Msg); when SQL_ADA95_DATA_ERROR => Ada.Exceptions.Raise_Exception (Data_Error'Identity, Msg); when SQL_ADA95_INVALID_ENUM => Ada.Exceptions.Raise_Exception (Unhandled_Enum'Identity, "[Proc=" & ProcedureName & "] ODBC Call returned enumeration " & "value that is not handled by the Ada95 binding: " & ErrorMessage); when SQL_ADA95_TYPE_ERROR => Ada.Exceptions.Raise_Exception (Type_Error'Identity, Msg); when SQL_ADA95_NO_UNICODE => Ada.Exceptions.Raise_Exception (No_Unicode_Support'Identity, Msg); when others => if Generate_Detailed_Exceptions then Check_State; end if; Ada.Exceptions.Raise_Exception (Database_Error'Identity, Msg); end case; end Raise_SQL_Error; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-statement_attribute-debug.adb0000644000175000017500000000710510663647575025352 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2001 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Exceptions; package body GNU.DB.SQLCLI.Statement_Attribute.Debug is procedure Dump (File : in Ada.Text_IO.File_Type; StatementHandle : in SQLHSTMT) is package SA_IO is new Ada.Text_IO.Enumeration_IO (SQL_STATEMENT_ATTRIBUTE); use Ada.Text_IO; use SA_IO; procedure Dump_Statement_Attr (A : in SQL_STATEMENT_ATTRIBUTE); procedure Dump_Statement_Attr (A : in SQL_STATEMENT_ATTRIBUTE) is AV : constant Statement_Attribute'Class := SQLGetStmtAttr (StatementHandle, A); begin Put (File, A, Debug_Label_Width); Put (File, ": "); Put (File, Statement_Attributes.To_String (AV)); New_Line (File); end Dump_Statement_Attr; begin for I in SQL_STATEMENT_ATTRIBUTE'Range loop declare begin Dump_Statement_Attr (I); exception when Event : others => Put (File, I, Debug_Label_Width); Put (File, ": ***** "); Put (File, Ada.Exceptions.Exception_Name (Event)); Put (File, ", "); Put (File, Ada.Exceptions.Exception_Message (Event)); New_Line (File); end; end loop; end Dump; procedure Dump (StatementHandle : in SQLHSTMT) is begin Dump (Ada.Text_IO.Standard_Output, StatementHandle); end Dump; end GNU.DB.SQLCLI.Statement_Attribute.Debug; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-statement_attribute-debug.ads0000644000175000017500000000465207227712011025353 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2001 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Text_IO; package GNU.DB.SQLCLI.Statement_Attribute.Debug is procedure Dump (File : in Ada.Text_IO.File_Type; StatementHandle : in SQLHSTMT); procedure Dump (StatementHandle : in SQLHSTMT); end GNU.DB.SQLCLI.Statement_Attribute.Debug; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-statement_attribute.ads0000644000175000017500000004155307735567063024313 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2002 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with GNU.DB.SQLCLI.Connection_Attribute; with GNU.DB.SQLCLI.Generic_Attr; with GNU.DB.SQLCLI.Dispatch; with GNU.DB.SQLCLI.Dispatch.A_Unsigned; with GNU.DB.SQLCLI.Dispatch.A_String; with GNU.DB.SQLCLI.Dispatch.A_Wide_String; with GNU.DB.SQLCLI.Dispatch.A_Enumerated; with GNU.DB.SQLCLI.Dispatch.A_Boolean; with GNU.DB.SQLCLI.Dispatch.A_Context; with GNU.DB.SQLCLI.Dispatch.A_Pointer; pragma Elaborate_All (GNU.DB.SQLCLI.Generic_Attr); pragma Elaborate_All (GNU.DB.SQLCLI.Dispatch); pragma Elaborate_All (GNU.DB.SQLCLI.Dispatch.A_Unsigned); pragma Elaborate_All (GNU.DB.SQLCLI.Dispatch.A_String); pragma Elaborate_All (GNU.DB.SQLCLI.Dispatch.A_Wide_String); pragma Elaborate_All (GNU.DB.SQLCLI.Dispatch.A_Enumerated); pragma Elaborate_All (GNU.DB.SQLCLI.Dispatch.A_Boolean); pragma Elaborate_All (GNU.DB.SQLCLI.Dispatch.A_Context); pragma Elaborate_All (GNU.DB.SQLCLI.Dispatch.A_Pointer); package GNU.DB.SQLCLI.Statement_Attribute is type SQL_STATEMENT_ATTRIBUTE is (SQL_ATTR_CURSOR_SENSITIVITY, SQL_ATTR_CURSOR_SCROLLABLE, SQL_ATTR_QUERY_TIMEOUT, SQL_ATTR_MAX_ROWS, SQL_ATTR_NOSCAN, SQL_ATTR_MAX_LENGTH, SQL_ATTR_ASYNC_ENABLE, SQL_ATTR_ROW_BIND_TYPE, SQL_ATTR_CURSOR_TYPE, SQL_ATTR_CONCURRENCY, SQL_ATTR_KEYSET_SIZE, SQL_ROWSET_SIZE, SQL_ATTR_SIMULATE_CURSOR, SQL_ATTR_RETRIEVE_DATA, SQL_ATTR_USE_BOOKMARKS, SQL_ATTR_ROW_NUMBER, SQL_ATTR_ENABLE_AUTO_IPD, SQL_ATTR_FETCH_BOOKMARK_PTR, SQL_ATTR_PARAM_BIND_OFFSET_PTR, SQL_ATTR_PARAM_BIND_TYPE, SQL_ATTR_PARAM_OPERATION_PTR, SQL_ATTR_PARAM_STATUS_PTR, SQL_ATTR_PARAMS_PROCESSED_PTR, SQL_ATTR_PARAMSET_SIZE, SQL_ATTR_ROW_BIND_OFFSET_PTR, SQL_ATTR_ROW_OPERATION_PTR, SQL_ATTR_ROW_STATUS_PTR, SQL_ATTR_ROWS_FETCHED_PTR, SQL_ATTR_ROW_ARRAY_SIZE, SQL_ATTR_APP_ROW_DESC, SQL_ATTR_APP_PARAM_DESC, SQL_ATTR_IMP_ROW_DESC, SQL_ATTR_IMP_PARAM_DESC, SQL_ATTR_METADATA_ID); for SQL_STATEMENT_ATTRIBUTE use (SQL_ATTR_CURSOR_SENSITIVITY => -2, SQL_ATTR_CURSOR_SCROLLABLE => -1, SQL_ATTR_QUERY_TIMEOUT => 0, SQL_ATTR_MAX_ROWS => 1, SQL_ATTR_NOSCAN => 2, SQL_ATTR_MAX_LENGTH => 3, SQL_ATTR_ASYNC_ENABLE => 4, SQL_ATTR_ROW_BIND_TYPE => 5, SQL_ATTR_CURSOR_TYPE => 6, SQL_ATTR_CONCURRENCY => 7, SQL_ATTR_KEYSET_SIZE => 8, SQL_ROWSET_SIZE => 9, SQL_ATTR_SIMULATE_CURSOR => 10, SQL_ATTR_RETRIEVE_DATA => 11, SQL_ATTR_USE_BOOKMARKS => 12, SQL_ATTR_ROW_NUMBER => 14, SQL_ATTR_ENABLE_AUTO_IPD => 15, SQL_ATTR_FETCH_BOOKMARK_PTR => 16, SQL_ATTR_PARAM_BIND_OFFSET_PTR => 17, SQL_ATTR_PARAM_BIND_TYPE => 18, SQL_ATTR_PARAM_OPERATION_PTR => 19, SQL_ATTR_PARAM_STATUS_PTR => 20, SQL_ATTR_PARAMS_PROCESSED_PTR => 21, SQL_ATTR_PARAMSET_SIZE => 22, SQL_ATTR_ROW_BIND_OFFSET_PTR => 23, SQL_ATTR_ROW_OPERATION_PTR => 24, SQL_ATTR_ROW_STATUS_PTR => 25, SQL_ATTR_ROWS_FETCHED_PTR => 26, SQL_ATTR_ROW_ARRAY_SIZE => 27, SQL_ATTR_APP_ROW_DESC => 10010, SQL_ATTR_APP_PARAM_DESC => 10011, SQL_ATTR_IMP_ROW_DESC => 10012, SQL_ATTR_IMP_PARAM_DESC => 10013, SQL_ATTR_METADATA_ID => 10014); for SQL_STATEMENT_ATTRIBUTE'Size use SQLINTEGER'Size; -- Some old names SQL_STMT_OPT_MIN : constant SQL_STATEMENT_ATTRIBUTE := SQL_ATTR_QUERY_TIMEOUT; SQL_STMT_OPT_MAX : constant SQL_STATEMENT_ATTRIBUTE := SQL_ATTR_ROW_NUMBER; subtype SQL_STATEMENT_OPTION is SQL_STATEMENT_ATTRIBUTE range SQL_STMT_OPT_MIN .. SQL_STMT_OPT_MAX; procedure Get_Stmt_Attr (StatementHandle : in SQLHSTMT; Attribute : in SQL_STATEMENT_ATTRIBUTE; Value : in SQLPOINTER; Length : in out SQLINTEGER; Data : in SQLSMALLINT; ErrorCode : access SQLRETURN); pragma Inline (Get_Stmt_Attr); procedure Set_Stmt_Attr (StatementHandle : in SQLHSTMT; Attribute : in SQL_STATEMENT_ATTRIBUTE; Value : in SQLPOINTER; Length : in SQLINTEGER; Data : in SQLSMALLINT; ErrorCode : out SQLRETURN); pragma Inline (Set_Stmt_Attr); package Statement_Attributes is new GNU.DB.SQLCLI.Generic_Attr (Context => SQLHSTMT, T => SQL_STATEMENT_ATTRIBUTE, Base => SQLINTEGER, Aux => SQLSMALLINT, Get => Get_Stmt_Attr, Set => Set_Stmt_Attr, Default_Context => Null_Handle); subtype Statement_Attribute is Statement_Attributes.Attribute_Value_Pair; package Dispatch is new GNU.DB.SQLCLI.Dispatch (Statement_Attributes); package SA_String is new Dispatch.A_String; subtype Statement_Attribute_String is SA_String.Info; package SA_WString is new Dispatch.A_Wide_String; subtype Statement_Attribute_Wide_String is SA_WString.Info; package SA_Context is new Dispatch.A_Context; subtype Statement_Attribute_Handle is SA_Context.Info; package SA_Unsigned is new Dispatch.A_Unsigned (SQLUINTEGER); subtype Statement_Attribute_Unsigned is SA_Unsigned.Info; package SA_Boolean is new Dispatch.A_Boolean (SQLUINTEGER); subtype Statement_Attribute_Boolean is SA_Boolean.Info; package SA_PointerUInt is new Dispatch.A_Pointer (SQLUINTEGER, PTR_SQLUINTEGER); subtype Statement_Attribute_Pointer_To_UInt is SA_PointerUInt.Info; package SA_PointerSUInt is new Dispatch.A_Pointer (SQLUSMALLINT, PTR_SQLUSMALLINT); subtype Statement_Attribute_Pointer_To_USmallInt is SA_PointerSUInt.Info; function SQLGetStmtAttr (StatementHandle : SQLHSTMT; Attribute : SQL_STATEMENT_ATTRIBUTE; MaxLength : SQLSMALLINT := SQL_MAX_OPTION_STRING_LENGTH; ErrorCode : access SQLRETURN) return Statement_Attribute'Class; -- This version returns the ErrorCode in case of an ODBC Error function SQLGetStmtAttr (StatementHandle : SQLHSTMT; Attribute : SQL_STATEMENT_ATTRIBUTE; MaxLength : SQLSMALLINT := SQL_MAX_OPTION_STRING_LENGTH) return Statement_Attribute'Class; -- This version raises an exception in case of an ODBC Error function SQLSetStmtAttr (StatementHandle : in SQLHSTMT; AV_Pair : in Statement_Attribute'Class) return SQLRETURN; procedure SQLSetStmtAttr (StatementHandle : in SQLHSTMT; AV_Pair : in Statement_Attribute'Class); -- --------------------------------------------------------------------- -- SQL_BIND_TYPE options SQL_BIND_BY_COLUMN : constant Statement_Attribute_Unsigned := (Attribute => SQL_ATTR_PARAM_BIND_TYPE, Value => 0); SQL_BIND_TYPE_DEFAULT : constant Statement_Attribute_Unsigned := SQL_BIND_BY_COLUMN; -- --------------------------------------------------------------------- -- SQL_ROWSET_SIZE options SQL_ROWSET_SIZE_DEFAULT : constant := 1; -- ---------------------------------------------------------------------- package Dsp_Async_Enable is new Dispatch.A_Enumerated (SQL_ATTR_ASYNC_ENABLE, GNU.DB.SQLCLI.Connection_Attribute.ASYNC_ENABLE, SQLINTEGER, "ASYNC_ENABLE"); subtype Statement_Attribute_Async_Enable is Dsp_Async_Enable.Info; -- ---------------------------------------------------------------------- type CONCURRENCY is (SQL_CONCUR_READ_ONLY, SQL_CONCUR_LOCK, SQL_CONCUR_ROWVER, SQL_CONCUR_VALUES); for CONCURRENCY use (SQL_CONCUR_READ_ONLY => 1, SQL_CONCUR_LOCK => 2, SQL_CONCUR_ROWVER => 3, SQL_CONCUR_VALUES => 4); for CONCURRENCY'Size use SQLINTEGER'Size; SQL_CONCUR_DEFAULT : constant CONCURRENCY := SQL_CONCUR_READ_ONLY; package Dsp_Concurrency is new Dispatch.A_Enumerated (SQL_ATTR_CONCURRENCY, CONCURRENCY, SQLINTEGER, "CONCURRENCY"); subtype Statement_Attribute_Concurrency is Dsp_Concurrency.Info; -- ---------------------------------------------------------------------- type CURSOR_SCROLLABLE is (SQL_NONSCROLLABLE, SQL_SCROLLABLE); for CURSOR_SCROLLABLE'Size use SQLINTEGER'Size; package Dsp_Cursor_Scrollable is new Dispatch.A_Enumerated (SQL_ATTR_CURSOR_SCROLLABLE, CURSOR_SCROLLABLE, SQLINTEGER, "CURSOR_SCROLLABLE"); subtype Statement_Attribute_CSCR is Dsp_Cursor_Scrollable.Info; -- ---------------------------------------------------------------------- type CURSOR_SENSITIVITY is (SQL_UNSPECIFIED, SQL_INSENSITIVE, SQL_SENSITIVE); for CURSOR_SENSITIVITY'Size use SQLINTEGER'Size; package Dsp_Cursor_Sensitivity is new Dispatch.A_Enumerated (SQL_ATTR_CURSOR_SENSITIVITY, CURSOR_SENSITIVITY, SQLINTEGER, "CURSOR_SENSITIVITY"); subtype Statement_Attribute_Cursor_Sensitivity is Dsp_Cursor_Sensitivity.Info; -- ---------------------------------------------------------------------- type CURSOR_TYPE is (SQL_CURSOR_FORWARD_ONLY, SQL_CURSOR_KEYSET_DRIVEN, SQL_CURSOR_DYNAMIC, SQL_CURSOR_STATIC); for CURSOR_TYPE'Size use SQLINTEGER'Size; SQL_CURSOR_TYPE_DEFAULT : constant CURSOR_TYPE := SQL_CURSOR_FORWARD_ONLY; package Dsp_Cursor_Type is new Dispatch.A_Enumerated (SQL_ATTR_CURSOR_TYPE, CURSOR_TYPE, SQLINTEGER, "CURSOR_TYPE"); subtype Statement_Attribute_Cursor_Type is Dsp_Cursor_Type.Info; -- ---------------------------------------------------------------------- type NOSCAN_OPTION is (SQL_NOSCAN_OFF, SQL_NOSCAN_ON); for NOSCAN_OPTION'Size use SQLUINTEGER'Size; SQL_NOSCAN_DEFAULT : constant NOSCAN_OPTION := SQL_NOSCAN_OFF; package Dsp_Noscan is new Dispatch.A_Enumerated (SQL_ATTR_NOSCAN, NOSCAN_OPTION, SQLINTEGER, "NOSCAN_OPTION"); subtype Statement_Attribute_NoScan is Dsp_Noscan.Info; -- ---------------------------------------------------------------------- type SQL_RETRIEVE_DATA is (SQL_RD_OFF, SQL_RD_ON); for SQL_RETRIEVE_DATA'Size use SQLUINTEGER'Size; SQL_RD_DEFAULT : constant SQL_RETRIEVE_DATA := SQL_RD_ON; package Dsp_Retrieve_Data is new Dispatch.A_Enumerated (SQL_ATTR_RETRIEVE_DATA, SQL_RETRIEVE_DATA, SQLINTEGER, "SQL_RETRIEVE_DATA"); subtype Statement_Attribute_Retrieve_Data is Dsp_Retrieve_Data.Info; -- ---------------------------------------------------------------------- type SQL_SIMULATE_CURSOR is (SQL_SC_NON_UNIQUE, SQL_SC_TRY_UNIQUE, SQL_SC_UNIQUE); for SQL_SIMULATE_CURSOR'Size use SQLUINTEGER'Size; package Dsp_Simulate_Cursor is new Dispatch.A_Enumerated (SQL_ATTR_SIMULATE_CURSOR, SQL_SIMULATE_CURSOR, SQLINTEGER, "SQL_SIMULATE_CURSOR"); subtype Statement_Attribute_Simulate_Cursor is Dsp_Simulate_Cursor.Info; -- ---------------------------------------------------------------------- type SQL_USE_BOOKMARK is (SQL_UB_OFF, SQL_UB_ON, SQL_UB_VARIABLE); for SQL_USE_BOOKMARK'Size use SQLUINTEGER'Size; SQL_UB_FIXED : constant SQL_USE_BOOKMARK := SQL_UB_ON; SQL_UB_DEFAULT : constant SQL_USE_BOOKMARK := SQL_UB_OFF; package Dsp_Use_Bookmarks is new Dispatch.A_Enumerated (SQL_ATTR_USE_BOOKMARKS, SQL_USE_BOOKMARK, SQLINTEGER, "SQL_USE_BOOKMARK"); subtype Statement_Attribute_Use_Bookmarks is Dsp_Use_Bookmarks.Info; -- ---------------------------------------------------------------------- end GNU.DB.SQLCLI.Statement_Attribute; gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli-statement_attribute.gpb0000644000175000017500000002436507735567063024316 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- -- Copyright (C) 2000-2002 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- #if DEBUG then with GNU.DB.SQLCLI.Dispatch.Debug; pragma Elaborate_All (GNU.DB.SQLCLI.Dispatch.Debug); #end if; with GNU.DB.SQLCLI; pragma Elaborate_All (GNU.DB.SQLCLI); package body GNU.DB.SQLCLI.Statement_Attribute is #if DEBUG then package DD is new Dispatch.Debug; #end if; procedure Register_String_Attributes; procedure Get_Stmt_Attr (StatementHandle : in SQLHSTMT; Attribute : in SQL_STATEMENT_ATTRIBUTE; Value : in SQLPOINTER; Length : in out SQLINTEGER; Data : in SQLSMALLINT; ErrorCode : access SQLRETURN) is pragma Unreferenced (Data); function GetStmtAttr (StatementHandle : SQLHSTMT; Attribute : SQL_STATEMENT_ATTRIBUTE; Value : SQLPOINTER; BufferLength : SQLINTEGER; pStringLength : access SQLINTEGER) return SQLRETURN; pragma Import ($CALLCONVENTION, GetStmtAttr, "SQLGetStmtAttr"); #if UNICODE then function GetStmtAttrW (StatementHandle : SQLHSTMT; Attribute : SQL_STATEMENT_ATTRIBUTE; Value : SQLPOINTER; BufferLength : SQLINTEGER; pStringLength : access SQLINTEGER) return SQLRETURN; pragma Import ($CALLCONVENTION, GetStmtAttrW, "SQLGetStmtAttrW"); #end if; Len : aliased SQLINTEGER := Length; RC : SQLRETURN; begin if Unicode_Attr_Flag then #if UNICODE then RC := GetStmtAttrW (StatementHandle, Attribute, Value, Len, Len'Access); #else RC := SQL_ADA95_NO_UNICODE; Length := 0; #end if; else RC := GetStmtAttr (StatementHandle, Attribute, Value, Len, Len'Access); end if; ErrorCode.all := RC; if Is_SQL_Ok (RC) then Length := Len; end if; end Get_Stmt_Attr; procedure Set_Stmt_Attr (StatementHandle : in SQLHSTMT; Attribute : in SQL_STATEMENT_ATTRIBUTE; Value : in SQLPOINTER; Length : in SQLINTEGER; Data : in SQLSMALLINT; ErrorCode : out SQLRETURN) is pragma Unreferenced (Data); function SetStmtAttr (StatementHandle : SQLHSTMT; Attribute : SQL_STATEMENT_ATTRIBUTE; Value : SQLPOINTER; StringLength : SQLINTEGER) return SQLRETURN; pragma Import ($CALLCONVENTION, SetStmtAttr, "SQLSetStmtAttr"); #if UNICODE then function SetStmtAttrW (StatementHandle : SQLHSTMT; Attribute : SQL_STATEMENT_ATTRIBUTE; Value : SQLPOINTER; StringLength : SQLINTEGER) return SQLRETURN; pragma Import ($CALLCONVENTION, SetStmtAttrW, "SQLSetStmtAttrW"); #end if; RC : SQLRETURN; begin if Unicode_Attr_Flag then #if UNICODE then RC := SetStmtAttrW (StatementHandle, Attribute, Value, Length); #else RC := SQL_ADA95_NO_UNICODE; #end if; else RC := SetStmtAttr (StatementHandle, Attribute, Value, Length); end if; ErrorCode := RC; end Set_Stmt_Attr; function SQLGetStmtAttr (StatementHandle : SQLHSTMT; Attribute : SQL_STATEMENT_ATTRIBUTE; MaxLength : SQLSMALLINT := SQL_MAX_OPTION_STRING_LENGTH; ErrorCode : access SQLRETURN) return Statement_Attribute'Class is use type Dispatch.Attr_Get_Func; F : constant Dispatch.Attr_Get_Func := Dispatch.Get_Func (Attribute); begin if F = null then Raise_SQL_Error ("SQLGetStmtAttr", SQL_STATEMENT_ATTRIBUTE'Image (Attribute) & Attr_Not_Supported_Msg); else return F.all (StatementHandle, Attribute, MaxLength, 0, ErrorCode); end if; end SQLGetStmtAttr; function SQLGetStmtAttr (StatementHandle : SQLHSTMT; Attribute : SQL_STATEMENT_ATTRIBUTE; MaxLength : SQLSMALLINT := SQL_MAX_OPTION_STRING_LENGTH) return Statement_Attribute'Class is RC : aliased SQLRETURN; Result : constant Statement_Attribute'Class := SQLGetStmtAttr (StatementHandle, Attribute, MaxLength, RC'Access); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLGetStmtAttr", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); return Result; end SQLGetStmtAttr; function SQLSetStmtAttr (StatementHandle : in SQLHSTMT; AV_Pair : in Statement_Attribute'Class) return SQLRETURN is use type Dispatch.Attr_Set_Proc; F : constant Dispatch.Attr_Set_Proc := Dispatch.Set_Proc (AV_Pair.Attribute); ErrorCode : SQLRETURN; begin if F = null then Raise_SQL_Error ("SQLSetStmtAttr", SQL_STATEMENT_ATTRIBUTE'Image (AV_Pair.Attribute) & Attr_Not_Supported_Msg); else F.all (StatementHandle, AV_Pair, 0, ErrorCode); end if; return ErrorCode; end SQLSetStmtAttr; procedure SQLSetStmtAttr (StatementHandle : in SQLHSTMT; AV_Pair : in Statement_Attribute'Class) is RC : constant SQLRETURN := SQLSetStmtAttr (StatementHandle, AV_Pair); begin Check_SQL_Error (RC => RC, ProcedureName => "SQLSetStmtAttr", HandleType => SQL_HANDLE_STMT, Handle => StatementHandle); end SQLSetStmtAttr; procedure Register_String_Attributes is begin if Unicode_Attr_Flag then null; else null; end if; end Register_String_Attributes; begin SA_Unsigned.Register (SQL_ROWSET_SIZE); SA_Unsigned.Register (SQL_ATTR_ROW_BIND_TYPE); SA_Unsigned.Register (SQL_ATTR_PARAM_BIND_TYPE); SA_Unsigned.Register (SQL_ATTR_ROW_NUMBER); SA_Unsigned.Register (SQL_ATTR_KEYSET_SIZE); SA_Unsigned.Register (SQL_ATTR_MAX_LENGTH); SA_Unsigned.Register (SQL_ATTR_MAX_ROWS); SA_Unsigned.Register (SQL_ATTR_PARAMSET_SIZE); SA_Unsigned.Register (SQL_ATTR_QUERY_TIMEOUT); SA_Unsigned.Register (SQL_ATTR_ROW_ARRAY_SIZE); SA_Unsigned.Register (SQL_ATTR_FETCH_BOOKMARK_PTR); SA_PointerSUInt.Register (SQL_ATTR_ROW_STATUS_PTR); SA_PointerSUInt.Register (SQL_ATTR_PARAM_STATUS_PTR); SA_PointerSUInt.Register (SQL_ATTR_PARAM_OPERATION_PTR); SA_PointerSUInt.Register (SQL_ATTR_ROW_OPERATION_PTR); SA_PointerUInt.Register (SQL_ATTR_PARAMS_PROCESSED_PTR); SA_PointerUInt.Register (SQL_ATTR_ROW_BIND_OFFSET_PTR); SA_PointerUInt.Register (SQL_ATTR_ROWS_FETCHED_PTR); SA_PointerUInt.Register (SQL_ATTR_PARAM_BIND_OFFSET_PTR); SA_Context.Register (SQL_ATTR_APP_PARAM_DESC); SA_Context.Register (SQL_ATTR_APP_ROW_DESC); SA_Context.Register (SQL_ATTR_IMP_ROW_DESC); SA_Context.Register (SQL_ATTR_IMP_PARAM_DESC); SA_Boolean.Register (SQL_ATTR_METADATA_ID); SA_Boolean.Register (SQL_ATTR_ENABLE_AUTO_IPD); Register_String_Attributes; Register_Initializer (Register_String_Attributes'Access); #if DEBUG then DD.Verify; #end if; end GNU.DB.SQLCLI.Statement_Attribute; gnade-1.6.2.orig/dbi/postgres/0000755000175000017500000000000011040716276016005 5ustar lbrentalbrentagnade-1.6.2.orig/dbi/postgres/Makefile0000644000175000017500000000776610030367733017463 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/dbi/postgres/Makefile,v $ ## Description : Makefile for the direct PostgreSQL bindings -- ## Author : Michael Erdmann -- ## Created On : 10-Apr-2002 -- ## Last Modified By: $Author: merdmann $ ## Last Modified On: $Date: 2004/03/24 20:30:19 $ -- ## Status : $State: Exp $ -- ## -- ## Copyright (C) 2000-2002 -- ## -- ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## This makefile builds the direct binding to the MySQL database and ## stores the package and object files in the proper include resp. lib ## directories. ## ## Restrictions ## ============ ## None ## ## References ## ========== ## include ../../make.conf # # libname=libgnadepostgresql ## ## ## all build:: $(ADAMAKE) -d -Ppostgres.gpr -u ifneq ($(EXPORT),) $(MAKE) install endif ## ## ## install :: $(ADAINSTALL) $(includedir) $(wildcard gnu-db-postgres*.ad* gnu-db-postgres*.ali ) $(MKSTATIC) $(libdir) $(libname).a $(MKSHARED) $(libdir) $(MINOR) $(MAJOR) $(libname).so ## ## ## clean :: ifeq ($(EXPORT),) $(ADAUINSTALL) $(includedir) \ $(wildcard $(includedir)/gnu-db-postgres*.ad* $(includedir)/gnu-db-postgres*.ali) endif $(RM) *.o *.ali core b~*.ad* *~ gnade-1.6.2.orig/dbi/postgres/Makefile.postgres0000644000175000017500000000674010042017522021306 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/dbi/postgres/Makefile.postgres,v $ ## Description : Makefile for the direct PostgreSQL bindings -- ## Author : Michael Erdmann -- ## Created On : 10-Apr-2002 -- ## Last Modified By: $Author: merdmann $ ## Last Modified On: $Date: 2004/04/22 19:38:58 $ -- ## Status : $State: Exp $ -- ## -- ## Copyright (C) 2000-2002 -- ## -- ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## This makefile builds the direct binding to the MySQL database and ## stores the package and object files in the proper include resp. lib ## directories. ## ## Restrictions ## ============ ## None ## ## References ## ========== ## all build:: $(MAKE) -C./ $@ gnade-1.6.2.orig/dbi/postgres/README0000644000175000017500000000032107330016120016645 0ustar lbrentalbrentaThis binding is not intended to provide a Layer that hides the details of PostgreSQL, instead the opposite is intended. This binding exposes the same functionality like the C interface libpq. Have fun Jürgen gnade-1.6.2.orig/dbi/postgres/gnade-postgres.gpr0000644000175000017500000000155310670336556021454 0ustar lbrentalbrenta-- $Id: gnade-postgres.gpr,v 1.2 2007/09/07 21:06:54 persan Exp $ with "../../gnade"; with "../../support/gnade-support.gpr"; project Gnade.Postgres is for Languages use ("Ada"); for Source_Dirs use ("."); for Object_Dir use "lib-obj"; for library_name use "gnadepostgresql"; for Library_Kind use "static"; for Library_dir use project'Object_Dir & "/lib"; package Compiler is for Default_Switches ("Ada") use Gnade.Compiler'Default_Switches ("Ada"); end Compiler; package Builder is for Default_Switches ("Ada") use Gnade.Builder'Default_Switches ("Ada"); end Builder; package Binder is for Default_Switches ("Ada") use Gnade.Binder'Default_Switches ("Ada"); end Binder; package Linker is for Default_Switches ("Ada") use Gnade.Builder'Default_Switches ("Ada"); end Linker; end Gnade.Postgres; gnade-1.6.2.orig/dbi/postgres/gnu-db-postgresql.adb0000644000175000017500000006463610664033261022046 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Juergen Pfeifer -- Created On : 29-Oct-2000 -- Last Modified By: $Author: persan $ -- Last Modified On: $Date: 2007/08/25 14:03:29 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000-2001 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- This binding is not intended to provide a Layer that hides the details -- -- of PostgreSQL, instead the opposite is intended. This binding exposes -- -- the same functionality like the C interface libpq. -- -- Currently we do not support the asynchronous command features of -- -- PostgreSQL, but we hope we'll have a nice Ada95 integration of that in -- -- the near future. -- ------------------------------------------------------------------------------- with System.Address_To_Access_Conversions; with Ada.Unchecked_Conversion; with Ada.Unchecked_Deallocation; with Interfaces.C; use Interfaces.C; with Interfaces.C.Strings; with System; package body GNU.DB.PostgreSQL is package C renames Interfaces.C; package CS renames Interfaces.C.Strings; subtype char_array is C.char_array; subtype chars_ptr is CS.chars_ptr; function To_Result is new Ada.Unchecked_Conversion (System.Address, PGresult); function To_Addr is new Ada.Unchecked_Conversion (PGresult, System.Address); function To_Conn is new Ada.Unchecked_Conversion (System.Address, Connection_Handle); function To_Addr is new Ada.Unchecked_Conversion (Connection_Handle, System.Address); protected body PGConn is function Handle return Connection_Handle is begin return C_Connection; end Handle; procedure Reset is procedure PQreset (Connection : System.Address); pragma Import (C, PQreset, "PQreset"); begin PQreset (To_Addr (C_Connection)); end Reset; function Error return String is function PQerr (Conn : System.Address) return chars_ptr; pragma Import (C, PQerr, "PQerrorMessage"); begin return CS.Value (PQerr (To_Addr (C_Connection))); end Error; function Status return ConnStatus is function PQstatus (Conn : System.Address) return Interfaces.C.int; pragma Import (C, PQstatus, "PQstatus"); begin return ConnStatus'Val (PQstatus (To_Addr (C_Connection))); end Status; procedure Close is procedure PQfinish (Connection : System.Address); pragma Import (C, PQfinish, "PQfinish"); begin if C_Connection /= Null_Connection then PQfinish (To_Addr (C_Connection)); C_Connection := Null_Connection; end if; end Close; function PID return Backend_PID is function PQpid (Conn : System.Address) return Interfaces.C.int; pragma Import (C, PQpid, "PQbackendPID"); function To_PID is new Ada.Unchecked_Conversion (Source => Interfaces.C.int, Target => Backend_PID); begin return To_PID (PQpid (To_Addr (C_Connection))); end PID; procedure Execute (Res : out Result; Query : in String) is function PQexec (Conn : System.Address; Qry : chars_ptr) return System.Address; pragma Import (C, PQexec, "PQexec"); P : chars_ptr := CS.New_String (Query); R : constant PGresult := To_Result (PQexec (To_Addr (C_Connection), P)); Stat : ExecStatus; begin CS.Free (P); if R = Null_Result then raise PostgreSQL_Error; else Res.Res := R; Stat := Status (Res); if Stat = PGRES_FATAL_ERROR then raise PostgreSQL_Error; end if; end if; end Execute; procedure Empty_Result (Res : out Result; Status : in ExecStatus) is function PQemptyRes (Conn : System.Address; Status : C.int) return System.Address; pragma Import (C, PQemptyRes, "PQmakeEmptyPGresult"); R : constant PGresult := To_Result (PQemptyRes (To_Addr (C_Connection), ExecStatus'Pos (Status))); begin if R = Null_Result then raise PostgreSQL_Error; else Res.Res := R; end if; end Empty_Result; procedure SetNonBlocking is function PQnonblocking (Conn : System.Address) return Interfaces.C.int; pragma Import (C, PQnonblocking, "PQsetnonblocking"); R : constant Interfaces.C.int := PQnonblocking (To_Addr (C_Connection)); begin null; end SetNonBlocking; function IsNonBlocking return Boolean is function PQisnonblocking (Conn : System.Address) return Interfaces.C.int; pragma Import (C, PQisnonblocking, "PQisnonblocking"); R : constant Interfaces.C.int := PQisnonblocking (To_Addr (C_Connection)); begin if R /= 0 then return True; else return False; end if; end IsNonBlocking; function SendQuery (Query : in String) return Boolean is function PQsendQuery (Conn : System.Address; Qry : chars_ptr) return Interfaces.C.int; pragma Import (C, PQsendQuery, "PQsendQuery"); P : constant chars_ptr := CS.New_String (Query); R : constant Interfaces.C.int := PQsendQuery (To_Addr (C_Connection), P); begin if R /= 0 then return True; else return False; end if; end SendQuery; procedure GetResult (Res : out Result; Done : out Boolean) is function PQgetResult (Conn : System.Address) return System.Address; pragma Import (C, PQgetResult, "PQgetResult"); R : constant PGresult := To_Result (PQgetResult (To_Addr (C_Connection))); begin if R = Null_Result then Done := True; else Res.Res := R; Done := False; end if; end GetResult; function ConsumeInput return Boolean is function PQconsumeInput (Conn : System.Address) return Interfaces.C.int; pragma Import (C, PQconsumeInput, "PQconsumeInput"); R : constant Interfaces.C.int := PQconsumeInput (To_Addr (C_Connection)); begin if R /= 0 then return True; else return False; end if; end ConsumeInput; function Flush return Boolean is function PQflush (Conn : System.Address) return Interfaces.C.int; pragma Import (C, PQflush, "PQflush"); R : constant Interfaces.C.int := PQflush (To_Addr (C_Connection)); begin if R = 0 then return True; else return False; end if; end Flush; function IsBusy return Boolean is function PQisBusy (Conn : System.Address) return Interfaces.C.int; pragma Import (C, PQisBusy, "PQisBusy"); R : constant Interfaces.C.int := PQisBusy (To_Addr (C_Connection)); begin if R /= 0 then return True; else return False; end if; end IsBusy; function RequestCancel return Boolean is function PQrequestCancel (Conn : System.Address) return Interfaces.C.int; pragma Import (C, PQrequestCancel, "PQrequestCancel"); R : constant Interfaces.C.int := PQrequestCancel (To_Addr (C_Connection)); begin if R /= 0 then return True; else return False; end if; end RequestCancel; function Socket return Interfaces.C.int is function PQsocket (Conn : System.Address) return Interfaces.C.int; pragma Import (C, PQsocket, "PQsocket"); R : constant Interfaces.C.int := PQsocket (To_Addr (C_Connection)); begin return R; end Socket; procedure Notifies (Message : out Notification; Done : out Boolean) is function PQnotifies (Conn : System.Address) return System.Address; pragma Import (C, PQnotifies, "PQnotifies"); procedure Free (Addr : System.Address); pragma Import (C, Free, "free"); type NotiPtr is access all Notification; package P is new System.Address_To_Access_Conversions (Notification); function Cvt is new Ada.Unchecked_Conversion (P.Object_Pointer, NotiPtr); N : NotiPtr; A : constant System.Address := PQnotifies (To_Addr (C_Connection)); begin N := Cvt (P.To_Pointer (A)); if N /= null then Message := N.all; Free (A); Done := False; else Done := True; end if; end Notifies; end PGConn; procedure Initialize (Object : in out Database) is pragma Unreferenced (Object); begin null; end Initialize; procedure Finalize (Object : in out Database) is procedure Free is new Ada.Unchecked_Deallocation (PGConn, Connection_Pointer); begin Object.Connection.Close; if Object.Connection /= null then Free (Object.Connection); end if; end Finalize; function Connect (Params : access String) return Connection_Handle is function PQConnect (Options : char_array) return System.Address; pragma Import (C, PQConnect, "PQconnectdb"); Conn : Connection_Handle; begin Conn := To_Conn (PQConnect (C.To_C (Params.all))); if Conn = Null_Connection then raise PostgreSQL_Error; else return Conn; end if; end Connect; procedure Reset (DB : in Database'Class) is begin DB.Connection.Reset; end Reset; type C_Accessor is access function (Conn : System.Address) return chars_ptr; pragma Convention (C, C_Accessor); generic Accessor : C_Accessor; function Connection_Accessor (DB : in Database'Class) return String; function Connection_Accessor (DB : in Database'Class) return String is begin return CS.Value (Accessor.all (To_Addr (DB.Connection.Handle))); end Connection_Accessor; function PQdb (Conn : System.Address) return chars_ptr; pragma Import (C, PQdb, "PQdb"); function Get_Name is new Connection_Accessor (Accessor => PQdb'Access); function PQuser (Conn : System.Address) return chars_ptr; pragma Import (C, PQuser, "PQuser"); function Get_User is new Connection_Accessor (Accessor => PQuser'Access); function PQpass (Conn : System.Address) return chars_ptr; pragma Import (C, PQpass, "PQpass"); function Get_Pass is new Connection_Accessor (Accessor => PQpass'Access); function PQhost (Conn : System.Address) return chars_ptr; pragma Import (C, PQhost, "PQhost"); function Get_Host is new Connection_Accessor (Accessor => PQhost'Access); function PQport (Conn : System.Address) return chars_ptr; pragma Import (C, PQport, "PQport"); function Get_Port is new Connection_Accessor (Accessor => PQport'Access); function PQtty (Conn : System.Address) return chars_ptr; pragma Import (C, PQtty, "PQtty"); function Get_TTY is new Connection_Accessor (Accessor => PQtty'Access); function PQopt (Conn : System.Address) return chars_ptr; pragma Import (C, PQopt, "PQoptions"); function Get_Options is new Connection_Accessor (Accessor => PQopt'Access); function Name (DB : in Database'Class) return String renames Get_Name; function User (DB : in Database'Class) return String renames Get_User; function Password (DB : in Database'Class) return String renames Get_Pass; function Host (DB : in Database'Class) return String renames Get_Host; function Port (DB : in Database'Class) return String renames Get_Port; function TTY (DB : in Database'Class) return String renames Get_TTY; function Options (DB : in Database'Class) return String renames Get_Options; function Error (DB : in Database'Class) return String is begin return DB.Connection.Error; end Error; function Status (DB : in Database'Class) return ConnStatus is begin return DB.Connection.Status; end Status; function Server_PID (DB : in Database'Class) return Backend_PID is begin return DB.Connection.PID; end Server_PID; procedure Execute (Res : out Result; DB : in Database'Class; Query : String) is begin DB.Connection.Execute (Res, Query); end Execute; procedure Make_Empty_Result (Res : out Result; DB : in Database'Class; Status : in ExecStatus := PGRES_EMPTY_QUERY) is begin DB.Connection .Empty_Result (Res, Status); end Make_Empty_Result; procedure Initialize (Object : in out Result) is pragma Unreferenced (Object); begin null; end Initialize; procedure Finalize (Object : in out Result) is procedure PQclear (Res : in System.Address); pragma Import (C, PQclear, "PQclear"); begin if Object.Res /= Null_Result then PQclear (To_Addr (Object.Res)); Object.Res := Null_Result; end if; end Finalize; function Status (Res : in Result) return ExecStatus is function PQresStatus (Conn : System.Address) return Interfaces.C.int; pragma Import (C, PQresStatus, "PQresultStatus"); begin return ExecStatus'Val (PQresStatus (To_Addr (Res.Res))); end Status; function Status (Status : in ExecStatus) return String is function PQresStat (stat : Interfaces.C.int) return chars_ptr; pragma Import (C, PQresStat, "PQresStatus"); begin return CS.Value (PQresStat (ExecStatus'Pos (Status))); end Status; function Status (Res : in Result) return String is Stat : constant ExecStatus := Status (Res); begin return Status (Stat); end Status; function Error (Res : in Result) return String is function PQresErr (Res : System.Address) return chars_ptr; pragma Import (C, PQresErr, "PQresultErrorMessage"); begin return CS.Value (PQresErr (To_Addr (Res.Res))); end Error; function Quote_Identifier (Identifier : String) return String is begin return '"' & Identifier & '"'; end Quote_Identifier; type C_Info is access function (Res : System.Address) return C.int; pragma Convention (C, C_Info); generic Accessor : C_Info; function Info_Accessor (Res : in Result) return Integer; function Info_Accessor (Res : in Result) return Integer is begin return Integer (Accessor.all (To_Addr (Res.Res))); end Info_Accessor; function PQntuples (Res : System.Address) return C.int; pragma Import (C, PQntuples, "PQntuples"); function Get_Count is new Info_Accessor (Accessor => PQntuples'Access); function PQnfields (Res : System.Address) return C.int; pragma Import (C, PQnfields, "PQnfields"); function Get_FCount is new Info_Accessor (Accessor => PQnfields'Access); function PQbinaryTuples (Res : System.Address) return C.int; pragma Import (C, PQbinaryTuples, "PQbinaryTuples"); function Get_BinaryTuples is new Info_Accessor (Accessor => PQbinaryTuples'Access); function Tuple_Count (Res : Result) return Tuple_Index is begin return Tuple_Index (Get_Count (Res)); end Tuple_Count; function Field_Count (Res : Result) return Field_Index is begin return Field_Index (Get_FCount (Res)); end Field_Count; function Field_Name (Res : Result; Index : Field_Index) return String is function PQfname (Res : System.Address; Idx : C.int) return chars_ptr; pragma Import (C, PQfname, "PQfname"); begin return CS.Value (PQfname (To_Addr (Res.Res), C.int (Index))); end Field_Name; procedure Field_Lookup (Res : in Result; Name : in String; Index : out Field_Index; Found : out Boolean) is function PQfnumber (Res : System.Address; Name : chars_ptr) return C.int; pragma Import (C, PQfnumber, "PQfnumber"); P : chars_ptr := CS.New_String (Name); I : constant C.int := PQfnumber (To_Addr (Res.Res), P); begin CS.Free (P); if I < 0 then Found := False; Index := Field_Index'Last; else Found := True; Index := Field_Index (I); end if; end Field_Lookup; function Is_Binary (Res : Result; Index : Field_Index) return Boolean is pragma Unreferenced (Index); I : constant Integer := Get_BinaryTuples (Res); begin if I /= 0 then return True; else return False; end if; end Is_Binary; function Field_Type (Res : Result; Index : Field_Index) return TypeID is function PQftype (Res : System.Address; Idx : C.int) return TypeID; pragma Import (C, PQftype, "PQftype"); begin return PQftype (To_Addr (Res.Res), C.int (Index)); end Field_Type; procedure Value (Res : in Result; Tuple : in Tuple_Index; Field : in Field_Index; Pointer : out System.Address) is function Cvt is new Ada.Unchecked_Conversion (chars_ptr, System.Address); function PQgetvalue (Res : System.Address; Tuple : C.int; Field : C.int) return chars_ptr; pragma Import (C, PQgetvalue, "PQgetvalue"); P : constant chars_ptr := PQgetvalue (To_Addr (Res.Res), C.int (Tuple), C.int (Field)); begin Pointer := Cvt (P); end Value; function Value (Res : Result; Tuple : Tuple_Index := 0; Field : Field_Index := 0) return String is function PQgetvalue (Res : System.Address; Tuple : C.int; Field : C.int) return chars_ptr; pragma Import (C, PQgetvalue, "PQgetvalue"); P : constant chars_ptr := PQgetvalue (To_Addr (Res.Res), C.int (Tuple), C.int (Field)); begin if Is_Binary (Res, Field) then raise PostgreSQL_Error; end if; return CS.Value (P); end Value; function Value (Res : Result; Tuple : Tuple_Index := 0; Field_Name : String) return String is Found : Boolean; Idx : Field_Index; begin Field_Lookup (Res, Field_Name, Idx, Found); if Found then return Value (Res, Tuple, Idx); else raise PostgreSQL_Error; end if; end Value; function Field_Size (Res : Result; Field : Field_Index) return Integer is function PQfsize (Res : System.Address; Idx : C.int) return C.int; pragma Import (C, PQfsize, "PQfsize"); begin return Integer (PQfsize (To_Addr (Res.Res), C.int (Field))); end Field_Size; function Field_Modification (Res : Result; Field : Field_Index) return Integer is function PQfmod (Res : System.Address; Idx : C.int) return C.int; pragma Import (C, PQfmod, "PQfmod"); begin return Integer (PQfmod (To_Addr (Res.Res), C.int (Field))); end Field_Modification; function Field_Length (Res : Result; Tuple : Tuple_Index; Field : Field_Index) return Natural is function PQgetlen (Res : System.Address; Row : C.int; Idx : C.int) return C.int; pragma Import (C, PQgetlen, "PQgetlength"); begin return Natural (PQgetlen (To_Addr (Res.Res), C.int (Tuple), C.int (Field))); end Field_Length; function Is_Null (Res : Result; Tuple : Tuple_Index; Field : Field_Index) return Boolean is use type C.int; function PQisnull (Res : System.Address; Row : C.int; Idx : C.int) return C.int; pragma Import (C, PQisnull, "PQgetisnull"); R : constant C.int := PQisnull (To_Addr (Res.Res), C.int (Tuple), C.int (Field)); begin if R = 0 then return False; else return True; end if; end Is_Null; function Command_Status (Res : in Result) return String is function PQcmdStatus (Res : System.Address) return chars_ptr; pragma Import (C, PQcmdStatus, "PQcmdStatus"); begin return CS.Value (PQcmdStatus (To_Addr (Res.Res))); end Command_Status; function Command_Tuples (Res : in Result) return String is function PQcmdTuples (Res : System.Address) return chars_ptr; pragma Import (C, PQcmdTuples, "PQcmdTuples"); begin return CS.Value (PQcmdTuples (To_Addr (Res.Res))); end Command_Tuples; function Command_Tuples (Res : in Result) return Natural is S : constant String := Command_Tuples (Res); begin if S = "" then return 0; else return Natural'Value (S); end if; end Command_Tuples; function OID_Value (Res : in Result) return OID is function PQoidValue (Res : System.Address) return OID; pragma Import (C, PQoidValue, "PQoidValue"); begin return PQoidValue (To_Addr (Res.Res)); end OID_Value; -- ----------------------------------------------------------------------- procedure Load_TypeInfo (DB : in Database'Class; Typ : in TypeID := InvalidTypeID; R : out TypeInfo) is begin if Typ = InvalidTypeID then Execute (R, DB, "SELECT * FROM pg_type"); else Execute (R, DB, "SELECT * FROM pg_type WHERE OID=" & TypeID'Image (Typ)); end if; end Load_TypeInfo; function Value (Res : TypeInfo; Tuple : Tuple_Index := 0; Field_Name : String) return String is begin return Value (Result (Res), Tuple, Field_Name); end Value; procedure Set_Non_Blocking (DB : in Database'Class) is begin DB.Connection.SetNonBlocking; end Set_Non_Blocking; function Is_Non_Blocking (DB : in Database'Class) return Boolean is begin return DB.Connection.IsNonBlocking; end Is_Non_Blocking; function Send_Query (DB : in Database'Class; Query : in String) return Boolean is begin return DB.Connection.SendQuery (Query); end Send_Query; procedure Get_Result (DB : in Database'Class; Res : out Result; Done : out Boolean) is begin DB.Connection.GetResult (Res, Done); end Get_Result; function Consume_Input (DB : in Database'Class) return Boolean is begin return DB.Connection.ConsumeInput; end Consume_Input; function Flush (DB : in Database'Class) return Boolean is begin return DB.Connection.Flush; end Flush; function Is_Busy (DB : in Database'Class) return Boolean is begin return DB.Connection.IsBusy; end Is_Busy; function Request_Cancel (DB : in Database'Class) return Boolean is begin return DB.Connection.RequestCancel; end Request_Cancel; function Socket (DB : in Database'Class) return Interfaces.C.int is begin return DB.Connection.Socket; end Socket; procedure Notifies (DB : in Database'Class; Message : out Notification; Done : out Boolean) is begin DB.Connection.Notifies (Message, Done); end Notifies; end GNU.DB.PostgreSQL; gnade-1.6.2.orig/dbi/postgres/gnu-db-postgresql.ads0000644000175000017500000006117710664033261022064 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Filename : $RCSfile: gnu-db-postgresql.ads,v $ -- Author : Juergen Pfeifer -- Created On : 29-Oct-2000 -- Last Modified By: $Author: persan $ -- Last Modified On: $Date: 2007/08/25 14:03:29 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000-2001 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- This binding is not intended to provide a Layer that hides the details -- -- of PostgreSQL, instead the opposite is intended. This binding exposes -- -- the same functionality like the C interface libpq. -- ------------------------------------------------------------------------------- with System.Storage_Elements; with Ada.Finalization; with Interfaces.C; package GNU.DB.PostgreSQL is pragma Preelaborate (PostgreSQL); PostgreSQL_Error : exception; NAMEDATALEN : constant := 32; -- The maximum length for system identifiers (e.g. table names etc.) type OID is new Interfaces.C.unsigned; -- PostreSQL assigns a unique Object ID (OID) to a row. InvalidOID : constant OID; -- This denotes an invalid OID. subtype TypeID is OID; -- Types are objects in the database and have IDs. InvalidTypeID : constant TypeID; type Field_Index is new Natural; -- Field indices in general start with 0 in PostgreSQL type Tuple_Index is new Natural; -- Tuple indices in general start with 0 in PostgreSQL type ConnStatus is (CONNECTION_OK, CONNECTION_BAD, CONNECTION_STARTED, CONNECTION_MADE, CONNECTION_AWAITING_RESPONSE, CONNECTION_AUTH_OK, CONNECTION_SETENV); pragma Convention (C, ConnStatus); subtype SynchConnStatus is ConnStatus range CONNECTION_OK .. CONNECTION_BAD; -- These values are possible for synchronous connections. type Backend_PID is new Interfaces.C.int; -- This type is used to identify the backend server process handling the -- database connection. type ExecStatus is (PGRES_EMPTY_QUERY, PGRES_COMMAND_OK, PGRES_TUPLES_OK, PGRES_COPY_OUT, PGRES_COPY_IN, PGRES_BAD_RESPONSE, PGRES_NONFATAL_ERROR, PGRES_FATAL_ERROR); pragma Convention (C, ExecStatus); type Database (Parameters : access String) is tagged limited private; -- You must pass the PostgreSQP connection string as discriminant -- when you instantiate a new Database object. The connection to -- the database will be made during the initialization of the object. -- The connection will be closed automatically when the Database objects -- goes out of scope (will be "finalized"). procedure Reset (DB : in Database'Class); -- This function will close the connection to the backend and attempt -- to reestablish a new connection to the same postmaster, using all -- the same parameters previously used. This may be useful for error -- recovery if a working connection is lost. pragma Inline (Reset); function Name (DB : in Database'Class) return String; -- Returns the database name of the connection pragma Inline (Name); function User (DB : in Database'Class) return String; -- Returns the user name of the connection pragma Inline (User); function Password (DB : in Database'Class) return String; -- Returns the password of the connection pragma Inline (Password); function Host (DB : in Database'Class) return String; -- Returns the server host name of the connection pragma Inline (Host); function Port (DB : in Database'Class) return String; -- Returns the port of the connection pragma Inline (Port); function TTY (DB : in Database'Class) return String; -- Returns the debug tty of the connection pragma Inline (TTY); function Options (DB : in Database'Class) return String; -- Returns the backend options used in the connection pragma Inline (Options); function Error (DB : in Database'Class) return String; -- Returns the error message most recently generated by an operation -- on the connection pragma Inline (Error); function Server_PID (DB : in Database'Class) return Backend_PID; -- Returns the process ID of the backend server handling this connection pragma Inline (Server_PID); function Status (DB : in Database'Class) return ConnStatus; -- Returns the status of the connection. -- Only two of the ConnStatus values are seen outside of an asynchronous -- connection procedure - CONNECTION_OK or CONNECTION_BAD. A good -- connection to the database has the status CONNECTION_OK. A failed -- connection attempt is signaled by status CONNECTION_BAD. Ordinarily, -- an OK status will remain so until PQfinish, but a communications -- failure might result in the status changing to CONNECTION_BAD -- prematurely. In that case the application could try to recover by -- calling the Reset procedure. pragma Inline (Status); type Result is limited private; -- This is the abstraction of a query result set. procedure Execute (Res : out Result; DB : in Database'Class; Query : String); -- Submit a query to Postgres and wait for the result pragma Inline (Execute); function Status (Res : in Result) return ExecStatus; -- Returns the result status of the query -- If the result status is PGRES_TUPLES_OK, then the routines described -- below can be used to retrieve the tuples returned by the query. -- Note that a SELECT that happens to retrieve zero tuples still shows -- PGRES_TUPLES_OK. PGRES_COMMAND_OK is for commands that can never -- return tuples (INSERT, UPDATE, etc.). A response of PGRES_EMPTY_QUERY -- often exposes a bug in the client software. function Status (Status : in ExecStatus) return String; -- Converts the enumerated type returned by PQresultStatus into a -- string constant describing the status code function Status (Res : in Result) return String; -- Combination of the above two elementary functions. Get the string -- constant describing the status code directly from the Result pragma Inline (Status); function Error (Res : in Result) return String; -- Returns the error message associated with the query, or an empty -- string if there was no error. -- -- Immediately following an Execute or GetResult call, Error (on the -- Database object) will return the same string as Error (on the Result). -- However, a Result will retain its error message until destroyed, -- whereas the Database's error message will change when subsequent -- operations are done. Use Error (on the Result) when you want to know -- the status associated with a particular Result; use Error (on the -- Database) when you want to know the status from the latest operation -- on the connection. pragma Inline (Error); function Tuple_Count (Res : Result) return Tuple_Index; -- Returns the number of tuples (instances) in the query result pragma Inline (Tuple_Count); function Field_Count (Res : Result) return Field_Index; -- Returns the number of fields (attributes) in each tuple of the -- query result pragma Inline (Field_Count); function Field_Name (Res : Result; Index : Field_Index) return String; -- Returns the field (attribute) name associated with the given field -- index. pragma Inline (Field_Name); procedure Field_Lookup (Res : in Result; Name : in String; Index : out Field_Index; Found : out Boolean); -- Returns the field (attribute) index associated with the given -- field name. If the field was found, the 'Found' parameter is set -- to True and the 'Index' parameter will contain the fields index. -- Otherwise 'Found' is set to False. pragma Inline (Field_Lookup); function Is_Binary (Res : Result; Index : Field_Index) return Boolean; -- Returns True if the Result contains binary tuple data, False if it -- contains ASCII data. pragma Inline (Is_Binary); function Field_Type (Res : Result; Index : Field_Index) return TypeID; -- Returns the field type associated with the given field index. -- The TypeID returned is an internal coding of the type. pragma Inline (Field_Type); procedure Value (Res : in Result; Tuple : in Tuple_Index; Field : in Field_Index; Pointer : out System.Address); -- For most queries, the value referenced by Pointer is a C-String -- representation of the attribute value. But if Is_Binary is True, -- the value referenced by Pointer is the binary representation of the type -- in the internal format of the backend server. It is then the -- programmer's responsibility to cast and convert the data to the -- correct Ada type. The Pointer returned points to storage that -- is part of the Result object. One should not modify it, and one -- must explicitly copy the value into other storage if it is to be -- used past the lifetime of the Result object itself. function Value (Res : Result; Tuple : Tuple_Index := 0; Field : Field_Index := 0) return String; -- Returns a single field (attribute) value of one tuple of a Result -- as a String. If this is a binary field please use the more general -- Value procedure above. function Value (Res : Result; Tuple : Tuple_Index := 0; Field_Name : String) return String; -- Returns a single field (attribute) value of one tuple of a Result -- as a String. If this is a binary field please use the more general -- Value procedure above. pragma Inline (Value); function Field_Size (Res : Result; Field : Field_Index) return Integer; -- Returns the size in bytes of the field associated with the given -- field index. -- Field_Size returns the space allocated for this field in a database -- tuple, in other words the size of the server's binary representation -- of the data type. -1 is returned if the field is variable size. pragma Inline (Field_Size); function Field_Modification (Res : Result; Field : Field_Index) return Integer; -- Returns the type-specific modification data of the field associated -- with the given field index. pragma Inline (Field_Modification); function Field_Length (Res : Result; Tuple : Tuple_Index; Field : Field_Index) return Natural; -- Returns the length of a field (attribute) in bytes. -- This is the actual data length for the particular data value, that is -- the size of the object retrieved by the Value function. Note that for -- ASCII-represented values, this size has little to do with the binary -- size reported by Field_Size. pragma Inline (Field_Length); function Is_Null (Res : Result; Tuple : Tuple_Index; Field : Field_Index) return Boolean; -- Tests a field for a NULL entry. This function returns True if the -- field contains a NULL, False if it contains a non-null value. -- (Note that the Value function will return an empty string for a NULL -- field.) pragma Inline (Is_Null); function Command_Status (Res : in Result) return String; -- Returns the command status string from the SQL command that generated -- the Result. pragma Inline (Command_Status); function Command_Tuples (Res : in Result) return String; -- Returns the number of rows affected by the SQL command. -- If the SQL command that generated the Result was INSERT, UPDATE or -- DELETE, this returns a string containing the number of rows affected. -- If the command was anything else, it returns the empty string function Command_Tuples (Res : in Result) return Natural; -- Returns the number of rows affected by the SQL command. -- If the SQL command that generated the Result was INSERT, UPDATE or -- DELETE, this returns the number of rows affected. -- If the command was anything else, it returns 0. pragma Inline (Command_Tuples); function OID_Value (Res : in Result) return OID; -- Returns the object id of the tuple inserted, if the SQL command was -- an INSERT. Otherwise, returns InvalidOid. pragma Inline (OID_Value); procedure Make_Empty_Result (Res : out Result; DB : in Database'Class; Status : in ExecStatus := PGRES_EMPTY_QUERY); -- Constructs an empty Result object with the given status -- This is libpq's internal routine to allocate and initialize an empty -- Result object. It is exported because some applications find it useful -- to generate result objects (particularly objects with error status) -- themselves. If the Database connection is valid and status indicates -- an error, the connection's current errorMessage is copied into the -- Result. pragma Inline (Make_Empty_Result); type TypeInfo is limited private; -- This is the abstraction of a set of type informations. procedure Load_TypeInfo (DB : in Database'Class; Typ : in TypeID := InvalidTypeID; R : out TypeInfo); -- Get a type information set. If you ask for a specific type, this -- will be a single tuple. If you specify InvalidTypeID you'll get -- the set of all types defined in the database. pragma Inline (Load_TypeInfo); function Value (Res : TypeInfo; Tuple : Tuple_Index := 0; Field_Name : String) return String; -- Returns a single field (attribute) value of one tuple of a TypeInfo -- as a String. Look at the fields defined in the pg_types table of -- any PostgreSQL database for possible values. pragma Inline (Value); -- ----------------------------------------------------------------------- -- Procedures and functions for Asynchronous query processing -- ----------------------------------------------------------------------- procedure Set_Non_Blocking (DB : in Database'Class); -- Sets the state of the connection to non-blocking -- When a database connection has been set to non-blocking mode and -- Execute is called, it will temporarily set the state of the connection -- to blocking until the Execute completes. function Is_Non_Blocking (DB : in Database'Class) return Boolean; -- Returns the blocking status of the database connection. function Send_Query (DB : in Database'Class; Query : in String) return Boolean; -- Submit a query to Postgres without waiting for the result(s). True is -- returned if the query was successfully dispatched, False if not (in -- which case, use function Error to get more information about the -- failure). -- After successfully calling Send_Query, call Get_Result one or more -- times to obtain the query results. Send_Query may not be called again -- (on the same connection) until Get_Result has returned with completion -- flag set to True, indicating that the query is done. procedure Get_Result (DB : in Database'Class; Res : out Result; Done : out Boolean); -- Wait for the next result from a prior Send_Query, and return it. -- Done is set to True when the query is complete and there will be no -- more results, in this case Res will not be set. When Done is set to -- False, the Res contains a Result and processing is not finished. function Consume_Input (DB : in Database'Class) return Boolean; -- If input is available from the backend, consume it. -- Consume_Input normally returns True indicating "no error", but returns -- False if there was some kind of trouble (in which case function Error -- should be used). Note that the result does not say whether any input -- data was actually collected. After calling Consume_Input, the -- application may check Is_Busy and/or Notifies to see if their state -- has changed. -- -- Consume_Input may be called even if the application is not prepared to -- deal with a result or notification just yet. The routine will read -- available data and save it in a buffer, thereby causing a select(2) -- read-ready indication to go away. The application can thus use -- Consume_Input to clear the select condition immediately, and then -- examine the results at leisure. function Flush (DB : in Database'Class) return Boolean; -- Attempt to flush any data queued to the backend, returns True if -- successful (or if the send queue is empty) or False if it failed for -- some reason. -- Flush needs to be called on a non-blocking connection before calling -- select to determine if a responce has arrived. If True is returned it -- ensures that there is no data queued to the backend that has not -- actually been sent. Only applications that have used Set_Non_Blocking -- have a need for this. function Is_Busy (DB : in Database'Class) return Boolean; -- Returns True if a query is busy, that is, Get_Result would block -- waiting for input. A False return indicates that Get_Result can be -- called with assurance of not blocking. -- Is_Busy will not itself attempt to read data from the backend; -- therefore Consume_Input must be invoked first, or the busy state will -- never end. function Socket (DB : in Database'Class) return Interfaces.C.int; -- Obtain the file descriptor number for the backend connection socket. -- A valid descriptor will be >= 0; a result of -1 indicates that no -- backend connection is currently open. -- function Request_Cancel (DB : in Database'Class) return Boolean; -- Request that Postgres abandon processing of the current query. -- The return value is True if the cancel request was successfully -- dispatched, False if not. (If not, function Error tells why not.) -- Successful dispatch is no guarantee that the request will have any -- effect, however. Regardless of the return value of Request_Cancel, -- the application must continue with the normal result-reading sequence -- using Get_Result. If the cancellation is effective, the current query -- will terminate early and return an error result. If the cancellation -- fails (say, because the backend was already done processing the query), -- then there will be no visible result at all. -- Note that if the current query is part of a transaction, cancellation -- will abort the whole transaction. -- Request_Cancel can safely be invoked from a signal handler. So, it is -- also possible to use it in conjunction with plain Execute, if the -- decision to cancel can be made in a signal handler. Note that -- Request_Cancel will have no effect if the connection is not currently -- open or the backend is not currently processing a query. type Notification is record Relation_Name : String (1 .. NAMEDATALEN); Notifier : Backend_PID; end record; pragma Convention (C, Notification); procedure Notifies (DB : in Database'Class; Message : out Notification; Done : out Boolean); -- Returns the next notification from a list of unhandled notification -- messages received from the backend. Done is set to False if there are -- no pending notifications. In this case Message is not be set. If Done -- is set to False, Message contains a valid Notification. Once a -- notification is returned from Notifies, it is considered handled and -- will be removed from the list of notifications. -- ----------------------------------------------------------------------- -- Helpers -- ----------------------------------------------------------------------- function Quote_Identifier (Identifier : String) return String; pragma Inline (Quote_Identifier); private use Ada.Finalization; InvalidOID : constant OID := 0; InvalidTypeID : constant TypeID := TypeID (InvalidOID); type Connection_Handle is new System.Storage_Elements.Integer_Address; Null_Connection : constant Connection_Handle := 0; function Connect (Params : access String) return Connection_Handle; -- According to the PostgreSQL documentation, starting with Version 7 -- PostgreSQL is threadsafe, the connection object should only be used -- by one thread at a time; Result object may be used concurrent. -- So we protect the PostgreSQL connection by this protected type. protected type PGConn (Parameters : access String) is function Handle return Connection_Handle; procedure Reset; function Error return String; function Status return ConnStatus; procedure Close; function PID return Backend_PID; procedure Execute (Res : out Result; Query : in String); procedure Empty_Result (Res : out Result; Status : in ExecStatus); procedure SetNonBlocking; function IsNonBlocking return Boolean; function SendQuery (Query : in String) return Boolean; procedure GetResult (Res : out Result; Done : out Boolean); function ConsumeInput return Boolean; function Flush return Boolean; function IsBusy return Boolean; function Socket return Interfaces.C.int; function RequestCancel return Boolean; procedure Notifies (Message : out Notification; Done : out Boolean); private C_Connection : Connection_Handle := Connect (Parameters); end PGConn; type Connection_Pointer is access all PGConn; type Database (Parameters : access String) is new Limited_Controlled with record Connection : Connection_Pointer := new PGConn (Parameters); end record; procedure Initialize (Object : in out Database); procedure Finalize (Object : in out Database); type PGresult is new System.Storage_Elements.Integer_Address; Null_Result : constant PGresult := 0; type Result is new Limited_Controlled with record Res : PGresult := Null_Result; end record; procedure Initialize (Object : in out Result); procedure Finalize (Object : in out Result); type TypeInfo is new Result with null record; pragma Linker_Options ("-lpq"); end GNU.DB.PostgreSQL; gnade-1.6.2.orig/dbi/postgres/postgres.gpr0000644000175000017500000000121710027000434020350 0ustar lbrentalbrenta-- $Id: postgres.gpr,v 1.5 2004/03/20 08:30:20 merdmann Exp $ with "../../gnade" ; project Postgres is for Languages use ("Ada"); for Source_Dirs use ("."); for Object_Dir use "."; package Compiler is for Default_Switches ("Ada") use ( "-g", GNADE.IncludeOpt); end Compiler; package Builder is for Default_Switches ("Ada") use ("-s", "-m", "-g", "-gnatQ", GNADE.IncludeOpt); end Builder; package Binder is for Default_Switches ("Ada") use ("-static"); end Binder; package Linker is for Default_Switches ("Ada") use ("-g"); end Linker; end Postgres; gnade-1.6.2.orig/dbi/sqlite/0000755000175000017500000000000011040716254015434 5ustar lbrentalbrentagnade-1.6.2.orig/dbi/sqlite/Makefile0000644000175000017500000000717010027400162017071 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/dbi/sqlite/Makefile,v $ ## Description : Makefile for the SQLite bindigns -- ## Author : Michael Erdmann -- ## Created On : 27-07-2003 -- ## Last Modified By: $Author: merdmann $ ## Last Modified On: $Date: 2004/03/21 20:52:02 $ -- ## Status : $State: Exp $ -- ## -- ## Copyright (C) 2004 M.Erdmann -- ## -- ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNADE; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## ## Restrictions ## ============ ## None ## ## References ## ========== ## include ../../make.conf # libname=libgnadesqlite ## ## ## all build:: $(PREPROCESSED_SOURCES) $(ADAMAKE) -d -Psqlite.gpr -u ifneq ($(EXPORT),) $(MAKE) install endif ## ## ## install :: $(ADAINSTALL) $(includedir) $(wildcard gnu-db-sqlite*.ad* gnu-db-sqlite*.ali) $(MKSTATIC) $(libdir) $(libname).a $(MKSHARED) $(libdir) $(MINOR) $(MAJOR) $(libname).so ## ## ## distclean clean :: ifeq ($(EXPORT),) $(ADAUINSTALL) $(includedir) $(wildcard $(includedir)/gnu-db-sqlite*.ad* \ $(includedir)/gnu-db-sqlite*.ali) endif $(RM) *.o *.ali core b~*.ad* *~ *.a gnade-1.6.2.orig/dbi/sqlite/Makefile.sqlite0000644000175000017500000000614510042017522020373 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/dbi/sqlite/Makefile.sqlite,v $ ## Description : Makefile for the SQLite bindigns -- ## Author : Michael Erdmann -- ## Created On : 27-07-2003 -- ## Last Modified By: $Author: merdmann $ ## Last Modified On: $Date: 2004/04/22 19:38:58 $ -- ## Status : $State: Exp $ -- ## -- ## Copyright (C) 2003 M.Erdmann -- ## -- ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNADE; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## ## Restrictions ## ============ ## None ## ## References ## ========== ## all build: $(MAKE) -C./ $@ gnade-1.6.2.orig/dbi/sqlite/README0000644000175000017500000000124710175203130016310 0ustar lbrentalbrenta-------------- -- Sqlite 2 -- -------------- This directory contains bindings to sqlite (http://www.sqlite.org). Tested succesfully on: - Windows 2000 / GNAT 3.15p - Windows 2000 / MinGW/GCC3.4.2 To use it under windows, download the def and dll files from the website of sqlite. Then create a static import library file as stated in GNAT User's Guide section 25.7.2.2 Gnat-Style Import Library. This means to build the import library "libsqlite.a" as follows: $ gnatdll -e sqlite.def -d sqlite.dll NOTE: Binding for Sqlite2 is frozen now, I won't touch it anymore. Use Sqlite3 binding instead. ------------- -- Contact -- ------------- Ching Bon Lam (cblam@gmx.net)gnade-1.6.2.orig/dbi/sqlite/gnu-db-sqlite.adb0000644000175000017500000003016710163070503020561 0ustar lbrentalbrentawith Ada.Strings.Unbounded; with Ada.Unchecked_Deallocation; with Ada.Text_IO; with Interfaces.C; with Interfaces.C.Strings; with Interfaces.C.Pointers; with System; package body GNU.DB.SQLite is pragma Linker_Options("-lsqlite"); package ASU renames Ada.Strings.Unbounded; package C renames Interfaces.C; package CS renames Interfaces.C.Strings; ------------------- -- local support -- ------------------- type Pchars_ptr is access all CS.chars_ptr; -- equivalent of access string -- Most of the sqlite functions return an string that contains the error -- message when an error is occured. Sqlite uses "char**" for errmsg, which -- can be simulated by "access all CS.chars_ptr" in Ada95. procedure Free is new Ada.Unchecked_Deallocation(CS.chars_ptr, Pchars_ptr); procedure Free_Table is new Ada.Unchecked_Deallocation(Table_Array, Table_Reference); subtype chars_ptr is CS.chars_ptr; -- equivalent of string type chars_ptr_array is array(C.size_t range <>) of aliased chars_ptr; -- same as char** package Pstring is new Interfaces.C.Pointers(C.size_t, chars_ptr, chars_ptr_array, CS.Null_Ptr); subtype Pstring_array is Pstring.Pointer; type exec_sqlite_callback is access function (pArg : System.Address; argc : C.int; argv : Pstring_array; columnNames : Pstring_array) return C.int; -- sqlite.h:91 -- typedef int (*sqlite_callback)(void*,int,char**, char**); function sqlite_exec (db : DB_Access; sql : C.char_array; cb : exec_sqlite_callback; arg : System.Address; errmsg : Pchars_ptr) return C.int; pragma Import(C, sqlite_exec, "sqlite_exec"); -- sqlite.h:133 -- int sqlite_exec( -- sqlite*, /* An open database */ -- const char *sql, /* SQL to be executed */ -- sqlite_callback, /* Callback function */ -- void *, /* 1st argument to callback function */ -- char **errmsg /* Error msg written here */ -- ); procedure check_return_code (code : in integer) is begin case code is when 0 => null; when 1 => raise SQLITE_ERROR; when 2 => raise SQLITE_INTERNAL; when 3 => raise SQLITE_PERM; when 4 => raise SQLITE_ABORT; when 5 => raise SQLITE_BUSY; when 6 => raise SQLITE_LOCKED; when 7 => raise SQLITE_NOMEM; when 8 => raise SQLITE_READONLY; when 9 => raise SQLITE_INTERRUPT; when 10 => raise SQLITE_IOERR; when 11 => raise SQLITE_CORRUPT; when 12 => raise SQLITE_NOTFOUND; when 13 => raise SQLITE_FULL; when 14 => raise SQLITE_CANTOPEN; when 15 => raise SQLITE_PROTOCOL; when 16 => raise SQLITE_EMPTY; when 17 => raise SQLITE_SCHEMA; when 18 => raise SQLITE_TOOBIG; when 19 => raise SQLITE_CONSTRAINT; when 20 => raise SQLITE_MISMATCH; when 21 => raise SQLITE_MISUSE; when 22 => raise SQLITE_NOLFS; when 23 => raise SQLITE_AUTH; when 24 => raise SQLITE_FORMAT; when others => raise UNDEFINED_ERROR; end case; end check_return_code; -- hardcoded in the source of sqlite procedure exec_real (db : in out Object; sql : in string; proxy : in exec_sqlite_callback; err : out Ustring) is tmperr : Pchars_ptr := new CS.chars_ptr; ret : integer; begin tmperr.all := CS.Null_Ptr; -- use the proxy here ret := integer(sqlite_exec(db.db, C.To_C(sql), proxy, System.Null_Address, tmperr)); if (CS."/="(tmperr.all, CS.Null_Ptr)) then err := ASU.To_Unbounded_String(CS.Value(tmperr.all)); end if; Free(tmperr); check_return_code(ret); end; ----------- -- close -- ----------- procedure close (db : in out Object) is procedure sqlite_close (db : in out DB_Access); pragma Import(C, sqlite_close, "sqlite_close"); -- sqlite.h:86 -- void sqlite_close(sqlite *); begin if not db.open then raise DB_NOT_OPEN; end if; sqlite_close(db.db); db.db := null; db.open := FALSE; end close; ---------- -- exec -- ---------- procedure exec (db : in out Object; sql : in string; errmsg : out Ustring) is use C; function nothing (pArg : System.Address; argc : C.int; argv : Pstring_array; columnNames : Pstring_array) return C.int is begin return 0; end nothing; -- create a proxy callback that converts all C data -- to Ada data and pass it on to the callback that the user provided begin if not db.open then raise DB_NOT_OPEN; end if; exec_real(db, sql, nothing'Unrestricted_Access, errmsg); end exec; ------------------------ -- exec_with_callback -- ------------------------ procedure exec_with_callback (db : in out Object; sql : in string; cb : in Exec_Callback; errmsg : out Ustring) is use C; function proxy (pArg : System.Address; argc : C.int; argv : Pstring_array; columnNames : Pstring_array) return C.int is begin if (argc <= 0) then return 0; end if; declare i : C.size_t := 0; argv2 : Row_Array(0 .. integer(argc) - 1 ); columnNames2 : Row_Array(0 .. integer(argc) - 1 ); begin for i in 0 .. C.size_t(argc) - 1 loop argv2(integer(i)) := ASU.To_Unbounded_String(CS.Value(Pstring.Value(argv)(i))); columnNames2(integer(i)) := ASU.To_Unbounded_String(CS.Value(Pstring.Value(columnNames)(i))); end loop; return C.int(cb(integer(argc), argv2, columnNames2)); end; end proxy; -- create a proxy callback that converts all C data -- to Ada data and pass it on to the callback that the user provided begin if not db.open then raise DB_NOT_OPEN; end if; exec_real(db, sql, proxy'Unrestricted_Access, errmsg); end exec_with_callback; ---------------------------------- -- exec_with_callback_with_data -- ---------------------------------- procedure exec_with_callback_with_data (db : in out Object; sql : in string; cb : in Exec_Callback_with_data; arg : in out Data_Type; errmsg : out Ustring) is use C; function proxy (pArg : System.Address; argc : C.int; argv : Pstring_array; columnNames : Pstring_array) return C.int is begin if (argc <= 0) then return 0; end if; declare i : C.size_t := 0; argv2 : Row_Array(0 .. integer(argc) - 1 ); columnNames2 : Row_Array(0 .. integer(argc) - 1 ); begin for i in 0 .. C.size_t(argc) - 1 loop argv2(integer(i)) := ASU.To_Unbounded_String(CS.Value(Pstring.Value(argv)(i))); columnNames2(integer(i)) := ASU.To_Unbounded_String(CS.Value(Pstring.Value(columnNames)(i))); end loop; return C.int(cb(arg, integer(argc), argv2, columnNames2)); end; end proxy; -- create a proxy callback that converts all C data -- to Ada data and pass it on to the callback that the user provided begin if not db.open then raise DB_NOT_OPEN; end if; exec_real(db, sql, proxy'Unrestricted_Access, errmsg); end exec_with_callback_with_data; -------------- -- Finalize -- -------------- procedure Finalize (Self : in out Table_Controlled) is procedure Free_Row is new Ada.Unchecked_Deallocation(Row_Array, Row_Reference); begin if Self.Table /= null then for I in Self.Table'Range loop Free_Row(Self.Table(I)); end loop; Free_Table(Self.table); end if; end Finalize; --------------- -- get_table -- --------------- procedure get_table (db : in out Object; sql : in string; table : out Table_Controlled; errmsg : out Ustring) is type Node; type PNode is access all Node; type Node is record next : PNode := null; info : Row_Reference; end record; -- type Node declaration procedure Free is new Ada.Unchecked_Deallocation(Node, PNode); Include_Column_Names : boolean := TRUE; Current : PNode := new Node; Head : PNode := Current; Count_Columns : integer := 0; Count_Rows : integer := 0; function callback (argc : integer; argv : Row_Array; columnNames : Row_Array) return integer is previous : PNode; begin if Include_Column_Names then Count_Rows := 1; Count_Columns := columnNames'Last; -- copy columnNames to Node.info Current.info := new Row_Array(columnNames'Range); Current.info.all := columnNames; Include_Column_Names := FALSE; end if; Count_Rows := Count_Rows + 1; -- insert new Node after the last one previous := Current; Current := new Node; previous.next := Current; Current.info := new Row_Array(argv'Range); Current.info.all := argv; return 0; end callback; begin Exec_with_callback(db, sql, callback'Unrestricted_Access, errmsg); declare tmp_table : Table_Reference := new Table_Array(1 .. Count_Rows); previous : PNode; begin Current := Head; for I in tmp_table'Range loop tmp_table(I) := Current.info; -- copy row -- go to next Node previous := Current; Current := Current.next; if I = tmp_table'Last and Current /= null then Ada.Text_IO.Put_Line("error with count"); end if; Free(previous); -- Free previous Node end loop; table.table := tmp_table; end; end get_table; ---------------- -- Initialize -- ---------------- procedure Initialize (Self : in out Table_Controlled) is begin Self.Table := null; end Initialize; ---------- -- open -- ---------- procedure open (db : in out Object; filename : in string; mode : in File_Mode_Type := READ_WRITE; errmsg : out Ustring) is function sqlite_open (filename : C.char_array; mode : C.int; errmsg : Pchars_ptr) return DB_Access; pragma Import(C, sqlite_open, "sqlite_open"); -- sqlite.h:78 -- sqlite *sqlite_open(const char *filename, int mode, char **errmsg); begin if db.open then raise DB_ALREADY_OPEN; end if; declare tmperr : Pchars_ptr := new CS.chars_ptr; begin tmperr.all := CS.Null_Ptr; -- file mode is not implemented in current implementation -- of sqlite db.db := sqlite_open(C.To_C(filename), 0, tmperr); if (CS."/="(tmperr.all, CS.Null_Ptr)) then errmsg := ASU.To_Unbounded_String(CS.Value(tmperr.all)); else db.open := TRUE; end if; Free(tmperr); end; end open; end GNU.DB.SQLite; gnade-1.6.2.orig/dbi/sqlite/gnu-db-sqlite.ads0000644000175000017500000002133710011241154020573 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/dbi/sqlite/gnu-db-sqlite.ads,v $ -- Description : SQLite Base Package -- -- Author : Ching Bon Lam -- -- Created : 26.7.2003 -- -- Last Modified By: $Author: cblam $ -- -- Last Modified On: $Date: 2004/02/07 19:54:20 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2003 Ching Bon Lam -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Functional Description -- -- ====================== -- -- Thick binding to sqlite (http://www.sqlite.org). -- -- -- -- Restrictions -- -- ============ -- -- None -- -- -- -- References -- -- ========== -- -- Sqlite homepage : http://www.sqlite.org -- -- -- -- Contact -- -- ======= -- -- Error reports shall be handled via http://gnade.sourceforge.net -- -- Features and ideas via: gnade-develop@lists.sourceforge.net -- -- -- -- Author contact: -- -- Ching Bon Lam -- -- -- ------------------------------------------------------------------------------- with Ada.Finalization; with Ada.Strings.Unbounded; with Ada.Unchecked_Deallocation; package GNU.DB.SQLite is type Object is private; type Ptr is access all Object; type File_Mode_Type is (READ, WRITE, READ_WRITE); subtype Ustring is Ada.Strings.Unbounded.Unbounded_String; type Row_Array is array(integer range <>) of Ustring; type Row_Reference is access Row_Array; -- one row of data returned by the callback type Table_Array is array(integer range <>) of Row_Reference; type Table_Reference is access Table_Array; type Table_Controlled is new Ada.Finalization.Controlled with record Table : Table_Reference; end record; -- one table of data returned by 'get_table' type Exec_Callback is access function (argc : integer; argv : Row_Array; columnNames : Row_Array) return integer; -- callback type used for exec_with_callback ---------------- -- exceptions -- ---------------- DB_NOT_OPEN : exception; DB_ALREADY_OPEN : exception; -- SQLITE_OK : exception; -- not an error of course SQLITE_ERROR : exception; SQLITE_INTERNAL : exception; SQLITE_PERM : exception; SQLITE_ABORT : exception; SQLITE_BUSY : exception; SQLITE_LOCKED : exception; SQLITE_NOMEM : exception; SQLITE_READONLY : exception; SQLITE_INTERRUPT : exception; SQLITE_IOERR : exception; SQLITE_CORRUPT : exception; SQLITE_NOTFOUND : exception; SQLITE_FULL : exception; SQLITE_CANTOPEN : exception; SQLITE_PROTOCOL : exception; SQLITE_EMPTY : exception; SQLITE_SCHEMA : exception; SQLITE_TOOBIG : exception; SQLITE_CONSTRAINT : exception; SQLITE_MISMATCH : exception; SQLITE_MISUSE : exception; SQLITE_NOLFS : exception; SQLITE_AUTH : exception; SQLITE_FORMAT : exception; SQLITE_ROW : exception; SQLITE_DONE : exception; UNDEFINED_ERROR : exception; -------------------------- -- primitive operations -- -------------------------- procedure open (db : in out Object; filename : in string; mode : in File_Mode_Type := READ_WRITE; errmsg : out Ustring); -- Opens a DB from a file. If the file is non-existence, it will create -- the file. Raises DB_ALREADY_OPEN if you call it on an open db. -- exceptions: DB_ALREADY_OPEN procedure close (db : in out Object); -- Closes a DB that's open. Raises DB_NOT_OPEN if the db is not open. -- exceptions: DB_NOT_OPEN procedure exec (db : in out Object; sql : in string; errmsg : out Ustring); -- Executes the "sql" query and returns nothing. It's the same as -- exec_with_callback, however, the callback is left out. Most usable -- for queries that doesn't return any result. -- Raises DB_NOT_OPEN when db is not open. Raises SQLITE exceptions when -- there is something wrong with sqlite itself. -- exceptions : DB_NOT_OPEN, all SQLITE exceptions procedure exec_with_callback (db : in out Object; sql : in string; cb : in Exec_Callback; errmsg : out Ustring); -- Does the same as exec, but it calls the callback for the processing of -- the results. -- exceptions : DB_NOT_OPEN, all SQLITE exceptions generic type Data_Type is private; type Exec_Callback_with_data is access function (pArg : Data_Type; argc : integer; argv : Row_Array; columnNames : Row_Array) return integer; procedure exec_with_callback_with_data (db : in out Object; sql : in string; cb : in Exec_Callback_with_data; arg : in out Data_Type; errmsg : out Ustring); -- Does the same as exec_with_callback, but you can pass a datastructure -- with it. -- exceptions : DB_NOT_OPEN, all SQLITE exceptions procedure get_table (db : in out Object; sql : in string; table : out Table_Controlled; errmsg : out Ustring); -- Wrapper around exec_with_callback, it returns a rectangular table with -- each row a Row_Array. -- First row contains the columnNames of the fields. -- Don't forget to call free_table after you are done with table -- exceptions : DB_NOT_OPEN, all SQLITE exceptions private type DB_Type is limited null record; type DB_Access is access all DB_Type; for DB_Access'Storage_Size use 0; pragma Convention (C, DB_Access); type Object is record open : boolean := FALSE; db : DB_Access := null; end record; procedure Initialize (Self : in out Table_Controlled); procedure Finalize (Self : in out Table_Controlled); end GNU.DB.SQLite;gnade-1.6.2.orig/dbi/sqlite/sqlite.gpr0000644000175000017500000000121010027000434017427 0ustar lbrentalbrenta--$Id: sqlite.gpr,v 1.5 2004/03/20 08:30:20 merdmann Exp $ with "../../gnade" ; project SQLite is for Languages use ("Ada"); for Source_Dirs use ("."); for Object_Dir use "."; package Compiler is for Default_Switches ("Ada") use ( "-g", GNADE.IncludeOpt); end Compiler; package Builder is for Default_Switches ("Ada") use ("-s", "-m", "-g", "-gnatQ", GNADE.IncludeOpt); end Builder; package Binder is for Default_Switches ("Ada") use ("-static"); end Binder; package Linker is for Default_Switches ("Ada") use ("-g"); end Linker; end SQLite; gnade-1.6.2.orig/dbi/sqlite3/0000755000175000017500000000000011040716276015523 5ustar lbrentalbrentagnade-1.6.2.orig/dbi/sqlite3/Makefile0000644000175000017500000000707110670340020017154 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/dbi/sqlite3/Makefile,v $ ## Description : Makefile for the SQLite bindigns -- ## Author : Michael Erdmann -- ## Created On : 27-07-2003 -- ## Last Modified By: $Author: persan $ ## Last Modified On: $Date: 2007/09/07 21:18:08 $ -- ## Status : $State: Exp $ -- ## -- ## Copyright (C) 2004 M.Erdmann -- ## -- ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNADE; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## ## Restrictions ## ============ ## None ## ## References ## ========== ## include ../../make.conf # libname=libgnadesqlite3 ## ## ## all build:: $(PREPROCESSED_SOURCES) $(ADAMAKE) -d -p -Pgnade-sqlite.gpr -u ifneq ($(EXPORT),) $(MAKE) install endif ## ## ## install :: ${CP} gnu-db-sqlite3*.ad? ${prefix}/include/gnade/sqlite3 ${CP} lib-obj\lib\* ${prefix}/lib/gnade/sqlite3 ## ## ## distclean clean :: ifeq ($(EXPORT),) $(ADAUINSTALL) $(includedir) $(wildcard $(includedir)/gnu-db-sqlite*.ad* \ $(includedir)/gnu-db-sqlite*.ali) endif $(RM) -rf lib-obj core *~ gnade-1.6.2.orig/dbi/sqlite3/Makefile.sqlite0000644000175000017500000000614610164350272020466 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/dbi/sqlite3/Makefile.sqlite,v $ ## Description : Makefile for the SQLite bindigns -- ## Author : Michael Erdmann -- ## Created On : 27-07-2003 -- ## Last Modified By: $Author: merdmann $ ## Last Modified On: $Date: 2004/12/28 21:31:38 $ -- ## Status : $State: Exp $ -- ## -- ## Copyright (C) 2003 M.Erdmann -- ## -- ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNADE; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## ## Restrictions ## ============ ## None ## ## References ## ========== ## all build: $(MAKE) -C./ $@ gnade-1.6.2.orig/dbi/sqlite3/README0000644000175000017500000000061710664457425016420 0ustar lbrentalbrentaThis directory contains bindings to sqlite3 (http://www.sqlite.org). Tested succesfully: * Windows XP/GNAT GPL 2007 * Windows XP/GNATPro 6.1.0w (20070515-41) To use it under windows, download the def and dll files from the website of sqlite. * copy sqlite3.exe and sqlite3.dll to ${GNAT_ROOT}/bin * copy sqlite3.exe sqlite3.dll to ${GNAT_ROOT}/lib Per Samdberg (per.sandberg@bredband.net) gnade-1.6.2.orig/dbi/sqlite3/gnade-sqlite.gpr0000644000175000017500000000157010664033261020612 0ustar lbrentalbrenta--$Id: gnade-sqlite.gpr,v 1.2 2007/08/25 14:03:29 persan Exp $ with "../../gnade" ; with "../../support/gnade-support" ; Project Gnade.SQLite is for Languages use ("Ada"); for Source_Dirs use ("."); for Object_Dir use "."; for Object_Dir use "lib-obj"; for Library_Kind use "Static"; for Library_Dir use Project'Object_Dir & "/lib"; for Library_Name use "gnadesqlite3"; package Builder is for Default_Switches ("Ada") use GNADE.Compiler'Default_Switches ("Ada"); end Builder; package Compiler is for Default_Switches ("Ada") use GNADE.Compiler'Default_Switches ("Ada"); end Compiler; package Binder is for Default_Switches ("Ada") use GNADE.Binder'Default_Switches ("Ada"); end Binder; package Linker is for Default_Switches ("Ada") use GNADE.Linker'Default_Switches ("Ada"); end Linker; end Gnade.SQLite; gnade-1.6.2.orig/dbi/sqlite3/gnu-db-sqlite3.adb0000644000175000017500000011041310670337037020733 0ustar lbrentalbrenta-- with Ada.Text_IO; with Interfaces.C; with Interfaces.C.Strings; with Interfaces.C.Pointers; with System; with Ada.Exceptions; package body GNU.DB.SQLite3 is package C renames Interfaces.C; package CS renames Interfaces.C.Strings; ---------------------------------------------------------------------------- -- local support ----------------------------------------------------------- ---------------------------------------------------------------------------- package C_Wide_Strings is new C.Pointers (C.size_t, C.wchar_t, C.wchar_array, C.wide_nul); package CWS renames C_Wide_Strings; function To_Ada (Thing : CWS.Pointer) return Wide_String is begin return C.To_Ada (CWS.Value (Thing)); end To_Ada; pragma Inline (To_Ada); function To_Ada (Thing : CS.chars_ptr) return String is begin return CS.Value (Thing); end To_Ada; pragma Inline (To_Ada); function To_C (Thing : Wide_String) return C.wchar_array is begin return C.To_C (Thing) (0 .. C.size_t (Thing'Length)); end To_C; pragma Inline (To_C); type Error_Description is record Id : Ada.Exceptions.Exception_Id; Code : Return_Value; Msg : access String; end record; Retcode_2_Exception_Map : constant array (Return_Value) of Error_Description := (SQLITE_OK => (Ada.Exceptions.Null_Id, SQLITE_OK, new String'("")), SQLITE_ERROR => (SQLITE_Exception'Identity, SQLITE_ERROR, new String'("SQL error or missing database")), SQLITE_INTERNAL => (SQLITE_Exception'Identity, SQLITE_ERROR, new String'("SQL error or missing database")), SQLITE_PERM => (SQLITE_Exception'Identity, SQLITE_ERROR, new String'("SQL error or missing database")), SQLITE_ABORT => (SQLITE_Exception'Identity, SQLITE_ERROR, new String'("SQL error or missing database")), SQLITE_BUSY => (SQLITE_Exception'Identity, SQLITE_ERROR, new String'("SQL error or missing database")), SQLITE_LOCKED => (SQLITE_Exception'Identity, SQLITE_ERROR, new String'("SQL error or missing database")), SQLITE_NOMEM => (Storage_Error'Identity, SQLITE_ERROR, new String'("SQL error or missing database")), SQLITE_READONLY => (SQLITE_Exception'Identity, SQLITE_ERROR, new String'("SQL error or missing database")), SQLITE_INTERRUPT => (SQLITE_Exception'Identity, SQLITE_ERROR, new String'("SQL error or missing database")), SQLITE_IOERR => (SQLITE_Exception'Identity, SQLITE_ERROR, new String'("SQL error or missing database")), SQLITE_CORRUPT => (SQLITE_Exception'Identity, SQLITE_ERROR, new String'("SQL error or missing database")), SQLITE_NOTFOUND => (SQLITE_Exception'Identity, SQLITE_ERROR, new String'("SQL error or missing database")), SQLITE_FULL => (SQLITE_Exception'Identity, SQLITE_ERROR, new String'("SQL error or missing database")), SQLITE_CANTOPEN => (SQLITE_Exception'Identity, SQLITE_ERROR, new String'("SQL error or missing database")), SQLITE_PROTOCOL => (SQLITE_Exception'Identity, SQLITE_ERROR, new String'("SQL error or missing database")), SQLITE_EMPTY => (SQLITE_Exception'Identity, SQLITE_ERROR, new String'("SQL error or missing database")), SQLITE_SCHEMA => (SQLITE_Exception'Identity, SQLITE_ERROR, new String'("SQL error or missing database")), SQLITE_TOOBIG => (SQLITE_Exception'Identity, SQLITE_ERROR, new String'("SQL error or missing database")), SQLITE_CONSTRAINT => (SQLITE_Exception'Identity, SQLITE_ERROR, new String'("SQL error or missing database")), SQLITE_MISMATCH => (SQLITE_Exception'Identity, SQLITE_ERROR, new String'("SQL error or missing database")), SQLITE_MISUSE => (SQLITE_Exception'Identity, SQLITE_ERROR, new String'("SQL error or missing database")), SQLITE_NOLFS => (SQLITE_Exception'Identity, SQLITE_ERROR, new String'("SQL error or missing database")), SQLITE_AUTH => (SQLITE_Exception'Identity, SQLITE_ERROR, new String'("SQL error or missing database")), SQLITE_FORMAT => (SQLITE_Exception'Identity, SQLITE_ERROR, new String'("SQL error or missing database")), SQLITE_RANGE => (SQLITE_Exception'Identity, SQLITE_ERROR, new String'("SQL error or missing database")), SQLITE_NOTADB => (SQLITE_Exception'Identity, SQLITE_ERROR, new String'("SQL error or missing database")), SQLITE_ROW => (SQLITE_Exception'Identity, SQLITE_ERROR, new String'("SQL error or missing database")), SQLITE_DONE => (SQLITE_Exception'Identity, SQLITE_ERROR, new String'("SQL error or missing database")), UNDEFINED_ERROR => (SQLITE_Exception'Identity, SQLITE_ERROR, new String'("SQL error or missing database"))); procedure Retcode_2_Exception (Code : Return_Value; Info : String := "") is begin if Code /= SQLITE_OK then Ada.Exceptions.Raise_Exception (Retcode_2_Exception_Map (Code).Id, "[" & Code'Img & "] " & Retcode_2_Exception_Map (Code).Msg.all & " " & Info); end if; end Retcode_2_Exception; function Int_To_Ret_Val (Rc : Integer) return Return_Value is begin case Rc is when 0 => return SQLITE_OK; when 1 => return SQLITE_ERROR; when 2 => return SQLITE_INTERNAL; when 3 => return SQLITE_PERM; when 4 => return SQLITE_ABORT; when 5 => return SQLITE_BUSY; when 6 => return SQLITE_LOCKED; when 7 => return SQLITE_NOMEM; when 8 => return SQLITE_READONLY; when 9 => return SQLITE_INTERRUPT; when 10 => return SQLITE_IOERR; when 11 => return SQLITE_CORRUPT; when 12 => return SQLITE_NOTFOUND; when 13 => return SQLITE_FULL; when 14 => return SQLITE_CANTOPEN; when 15 => return SQLITE_PROTOCOL; when 16 => return SQLITE_EMPTY; when 17 => return SQLITE_SCHEMA; when 18 => return SQLITE_TOOBIG; when 19 => return SQLITE_CONSTRAINT; when 20 => return SQLITE_MISMATCH; when 21 => return SQLITE_MISUSE; when 22 => return SQLITE_NOLFS; when 23 => return SQLITE_AUTH; when 24 => return SQLITE_FORMAT; when 25 => return SQLITE_RANGE; when 26 => return SQLITE_NOTADB; when 100 => return SQLITE_ROW; when 101 => return SQLITE_DONE; when others => return UNDEFINED_ERROR; end case; end Int_To_Ret_Val; function Int_To_Ret_Val (int : C.int) return Return_Value is begin return Int_To_Ret_Val (Integer (int)); end Int_To_Ret_Val; -- pragma Import(C, SQLITE_STATIC, "SQLITE_STATIC"); ---------------------------------------------------------------------------- -- body -------------------------------------------------------------------- ---------------------------------------------------------------------------- ----------------- -- bind_double -- ----------------- function Bind_Double (Stmt : access Statement; N : Integer; D : Long_Float) return Return_Value is function Sqlite3_Bind_Double (Stmt : Stmt_Access; N : C.int; D : C.double) return C.int; pragma Import (C, Sqlite3_Bind_Double, "sqlite3_bind_double"); -- sqlite3.h:627 -- int sqlite3_bind_double(sqlite3_stmt*, int, double); begin return Int_To_Ret_Val (Sqlite3_Bind_Double (Stmt.Stmt, C.int (N), C.double (D))); end Bind_Double; -------------- -- bind_int -- -------------- function Bind_Int (Stmt : access Statement; N : Integer; I : Integer) return Return_Value is function Sqlite3_Bind_Int (Stmt : Stmt_Access; N : C.int; I : C.int) return C.int; pragma Import (C, Sqlite3_Bind_Int, "sqlite3_bind_int"); -- sqlite3.h:628 -- int sqlite3_bind_int(sqlite3_stmt*, int, int); begin return Int_To_Ret_Val (Sqlite3_Bind_Int (Stmt.Stmt, C.int (N), C.int (I))); end Bind_Int; ---------------- -- bind_int64 -- ---------------- function Bind_Int64 (Stmt : access Statement; N : Integer; I : Int64) return Return_Value is function Sqlite3_Bind_Int64 (Stmt : Stmt_Access; N : C.int; I : Int64) return C.int; pragma Import (C, Sqlite3_Bind_Int64, "sqlite3_bind_int64"); -- sqlite3.h:629 -- int sqlite3_bind_int64(sqlite3_stmt*, int, sqlite_int64); begin return Int_To_Ret_Val (Sqlite3_Bind_Int64 (Stmt.Stmt, C.int (N), I)); end Bind_Int64; --------------- -- bind_null -- --------------- function Bind_Null (Stmt : access Statement; N : Integer) return Return_Value is function Sqlite3_Bind_Null (Stmt : Stmt_Access; N : C.int) return C.int; pragma Import (C, Sqlite3_Bind_Null, "sqlite3_bind_null"); -- sqlite3.h:630 -- int sqlite3_bind_null(sqlite3_stmt*, int); begin return Int_To_Ret_Val (Sqlite3_Bind_Null (Stmt.Stmt, C.int (N))); end Bind_Null; --------------- -- bind_text -- --------------- function Bind_Text (Stmt : access Statement; N : Integer; T : String) return Return_Value is function Sqlite3_Bind_Text (Stmt : Stmt_Access; N : C.int; T : C.char_array; N2 : C.int; A : System.Address) return C.int; pragma Import (C, Sqlite3_Bind_Text, "sqlite3_bind_text"); -- sqlite3.h:631 -- int sqlite3_bind_text(sqlite3_stmt*, int, const char*, int n, void(*)(void*)); begin return Int_To_Ret_Val (Sqlite3_Bind_Text ( Stmt.Stmt, C.int (N), C.To_C (T), 0, System.Null_Address --SQLITE_STATIC )); end Bind_Text; ----------------- -- bind_text16 -- ----------------- function Bind_Text16 (Stmt : access Statement; N : Integer; T : Wide_String) return Return_Value is function Sqlite3_Bind_Text16 (Stmt : Stmt_Access; N : C.int; T : C.wchar_array; N2 : C.int; A : System.Address) return C.int; pragma Import (C, Sqlite3_Bind_Text16, "sqlite3_bind_text16"); -- sqlite3.h:632 -- int sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*)); begin return Int_To_Ret_Val (Sqlite3_Bind_Text16 ( Stmt.Stmt, C.int (N), To_C (T), 0, System.Null_Address )); end Bind_Text16; ----------- -- close -- ----------- function Close (Self : access Object) return Return_Value is function Sqlite3_Close (Db : DB_Access) return C.int; pragma Import (C, Sqlite3_Close, "sqlite3_close"); -- sqlite3.h:75 -- int sqlite3_close(sqlite3 *); Return_Code : Return_Value; begin Return_Code := Int_To_Ret_Val (Sqlite3_Close (Self.Db)); if (Return_Code = SQLITE_OK) then Self.Db := null; end if; return Return_Code; end Close; procedure Close (Self : access Object) is begin Retcode_2_Exception (Self.Close); end Close; ------------- -- Changes -- ------------- function Changes (Self : access Object) return Integer is function Sqlite3_Changes (Db : DB_Access) return C.int; pragma Import (C, Sqlite3_Changes, "sqlite3_changes"); -- sqlite3.h:194 -- int sqlite3_changes(sqlite3*); begin return Integer (Sqlite3_Changes (Self.Db)); end Changes; ------------------ -- column_count -- ------------------ function Column_Count (Stmt : access Statement) return Integer is function Sqlite3_Column_Count (Stmt : Stmt_Access) return C.int; pragma Import (C, Sqlite3_Column_Count, "sqlite3_column_count"); -- sqlite3.h:661 -- int sqlite3_column_count(sqlite3_stmt *pStmt); begin return Integer (Sqlite3_Column_Count (Stmt.Stmt)); end Column_Count; ------------------ -- column_count -- ------------------ function Column_Count (Self : Table_Reference; Row : Natural) return Natural is use String_Vectors; use String_Tables; begin if Row <= Row_Count (Self) then return Natural (Length (Element (Self.all, Row))); end if; return 0; end Column_Count; --------------------- -- column_decltype -- --------------------- function Column_Decltype (Stmt : access Statement; ICol : Integer) return String is function Sqlite3_Column_Decltype (Stmt : Stmt_Access; ICol : C.int) return CS.chars_ptr; pragma Import (C, Sqlite3_Column_Decltype, "sqlite3_column_decltype"); -- sqlite3.h:690 -- const char *sqlite3_column_decltype(sqlite3_stmt *, int i); begin return To_Ada (Sqlite3_Column_Decltype (Stmt.Stmt, C.int (ICol))); end Column_Decltype; ----------------------- -- column_decltype16 -- ----------------------- function Column_Decltype16 (Stmt : access Statement; ICol : Integer) return Wide_String is function Sqlite3_Column_Decltype16 (Stmt : Stmt_Access; ICol : C.int) return CWS.Pointer; pragma Import (C, Sqlite3_Column_Decltype16, "sqlite3_column_decltype16"); -- sqlite3.h:710 -- const void *sqlite3_column_decltype16(sqlite3_stmt*,int); begin return To_Ada (Sqlite3_Column_Decltype16 (Stmt.Stmt, C.int (ICol))); end Column_Decltype16; ---------------- -- column_int -- ---------------- function Column_Int (Stmt : access Statement; ICol : Integer) return Integer is function Sqlite3_Column_Int (Stmt : Stmt_Access; ICol : C.int) return C.int; pragma Import (C, Sqlite3_Column_Int, "sqlite3_column_int"); -- sqlite3.h:828 -- int sqlite3_column_int(sqlite3_stmt*, int iCol); begin return Integer (Sqlite3_Column_Int (Stmt.Stmt, C.int (ICol))); end Column_Int; ----------------- -- column_text -- ----------------- function Column_Text (Stmt : access Statement; ICol : Integer) return String is function Sqlite3_Column_Text (Stmt : Stmt_Access; ICol : C.int) return CS.chars_ptr; pragma Import (C, Sqlite3_Column_Text, "sqlite3_column_text"); -- sqlite3.h:830 -- const unsigned char *sqlite3_column_text(sqlite3_stmt*, int iCol); begin return To_Ada (Sqlite3_Column_Text (Stmt.Stmt, C.int (ICol))); end Column_Text; ------------------- -- column_text16 -- ------------------- function Column_Text16 (Stmt : access Statement; ICol : Integer) return Wide_String is function Sqlite3_Column_Text16 (Stmt : Stmt_Access; ICol : C.int) return CWS.Pointer; pragma Import (C, Sqlite3_Column_Text16, "sqlite3_column_text16"); -- sqlite3.h:831 -- const void *sqlite3_column_text16(sqlite3_stmt*, int iCol); begin return To_Ada (Sqlite3_Column_Text16 (Stmt.Stmt, C.int (ICol))); end Column_Text16; ----------------- -- column_name -- ----------------- function Column_Name (Stmt : access Statement; ICol : Integer) return String is function Sqlite3_Column_Name (Stmt : Stmt_Access; ICol : C.int) return CS.chars_ptr; pragma Import (C, Sqlite3_Column_Name, "sqlite3_column_name"); -- sqlite3.h:669 -- const char *sqlite3_column_name(sqlite3_stmt*,int); begin return To_Ada (Sqlite3_Column_Name (Stmt.Stmt, C.int (ICol))); end Column_Name; ------------------- -- column_name16 -- ------------------- function Column_Name16 (Stmt : access Statement; ICol : Integer) return Wide_String is function Sqlite3_Column_Name16 (Stmt : Stmt_Access; ICol : C.int) return CWS.Pointer; pragma Import (C, Sqlite3_Column_Name16, "sqlite3_column_name16"); -- sqlite3.h:670 -- const void *sqlite3_column_name16(sqlite3_stmt*,int); begin return To_Ada (Sqlite3_Column_Name16 (Stmt.Stmt, C.int (ICol))); end Column_Name16; ----------------- -- column_type -- ----------------- function Column_Type (Stmt : access Statement; ICol : Integer) return Integer is function Sqlite3_Column_Type (Stmt : Stmt_Access; ICol : C.int) return C.int; pragma Import (C, Sqlite3_Column_Type, "sqlite3_column_type"); -- sqlite3.h:832 -- int sqlite3_column_type(sqlite3_stmt*, int iCol); begin return Integer (Sqlite3_Column_Type (Stmt.Stmt, C.int (ICol))); end Column_Type; -------------- -- Complete -- -------------- function Complete (Sql : String) return Boolean is function Sqlite3_Complete (Sql : C.char_array) return C.int; pragma Import (C, Sqlite3_Complete, "sqlite3_complete"); -- sqlite3.h:233 -- int sqlite3_complete(const char *sql); begin if (Integer (Sqlite3_Complete (C.To_C (Sql))) = 0) then return False; else return True; end if; end Complete; ---------------- -- Complete16 -- ---------------- function Complete16 (Sql : Wide_String) return Boolean is function Sqlite3_Complete16 (Sql : C.wchar_array) return C.int; pragma Import (C, Sqlite3_Complete16, "sqlite3_complete16"); -- sqlite3.h:234 -- int sqlite3_complete16(const void *sql); begin if (Integer (Sqlite3_Complete16 (C.To_C (Sql))) = 0) then return False; else return True; end if; end Complete16; ---------------- -- data_count -- ---------------- function Data_Count (Stmt : access Statement) return Integer is function Sqlite3_Data_Count (Stmt : Stmt_Access) return C.int; pragma Import (C, Sqlite3_Data_Count, "sqlite3_data_count"); -- sqlite3.h:755 -- int sqlite3_data_count(sqlite3_stmt *pStmt); begin return Integer (Sqlite3_Data_Count (Stmt.Stmt)); end Data_Count; ------------- -- element -- ------------- function Element (Self : Table_Reference; Row : Natural; Col : Natural) return String is use String_Tables; use String_Vectors; begin return Element (Element (Self.all, Row), Col); end Element; --------------- -- element16 -- --------------- function Element16 (Self : Table16_Reference; Row : Natural; Col : Natural) return Wide_String is use Wide_String_Tables; use Wide_String_Vectors; begin return Element (Element (Self.all, Row), Col); end Element16; ------------- -- errcode -- ------------- function Errcode (Self : access Object) return Integer is function Sqlite3_Errcode (Db : DB_Access) return C.int; pragma Import (C, Sqlite3_Errcode, "sqlite3_errcode"); -- sqlite3.h:528 -- int sqlite3_errcode(sqlite3 *db); begin return Integer (Sqlite3_Errcode (Self.Db)); end Errcode; ------------ -- errmsg -- ------------ function Errmsg (Self : access Object) return String is function Sqlite3_Errmsg (Db : DB_Access) return CS.chars_ptr; pragma Import (C, Sqlite3_Errmsg, "sqlite3_errmsg"); -- sqlite3.h:538 -- const char *sqlite3_errmsg(sqlite3*); begin return To_Ada (Sqlite3_Errmsg (Self.Db)); end Errmsg; -------------- -- errmsg16 -- -------------- function Errmsg16 (Self : access Object) return Wide_String is function Sqlite3_Errmsg16 (Db : DB_Access) return CWS.Pointer; pragma Import (C, Sqlite3_Errmsg16, "sqlite3_errmsg16"); -- sqlite3.h:548 -- const void *sqlite3_errmsg16(sqlite3*); begin return To_Ada (Sqlite3_Errmsg16 (Self.Db)); end Errmsg16; ---------- -- exec -- ---------- function Exec (Self : access Object; Sql : String; Cb : Callback) return Return_Value is function Proxy (PArg : Handle; Argc : Integer; Argv : String_Vectors.Vector; ColumnNames : String_Vectors.Vector) return Return_Value is pragma Unreferenced (PArg); begin return Cb (Argc - 1, Argv, ColumnNames); end Proxy; pragma Inline (Proxy); package Real_Exec is new Generic_Exec (Object, Handle); begin return Real_Exec.Exec (Self, Sql, Proxy'Access, null); end Exec; procedure Exec (Self : access Object; Sql : String; Cb : Callback) is begin Retcode_2_Exception (Self.Exec (Sql, Cb)); end Exec; ------------ -- exec16 -- ------------ function Exec16 (Self : access Object; Sql : Wide_String; Cb : Callback16) return Return_Value is function Proxy (PArg : Handle; Argc : Integer; Argv : Wide_String_Vectors.Vector; ColumnNames : Wide_String_Vectors.Vector) return Return_Value is pragma Unreferenced (PArg); begin return Cb (Argc, Argv, ColumnNames); end Proxy; pragma Inline (Proxy); package Real_Exec16 is new Generic_Exec16 (Object, Handle); begin return Real_Exec16.Exec16 (Self, Sql, Proxy'Access, null); end Exec16; ---------- -- exec -- ---------- function Exec (Self : access Object; Sql : String) return Return_Value is function Nothing (Argc : Integer; Argv : String_Vectors.Vector; ColumnNames : String_Vectors.Vector) return Return_Value is pragma Unreferenced (Argc, Argv, ColumnNames); begin return SQLITE_OK; end Nothing; pragma Inline (Nothing); begin return Exec (Self, Sql, Nothing'Unrestricted_Access); end Exec; procedure Exec (Self : access Object; Sql : String) is begin Retcode_2_Exception (Self.Exec (Sql), Sql); end Exec; ------------ -- exec16 -- ------------ function Exec16 (Self : access Object; Sql : Wide_String) return Return_Value is function Nothing (Argc : Integer; Argv : Wide_String_Vectors.Vector; ColumnNames : Wide_String_Vectors.Vector) return Return_Value is pragma Unreferenced (Argc, Argv, ColumnNames); begin return SQLITE_OK; end Nothing; pragma Inline (Nothing); begin return Exec16 (Self, Sql, Nothing'Unrestricted_Access); end Exec16; -------------- -- finalize -- -------------- function Finalize (Stmt : access Statement) return Return_Value is function Sqlite3_Finalize (Stmt : Stmt_Access) return C.int; pragma Import (C, Sqlite3_Finalize, "sqlite3_finalize"); -- sqlite3.h:848 -- int sqlite3_finalize(sqlite3_stmt *pStmt); begin return Int_To_Ret_Val (Sqlite3_Finalize (Stmt.Stmt)); end Finalize; procedure Finalize (Stmt : access Statement) is begin Retcode_2_Exception (Stmt.Finalize); end Finalize; ------------------ -- Generic_Exec -- ------------------ package body Generic_Exec is use String_Vectors; function Exec (Self : access Object; Sql : String; Cb : Callback; Arg : Data_Handle) return Return_Value is St : aliased Statement; RSt : constant Statement_Reference := St'Unrestricted_Access; Rc : Return_Value; Vals : String_Vectors.Vector; Cols : String_Vectors.Vector; NCol : Integer; Cols_Done : Boolean := False; begin Rc := Prepare (Self, Sql, RSt); if not (Rc = SQLITE_OK) then return Rc; end if; NCol := Column_Count (RSt); loop Rc := Step (RSt); if (Rc = SQLITE_ROW) then Clear (Vals); if not Cols_Done then for I in 0 .. (NCol - 1) loop Append (Cols, Column_Name (RSt, I)); end loop; Cols_Done := True; end if; for I in 0 .. (NCol - 1) loop Append (Vals, Column_Text (RSt, I)); end loop; Rc := Cb (Arg, NCol, Vals, Cols); if not (Rc = SQLITE_OK) then Rc := Finalize (RSt); Rc := SQLITE_ABORT; exit; end if; else Rc := Finalize (RSt); exit; end if; end loop; return Rc; end Exec; end Generic_Exec; -------------------- -- Generic_Exec16 -- -------------------- package body Generic_Exec16 is use Wide_String_Vectors; function Exec16 (Self : access Object; Sql : Wide_String; Cb : Callback16; Arg : Data_Handle) return Return_Value is St : aliased Statement; RSt : constant Statement_Reference := St'Unrestricted_Access; Rc : Return_Value; Vals : Wide_String_Vectors.Vector; Cols : Wide_String_Vectors.Vector; NCol : Integer; Cols_Done : Boolean := False; begin Rc := Prepare16 (Self, Sql, RSt); if not (Rc = SQLITE_OK) then return Rc; end if; NCol := Column_Count (RSt); loop Rc := Step (RSt); if (Rc = SQLITE_ROW) then Clear (Vals); if not Cols_Done then for I in 0 .. (NCol - 1) loop Append (Cols, Column_Name16 (RSt, I)); end loop; Cols_Done := True; end if; for I in 0 .. (NCol - 1) loop Append (Vals, Column_Text16 (RSt, I)); end loop; Rc := Cb (Arg, NCol, Vals, Cols); if not (Rc = SQLITE_OK) then Rc := Finalize (RSt); Rc := SQLITE_ABORT; exit; end if; else Rc := Finalize (RSt); exit; end if; end loop; return Rc; end Exec16; end Generic_Exec16; --------------- -- Get_Table -- --------------- function Get_Table (Self : access Object; Sql : String; Table : Table_Reference) return Return_Value is use String_Tables; use String_Vectors; package Tables_Exec is new Generic_Exec (String_Tables.Vector, Table_Reference); function Build_Table (PArg : Table_Reference; Argc : Integer; Argv : String_Vectors.Vector; ColumnNames : String_Vectors.Vector) return Return_Value is pragma Unreferenced (Argc); begin if Is_Empty (PArg.all) then Append (PArg.all, ColumnNames); end if; Append (PArg.all, Argv); return SQLITE_OK; end Build_Table; begin Clear (Table.all); return Tables_Exec.Exec (Self, Sql, Build_Table'Unrestricted_Access, Table); end Get_Table; ----------------- -- Get_Table16 -- ----------------- function Get_Table16 (Self : access Object; Sql : Wide_String; Table : Table16_Reference) return Return_Value is use Wide_String_Tables; use Wide_String_Vectors; package Tables16_Exec16 is new Generic_Exec16 (Wide_String_Tables.Vector, Table16_Reference); function Build_Table16 (PArg : Table16_Reference; Argc : Integer; Argv : Wide_String_Vectors.Vector; ColumnNames : Wide_String_Vectors.Vector) return Return_Value is pragma Unreferenced (Argc); begin if Is_Empty (PArg.all) then Append (PArg.all, ColumnNames); end if; Append (PArg.all, Argv); return SQLITE_OK; end Build_Table16; begin Clear (Table.all); return Tables16_Exec16.Exec16 (Self, Sql, Build_Table16'Unrestricted_Access, Table); end Get_Table16; --------------- -- Interrupt -- --------------- procedure Interrupt (Self : access Object) is procedure Sqlite3_Interrupt (Db : DB_Access); pragma Import (C, Sqlite3_Interrupt, "sqlite3_interrupt"); -- sqlite3.h:220 -- void sqlite3_interrupt(sqlite3*); begin Sqlite3_Interrupt (Self.Db); end Interrupt; ----------------------- -- Last_Insert_Rowid -- ----------------------- function Last_Insert_Rowid (Self : access Object) return Uint64 is function Sqlite3_Last_Insert_Rowid (Db : DB_Access) return Uint64; pragma Import (C, Sqlite3_Last_Insert_Rowid, "sqlite3_last_insert_rowid"); -- sqlite3.h:172 -- sqlite_int64 sqlite3_last_insert_rowid(sqlite3*); begin return Sqlite3_Last_Insert_Rowid (Self.Db); end Last_Insert_Rowid; ---------- -- open -- ---------- function Open (Self : access Object; Filename : String) return Return_Value is function Sqlite3_Open (Filename : C.char_array; DB_Handle : access DB_Access) return C.int; pragma Import (C, Sqlite3_Open, "sqlite3_open"); -- sqlite3.h:504 -- int sqlite3_open( -- const char *filename, /* Database filename (UTF-8) */ -- sqlite3 **ppDb /* OUT: SQLite db handle */ -- ); begin return Int_To_Ret_Val (Sqlite3_Open (C.To_C (Filename), Self.all.Db'Unchecked_Access)); end Open; procedure Open (Self : access Object; Filename : String) is begin Retcode_2_Exception (Self.Open (Filename)); end Open; ------------ -- open16 -- ------------ function Open16 (Self : access Object; Filename : Wide_String) return Return_Value is function Sqlite3_Open16 (Filename : C.wchar_array; DB_Handle : access DB_Access) return C.int; pragma Import (C, Sqlite3_Open16, "sqlite3_open16"); -- sqlite3.h:508 -- int sqlite3_open16( -- const void *filename, /* Database filename (UTF-16) */ -- sqlite3 **ppDb /* OUT: SQLite db handle */ -- ); begin return Int_To_Ret_Val (Sqlite3_Open16 (To_C (Filename), Self.Db'Access)); end Open16; ------------- -- prepare -- ------------- function Prepare (Self : access Object; Sql : String; Stmt : Statement_Reference) return Return_Value is function Sqlite3_Prepare (Db : DB_Access; ZSql : C.char_array; NBytes : C.int; PpStmt : access Stmt_Access; PzTail : System.Address) return C.int; pragma Import (C, Sqlite3_Prepare, "sqlite3_prepare"); -- sqlite3.h:581 -- int sqlite3_prepare( -- sqlite3 *db, /* Database handle */ -- const char *zSql, /* SQL statement, UTF-8 encoded */ -- int nBytes, /* Length of zSql in bytes. */ -- sqlite3_stmt **ppStmt, /* OUT: Statement handle */ -- const char **pzTail /* OUT: Pointer to unused portion of zSql */ -- ); begin return Int_To_Ret_Val (Sqlite3_Prepare (Self.Db, C.To_C (Sql), C.int (-1), Stmt.Stmt'Access, System.Null_Address) ); end Prepare; procedure Prepare (Self : access Object; Sql : String; Stmt : Statement_Reference) is begin Retcode_2_Exception (Prepare (Self, Sql, Stmt), Sql); end Prepare; --------------- -- prepare16 -- --------------- function Prepare16 (Self : access Object; Sql : Wide_String; Stmt : Statement_Reference) return Return_Value is function Sqlite3_Prepare16 (Db : DB_Access; ZSql : C.wchar_array; NBytes : C.int; PpStmt : access Stmt_Access; PzTail : System.Address) return C.int; pragma Import (C, Sqlite3_Prepare16, "sqlite3_prepare16"); -- sqlite3.h:588 -- int sqlite3_prepare16( -- sqlite3 *db, /* Database handle */ -- const void *zSql, /* SQL statement, UTF-16 encoded */ -- int nBytes, /* Length of zSql in bytes. */ -- sqlite3_stmt **ppStmt, /* OUT: Statement handle */ -- const void **pzTail /* OUT: Pointer to unused portion of zSql */ -- ); begin return Int_To_Ret_Val (Sqlite3_Prepare16 (Self.Db, To_C (Sql), C.int (-1), Stmt.Stmt'Access, System.Null_Address) ); end Prepare16; ----------- -- Reset -- ----------- function Reset (Stmt : access Statement) return Return_Value is function Sqlite3_Reset (Stmt : Stmt_Access) return C.int; pragma Import (C, Sqlite3_Reset, "sqlite3_reset"); -- sqlite3.h:857 -- int sqlite3_reset(sqlite3_stmt *pStmt); begin return Int_To_Ret_Val (Sqlite3_Reset (Stmt.Stmt)); end Reset; --------------- -- Row_Count -- --------------- function Row_Count (Self : Table_Reference) return Natural is use String_Tables; begin return Natural (Length (Self.all)); end Row_Count; ---------- -- Step -- ---------- function Step (Stmt : access Statement) return Return_Value is function Sqlite3_Step (Stmt : Stmt_Access) return C.int; pragma Import (C, Sqlite3_Step, "sqlite3_step"); -- sqlite3.h:744 -- int sqlite3_step(sqlite3_stmt*); begin return Int_To_Ret_Val (Sqlite3_Step (Stmt.Stmt)); end Step; function Step (Stmt : access Statement) return Boolean is begin return Stmt.Step = SQLITE_OK; end Step; procedure Step (Stmt : access Statement) is begin Retcode_2_Exception (Stmt.Step); end Step; ------------- -- Total_Changes -- ------------- function Total_Changes (Self : access Object) return Integer is function Sqlite3_Total_Changes (Db : DB_Access) return C.int; pragma Import (C, Sqlite3_Total_Changes, "sqlite3_total_changes"); -- sqlite3.h:212 -- int sqlite3_total_changes(sqlite3*); begin return Integer (Sqlite3_Total_Changes (Self.Db)); end Total_Changes; end GNU.DB.SQLite3; gnade-1.6.2.orig/dbi/sqlite3/gnu-db-sqlite3.ads0000644000175000017500000005061510670337037020763 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/dbi/sqlite3/gnu-db-sqlite3.ads,v $ -- Description : SQLite Base Package -- -- Author : Ching Bon Lam -- -- Created : 26.7.2003 -- -- Last Modified By: $Author: persan $ -- -- Last Modified On: $Date: 2007/09/07 21:09:51 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2003 Ching Bon Lam -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Functional Description -- -- ====================== -- -- Thick binding to sqlite (http://www.sqlite.org). -- -- -- -- Restrictions -- -- ============ -- -- None -- -- -- -- References -- -- ========== -- -- Sqlite homepage : http://www.sqlite.org -- -- -- -- Contact -- -- ======= -- -- Error reports shall be handled via http://gnade.sourceforge.net -- -- Features and ideas via: gnade-develop@lists.sourceforge.net -- -- -- -- Author contact: -- -- Ching Bon Lam -- -- -- ------------------------------------------------------------------------------- with GNU.DB.Support.Wide_String_Tables; with GNU.DB.Support.Wide_String_Vectors; with GNU.DB.Support.String_Vectors; with GNU.DB.Support.String_Tables; package GNU.DB.SQLite3 is use GNU.DB.Support; type Object is tagged private; type Handle is access all Object; -- sqlite3.h:47 -- typedef struct sqlite3 sqlite3; ---------------------------------------------------------------------------- -- return values ----------------------------------------------------------- ---------------------------------------------------------------------------- type Return_Value is (-- sqlite3.h:133-161 SQLITE_OK, -- Successful result SQLITE_ERROR, -- SQL error or missing database SQLITE_INTERNAL, -- An internal logic error in SQLite SQLITE_PERM, -- Access permission denied SQLITE_ABORT, -- Callback routine requested an abort SQLITE_BUSY, -- The database file is locked SQLITE_LOCKED, -- A table in the database is locked SQLITE_NOMEM, -- A malloc() failed SQLITE_READONLY, -- Attempt to write a readonly database SQLITE_INTERRUPT, -- Operation terminated by sqlite3_interrupt() SQLITE_IOERR, -- Some kind of disk I/O error occurred SQLITE_CORRUPT, -- The database disk image is malformed SQLITE_NOTFOUND, -- (Internal Only) Table or record not found SQLITE_FULL, -- Insertion failed because database is full SQLITE_CANTOPEN, -- Unable to open the database file SQLITE_PROTOCOL, -- Database lock protocol error SQLITE_EMPTY, -- Database is empty SQLITE_SCHEMA, -- The database schema changed SQLITE_TOOBIG, -- Too much data for one row of a table SQLITE_CONSTRAINT, -- Abort due to contraint violation SQLITE_MISMATCH, -- Data type mismatch SQLITE_MISUSE, -- Library used incorrectly SQLITE_NOLFS, -- Uses OS features not supported on host SQLITE_AUTH, -- Authorization denied SQLITE_FORMAT, -- Auxiliary database format error SQLITE_RANGE, -- 2nd parameter to sqlite3_bind out of range SQLITE_NOTADB, -- File opened that is not a database file SQLITE_ROW, -- sqlite3_step() has another row ready SQLITE_DONE, -- sqlite3_step() has finished executing UNDEFINED_ERROR); ---------------------------------------------------------------------------- -- Other important types --------------------------------------------------- ---------------------------------------------------------------------------- type Statement is tagged private; type Statement_Reference is access all Statement; -- sqlite3.h:554 -- typedef struct sqlite3_stmt sqlite3_stmt; type Uint64 is mod 2 ** 64; type Int64 is range -(2 ** (64 - 1)) .. +(2 ** (64 - 1) - 1); -- sqlite3.h:55 type Callback is access function (Argc : Integer; Argv : String_Vectors.Vector; ColumnNames : String_Vectors.Vector) return Return_Value; type Callback16 is access function (Argc : Integer; Argv : Wide_String_Vectors.Vector; ColumnNames : Wide_String_Vectors.Vector) return Return_Value; type Table_Reference is access all String_Tables.Vector; type Table16_Reference is access all Wide_String_Tables.Vector; ---------------------------------------------------------------------------- -- Basic operations -------------------------------------------------------- ---------------------------------------------------------------------------- function Close (Self : access Object) return Return_Value; procedure Close (Self : access Object); -- sqlite3.h:75 -- int sqlite3_close(sqlite3 *); function Last_Insert_Rowid (Self : access Object) return Uint64; -- sqlite3.h:172 -- sqlite_int64 sqlite3_last_insert_rowid(sqlite3*); function Changes (Self : access Object) return Integer; -- sqlite3.h:194 -- int sqlite3_changes(sqlite3*); function Total_Changes (Self : access Object) return Integer; -- sqlite3.h:212 -- int sqlite3_total_changes(sqlite3*); procedure Interrupt (Self : access Object); -- sqlite3.h:220 -- void sqlite3_interrupt(sqlite3*); function Complete (Sql : String) return Boolean; -- sqlite3.h:233 -- int sqlite3_complete(const char *sql); function Complete16 (Sql : Wide_String) return Boolean; -- sqlite3.h:234 -- int sqlite3_complete16(const void *sql); function Open (Self : access Object; Filename : String) return Return_Value; procedure Open (Self : access Object; Filename : String); -- sqlite3.h:504 -- int sqlite3_open( -- const char *filename, /* Database filename (UTF-8) */ -- sqlite3 **ppDb /* OUT: SQLite db access Object */ -- ); function Open16 (Self : access Object; Filename : Wide_String) return Return_Value; -- sqlite3.h:508 -- int sqlite3_open16( -- const void *filename, /* Database filename (UTF-16) */ -- sqlite3 **ppDb /* OUT: SQLite db access Object */ -- ); ---------------------------------------------------------------------------- -- Exec -------------------------------------------------------------------- ---------------------------------------------------------------------------- generic type Data_Type is private; type Data_Handle is access all Data_Type; package Generic_Exec is type Callback is access function (PArg : Data_Handle; Argc : Integer; Argv : String_Vectors.Vector; ColumnNames : String_Vectors.Vector) return Return_Value; -- sqlite3.h:80 -- typedef int (*sqlite3_callback)(void*,int,char**, char**); function Exec (Self : access Object; Sql : String; Cb : Callback; Arg : Data_Handle) return Return_Value; -- sqlite3.h:122 -- int sqlite3_exec( -- sqlite3*, /* An open database */ -- const char *sql, /* SQL to be executed */ -- sqlite3_callback, /* Callback function */ -- void *, /* 1st argument to callback function */ -- char **errmsg /* Error msg written here */ -- ); end Generic_Exec; generic type Data_Type is private; type Data_Handle is access all Data_Type; package Generic_Exec16 is type Callback16 is access function (PArg : Data_Handle; Argc : Integer; Argv : Wide_String_Vectors.Vector; ColumnNames : Wide_String_Vectors.Vector) return Return_Value; function Exec16 (Self : access Object; Sql : Wide_String; Cb : Callback16; Arg : Data_Handle) return Return_Value; end Generic_Exec16; function Exec (Self : access Object; Sql : String; Cb : Callback) return Return_Value; procedure Exec (Self : access Object; Sql : String; Cb : Callback); function Exec16 (Self : access Object; Sql : Wide_String; Cb : Callback16) return Return_Value; function Exec (Self : access Object; Sql : String) return Return_Value; procedure Exec (Self : access Object; Sql : String); function Exec16 (Self : access Object; Sql : Wide_String) return Return_Value; ---------------------------------------------------------------------------- -- Tables ------------------------------------------------------------------ ---------------------------------------------------------------------------- function Get_Table (Self : access Object; Sql : String; Table : Table_Reference) return Return_Value; function Get_Table16 (Self : access Object; Sql : Wide_String; Table : Table16_Reference) return Return_Value; function Row_Count (Self : Table_Reference) return Natural; function Column_Count (Self : Table_Reference; Row : Natural) return Natural; function Element (Self : Table_Reference; Row : Natural; Col : Natural) return String; function Element16 (Self : Table16_Reference; Row : Natural; Col : Natural) return Wide_String; ---------------------------------------------------------------------------- -- Error stuff ------------------------------------------------------------- ---------------------------------------------------------------------------- function Errcode (Self : access Object) return Integer; -- sqlite3.h:528 -- int sqlite3_errcode(sqlite3 *db); function Errmsg (Self : access Object) return String; -- sqlite3.h:538 -- const char *sqlite3_errmsg(sqlite3*); function Errmsg16 (Self : access Object) return Wide_String; -- sqlite3.h:548 -- const void *sqlite3_errmsg16(sqlite3*); ---------------------------------------------------------------------------- -- Stepping ---------------------------------------------------------------- ---------------------------------------------------------------------------- SQLITE_INTEGER : constant Integer := 1; SQLITE_FLOAT : constant Integer := 2; SQLITE_TEXT : constant Integer := 3; SQLITE_BLOB : constant Integer := 4; SQLITE_NULL : constant Integer := 5; function Prepare (Self : access Object; Sql : String; Stmt : Statement_Reference) return Return_Value; procedure Prepare (Self : access Object; Sql : String; Stmt : Statement_Reference); -- sqlite3.h:581 -- int sqlite3_prepare( -- sqlite3 *db, /* Database handle */ -- const char *zSql, /* SQL statement, UTF-8 encoded */ -- int nBytes, /* Length of zSql in bytes. */ -- sqlite3_stmt **ppStmt, /* OUT: Statement handle */ -- const char **pzTail /* OUT: Pointer to unused portion of zSql */ -- ); function Prepare16 (Self : access Object; Sql : Wide_String; Stmt : Statement_Reference) return Return_Value; -- sqlite3.h:588 -- int sqlite3_prepare16( -- sqlite3 *db, /* Database handle */ -- const void *zSql, /* SQL statement, UTF-16 encoded */ -- int nBytes, /* Length of zSql in bytes. */ -- sqlite3_stmt **ppStmt, /* OUT: Statement handle */ -- const void **pzTail /* OUT: Pointer to unused portion of zSql */ -- ); -- generic -- type Data_Type is private; -- package Blob_Generic is -- function Bind_Blob -- (Stmt : Statement_Reference; -- N : Integer; -- B : Data_Type) -- return Return_Value; -- procedure Bind_Blob -- (Stmt : Statement_Reference; -- N : Integer; -- B : Data_Type); -- -- end Blob_Generic; -- function bind_blob -- (stmt : Statement_Reference; -- N : integer; -- B : something) -- return Return_Value; -- sqlite3.h:626 -- int sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*)); function Bind_Double (Stmt : access Statement; N : Integer; D : Long_Float) return Return_Value; -- sqlite3.h:627 -- int sqlite3_bind_double(sqlite3_stmt*, int, double); function Bind_Int (Stmt : access Statement; N : Integer; I : Integer) return Return_Value; -- sqlite3.h:628 -- int sqlite3_bind_int(sqlite3_stmt*, int, int); function Bind_Int64 (Stmt : access Statement; N : Integer; I : Int64) return Return_Value; -- sqlite3.h:629 -- int sqlite3_bind_int64(sqlite3_stmt*, int, sqlite_int64); function Bind_Null (Stmt : access Statement; N : Integer) return Return_Value; -- sqlite3.h:630 -- int sqlite3_bind_null(sqlite3_stmt*, int); function Bind_Text (Stmt : access Statement; N : Integer; T : String) return Return_Value; -- sqlite3.h:631 -- int sqlite3_bind_text(sqlite3_stmt*, int, const char*, int n, void(*)(void*)); function Bind_Text16 (Stmt : access Statement; N : Integer; T : Wide_String) return Return_Value; -- sqlite3.h:632 -- int sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*)); -- function bind_value -- (stmt : Statement_Reference; -- N : integer; -- V : Value) -- return Return_Value; -- sqlite3.h:633 -- int sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*); function Column_Count (Stmt : access Statement) return Integer; -- sqlite3.h:661 -- int sqlite3_column_count(sqlite3_stmt *pStmt); function Column_Name (Stmt : access Statement; ICol : Integer) return String; -- sqlite3.h:669 -- const char *sqlite3_column_name(sqlite3_stmt*,int); function Column_Name16 (Stmt : access Statement; ICol : Integer) return Wide_String; -- sqlite3.h:670 -- const void *sqlite3_column_name16(sqlite3_stmt*,int); function Column_Decltype (Stmt : access Statement; ICol : Integer) return String; -- sqlite3.h:690 -- const char *sqlite3_column_decltype(sqlite3_stmt *, int i); function Column_Decltype16 (Stmt : access Statement; ICol : Integer) return Wide_String; -- sqlite3.h:710 -- const void *sqlite3_column_decltype16(sqlite3_stmt*,int); function Step (Stmt : access Statement) return Return_Value; function Step (Stmt : access Statement) return Boolean; procedure Step (Stmt : access Statement); -- sqlite3.h:744 -- int sqlite3_step(sqlite3_stmt*); function Data_Count (Stmt : access Statement) return Integer; -- sqlite3.h:755 -- int sqlite3_data_count(sqlite3_stmt *pStmt); function Column_Int (Stmt : access Statement; ICol : Integer) return Integer; -- sqlite3.h:828 -- int sqlite3_column_int(sqlite3_stmt*, int iCol); function Column_Text (Stmt : access Statement; ICol : Integer) return String; -- sqlite3.h:830 --const unsigned char *sqlite3_column_text(sqlite3_stmt*, int iCol); function Column_Text16 (Stmt : access Statement; ICol : Integer) return Wide_String; -- sqlite3.h:831 --const void *sqlite3_column_text16(sqlite3_stmt*, int iCol); function Column_Type (Stmt : access Statement; ICol : Integer) return Integer; -- sqlite3.h:832 -- int sqlite3_column_type(sqlite3_stmt*, int iCol); function Finalize (Stmt : access Statement) return Return_Value; procedure Finalize (Stmt : access Statement); -- sqlite3.h:848 -- int sqlite3_finalize(sqlite3_stmt *pStmt); function Reset (Stmt : access Statement) return Return_Value; -- sqlite3.h:857 -- int sqlite3_reset(sqlite3_stmt *pStmt); ---------------------------------------------------------------------------- -- PRIVATE ----------------------------------------------------------------- ---------------------------------------------------------------------------- SQLITE_Exception : exception; private type DB_Type is limited null record; type DB_Access is access all DB_Type; for DB_Access'Storage_Size use 0; pragma Convention (C, DB_Access); type Object is tagged record Db : aliased DB_Access; end record; -- sqlite3.h:47 -- typedef struct sqlite3 sqlite3; type Stmt_Type is limited null record; type Stmt_Access is access all Stmt_Type; for Stmt_Access'Storage_Size use 0; pragma Convention (C, Stmt_Access); type Statement is tagged record Stmt : aliased Stmt_Access := null; end record; pragma Linker_Options ("-lsqlite3"); end GNU.DB.SQLite3; gnade-1.6.2.orig/doc/0000755000175000017500000000000011040716276014146 5ustar lbrentalbrentagnade-1.6.2.orig/doc/ACT/0000755000175000017500000000000011040716254014551 5ustar lbrentalbrentagnade-1.6.2.orig/doc/ACT/3tier.ap0000644000175000017500000004156507523242426016142 0ustar lbrentalbrenta*BEGIN GRAPHICS VERSION=500/420 ENCODING=7BIT ** "Creator" erdmann ** "Creation Date" Fri Jul 12 20:20:28 2002 ** "Creation Version" 5 (1375) ** "Revisor" erdmann ** "Last Modified" Sat Jul 27 18:58:01 2002 ** "Last Modified Version" 5 (1375) COLORMAP <"Transparent" 0 0 0 0 0 1> <"Black" 0 0 0 0 255 0> <"White" 0 0 0 0 0 0> <"Grey 95" 0 0 0 0 13 0> <"Grey 87" 0 0 0 0 33 0> <"Grey 75" 0 0 0 0 64 0> <"Grey 50" 0 0 0 0 128 0> <"Red" 0 0 255 255 0 0> <"Red 95" 0 13 255 255 0 0> <"Red 87" 0 33 255 255 0 0> <"Red 75" 0 64 255 255 0 0> <"Red 50" 0 128 255 255 0 0> <"Green" 0 255 0 255 0 0> <"Green 95" 0 255 13 255 0 0> <"Green 87" 0 255 33 255 0 0> <"Green 75" 0 255 64 255 0 0> <"Green 50" 0 255 128 255 0 0> <"Blue" 0 255 255 0 0 0> <"Blue 95" 0 255 255 13 0 0> <"Blue 87" 0 255 255 33 0 0> <"Blue 75" 0 255 255 64 0 0> <"Blue 50" 0 255 255 128 0 0> <"Yellow" 0 0 0 255 0 0> <"Yellow 95" 0 0 0 255 13 0> <"Yellow 87" 0 0 0 255 33 0> <"Yellow 75" 0 0 0 255 64 0> <"Yellow 50" 0 0 0 255 128 0> <"Magenta" 0 0 255 0 0 0> <"Magenta 95" 0 0 255 0 13 0> <"Magenta 87" 0 0 255 0 33 0> <"Magenta 75" 0 0 255 0 64 0> <"Magenta 50" 0 0 255 0 128 0> <"Cyan" 0 255 0 0 0 0> <"Cyan 95" 0 255 0 0 13 0> <"Cyan 87" 0 255 0 0 33 0> <"Cyan 75" 0 255 0 0 64 0> <"Cyan 50" 0 255 0 0 128 0> <"Tan" 0 0 57 131 0 0> <"Clay" 0 0 74 74 57 0> <"Brown" 0 30 100 220 30 0> <"Dark Brown" 0 60 135 190 65 0> <"Olive" 0 90 65 190 65 0> <"Light Orange" 0 0 33 255 0 0> <"Orange" 0 0 90 255 0 0> <"Dark Orange" 0 0 132 255 0 0> <"Light Purple" 0 31 153 0 0 0> <"Purple" 0 80 208 0 15 0> <"Dark Purple" 0 25 126 0 44 0> <"PaleYellow" 0 1 0 52 0 0> <"Blau 75" 0 255 255 64 0 0> <"Blau 50" 0 255 255 128 0 0> <"Rot 50" 0 128 255 255 0 0> END COLORMAP FONT "Times" "Zapf Dingbats" "Swiss" "Morewingbats" "Dutch" "Helvetica" "Courier Swa" END FONT HDRFTR FIRST HEADER OFFSET 252 NLINES 0 END HEADER FOOTER OFFSET 252 NLINES 0 END FOOTER END FIRST BASE HEADER OFFSET 252 NLINES 0 END HEADER FOOTER OFFSET 252 NLINES 1 INNER 0 .STR "Michael Erdmann" FONT 5 FORE_COLOR 20 END INNER CENTER 0 .STR "11.7.2002" END CENTER OUTER 0 .STR "Page #p" SIZE 100000 END OUTER END FOOTER END BASE EVEN HEADER OFFSET 252 NLINES 0 END HEADER FOOTER OFFSET 252 NLINES 0 END FOOTER END EVEN FINAL HEADER OFFSET 252 NLINES 0 END HEADER FOOTER OFFSET 252 NLINES 0 END FOOTER END FINAL END HDRFTR SESSION WIN_SIZE <15107 11640> VIEW <0 0 0 1 1 0> GRID_DPI 1000 GRID_FACTOR 394 UNITS <394 2 "cm"> PAGEZEROS <394 -106> PAGEWID 11693 PAGEHYT 8268 PRINTWID 11693 PRINTHYT 8268 PRINTLAND ON PRINTMARG <602 201 602 201> PRINTMARKS <1 0 0> SLIDE_STYLE <0 -1 1> BACKFILL <34 2 5 1000 0 0 0> LINEFILL <21 21 5 1000 0 0 0> SHADOW <11 0 15 15> R_ARROW 1 V_SPACE <0 500 0> FONT 2 SIZE 360000 L_SPACE 500 MARGINS <250 250 500 125> REZ <1 1291 1291 -399 -769> END SESSION PART "Source File" .GRP R_ARROW 0 .POL AT (4148,2565) RECOLOR ON PARA <0 0 0 0 1000 34 0 111> PNTS (394,0)(0,788)(1182,788)(1576,0)(394,0) END .GRP SLIDE_INFO SLIDE_STYLE <0 -1 1> END SLIDE_INFO PICTURE .RECT AT (8086,2174) RECOLOR ON R_ARROW 1 PNTS (0,0)(1576,0)(1576,2363)(0,2363)(0,0) .POL AT (2253,1775) RECOLOR ON R_ARROW 0 PNTS (0,0)(4335,0)(4335,4334)(0,4334)(0,0) .POL AT (2645,2170) RECOLOR ON BACKFILL <12 2 5 1000 0 0 0> PNTS (0,0)(788,0)(788,394)(0,394)(0,0) .RECT AT (2645,2958) RECOLOR ON BACKFILL <23 2 5 1000 0 0 0> R_ARROW 1 PNTS (0,0)(788,0)(788,1576)(0,1576)(0,0) .RECT AT (4134,2925) RECOLOR ON PNTS (0,0)(1970,0)(1970,1620)(0,1620)(0,0) .LINE AT (3039,4534) RECOLOR ON BACKFILL <34 2 5 1000 0 0 0> PNTS (0,0)(0,394) .TXT AT (3733,1385) RECOLOR ON BACKFILL <20 20 5 1000 0 0 0> THICKNESS 0 V_SPACE <0 194 0> SIZE 140000 BOLD ON L_SPACE 194 MARGINS <0 0 0 0> TXTXYOFF <-7 142> T_PNTS (0,142)(0,0)(593,0)(593,146)(0,146)(0,142)(593,142) .STR L_SPACE 500 "Server" .TXT AT (8476,1239) RECOLOR ON HOR_JUST CENTER L_SPACE 194 TXTXYOFF <-13 139> T_PNTS (0,139)(0,0)(841,0)(841,337)(0,337)(0,139)(841,139) .STR L_SPACE 500 "Database\nServers" .RECT AT (7692,2960) RECOLOR ON BACKFILL <34 2 5 1000 0 0 0> THICKNESS 1 V_SPACE <0 500 0> SIZE 360000 BOLD OFF HOR_JUST LEFT MARGINS <250 250 500 125> PNTS (0,0)(1576,0)(1576,2363)(0,2363)(0,0) .RECT AT (7300,3748) RECOLOR ON PNTS (0,0)(1576,0)(1576,2363)(0,2363)(0,0) .POL AT (4133,2182) RECOLOR ON BACKFILL <44 2 5 1000 0 0 0> R_ARROW 0 PNTS (0,0)(1970,0)(1970,394)(0,394)(0,0) .TXT AT (2781,2229) RECOLOR ON BACKFILL <20 20 5 1000 0 0 0> THICKNESS 0 R_ARROW 1 HOR_JUST CENTER MARGINS <0 0 0 0> TXTXYOFF <0 119> T_PNTS (0,119)(0,0)(508,0)(508,289)(0,289)(0,119)(508,119) .STR V_SPACE <0 167 0> SIZE 120000 "HTTP \nServer" .LINE AT (3039,2564) RECOLOR ON BACKFILL <34 2 5 1000 0 0 0> THICKNESS 1 V_SPACE <0 500 0> SIZE 360000 HOR_JUST LEFT MARGINS <250 250 500 125> PNTS (0,0)(0,394) .TXT AT (4918,2308) RECOLOR ON BACKFILL <20 20 5 1000 0 0 0> THICKNESS 0 HOR_JUST CENTER MARGINS <0 0 0 0> TXTXYOFF <2 122> T_PNTS (0,122)(0,0)(371,0)(371,126)(0,126)(0,122)(371,122) .STR V_SPACE <0 167 0> SIZE 120000 "AWS" .RECT AT (5315,4939) RECOLOR ON BACKFILL <44 2 5 1000 0 0 0> THICKNESS 1 V_SPACE <0 500 0> SIZE 360000 HOR_JUST LEFT MARGINS <250 250 500 125> PNTS (0,0)(788,0)(788,788)(0,788)(0,0) .TXT AT (5411,5266) RECOLOR ON BACKFILL <20 20 5 1000 0 0 0> THICKNESS 0 HOR_JUST CENTER MARGINS <0 0 0 0> TXTXYOFF <-6 122> T_PNTS (0,122)(0,0)(575,0)(575,126)(0,126)(0,122)(575,122) .STR V_SPACE <0 167 0> SIZE 120000 "GNADE" .LINE AT (6133,5325) RECOLOR ON BACKFILL <34 2 5 1000 0 0 0> THICKNESS 1 V_SPACE <0 500 0> SIZE 360000 HOR_JUST LEFT MARGINS <250 250 500 125> PNTS (0,0)(1166,0) .TXT AT (7537,4523) RECOLOR ON BACKFILL <20 20 5 1000 0 0 0> THICKNESS 0 V_SPACE <0 194 0> SIZE 140000 BOLD ON HOR_JUST CENTER L_SPACE 194 MARGINS <0 0 0 0> TXTXYOFF <-13 142> T_PNTS (0,142)(0,0)(1029,0)(1029,184)(0,184)(0,142)(1029,142) .STR L_SPACE 500 "PostgeSQL" .TXT AT (8025,3349) RECOLOR ON L_SPACE 194 T_PNTS (0,142)(0,0)(653,0)(653,184)(0,184)(0,142)(653,142) .STR L_SPACE 500 "MySQL" .TXT AT (8673,2561) RECOLOR ON L_SPACE 194 TXTXYOFF <-7 142> T_PNTS (0,142)(0,0)(589,0)(589,146)(0,146)(0,142)(589,142) .STR L_SPACE 500 "Oracle" .TXT AT (2684,3427) RECOLOR ON V_SPACE <0 500 0> SIZE 360000 BOLD OFF TXTXYOFF <0 119> T_PNTS (0,119)(0,0)(693,0)(693,488)(0,488)(0,119)(693,119) .STR V_SPACE <0 167 0> SIZE 120000 "Appl.\nGUI\n(Servlets)" .TXT AT (4400,2982) RECOLOR ON V_SPACE <0 500 0> SIZE 360000 TXTXYOFF <1 121> T_PNTS (0,121)(0,0)(1409,0)(1409,326)(0,326)(0,121)(1409,121) .STR V_SPACE <0 167 0> SIZE 120000 "Application specific\nlogic" .LINE AT (4528,4546) RECOLOR ON BACKFILL <34 2 5 1000 0 0 0> THICKNESS 1 L_ARROW 1 V_SPACE <0 500 0> SIZE 360000 HOR_JUST LEFT MARGINS <250 250 500 125> PNTS (0,0)(0,394) .LINE AT (5710,4546) RECOLOR ON L_ARROW 0 PNTS (0,0)(0,394) .RECT AT (2645,4928) BACKFILL <44 2 0 9 0 0 0> PARA <0 0 0 0 1000 1 0 111> PNTS (0,0)(2364,0)(2364,788)(0,788)(0,0) .TXT AT (3390,5173) RECOLOR ON BACKFILL <20 20 5 1000 0 0 0> THICKNESS 0 PARA <0 0 0 0 1000 34 0 111> HOR_JUST CENTER MARGINS <0 0 0 0> TXTXYOFF <0 122> T_PNTS (0,122)(0,0)(852,0)(852,324)(0,324)(0,122)(852,122) .STR V_SPACE <0 167 0> SIZE 120000 "PolyORB \n(ORB, RMI)" .TXT AT (2957,227) BACKFILL <20 2 5 1000 0 0 0> PARA <0 0 0 0 1000 1 0 111> V_SPACE <0 500 0> SIZE 360000 HOR_JUST LEFT TXTXYOFF <-5 357> T_PNTS (0,357)(0,0)(4710,0)(4710,364)(0,364)(0,357)(4710,357) .STR "Two Tier Architecture" .POL AT (397,1888) BACKFILL <34 2 5 1000 0 0 0> THICKNESS 1 R_ARROW 0 MARGINS <250 250 500 125> PNTS (0,0)(1112,0)(1112,1881)(0,1881)(0,0) .TXT AT (462,1412) RECOLOR ON BACKFILL <20 20 5 1000 0 0 0> THICKNESS 0 R_ARROW 1 PARA <0 0 0 0 1000 34 0 111> V_SPACE <0 194 0> SIZE 140000 BOLD ON L_SPACE 194 MARGINS <0 0 0 0> TXTXYOFF <-8 142> T_PNTS (0,142)(0,0)(527,0)(527,146)(0,146)(0,142)(527,142) .STR L_SPACE 500 "Client" .RECT AT (601,2132) BACKFILL <12 2 5 1000 0 0 0> THICKNESS 1 PARA <0 0 0 0 1000 1 0 111> V_SPACE <0 500 0> SIZE 360000 BOLD OFF MARGINS <250 250 500 125> PNTS (0,0)(651,0)(651,815)(0,815)(0,0) .LINE AT (1255,2348) RECOLOR ON BACKFILL <34 2 5 1000 0 0 0> L_ARROW 1 PARA <0 0 0 0 1000 34 0 111> PNTS (0,0)(1353,0) .TXT AT (628,2313) RECOLOR ON BACKFILL <20 20 5 1000 0 0 0> THICKNESS 0 L_ARROW 0 HOR_JUST CENTER MARGINS <0 0 0 0> TXTXYOFF <-13 119> T_PNTS (0,119)(0,0)(594,0)(594,122)(0,122)(0,119)(594,119) .STR V_SPACE <0 167 0> SIZE 120000 "Browser" .TXT AT (1678,2140) RECOLOR ON V_SPACE <0 500 0> SIZE 360000 TXTXYOFF <-10 119> T_PNTS (0,119)(0,0)(417,0)(417,120)(0,120)(0,119)(417,119) .STR V_SPACE <0 167 0> SIZE 120000 BOLD ON "HTTP" .RECT AT (4291,3513) BACKFILL <22 2 5 1000 0 0 0> THICKNESS 1 PARA <0 0 0 0 1000 1 0 111> V_SPACE <0 500 0> SIZE 360000 BOLD OFF HOR_JUST LEFT MARGINS <250 250 500 125> PNTS (0,0)(451,0)(451,829)(0,829)(0,0) .RECT AT (5075,3536) PNTS (0,0)(858,0)(858,818)(0,818)(0,0) END PICTURE SLIDE_INFO SLIDE_STYLE <0 -1 1> END SLIDE_INFO PICTURE .POL AT (2485,1852) RECOLOR ON BACKFILL <34 2 5 1000 0 0 0> R_ARROW 0 PARA <0 0 0 0 1000 34 0 111> PNTS (0,0)(1577,0)(1577,4334)(0,4334)(0,0) .POL AT (4907,1642) RECOLOR ON BACKFILL <33 2 5 1000 0 0 0> PNTS (0,0)(2757,0)(2757,4334)(0,4334)(0,0) .POL AT (4616,1934) RECOLOR ON PNTS (0,0)(2757,0)(2757,4334)(0,4334)(0,0) .RECT AT (8709,2716) RECOLOR ON BACKFILL <34 2 5 1000 0 0 0> R_ARROW 1 PNTS (0,0)(1576,0)(1576,2363)(0,2363)(0,0) .POL AT (1996,2291) RECOLOR ON R_ARROW 0 PNTS (0,0)(1577,0)(1577,4334)(0,4334)(0,0) .POL AT (4311,2291) RECOLOR ON BACKFILL <32 2 5 1000 0 0 0> PNTS (0,0)(2757,0)(2757,4334)(0,4334)(0,0) .POL AT (2390,2686) RECOLOR ON BACKFILL <12 2 5 1000 0 0 0> PNTS (0,0)(788,0)(788,394)(0,394)(0,0) .RECT AT (2390,3474) RECOLOR ON BACKFILL <23 2 5 1000 0 0 0> R_ARROW 1 PNTS (0,0)(788,0)(788,1576)(0,1576)(0,0) .POL AT (2391,5445) RECOLOR ON BACKFILL <44 2 5 1000 0 0 0> R_ARROW 0 PNTS (0,0)(788,0)(788,788)(0,788)(0,0) .POL AT (4703,5445) RECOLOR ON PNTS (0,0)(788,0)(788,788)(0,788)(0,0) .RECT AT (4704,3429) RECOLOR ON BACKFILL <23 2 5 1000 0 0 0> R_ARROW 1 PNTS (0,0)(1970,0)(1970,1620)(0,1620)(0,0) .LINE AT (2784,5050) RECOLOR ON BACKFILL <34 2 5 1000 0 0 0> PNTS (0,0)(0,394) .LINE AT (3188,5838) RECOLOR ON PNTS (0,0)(1528,0) .TXT AT (2212,6770) RECOLOR ON BACKFILL <20 20 5 1000 0 0 0> THICKNESS 0 V_SPACE <0 194 0> SIZE 140000 BOLD ON L_SPACE 194 MARGINS <0 0 0 0> TXTXYOFF <-8 142> T_PNTS (0,142)(0,0)(1185,0)(1185,146)(0,146)(0,142)(1185,142) .STR L_SPACE 500 "Client Server" .TXT AT (4620,6794) RECOLOR ON HOR_JUST CENTER L_SPACE 194 TXTXYOFF <0 142> T_PNTS (0,142)(0,0)(2196,0)(2196,340)(0,340)(0,142)(2196,142) .STR L_SPACE 500 "Application/Transaction" .STR "\nServers" .TXT AT (8981,2042) RECOLOR ON L_SPACE 194 TXTXYOFF <-13 139> T_PNTS (0,139)(0,0)(841,0)(841,338)(0,338)(0,139)(841,139) .STR L_SPACE 500 "Database\nServers" .RECT AT (8457,3422) RECOLOR ON BACKFILL <34 2 5 1000 0 0 0> THICKNESS 1 V_SPACE <0 500 0> SIZE 360000 BOLD OFF HOR_JUST LEFT MARGINS <250 250 500 125> PNTS (0,0)(1576,0)(1576,2363)(0,2363)(0,0) .RECT AT (8251,4261) RECOLOR ON PNTS (0,0)(1576,0)(1576,2363)(0,2363)(0,0) .POL AT (4703,2686) RECOLOR ON BACKFILL <44 2 5 1000 0 0 0> R_ARROW 0 PNTS (0,0)(1970,0)(1970,394)(0,394)(0,0) .TXT AT (2526,2745) RECOLOR ON BACKFILL <20 20 5 1000 0 0 0> THICKNESS 0 R_ARROW 1 HOR_JUST CENTER MARGINS <0 0 0 0> TXTXYOFF <0 119> T_PNTS (0,119)(0,0)(508,0)(508,290)(0,290)(0,119)(508,119) .STR V_SPACE <0 167 0> SIZE 120000 "HTTP \nServer" .LINE AT (2784,3080) RECOLOR ON BACKFILL <34 2 5 1000 0 0 0> THICKNESS 1 V_SPACE <0 500 0> SIZE 360000 HOR_JUST LEFT MARGINS <250 250 500 125> PNTS (0,0)(0,394) .TXT AT (2446,5772) RECOLOR ON BACKFILL <20 20 5 1000 0 0 0> THICKNESS 0 HOR_JUST CENTER MARGINS <0 0 0 0> TXTXYOFF <-13 122> T_PNTS (0,122)(0,0)(662,0)(662,159)(0,159)(0,122)(662,122) .STR V_SPACE <0 167 0> SIZE 120000 "PolyORB" .TXT AT (5492,2816) RECOLOR ON V_SPACE <0 500 0> SIZE 360000 TXTXYOFF <2 122> T_PNTS (0,122)(0,0)(371,0)(371,126)(0,126)(0,122)(371,122) .STR V_SPACE <0 167 0> SIZE 120000 "AWS" .TXT AT (4757,5770) RECOLOR ON V_SPACE <0 500 0> SIZE 360000 TXTXYOFF <-12 122> T_PNTS (0,122)(0,0)(662,0)(662,159)(0,159)(0,122)(662,122) .STR V_SPACE <0 167 0> SIZE 120000 "PolyORB" .RECT AT (5885,5443) RECOLOR ON BACKFILL <44 2 5 1000 0 0 0> THICKNESS 1 V_SPACE <0 500 0> SIZE 360000 HOR_JUST LEFT MARGINS <250 250 500 125> PNTS (0,0)(788,0)(788,788)(0,788)(0,0) .TXT AT (5981,5770) RECOLOR ON BACKFILL <20 20 5 1000 0 0 0> THICKNESS 0 HOR_JUST CENTER MARGINS <0 0 0 0> TXTXYOFF <-6 122> T_PNTS (0,122)(0,0)(576,0)(576,126)(0,126)(0,122)(576,122) .STR V_SPACE <0 167 0> SIZE 120000 "GNADE" .LINE AT (6673,5838) RECOLOR ON BACKFILL <34 2 5 1000 0 0 0> THICKNESS 1 V_SPACE <0 500 0> SIZE 360000 HOR_JUST LEFT MARGINS <250 250 500 125> PNTS (0,0)(1577,0) .TXT AT (8489,5036) RECOLOR ON BACKFILL <20 20 5 1000 0 0 0> THICKNESS 0 V_SPACE <0 194 0> SIZE 140000 BOLD ON HOR_JUST CENTER L_SPACE 194 MARGINS <0 0 0 0> TXTXYOFF <-13 142> T_PNTS (0,142)(0,0)(1029,0)(1029,184)(0,184)(0,142)(1029,142) .STR L_SPACE 500 "PostgeSQL" .TXT AT (8976,3862) RECOLOR ON L_SPACE 194 T_PNTS (0,142)(0,0)(653,0)(653,184)(0,184)(0,142)(653,142) .STR L_SPACE 500 "MySQL" .TXT AT (9191,3057) RECOLOR ON L_SPACE 194 TXTXYOFF <-7 142> T_PNTS (0,142)(0,0)(589,0)(589,146)(0,146)(0,142)(589,142) .STR L_SPACE 500 "Oracle" .TXT AT (2428,3943) RECOLOR ON V_SPACE <0 500 0> SIZE 360000 BOLD OFF TXTXYOFF <1 119> T_PNTS (0,119)(0,0)(693,0)(693,487)(0,487)(0,119)(693,119) .STR V_SPACE <0 167 0> SIZE 120000 "Appl.\nGUI\n(Servlets)" .TXT AT (4909,4000) RECOLOR ON V_SPACE <0 500 0> SIZE 360000 TXTXYOFF <1 121> T_PNTS (0,121)(0,0)(1407,0)(1407,324)(0,324)(0,121)(1407,121) .STR V_SPACE <0 167 0> SIZE 120000 "Application specific\nlogic" .TXT AT (3649,5311) RECOLOR ON V_SPACE <0 500 0> SIZE 360000 BOLD ON TXTXYOFF <-6 122> T_PNTS (0,122)(0,0)(469,0)(469,460)(0,460)(0,122)(469,122) .STR V_SPACE <0 167 0> SIZE 120000 "Corba\nRMI\nDSA" .LINE AT (5098,5050) RECOLOR ON BACKFILL <34 2 5 1000 0 0 0> THICKNESS 1 L_ARROW 1 V_SPACE <0 500 0> SIZE 360000 BOLD OFF HOR_JUST LEFT MARGINS <250 250 500 125> PNTS (0,0)(0,394) .LINE AT (6280,5050) RECOLOR ON L_ARROW 0 PNTS (0,0)(0,394) .TXT AT (2995,-23) BACKFILL <20 2 5 1000 0 0 0> THICKNESS 0 PARA <0 0 0 0 1000 1 0 111> MARGINS <0 0 0 0> TXTXYOFF <-5 357> T_PNTS (0,357)(0,0)(5071,0)(5071,364)(0,364)(0,357)(5071,357) .STR "Three Tier Architecture" .POL AT (446,2425) BACKFILL <34 2 5 1000 0 0 0> THICKNESS 1 R_ARROW 0 MARGINS <250 250 500 125> PNTS (0,0)(1112,0)(1112,1881)(0,1881)(0,0) .TXT AT (635,6762) RECOLOR ON BACKFILL <20 20 5 1000 0 0 0> THICKNESS 0 R_ARROW 1 PARA <0 0 0 0 1000 34 0 111> V_SPACE <0 194 0> SIZE 140000 BOLD ON L_SPACE 194 MARGINS <0 0 0 0> TXTXYOFF <-8 142> T_PNTS (0,142)(0,0)(527,0)(527,146)(0,146)(0,142)(527,142) .STR L_SPACE 500 "Client" .RECT AT (650,2669) BACKFILL <12 2 5 1000 0 0 0> THICKNESS 1 PARA <0 0 0 0 1000 1 0 111> V_SPACE <0 500 0> SIZE 360000 BOLD OFF MARGINS <250 250 500 125> PNTS (0,0)(651,0)(651,815)(0,815)(0,0) .TXT AT (677,2850) RECOLOR ON BACKFILL <20 20 5 1000 0 0 0> THICKNESS 0 PARA <0 0 0 0 1000 34 0 111> HOR_JUST CENTER MARGINS <0 0 0 0> TXTXYOFF <-12 119> T_PNTS (0,119)(0,0)(594,0)(594,122)(0,122)(0,119)(594,119) .STR V_SPACE <0 167 0> SIZE 120000 "Browser" .TXT AT (1594,2669) RECOLOR ON V_SPACE <0 500 0> SIZE 360000 TXTXYOFF <-10 119> T_PNTS (0,119)(0,0)(417,0)(417,120)(0,120)(0,119)(417,119) .STR V_SPACE <0 167 0> SIZE 120000 BOLD ON "HTTP" .LINE AT (1300,2880) RECOLOR ON BACKFILL <34 2 5 1000 0 0 0> THICKNESS 1 V_SPACE <0 500 0> SIZE 360000 BOLD OFF HOR_JUST LEFT MARGINS <250 250 500 125> PNTS (0,0)(1060,0) .RECT AT (4958,830) BACKFILL <22 2 5 1000 0 0 0> PARA <0 0 0 0 1000 1 0 111> PNTS (0,0)(1486,0)(1486,652)(0,652)(0,0) .TXT AT (5241,1033) RECOLOR ON BACKFILL <20 20 5 1000 0 0 0> THICKNESS 0 PARA <0 0 0 0 1000 34 0 111> HOR_JUST CENTER MARGINS <0 0 0 0> TXTXYOFF <1 119> T_PNTS (0,119)(0,0)(948,0)(948,288)(0,288)(0,119)(948,119) .STR V_SPACE <0 167 0> SIZE 120000 "Application\nAministration" .TXT AT (5735,1710) RECOLOR ON V_SPACE <0 500 0> SIZE 360000 TXTXYOFF <-10 119> T_PNTS (0,119)(0,0)(417,0)(417,120)(0,120)(0,119)(417,119) .STR V_SPACE <0 167 0> SIZE 120000 BOLD ON "HTTP" .LINE AT (5664,1473) BACKFILL <34 2 5 1000 0 0 0> THICKNESS 1 PARA <0 0 0 0 1000 1 0 111> V_SPACE <0 500 0> SIZE 360000 BOLD OFF HOR_JUST LEFT MARGINS <250 250 500 125> PNTS (0,0)(0,1206) .TXT AT (6799,5465) RECOLOR ON BACKFILL <20 20 5 1000 0 0 0> THICKNESS 0 PARA <0 0 0 0 1000 34 0 111> BOLD ON HOR_JUST CENTER MARGINS <0 0 0 0> TXTXYOFF <0 122> T_PNTS (0,122)(0,0)(1323,0)(1323,293)(0,293)(0,122)(1323,122) .STR V_SPACE <0 167 0> SIZE 120000 "ODBC\nNative Interfaces" END PICTURE *END GRAPHICS gnade-1.6.2.orig/doc/ACT/3tier.ppt0000644000175000017500000005300007523242426016330 0ustar lbrentalbrentaĞÏࡱá!şÿ şÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿıÿÿÿ(şÿÿÿ   !"#$%&şÿÿÿ)şÿÿÿşÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿRoot Entry ÿÿÿÿÿÿÿÿd›Oφꪹ)è¸Ë)'€PowerPoint Document(ÿÿÿÿlµ)hµ)lµ)hµ) FCurrent UserÿÿÿÿÿÿPicturesÿÿÿÿÿÿÿÿÿÿÿÿRRişÿÿÿşÿÿÿşÿÿÿ şÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¿şğp ğ à ğH´ŞŞƒ¿ÀÂÄËÑÕÿğ©OÚú ğp ğ à ğH´ŞŞƒ¿ÀÂÄËÑÕÿğomùÀ ğÆ ğ  ğ‡BoCãDEÁFÁÿ{ƒ¿ÀÂÄËÿğÿooãã @¬¬¬¬¬`€ğéM » ÌğÌ¢ ğÓ ğN€€ù$‚ƒ„…¿ ¿ƒ¿¿Àÿğ@e¨ ğNŸ¨ HTTP Server¡& 1 ÿ  ¿şğjB ğ ³ ğBŞŞƒ¿ÀÂÄËÑÕÿğÅÖÖ¨ğâ ğÓ ğN€Àù$‚ƒ„…¿ ¿ƒ¿¿Àÿğ/ å x ğEŸ¨AWS¡&1 ÿ ¿şğp ğ à ğH´ÿ{ƒ¿ÀÂÄËÑÕÿğ õ » ã ğÅ¢ ğÓ ğN€ú$‚ƒ„…¿ ¿ƒ¿¿ÀÿğÖ , w  ğGŸ¨GNADE¡&1 ÿ ¿şğjB ğ ³ ğBŞŞƒ¿ÀÂÄËÑÕÿğû Í lû ğË¢ ğÓ ğN€@ú$‚ƒ„…¿ ¿ƒ¿¿Àÿğ, ôC–  ğMŸ¨ PostgeSQL¡( 1ÿ ÿÿ¿şğÇ¢ ğÓ ğN€€ú$‚ƒ„…¿ ¿ƒ¿¿Àÿğ‡ …ñ ğIŸ¨MySQL¡(1ÿÿÿ¿şğÈ¢ ğÓ ğN€Àú$‚ƒ„…¿ ¿ƒ¿¿ÀÿğÁ‚Õ ğJŸ¨Oracle¡(1ÿÿÿ¿şğÔ¢ ğÓ ğN€û$‚ƒ„…¿ ¿ƒ¿¿Àÿğ´™Í ğVŸ¨Appl. GUI (Servlets)¡&1 ÿ ¿şğÚ¢ ğÓ ğN€@û$‚ƒ„…¿ ¿ƒ¿¿ÀÿğÜÁ ï — ğ\Ÿ¨Application specific logic¡&1 ÿ ¿şğvB ğ Ó ğNŞŞƒ¿ÀÂÄËĞÑÓÕÿğ: 0 0  ğjB ğ ³ ğBŞŞƒ¿ÀÂÄËÑÕÿğ: Ù Ù  ğ  ğ ó ğx´€ÿ{ƒ†A‡Á¿ÀÂÄËÑÕÿDiagonal Hatchğ ôE Ü ğÓ¢ ğ Ó ğN€€û$‚ƒ„…¿ ¿ƒ¿¿Àÿğ¡ Ÿ‹ \  ğUŸ¨PolyORB (ORB, RMI)¡&1 ÿ ¿şğÓ¢ ğ!Ó ğN€Àû$‚ƒ„…¿ ¿ƒ¿Àÿğ¦ES ğUŸ¨Two Tier Architecture¡$1àş$¿şğÆ ğ"  ğ‡BC;DEÁFÁŞŞƒ¿ÀÂÄËÿğÿ;; @¬¬¬¬¬`€ğ?åe{ğÆ¢ ğ#Ó ğN€ü$‚ƒ„…¿ ¿ƒ¿¿Àÿğ,6€ ğHŸ¨Client¡&1ÿÿÿ¿şğp ğ$ à ğH´ƒ¿ÀÂÄËÑÕÿğÌZÑ¡ğvB ğ% Ó ğNŞŞƒ¿ÀÂÄËĞÑÓÕÿğHÓŞHğÇ¢ ğ&Ó ğN€@ü$‚ƒ„…¿ ¿ƒ¿¿èãé(š³š³ òº/È 0ÒÕ·DTimes·DZapf Dingbats ·DSwiss0·DMorewingbats@·DDutchP·DHelvetica`·DCourier Swa©  @£nÿı?" dd@ÿÿïÿÿÿÿÿÿ  @@``€€ °ğ¨ğ(ZW#1ğ,rğ$ÿac ğ$ƒ¿Àÿ@ñ÷ğó€Ğ‹ÿ úgşı40d0d¶Éò0¶ş!1ÿÿÿúÿÿpûppû@ ?Ù2Ú( ºMichael Erdmannğ8óóêøgï `ğ ÿÿÿ¿¿¿ÿÿÿ£>ÿı? od ş@ÿÿïÿÿÿÿÿÿ,£–ÿı? " dÿàÿ@ÿÿïÿÿÿÿÿÿ ¿ş  °¿ş @Ğ¿ş `ğ¿ş €¿ş £ÿı? " dÿàÿ@ÿÿïÿÿÿÿÿÿ¿ş  °¿ş @Ğ¿ş `ğ¿ş €¿şP£ˆÿı? od ş@ÿÿïÿÿÿÿÿÿ,    `£ p£>€£>ùK0 %ğğğµğ( ğ ğğÎ ğ ƒ ğ0€ø$ƒ¿Àÿ ğ‚°ĞLğà  ğVŸ¨ Click to edit Master title style¢!ª !ğ ğ ƒ ğ0€@ø$ƒ¿Àÿ ğâ°Ğğà  ğ Ÿ¨RClick to edit Master text styles Second level Third level Fourth level Fifth level¢!    ª Sğ½ ğ ƒ ğ0€€ø$ƒ¿Àÿ ğÀPàğà   ğEŸ¨*¡ ¿şúğÂ ğ ƒ ğ0€Àø$ƒ¿Àÿ ğÀ€àğà  ğJŸ¨Page *¡ ¿şØğH ğ ƒ ğ0“޽h”Ÿ‹¿Àÿ ?ğ ÿÿÿ¿¿¿ÿÿÿîYï€ù ñğé ğ"(ğğ( ğ ğğp ğ à ğH´ŞŞƒ¿ÀÂÄËÑÕÿğä2½5 ğÆ ğ  ğ‡BÁ CÀ DEÁFÁŞŞƒ¿ÀÂÄËÿğÿÁ Á À À @¬¬¬¬¬`€ğşÓ¿ ğÆ ğ   ğ‡BÆCãDEÁFÁƒ¿ÀÂÄËÿğÿÆÆãã @¬¬¬¬¬`€ğâô¹Åğp ğ  à ğH´òòƒ¿ÀÂÄËÑÕÿğ¨ô¹4 ğp ğ  à ğH´òòƒ¿ÀÂÄËÑÕÿğ•M ¼ : ğjB ğ  ³ ğBŞŞƒ¿ÀÂÄËÑÕÿğ4 ÖÖ ğÆ¢ ğ Ó ğN€ù$‚ƒ„…¿ ¿ƒ¿¿Àÿğd¹ q ğHŸ¨Server¡&1ÿÿÿ¿şğÒ¢ ğÓ ğN€@ù$‚ƒ„…¿ ¿ƒ¿¿ÀÿğÇò‹ ğTŸ¨Database Servers¡(1ÿÀÿğ3g¾y ğIŸ¨Browser¡&1 ÿ ¿şğÆ¢ ğ'Ó ğN€€ü$‚ƒ„…¿ ¿ƒ¿¿ÀÿğÏÆ³ ğHŸ¨HTTP¡(1 ÿÿÿ ¿şğH ğ( ƒ ğ0“޽h”Ÿ‹¿Àÿ ?ğ ÿÿÿ¿¿¿ÿÿÿî"ï€ù °!ğ¨!0ğ0Yğ@!ğ( ğ ğ)ğÆ ğ*  ğ‡BŒCÀ DEÁFÁŞŞƒ¿ÀÂÄËÿğÿŒŒÀ À @¬¬¬¬¬`€ğ+—$ ë ğÆ ğ+  ğ‡B4CÀ DEÁFÁòòƒ¿ÀÂÄËÿğÿ44À À @¬¬¬¬¬`€ğ² >r ğÆ ğ,  ğ‡B4CÀ DEÁFÁòòƒ¿ÀÂÄËÿğÿ44À À @¬¬¬¬¬`€ğZc —ğp ğ- à ğH´ŞŞƒ¿ÀÂÄËÑÕÿğ˜$n ğÆ ğ.  ğ‡BŒCÀ DEÁFÁŞŞƒ¿ÀÂÄËÿğÿŒŒÀ À @¬¬¬¬¬`€ğ(~ èğÆ ğ/  ğ‡B4CÀ DEÁFÁÿÿƒ¿ÀÂÄËÿğÿ44À À @¬¬¬¬¬`€ğ(³ çèğÆ ğ0  ğ‡BÆCãDEÁFÁƒ¿ÀÂÄËÿğÿÆÆãã @¬¬¬¬¬`€ğ a'îğp ğ1 à ğH´òòƒ¿ÀÂÄËÑÕÿğÑa'] ğÆ ğ2  ğ‡BÆCÆDEÁFÁÿ{ƒ¿ÀÂÄËÿğÿÆÆÆÆ @¬¬¬¬¬`€ğ@ a'ğÆ ğ3  ğ‡BÆCÆDEÁFÁÿ{ƒ¿ÀÂÄËÿğÿÆÆÆÆ @¬¬¬¬¬`€ğ@ • [ ğp ğ4 à ğH´òòƒ¿ÀÂÄËÑÕÿğ·– \ ğjB ğ5 ³ ğBŞŞƒ¿ÀÂÄËÑÕÿğ] DD@ ğjB ğ6 ³ ğBŞŞƒ¿ÀÂÄËÑÕÿğ# ,œ # ğÍ¢ ğ7Ó ğN€Àü$‚ƒ„…¿ ¿ƒ¿¿Àÿğ:÷Ÿ ğOŸ¨ Client Server¡&1ÿÿÿ¿şğ ¢ ğ8Ó ğN€ı$‚ƒ„…¿ ¿ƒ¿¿ÀÿğHc L  ğ‹Ÿ¨Application/Transaction Servers¡P1ÿ 1ÿÿÿ¿ş ÿÿ¿şğÒ¢ ğ9Ó ğN€@ı$‚ƒ„…¿ ¿ƒ¿¿Àÿğ–4Y ğTŸ¨Database Servers¡(1ÿÿÿ¿şğp ğ: à ğH´ŞŞƒ¿ÀÂÄËÑÕÿ𳓠ğp ğ; à ğH´ŞŞƒ¿ÀÂÄËÑÕÿğ– ‘çğÆ ğ<  ğ‡BoCãDEÁFÁÿ{ƒ¿ÀÂÄËÿğÿooãã @¬¬¬¬¬`€ğ • îğÌ¢ ğ=Ó ğN€€ı$‚ƒ„…¿ ¿ƒ¿¿Àÿğ+­ÒÑ ğNŸ¨ HTTP Server¡& 1 ÿ  ¿şğjB ğ> ³ ğBŞŞƒ¿ÀÂÄËÑÕÿğîDDÑğÇ¢ ğ?Ó ğN€Àı$‚ƒ„…¿ ¿ƒ¿¿Àÿğú €şW  ğIŸ¨PolyORB¡&1 ÿ ¿şğâ ğ@Ó ğN€ş$‚ƒ„…¿ ¿ƒ¿¿ÀÿğTZ 0 œ ğEŸ¨AWS¡&1 ÿ ¿şğÇ¢ ğAÓ ğN€@ş$‚ƒ„…¿ ¿ƒ¿¿Àÿğù ³ 1 U  ğIŸ¨PolyORB¡&1 ÿ ¿şğp ğB à ğH´ÿ{ƒ¿ÀÂÄËÑÕÿğ? > ğÅ¢ ğCÓ ğN€€ş$‚ƒ„…¿ ¿ƒ¿¿Àÿğù t ¿B  ğGŸ¨GNADE¡&1 ÿ ¿şğjB ğD ³ ğBŞŞƒ¿ÀÂÄËÑÕÿğ# # ğË¢ ğEÓ ğN€Àş$‚ƒ„…¿ ¿ƒ¿¿ÀÿğS g¼  ğMŸ¨ PostgeSQL¡( 1ÿ ÿÿ¿şğÇ¢ ğFÓ ğN€ÿ$‚ƒ„…¿ ¿ƒ¿¿Àÿğ¯0©  ğIŸ¨MySQL¡(1ÿÿÿ¿şğÈ¢ ğGÓ ğN€@ÿ$‚ƒ„…¿ ¿ƒ¿¿Àÿğß­ÿ3 ğJŸ¨Oracle¡(1ÿÿÿ¿şğÔ¢ ğHÓ ğN€€ÿ$‚ƒ„…¿ ¿ƒ¿¿Àÿğİuø  ğVŸ¨Appl. GUI (Servlets)¡&1 ÿ ¿şğÚ¢ ğIÓ ğN€Àÿ$‚ƒ„…¿ ¿ƒ¿¿Àÿğı 9¹  ğ\Ÿ¨Application specific logic¡&1 ÿ ¿şğÏ¢ ğJÓ ğN€%‚ƒ„…¿ ¿ƒ¿¿Àÿğğ 5B ú  ğQŸ¨ Corba RMI DSA¡(1 ÿÿÿ ¿şğvB ğK Ó ğNŞŞƒ¿ÀÂÄËĞÑÓÕÿğ] x x @ ğjB ğL ³ ğBŞŞƒ¿ÀÂÄËÑÕÿğ] !!@ ğÕ¢ ğMÓ ğN€@%‚ƒ„…¿ ¿ƒ¿Àÿğòÿ»+Å ğWŸ¨Three Tier Architecture¡$1àş$¿şğÆ ğN  ğ‡BC;DEÁFÁŞŞƒ¿ÀÂÄËÿğÿ;; @¬¬¬¬¬`€ğu° ğÆ¢ ğOÓ ğN€€%‚ƒ„…¿ ¿ƒ¿¿Àÿğ5k™‰ ğHŸ¨Client¡&1ÿÿÿ¿şğp ğP à ğH´ƒ¿ÀÂÄËÑÕÿğví×ğÇ¢ ğQÓ ğN€À%‚ƒ„…¿ ¿ƒ¿¿ÀÿğhƒÚ® ğIŸ¨Browser¡&1 ÿ ¿şğÆ¢ ğRÓ ğN€%‚ƒ„…¿ ¿ƒ¿¿Àÿğ•‚E ğHŸ¨HTTP¡(1 ÿÿÿ ¿şğjB ğS ³ ğBŞŞƒ¿ÀÂÄËÑÕÿğ{íO{ğp ğT à ğH´ÿÿƒ¿ÀÂÄËÑÕÿğŞ( €VğÙ¢ ğUÓ ğN€@%‚ƒ„…¿ ¿ƒ¿¿ÀÿğQÊ ï ÷ ğ[Ÿ¨Application Aministration¡&1 ÿ ¿şğÆ¢ ğVÓ ğN€€%‚ƒ„…¿ ¿ƒ¿¿Àÿğ×ç Ô  ğHŸ¨HTTP¡(1 ÿÿÿ ¿şğjB ğW ³ ğBŞŞƒ¿ÀÂÄËÑÕÿğP¾ ¾ ğØ¢ ğXÓ ğN€À%‚ƒ„…¿ ¿ƒ¿¿ÀÿğJ JIó  ğZŸ¨ODBC Native Interfaces¡(1 ÿÿÿ ¿şğH ğY ƒ ğ0“޽h”Ÿ‹¿Àÿ ?ğ ÿÿÿ¿¿¿ÿÿÿr@ëZ »#õ¼ ÛEĞÏࡱá!şÿ şÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿö_À‘ã÷Eô!şÿ €zğa( ÿÿÿw›»wİ»îİwî»wİ»îİĞÏࡱáşÿà…ŸòùOh«‘+'³Ù0ê@Wgµ Æ Ò ŞNo Slide TitleerdmannFCreated by Applixware @(#)Version: 5.0(1375) Sat Jun 24 20:02:18 2000 5 (1375)@@¾uÌĞ)Â@ kL3Â!şÿ SummaryInformation(ÿÿÿÿÿÿÿÿÿÿÿÿ(·)i(·)iDocumentSummaryInformation8ÿÿÿÿÿÿÿÿÿÿÿÿ"\;@h®ÿ¿"\;@h®ÿ¿HÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿşÿÕÍÕœ.“—+,ù®0¡±á!şÿ şÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿgnade-1.6.2.orig/doc/ACT/README0000644000175000017500000000020607523242426015435 0ustar lbrentalbrentaThis directory contaisn the source of some slide which have been presented at the 26.7.2002 during a meeting at ACT europe in paris. gnade-1.6.2.orig/doc/ACT/gnade-12-07-2002.ap0000644000175000017500000007755707523242426017231 0ustar lbrentalbrenta*BEGIN GRAPHICS VERSION=500/420 ENCODING=7BIT ** "Creator" erdmann ** "Creation Date" Fri Jul 12 20:20:28 2002 ** "Creation Version" 5 (1375) ** "Revisor" erdmann ** "Last Modified" Mon Jul 22 20:02:42 2002 ** "Last Modified Version" 5 (1375) COLORMAP <"Transparent" 0 0 0 0 0 1> <"Black" 0 0 0 0 255 0> <"White" 0 0 0 0 0 0> <"Grey 95" 0 0 0 0 13 0> <"Grey 87" 0 0 0 0 33 0> <"Grey 75" 0 0 0 0 64 0> <"Grey 50" 0 0 0 0 128 0> <"Red" 0 0 255 255 0 0> <"Red 95" 0 13 255 255 0 0> <"Red 87" 0 33 255 255 0 0> <"Red 75" 0 64 255 255 0 0> <"Red 50" 0 128 255 255 0 0> <"Green" 0 255 0 255 0 0> <"Green 95" 0 255 13 255 0 0> <"Green 87" 0 255 33 255 0 0> <"Green 75" 0 255 64 255 0 0> <"Green 50" 0 255 128 255 0 0> <"Blue" 0 255 255 0 0 0> <"Blue 95" 0 255 255 13 0 0> <"Blue 87" 0 255 255 33 0 0> <"Blue 75" 0 255 255 64 0 0> <"Blue 50" 0 255 255 128 0 0> <"Yellow" 0 0 0 255 0 0> <"Yellow 95" 0 0 0 255 13 0> <"Yellow 87" 0 0 0 255 33 0> <"Yellow 75" 0 0 0 255 64 0> <"Yellow 50" 0 0 0 255 128 0> <"Magenta" 0 0 255 0 0 0> <"Magenta 95" 0 0 255 0 13 0> <"Magenta 87" 0 0 255 0 33 0> <"Magenta 75" 0 0 255 0 64 0> <"Magenta 50" 0 0 255 0 128 0> <"Cyan" 0 255 0 0 0 0> <"Cyan 95" 0 255 0 0 13 0> <"Cyan 87" 0 255 0 0 33 0> <"Cyan 75" 0 255 0 0 64 0> <"Cyan 50" 0 255 0 0 128 0> <"Tan" 0 0 57 131 0 0> <"Clay" 0 0 74 74 57 0> <"Brown" 0 30 100 220 30 0> <"Dark Brown" 0 60 135 190 65 0> <"Olive" 0 90 65 190 65 0> <"Light Orange" 0 0 33 255 0 0> <"Orange" 0 0 90 255 0 0> <"Dark Orange" 0 0 132 255 0 0> <"Light Purple" 0 31 153 0 0 0> <"Purple" 0 80 208 0 15 0> <"Dark Purple" 0 25 126 0 44 0> <"PaleYellow" 0 1 0 52 0 0> <"Blau 75" 0 255 255 64 0 0> <"Blau 50" 0 255 255 128 0 0> <"Rot 50" 0 128 255 255 0 0> END COLORMAP FONT "Times" "Zapf Dingbats" "Swiss" "Morewingbats" "Dutch" "Helvetica" "Courier Swa" END FONT HDRFTR FIRST HEADER OFFSET 252 NLINES 0 END HEADER FOOTER OFFSET 252 NLINES 0 END FOOTER END FIRST BASE HEADER OFFSET 252 NLINES 0 END HEADER FOOTER OFFSET 252 NLINES 1 INNER 0 .STR "Michael Erdmann" FONT 5 FORE_COLOR 20 END INNER CENTER 0 .STR "11.7.2002" END CENTER OUTER 0 .STR "Page #p" SIZE 100000 END OUTER END FOOTER END BASE EVEN HEADER OFFSET 252 NLINES 0 END HEADER FOOTER OFFSET 252 NLINES 0 END FOOTER END EVEN FINAL HEADER OFFSET 252 NLINES 0 END HEADER FOOTER OFFSET 252 NLINES 0 END FOOTER END FINAL END HDRFTR SESSION WIN_SIZE <5694 6227> AUTOGRID ON VIEW <0 0 0 1 1 0> GRID_DPI 1000 GRID_FACTOR 394 UNITS <394 2 "cm"> PAGEZEROS <602 -299> PAGEWID 11693 PAGEHYT 8268 PRINTWID 11693 PRINTHYT 8268 PRINTLAND ON PRINTMARG <602 201 602 201> PRINTMARKS <1 0 0> NPAGEWID 8267 NPAGEHYT 11692 NPRINTWID 8267 NPRINTHYT 11692 NPRINTMARG <394 394 394 394> HPAGEWID 8267 HPAGEHYT 11692 HPRINTWID 8267 HPRINTHYT 11692 HPRINTMARG <394 394 394 394> OPAGEWID 8267 OPAGEHYT 11692 OPRINTWID 8267 OPRINTHYT 11692 OPRINTMARG <394 394 394 394> SLIDE_STYLE <0 -1 1> CURRENT_PAGE 7 BACKFILL <34 2 5 1000 0 0 0> LINEFILL <21 21 5 1000 0 0 0> SHADOW <11 0 15 15> R_ARROW 1 V_SPACE <0 500 0> FONT 2 SIZE 360000 L_SPACE 500 MARGINS <250 250 500 125> REZ <1 486 486 -615 -2474> END SESSION SLIDE_MASTER S_EXT1 <111 89 10375 2017> S_EXT2 <68 1367 10332 6628> T_ATTR0 BACKFILL <7 7 0 0 0 0 0> R_ARROW 0 V_SPACE <0 611 0> SIZE 440000 BOLD ON HOR_JUST CENTER L_SPACE 611 MARGINS <0 0 0 0> END T_ATTR0 T_ATTR1 END T_ATTR1 S_ATTR0 BACKFILL <20 20 0 0 0 0 0> PARA <-500 500 -500 1 1000 0 3 108> V_SPACE <56 444 0> SIZE 320000 BOLD OFF HOR_JUST LEFT L_SPACE 444 END S_ATTR0 S_ATTR1 END S_ATTR1 S_ATTR2 PARA <-500 1000 -500 1 1000 0 3 108> V_SPACE <28 389 0> SIZE 280000 END S_ATTR2 S_ATTR3 PARA <-500 1500 -500 1 1000 0 3 108> V_SPACE <28 333 0> SIZE 240000 END S_ATTR3 S_ATTR4 PARA <-500 2000 -500 1 1000 0 3 108> V_SPACE <28 306 0> SIZE 220000 END S_ATTR4 S_ATTR5 PARA <-500 2500 -500 1 1000 0 3 108> ITALICS ON END S_ATTR5 SLIDE_INFO SLIDE_STYLE <0 0 1> PAGE_BACKGD <0 0 1 17> C_SCHEME <7 7 20 20 21 21 34 2 23 27 44 12 1 0 0 0 0 0 0 0 0 0 0 11 5 3 4 35 13> END SLIDE_INFO .GRP BACKFILL <1 0 0 0 0 0 0> LINEFILL <1 2 5 1000 0 0 0> SHADOW <6 0 15 15> PARA <0 0 0 0 1000 1 0 111> V_SPACE <250 250 0> FONT 0 SIZE 180000 ITALICS OFF L_SPACE 250 MARGINS <125 125 250 62> .POL AT (20,7498) RECOLOR ON BACKFILL <34 2 5 1000 0 0 0> LINEFILL <21 21 5 1000 0 0 0> SHADOW <11 0 15 15> THICKNESS 28 PARA <0 0 0 0 1000 34 0 111> V_SPACE <0 500 0> FONT 2 SIZE 360000 L_SPACE 500 MARGINS <250 250 500 125> PNTS (0,0)(10492,0) .POL AT (1,394) RECOLOR ON PNTS (0,0)(10482,0) .TXT AT (6995,68) RECOLOR ON BACKFILL <20 20 5 1000 0 0 0> THICKNESS 0 V_SPACE <0 250 0> SIZE 180000 L_SPACE 250 MARGINS <0 0 0 0> TXTXYOFF <-8 142> T_PNTS (0,142)(0,0)(3464,0)(3464,146)(0,146)(0,142)(3464,142) .STR V_SPACE <0 194 0> SIZE 140000 "GNADE - GNAT Database Environment" END .GRP END SLIDE_MASTER HANDOUT_MASTER SLIDE_INFO SLIDE_STYLE <0 -1 1> END SLIDE_INFO .GRP BACKFILL <1 0 0 0 0 0 0> LINEFILL <1 2 5 1000 0 0 0> SHADOW <6 0 15 15> THICKNESS 1 PARA <0 0 0 0 1000 1 0 111> V_SPACE <250 250 0> FONT 0 SIZE 180000 MARGINS <125 125 250 62> END .GRP END HANDOUT_MASTER OUTLINE_MASTER SLIDE_INFO SLIDE_STYLE <0 -1 1> END SLIDE_INFO .GRP END .GRP END OUTLINE_MASTER NOTES_MASTER N_EXT1 <41 466 7021 5509> N_EXT2 <41 5781 7021 10823> N_ATTR0 BACKFILL <1 1 0 0 0 0 0> V_SPACE <28 250 0> FONT 4 MARGINS <0 0 0 0> END N_ATTR0 N_ATTR1 END N_ATTR1 N_ATTR2 PARA <0 500 0 0 1000 1 0 111> END N_ATTR2 N_ATTR3 PARA <0 1000 0 0 1000 1 0 111> END N_ATTR3 N_ATTR4 PARA <0 1500 0 0 1000 1 0 111> END N_ATTR4 N_ATTR5 PARA <0 2000 0 0 1000 1 0 111> END N_ATTR5 SLIDE_INFO SLIDE_STYLE <0 -1 1> END SLIDE_INFO .GRP BACKFILL <1 0 0 0 0 0 0> PARA <0 0 0 0 1000 1 0 111> V_SPACE <250 250 0> FONT 0 MARGINS <125 125 250 62> END .GRP END NOTES_MASTER PART "Source File" .GRP BACKFILL <34 2 5 1000 0 0 0> LINEFILL <21 21 5 1000 0 0 0> SHADOW <11 0 15 15> V_SPACE <0 500 0> FONT 2 SIZE 360000 L_SPACE 500 MARGINS <250 250 500 125> .POL AT (3940,2758) RECOLOR ON PARA <0 0 0 0 1000 34 0 111> PNTS (394,0)(0,788)(1182,788)(1576,0)(394,0) END .GRP SLIDE_INFO SLIDE_STYLE <0 -1 1> LAYOUT_ID <0 1 2 3 3> END SLIDE_INFO PICTURE .TXT AT (997,3914) RECOLOR ON BACKFILL <20 20 5 1000 0 0 0> THICKNESS 0 V_SPACE <0 250 0> SIZE 180000 L_SPACE 250 MARGINS <0 0 0 0> TXTXYOFF <0 183> T_PNTS (0,183)(0,0)(8745,0)(8745,1433)(0,1433)(0,183)(8745,183) .STR "Collection and maintenance of Ada 95 interfaces to as much RDBM S products ^anas possible.\n\nProvide an integrated solution for application devlopment based upon common ^anstandards.\n " .TXT AT (3841,2814) RECOLOR ON V_SPACE <0 333 0> TXTXYOFF <-27 244> T_PNTS (0,244)(0,0)(2630,0)(2630,317)(0,317)(0,244)(2630,244) .STR SIZE 240000 "Project Objectives" .TMP AT (111,89) RECOLOR ON TEMPLATE_FLAGS <1 1 0 0> T_POS <111 89 10375 2017> .TXT AT (248,827) RECOLOR ON TEMPLATED ON BACKFILL <20 7 0 0 0 0 0> THICKNESS 1 PARA <0 0 0 0 1000 1 0 111> V_SPACE <0 611 0> SIZE 440000 BOLD ON HOR_JUST CENTER L_SPACE 611 TXTXYOFF <0 447> T_PNTS (-2,445)(-2,-2)(9963,-2)(9963,1069)(-2,1069)(-2,445)(9963,445) H_SPACE 10265 .STR UNDERLINE ON "GN" .STR UNDERLINE OFF "AT " .STR UNDERLINE ON "A" .STR UNDERLINE OFF "da " .STR UNDERLINE ON "D" .STR UNDERLINE OFF "atabase " .STR UNDERLINE ON "E" .STR UNDERLINE OFF "nvironment\nGNADE" END PICTURE NOTES .GRP BACKFILL <1 0 0 0 0 0 0> LINEFILL <1 2 5 1000 0 0 0> SHADOW <6 0 15 15> PARA <0 0 0 0 1000 1 1 111> V_SPACE <0 250 0> FONT 0 SIZE 180000 BOLD OFF HOR_JUST LEFT L_SPACE 250 MARGINS <125 125 250 62> .TMP AT (41,466) RECOLOR ON TEMPLATE_FLAGS <5 14 0 0> T_POS <41 466 7021 5509> .VOID .TMP AT (41,5781) RECOLOR ON TEMPLATE_FLAGS <6 15 0 0> T_POS <41 5781 7021 10823> .VOID END .GRP END NOTES SLIDE_INFO SLIDE_STYLE <0 -1 1> LAYOUT_ID <0 1 2 3 3> END SLIDE_INFO PICTURE .RECT AT (1170,1945) RECOLOR ON BACKFILL <5 2 5 125 0 0 0> LINEFILL <21 21 5 1000 0 0 0> SHADOW <11 0 15 15> STYLE 4 R_ARROW 1 PARA <0 0 0 0 1000 34 0 111> V_SPACE <0 500 0> FONT 2 SIZE 360000 L_SPACE 500 MARGINS <250 250 500 125> PNTS (0,0)(2416,0)(2416,2841)(0,2841)(0,0) .RECT AT (3719,1967) RECOLOR ON BACKFILL <4 2 5 250 0 0 0> STYLE 0 XYRAD <1619 528> PNTS (0,0)(6483,0)(6483,2128)(0,2128)(0,0) .TXT AT (6995,68) RECOLOR ON BACKFILL <20 20 5 1000 0 0 0> THICKNESS 0 R_ARROW 0 V_SPACE <0 250 0> SIZE 180000 L_SPACE 250 MARGINS <0 0 0 0> TXTXYOFF <-8 142> T_PNTS (0,142)(0,0)(3464,0)(3464,146)(0,146)(0,142)(3464,142) H_SPACE 0 .STR V_SPACE <0 194 0> SIZE 140000 "GNADE - GNAT Database Environment" .TXT AT (1571,1468) RECOLOR ON V_SPACE <0 250 0> SIZE 180000 MARGINS <125 125 250 62> TXTXYOFF <0 0> PNTS (0,0)(0,0)(0,0)(0,0)(0,0) .STR "CThe" .TXT AT (2403,829) RECOLOR ON V_SPACE <0 500 0> MARGINS <0 0 0 0> TXTXYOFF <-23 367> T_PNTS (0,367)(0,0)(5265,0)(5265,378)(0,378)(0,367)(5265,367) .STR SIZE 360000 "Generic GNADE Model " .RECT AT (1368,2162) RECOLOR ON BACKFILL <44 2 5 1000 0 0 0> THICKNESS 1 R_ARROW 1 L_SPACE 500 MARGINS <250 250 500 125> XYRAD <0 0> PNTS (0,0)(1970,0)(1970,1182)(0,1182)(0,0) .RECT AT (1368,3738) RECOLOR ON BACKFILL <34 2 5 1000 0 0 0> PNTS (0,0)(1970,0)(1970,788)(0,788)(0,0) .RECT AT (1370,5115) RECOLOR ON BACKFILL <23 2 5 1000 0 0 0> PNTS (0,0)(1970,0)(1970,1673)(0,1673)(0,0) .TXT AT (1738,2534) RECOLOR ON BACKFILL <20 20 5 1000 0 0 0> THICKNESS 0 HOR_JUST CENTER MARGINS <0 0 0 0> TXTXYOFF <2 178> T_PNTS (0,178)(0,0)(1203,0)(1203,433)(0,433)(0,178)(1203,178) .STR V_SPACE <0 250 0> SIZE 180000 "Application\n Code" .TXT AT (1813,3913) RECOLOR ON V_SPACE <0 500 0> SIZE 360000 HOR_JUST LEFT TXTXYOFF <0 178> T_PNTS (0,178)(0,0)(1058,0)(1058,433)(0,433)(0,178)(1058,178) .STR V_SPACE <0 250 0> SIZE 180000 "Database^an Interface" .TXT AT (1621,5286) RECOLOR ON V_SPACE <0 500 0> SIZE 360000 HOR_JUST CENTER T_PNTS (0,178)(0,0)(1451,0)(1451,1230)(0,1230)(0,178)(1451,178) .STR V_SPACE <0 250 0> SIZE 180000 "Relational" .STR "\nDatabase^anManagement" .STR "\nSystem \n(RDBMS)" .LINE AT (2325,3339) RECOLOR ON BACKFILL <34 2 5 1000 0 0 0> THICKNESS 1 V_SPACE <0 500 0> SIZE 360000 HOR_JUST LEFT MARGINS <250 250 500 125> PNTS (0,0)(0,381) .TXT AT (3935,4833) RECOLOR ON BACKFILL <20 20 5 1000 0 0 0> THICKNESS 0 SIZE 140000 MARGINS <0 0 0 0> TXTXYOFF <0 141> T_PNTS (0,141)(0,0)(6275,0)(6275,918)(0,918)(0,141)(6275,141) .STR V_SPACE <0 194 0> "(2) The application code used the data base interface (dbi) to excutes\n an SQL query. " .STR "The data base interface executes the query via \n some dri ver software provided by the RDBMS vendor creating some ^an result set in the address space of the RDBMS. " .STR "\n " .TXT AT (3935,5762) RECOLOR ON V_SPACE <0 500 0> T_PNTS (0,141)(0,0)(5220,0)(5220,376)(0,376)(0,141)(5220,141) .STR V_SPACE <0 194 0> "(3) The application reads the records of the result set via the ^an DBI into the address space of the application. " .LINE AT (2317,4522) RECOLOR ON BACKFILL <34 2 5 1000 0 0 0> THICKNESS 1 V_SPACE <0 500 0> SIZE 360000 MARGINS <250 250 500 125> PNTS (0,0)(0,580) .TXT AT (3933,2357) RECOLOR ON BACKFILL <20 20 5 1000 0 0 0> THICKNESS 0 SIZE 140000 MARGINS <0 0 0 0> TXTXYOFF <0 122> T_PNTS (0,122)(0,0)(6112,0)(6112,1539)(0,1539)(0,122)(6112,122) .STR V_SPACE <0 167 0> SIZE 120000 "(1) DB := Connect( user => \"gnade\", password =>-...); " .STR V_SPACE <0 194 0> "\n" .STR V_SPACE <0 167 0> "\n(2) Result := Execute( DB, \"select * from EMPLOYEES where na me = 'Erdmann'\"..)" .STR V_SPACE <0 194 0> "\n" .STR V_SPACE <0 167 0> "\n(3) while not End_Of(Result) loop" .STR "\n Fetch( Result, mode => Next );" .STR "\n ....... ............" .STR "\n end loop;" .STR V_SPACE <0 194 0> SIZE 140000 "\n " .TXT AT (3935,4187) RECOLOR ON V_SPACE <0 500 0> TXTXYOFF <0 142> T_PNTS (0,142)(0,0)(5736,0)(5736,380)(0,380)(0,142)(5736,142) .STR V_SPACE <0 194 0> "(1) The application authorizes it self on the RDBMS in order to gain^an access to the data managed in the data base." .TXT AT (705,1772) RECOLOR ON V_SPACE <0 500 0> SIZE 360000 TXTXYOFF <-8 142> T_PNTS (0,142)(0,0)(1389,0)(1389,146)(0,146)(0,142)(1389,142) .STR V_SPACE <0 194 0> SIZE 140000 "GNADE Domain" END PICTURE NOTES .GRP BACKFILL <34 2 5 1000 0 0 0> THICKNESS 1 R_ARROW 0 PARA <0 0 0 0 1000 1 0 111> V_SPACE <0 250 0> SIZE 180000 L_SPACE 250 MARGINS <125 125 250 62> .TMP AT (41,466) RECOLOR ON TEMPLATE_FLAGS <5 14 0 0> T_POS <41 466 7021 5509> .VOID .TMP AT (41,5781) RECOLOR ON TEMPLATE_FLAGS <6 15 0 0> T_POS <41 5781 7021 10823> .VOID END .GRP END NOTES SLIDE_INFO SLIDE_STYLE <0 -1 1> LAYOUT_ID <0 1 2 3 3> END SLIDE_INFO PICTURE .TXT AT (2379,2190) RECOLOR ON BACKFILL <20 20 5 1000 0 0 0> THICKNESS 0 PARA <0 0 0 0 1000 34 0 111> V_SPACE <0 333 0> MARGINS <0 0 0 0> TXTXYOFF <0 242> T_PNTS (0,242)(0,0)(3428,0)(3428,1459)(0,1459)(0,242)(3428,242) .STR SIZE 240000 "Native Bindings for:" .STR SIZE 180000 "^an^an - MySQL" .STR V_SPACE <0 250 0> "\n - PostgreSQL\n - Oracle Call Interface (OCI)" .TXT AT (2341,4121) RECOLOR ON V_SPACE <0 333 0> TXTXYOFF <0 244> T_PNTS (0,244)(0,0)(5000,0)(5000,1908)(0,1908)(0,244)(5000,244) .STR SIZE 240000 "Binding to the ODBC 2.0 Interface\n " .STR SIZE 180000 " - MySQL^an - PostgreSQL^an - Oracle^an - MS SQL Server, MimerSQL ..........." .STR SIZE 240000 "^an" .TXT AT (1429,1118) RECOLOR ON V_SPACE <0 500 0> SIZE 180000 TXTXYOFF <-21 367> T_PNTS (0,367)(0,0)(6862,0)(6862,472)(0,472)(0,367)(6862,367) .STR SIZE 360000 "Supported Database Interfaces" END PICTURE NOTES .GRP BACKFILL <34 2 5 1000 0 0 0> THICKNESS 1 PARA <0 0 0 0 1000 1 0 111> L_SPACE 500 MARGINS <250 250 500 125> .TMP AT (41,466) RECOLOR ON TEMPLATE_FLAGS <5 14 0 0> T_POS <41 466 7021 5509> .VOID .TMP AT (41,5781) RECOLOR ON TEMPLATE_FLAGS <6 15 0 0> T_POS <41 5781 7021 10823> .VOID END .GRP END NOTES SLIDE_INFO SLIDE_STYLE <0 -1 1> LAYOUT_ID <0 1 2 3 3> END SLIDE_INFO PICTURE .TXT AT (3538,1606) RECOLOR ON BACKFILL <20 20 5 1000 0 0 0> THICKNESS 0 PARA <0 0 0 0 1000 34 0 111> SIZE 180000 L_SPACE 250 MARGINS <0 0 0 0> TXTXYOFF <-37 357> T_PNTS (0,357)(0,0)(3407,0)(3407,467)(0,467)(0,357)(3407,357) .STR SIZE 360000 "Native Bindings" .TXT AT (781,3145) RECOLOR ON R_ARROW 1 L_SPACE 500 TXTXYOFF <0 182> T_PNTS (0,182)(0,0)(9045,0)(9045,1681)(0,1681)(0,182)(9045,182) .STR V_SPACE <0 250 0> SIZE 180000 "Native bindings are Ada 95 implemenations " .STR "of the vendor specific data base API. ^anThe bindings normally do follow naming conventions of the vendor implementation^anin o rder to ensure the reusability of the vendor documentation.\n\n" .STR BACKFILL <7 20 5 1000 0 0 0> "GNADE does not explicitly promote the usage of native bindings in its tool chain^anbut we are collecting and maintaining the bi ndings as far as possible!" .STR BACKFILL <20 20 5 1000 0 0 0> "\n" END PICTURE NOTES .GRP BACKFILL <34 2 5 1000 0 0 0> THICKNESS 1 R_ARROW 0 PARA <0 0 0 0 1000 1 0 111> V_SPACE <0 500 0> SIZE 360000 MARGINS <250 250 500 125> .TMP AT (41,466) RECOLOR ON TEMPLATE_FLAGS <5 14 0 0> T_POS <41 466 7021 5509> .VOID .TMP AT (41,5781) RECOLOR ON TEMPLATE_FLAGS <6 15 0 0> T_POS <41 5781 7021 10823> .VOID END .GRP END NOTES SLIDE_INFO SLIDE_STYLE <0 -1 1> LAYOUT_ID <0 1 2 3 3> END SLIDE_INFO PICTURE .TXT AT (1575,814) RECOLOR ON BACKFILL <20 20 5 1000 0 0 0> THICKNESS 0 PARA <0 0 0 0 1000 34 0 111> SIZE 180000 L_SPACE 250 MARGINS <0 0 0 0> TXTXYOFF <-41 367> T_PNTS (0,367)(0,0)(6935,0)(6935,477)(0,477)(0,367)(6935,367) .STR SIZE 360000 "Pro & Con's of native Bindings" .TXT AT (1569,1964) RECOLOR ON R_ARROW 1 L_SPACE 500 TXTXYOFF <0 238> T_PNTS (0,238)(0,0)(7585,0)(7585,2071)(0,2071)(0,238)(7585,238) .STR BACKFILL <7 20 5 1000 0 0 0> V_SPACE <0 333 0> SIZE 240000 BOLD ON "Pro:" .STR BOLD OFF " " .STR SIZE 180000 "^an" .STR BACKFILL <20 20 5 1000 0 0 0> V_SPACE <0 250 0> "\n- Optimized with respect to the vendors RDB" .STR "MS (i.e. transfer of large^an BLOB's).\n- In general a small interface^an- Normally good documentation by the vendor." .STR V_SPACE <0 500 0> "\n" .TXT AT (1575,4087) RECOLOR ON SIZE 360000 TXTXYOFF <0 244> T_PNTS (0,244)(0,0)(7685,0)(7685,2076)(0,2076)(0,244)(7685,244) .STR BACKFILL <7 20 5 1000 0 0 0> V_SPACE <0 333 0> SIZE 240000 BOLD ON "Con's:" .STR BOLD OFF " " .STR BACKFILL <20 20 5 1000 0 0 0> SIZE 180000 "^an" .STR V_SPACE <0 250 0> "\n- Application becomes dependent on the Vendors Implementation \n- Usage of different vendors by the same application becomes d ifficult\n- Type conversion between SQL and the Ada 95 becomes a n \n application task." .STR V_SPACE <0 500 0> "\n" END PICTURE NOTES .GRP BACKFILL <34 2 5 1000 0 0 0> THICKNESS 1 R_ARROW 0 PARA <0 0 0 0 1000 1 0 111> SIZE 360000 MARGINS <250 250 500 125> .TMP AT (41,466) RECOLOR ON TEMPLATE_FLAGS <5 14 0 0> T_POS <41 466 7021 5509> .VOID .TMP AT (41,5781) RECOLOR ON TEMPLATE_FLAGS <6 15 0 0> T_POS <41 5781 7021 10823> .VOID END .GRP END NOTES SLIDE_INFO SLIDE_STYLE <0 -1 1> LAYOUT_ID <0 1 2 3 3> END SLIDE_INFO PICTURE .TXT AT (3127,751) RECOLOR ON BACKFILL <20 20 5 1000 0 0 0> THICKNESS 0 PARA <0 0 0 0 1000 34 0 111> SIZE 180000 L_SPACE 250 MARGINS <0 0 0 0> TXTXYOFF <-25 367> T_PNTS (0,367)(0,0)(4192,0)(4192,471)(0,471)(0,367)(4192,367) .STR SIZE 360000 "ODBC Interface (1)" .RECT AT (1182,1970) RECOLOR ON BACKFILL <44 2 5 1000 0 0 0> THICKNESS 1 R_ARROW 1 L_SPACE 500 MARGINS <250 250 500 125> PNTS (0,0)(1970,0)(1970,788)(0,788)(0,0) .RECT AT (1182,3212) RECOLOR ON BACKFILL <34 2 5 1000 0 0 0> PNTS (0,0)(1970,0)(1970,394)(0,394)(0,0) .RECT AT (1182,3940) RECOLOR ON BACKFILL <13 2 5 1000 0 0 0> PNTS (0,0)(1970,0)(1970,788)(0,788)(0,0) .POL AT (1182,5122) RECOLOR ON BACKFILL <23 2 5 1000 0 0 0> PNTS (0,0)(1970,0)(1970,1576)(0,1576)(0,0) .TXT AT (1585,3320) RECOLOR ON BACKFILL <20 20 5 1000 0 0 0> THICKNESS 0 MARGINS <0 0 0 0> TXTXYOFF <-10 142> T_PNTS (0,142)(0,0)(1338,0)(1338,185)(0,185)(0,142)(1338,142) .STR V_SPACE <0 194 0> SIZE 140000 "ODBC Bindings" .TXT AT (1502,4259) RECOLOR ON V_SPACE <0 500 0> SIZE 360000 TXTXYOFF <-15 139> T_PNTS (0,139)(0,0)(1316,0)(1316,182)(0,182)(0,139)(1316,139) .STR V_SPACE <0 194 0> SIZE 140000 "Driver Manager" .TXT AT (1811,5834) RECOLOR ON V_SPACE <0 500 0> SIZE 360000 FLD_XYSCALE <10230 10000> TXTXYOFF <-17 142> T_PNTS (0,142)(0,0)(691,0)(691,146)(0,146)(0,142)(691,142) .STR V_SPACE <0 194 0> SIZE 140000 FLD_XYSCALE <10000 10000> "RDBMS" .TXT AT (1675,2192) RECOLOR ON V_SPACE <0 500 0> SIZE 360000 HOR_JUST CENTER TXTXYOFF <-25 139> T_PNTS (0,139)(0,0)(1002,0)(1002,337)(0,337)(0,139)(1002,139) .STR V_SPACE <0 194 0> SIZE 140000 "Application ^anCode" .RECT AT (1183,5122) RECOLOR ON BACKFILL <23 2 5 1000 0 0 0> THICKNESS 1 V_SPACE <0 500 0> SIZE 360000 HOR_JUST LEFT MARGINS <250 250 500 125> PNTS (0,0)(1969,0)(1969,394)(0,394)(0,0) .TXT AT (1613,5252) RECOLOR ON BACKFILL <20 20 5 1000 0 0 0> THICKNESS 0 MARGINS <0 0 0 0> TXTXYOFF <-8 122> T_PNTS (0,122)(0,0)(1092,0)(1092,126)(0,126)(0,122)(1092,122) .STR V_SPACE <0 167 0> SIZE 120000 "ODBC libraries" .LINE AT (2151,2750) RECOLOR ON BACKFILL <34 2 5 1000 0 0 0> THICKNESS 1 V_SPACE <0 500 0> SIZE 360000 MARGINS <250 250 500 125> PNTS (0,0)(0,454) .LINE AT (2139,3595) RECOLOR ON PNTS (0,0)(0,342) .LINE AT (2130,4721) RECOLOR ON PNTS (0,0)(0,415) .TXT AT (3544,3144) RECOLOR ON BACKFILL <20 20 5 1000 0 0 0> THICKNESS 0 MARGINS <0 0 0 0> TXTXYOFF <0 183> T_PNTS (0,183)(0,0)(5958,0)(5958,488)(0,488)(0,183)(5958,183) .STR V_SPACE <0 250 0> SIZE 180000 "The Ada 95 ODBC bindings are linked with the Driver ^anManager (DM) Interface. " .TXT AT (3535,3932) RECOLOR ON V_SPACE <0 500 0> SIZE 360000 T_PNTS (0,183)(0,0)(6403,0)(6403,688)(0,688)(0,183)(6403,183) .STR V_SPACE <0 250 0> SIZE 180000 "The DM provides the ODBC API by translating the ODBC ^anprimiti ves into operations towards the RDBMS by invoking^anthe RDBMS li braries." .TXT AT (3537,5116) RECOLOR ON V_SPACE <0 500 0> SIZE 360000 T_PNTS (0,183)(0,0)(6121,0)(6121,1184)(0,1184)(0,183)(6121,183) .STR V_SPACE <0 250 0> SIZE 180000 "The RDBMS exports a set of ODBC libraries which are ^anused by the DM to implement the ODBC operations. \nThe RDBMS creates a r esult set which can be retrieved\nby the application record by r ecord.\n " .TXT AT (3539,1966) RECOLOR ON V_SPACE <0 500 0> SIZE 360000 T_PNTS (0,183)(0,0)(6667,0)(6667,933)(0,933)(0,183)(6667,183) .STR V_SPACE <0 250 0> SIZE 180000 "The application executes a SQL query on a data source \n(not a database). After execution of the query the application^anwill f etch the result record by record.^an" END PICTURE NOTES .GRP BACKFILL <34 2 5 1000 0 0 0> THICKNESS 1 R_ARROW 0 PARA <0 0 0 0 1000 1 0 111> V_SPACE <0 500 0> SIZE 360000 MARGINS <250 250 500 125> .TMP AT (41,466) RECOLOR ON TEMPLATE_FLAGS <5 14 0 0> T_POS <41 466 7021 5509> .VOID .TMP AT (41,5781) RECOLOR ON TEMPLATE_FLAGS <6 15 0 0> T_POS <41 5781 7021 10823> .VOID END .GRP END NOTES SLIDE_INFO SLIDE_STYLE <0 -1 1> LAYOUT_ID <0 1 2 3 3> END SLIDE_INFO PICTURE .TXT AT (3129,753) RECOLOR ON BACKFILL <20 20 5 1000 0 0 0> THICKNESS 0 PARA <0 0 0 0 1000 34 0 111> SIZE 180000 L_SPACE 250 MARGINS <0 0 0 0> TXTXYOFF <-25 367> T_PNTS (0,367)(0,0)(4330,0)(4330,471)(0,471)(0,367)(4330,367) .STR SIZE 360000 "ODBC Interface (2)" .TXT AT (775,1773) RECOLOR ON R_ARROW 1 V_SPACE <0 250 0> SIZE 140000 L_SPACE 194 TXTXYOFF <0 183> T_PNTS (0,183)(0,0)(8888,0)(8888,4933)(0,4933)(0,183)(8888,183) .STR SIZE 180000 L_SPACE 500 "- The interface between RDBMS and Application is based on so ca lled defered ^an buffers, which means together with a query add resses are passed to the ODBC^an interface which are pointing o n the parameters which have to be applied for ^an a query.\n\n select EMPNO from EMPLOYEES where NAME = \n\n is translated into:\n \n select EMPNO from EMPLOYEES where N AME = ? \n\n and a address which is bound to the which '?' deno ted parameter. \n\n- The conversion between SQL data types and h ost data types is done in the ^an ODBC driver. The mapping fro m host variable type to Ada 95 data type is ^an done in the ap plication.^an\n- The fields (e.g. EMPNO) in a record of the resu lt set are accessed by binding^an deferred buffers before execu tion of the query.^an " END PICTURE NOTES .GRP BACKFILL <34 2 5 1000 0 0 0> THICKNESS 1 R_ARROW 0 PARA <0 0 0 0 1000 1 0 111> V_SPACE <0 500 0> SIZE 360000 MARGINS <250 250 500 125> .TMP AT (41,466) RECOLOR ON TEMPLATE_FLAGS <5 14 0 0> T_POS <41 466 7021 5509> .VOID .TMP AT (41,5781) RECOLOR ON TEMPLATE_FLAGS <6 15 0 0> T_POS <41 5781 7021 10823> .VOID END .GRP END NOTES SLIDE_INFO SLIDE_STYLE <0 -1 1> LAYOUT_ID <0 1 2 3 3> END SLIDE_INFO PICTURE .TXT AT (1481,837) RECOLOR ON BACKFILL <20 20 5 1000 0 0 0> THICKNESS 0 PARA <0 0 0 0 1000 34 0 111> SIZE 180000 L_SPACE 250 MARGINS <0 0 0 0> TXTXYOFF <-41 367> T_PNTS (0,367)(0,0)(7626,0)(7626,378)(0,378)(0,367)(7626,367) .STR SIZE 360000 "Pro & Con's of the ODBC Interface" .TXT AT (1548,1950) RECOLOR ON R_ARROW 1 L_SPACE 500 TXTXYOFF <0 238> T_PNTS (0,238)(0,0)(6972,0)(6972,2071)(0,2071)(0,238)(6972,238) .STR BACKFILL <7 20 5 1000 0 0 0> V_SPACE <0 333 0> SIZE 240000 BOLD ON "Pro:" .STR BOLD OFF " " .STR SIZE 180000 "^an" .STR BACKFILL <20 20 5 1000 0 0 0> V_SPACE <0 250 0> "\n- Widly accepted and provided by almost all database vendors .\n- Large code base.\n- Reuse of existing documentation.\n- Par t of the type conversion is done in the ODBC driver" .STR V_SPACE <0 500 0> "\n" .TXT AT (1569,4328) RECOLOR ON SIZE 360000 TXTXYOFF <0 244> T_PNTS (0,244)(0,0)(7516,0)(7516,1577)(0,1577)(0,244)(7516,244) .STR BACKFILL <7 20 5 1000 0 0 0> V_SPACE <0 333 0> SIZE 240000 BOLD ON "Cons:" .STR BOLD OFF " " .STR SIZE 180000 "^an" .STR BACKFILL <20 20 5 1000 0 0 0> V_SPACE <0 250 0> "\n- Requires a driver manager which imposes additional complexi ty on^an the installation.\n- The use of deffered buffers makes the interface quite unsafe.\n" END PICTURE NOTES .GRP BACKFILL <34 2 5 1000 0 0 0> THICKNESS 1 R_ARROW 0 PARA <0 0 0 0 1000 1 0 111> V_SPACE <0 500 0> SIZE 360000 MARGINS <250 250 500 125> .TMP AT (41,466) RECOLOR ON TEMPLATE_FLAGS <5 14 0 0> T_POS <41 466 7021 5509> .VOID .TMP AT (41,5781) RECOLOR ON TEMPLATE_FLAGS <6 15 0 0> T_POS <41 5781 7021 10823> .VOID END .GRP END NOTES SLIDE_INFO SLIDE_STYLE <0 -1 1> LAYOUT_ID <0 1 2 3 3> END SLIDE_INFO PICTURE .RECT AT (7483,1798) RECOLOR ON BACKFILL <23 2 5 1000 0 0 0> STYLE 4 PARA <0 0 0 0 1000 34 0 111> PNTS (0,0)(2136,0)(2136,2429)(0,2429)(0,0) .TXT AT (1858,786) RECOLOR ON BACKFILL <20 20 5 1000 0 0 0> THICKNESS 0 STYLE 0 SIZE 240000 L_SPACE 333 MARGINS <0 0 0 0> TXTXYOFF <-44 367> T_PNTS (0,367)(0,0)(6642,0)(6642,477)(0,477)(0,367)(6642,367) .STR SIZE 360000 L_SPACE 250 "Integration of SQL into Ada 95" .POL AT (3818,3940) RECOLOR ON BACKFILL <44 2 5 1000 0 0 0> THICKNESS 1 L_SPACE 500 MARGINS <250 250 500 125> PNTS (0,0)(1,0) .RECT AT (3517,3545) RECOLOR ON BACKFILL <34 2 5 1000 0 0 0> PNTS (0,0)(1576,0)(1576,788)(0,788)(0,0) .POL AT (1408,3551) RECOLOR ON BACKFILL <44 2 5 1000 0 0 0> PNTS (394,0)(0,788)(1182,788)(1576,0)(394,0) .TXT AT (1755,3707) RECOLOR ON BACKFILL <20 20 5 1000 0 0 0> THICKNESS 0 MARGINS <0 0 0 0> TXTXYOFF <0 122> T_PNTS (0,122)(0,0)(1115,0)(1115,466)(0,466)(0,122)(1115,122) .STR V_SPACE <0 167 0> SIZE 120000 "Ada 95 Source" .STR "\nwith embedded" .STR "\nSQL" .TXT AT (3576,3835) RECOLOR ON R_ARROW 1 V_SPACE <0 500 0> SIZE 360000 TXTXYOFF <-15 142> T_PNTS (0,142)(0,0)(1425,0)(1425,153)(0,153)(0,142)(1425,142) .STR V_SPACE <0 194 0> SIZE 140000 "ESQL Translator" .POL AT (3462,5112) RECOLOR ON BACKFILL <34 2 5 1000 0 0 0> THICKNESS 1 R_ARROW 0 V_SPACE <0 500 0> SIZE 360000 MARGINS <250 250 500 125> PNTS (394,0)(0,788)(1182,788)(1576,0)(394,0) .TXT AT (3701,5415) RECOLOR ON BACKFILL <20 20 5 1000 0 0 0> THICKNESS 0 R_ARROW 1 MARGINS <0 0 0 0> TXTXYOFF <0 119> T_PNTS (0,119)(0,0)(1065,0)(1065,123)(0,123)(0,119)(1065,119) .STR V_SPACE <0 167 0> SIZE 120000 "Ada 95 source" .POL AT (3546,2174) RECOLOR ON BACKFILL <34 2 5 1000 0 0 0> THICKNESS 1 R_ARROW 0 V_SPACE <0 500 0> SIZE 360000 MARGINS <250 250 500 125> PNTS (394,0)(0,788)(1182,788)(1576,0)(394,0) .TXT AT (3869,2473) RECOLOR ON BACKFILL <20 20 5 1000 0 0 0> THICKNESS 0 R_ARROW 1 MARGINS <0 0 0 0> TXTXYOFF <-6 122> T_PNTS (0,122)(0,0)(892,0)(892,132)(0,132)(0,122)(892,122) .STR V_SPACE <0 167 0> SIZE 120000 "SQL Source" .RECT AT (5703,5121) RECOLOR ON BACKFILL <34 2 5 1000 0 0 0> THICKNESS 1 R_ARROW 0 V_SPACE <0 500 0> SIZE 360000 MARGINS <250 250 500 125> PNTS (0,0)(1348,0)(1348,788)(0,788)(0,0) .TXT AT (8164,3647) RECOLOR ON BACKFILL <20 20 5 1000 0 0 0> THICKNESS 0 MARGINS <0 0 0 0> TXTXYOFF <-17 142> T_PNTS (0,142)(0,0)(674,0)(674,146)(0,146)(0,142)(674,142) .STR V_SPACE <0 194 0> SIZE 140000 "RDBMS" .POL AT (7477,4306) RECOLOR ON BACKFILL <44 2 0 0 0 0 0> THICKNESS 1 STYLE 4 V_SPACE <0 500 0> SIZE 360000 MARGINS <250 250 500 125> PNTS (0,0)(2150,0)(2150,1917)(0,1917)(0,0) .ELL AT (7689,1883) RECOLOR ON BACKFILL <34 2 0 0 0 0 0> STYLE 0 PNTS (0,0)(1612,0)(1612,299)(0,299)(0,0) .ELL AT (7673,2916) RECOLOR ON PNTS (0,0)(1612,0)(1612,299)(0,299)(0,0) .LINE AT (7668,2048) RECOLOR ON BACKFILL <34 2 5 1000 0 0 0> PNTS (0,0)(0,1023) .LINE AT (9294,2029) RECOLOR ON PNTS (0,0)(0,1023) .RECT AT (8012,2245) RECOLOR ON BACKFILL <44 2 5 1000 0 0 0> PNTS (0,0)(1001,0)(1001,610)(0,610)(0,0) .TXT AT (8067,2428) RECOLOR ON BACKFILL <20 20 5 1000 0 0 0> THICKNESS 0 MARGINS <0 0 0 0> TXTXYOFF <0 119> T_PNTS (0,119)(0,0)(800,0)(800,288)(0,288)(0,119)(800,119) .STR V_SPACE <0 167 0> SIZE 120000 "Application\n Tables" .RECT AT (7721,4438) RECOLOR ON BACKFILL <34 2 5 1000 0 0 0> THICKNESS 1 V_SPACE <0 500 0> SIZE 360000 MARGINS <250 250 500 125> PNTS (0,0)(1576,0)(1576,394)(0,394)(0,0) .TXT AT (6070,5412) RECOLOR ON BACKFILL <20 20 5 1000 0 0 0> THICKNESS 0 MARGINS <0 0 0 0> TXTXYOFF <-8 142> T_PNTS (0,142)(0,0)(528,0)(528,146)(0,146)(0,142)(528,142) .STR V_SPACE <0 194 0> SIZE 140000 "GNAT" .RECT AT (7746,5094) RECOLOR ON BACKFILL <44 2 5 1000 0 0 0> THICKNESS 1 V_SPACE <0 500 0> SIZE 360000 MARGINS <250 250 500 125> PNTS (0,0)(1530,0)(1530,848)(0,848)(0,0) .LINE AT (7074,5496) RECOLOR ON BACKFILL <34 2 5 1000 0 0 0> R_ARROW 1 PNTS (0,0)(671,0) .TXT AT (7941,4511) RECOLOR ON BACKFILL <20 20 5 1000 0 0 0> THICKNESS 0 R_ARROW 0 MARGINS <0 0 0 0> TXTXYOFF <-8 122> T_PNTS (0,122)(0,0)(1148,0)(1148,159)(0,159)(0,122)(1148,122) .STR V_SPACE <0 167 0> SIZE 120000 "ODBC Bindings" .LINE AT (2825,3946) RECOLOR ON BACKFILL <34 2 5 1000 0 0 0> THICKNESS 1 R_ARROW 1 V_SPACE <0 500 0> SIZE 360000 MARGINS <250 250 500 125> PNTS (0,0)(690,0) .RECT AT (5685,2202) RECOLOR ON BACKFILL <23 2 5 1000 0 0 0> R_ARROW 0 PNTS (0,0)(1404,0)(1404,733)(0,733)(0,0) .TXT AT (5959,2494) RECOLOR ON BACKFILL <20 20 5 1000 0 0 0> THICKNESS 0 MARGINS <0 0 0 0> TXTXYOFF <-8 142> T_PNTS (0,142)(0,0)(924,0)(924,153)(0,153)(0,142)(924,142) .STR V_SPACE <0 194 0> SIZE 140000 "SQL Client" .LINE AT (4919,2573) RECOLOR ON BACKFILL <34 2 5 1000 0 0 0> THICKNESS 1 R_ARROW 1 V_SPACE <0 500 0> SIZE 360000 MARGINS <250 250 500 125> PNTS (0,0)(757,0) .LINE AT (7088,2564) RECOLOR ON PNTS (0,0)(941,9) .TXT AT (8047,5313) RECOLOR ON BACKFILL <20 20 5 1000 0 0 0> THICKNESS 0 R_ARROW 0 MARGINS <0 0 0 0> TXTXYOFF <0 119> T_PNTS (0,119)(0,0)(800,0)(800,291)(0,291)(0,119)(800,119) .STR V_SPACE <0 167 0> SIZE 120000 "Application" .STR "\nCode" .LINE AT (4334,4334) RECOLOR ON BACKFILL <34 2 5 1000 0 0 0> THICKNESS 1 R_ARROW 1 V_SPACE <0 500 0> SIZE 360000 MARGINS <250 250 500 125> PNTS (0,0)(0,788) .LINE AT (4323,2957) RECOLOR ON PNTS (0,598)(0,0) .LINE AT (4862,5497) RECOLOR ON PNTS (0,0)(848,0) .LINE AT (8459,3937) RECOLOR ON L_ARROW 1 PNTS (0,0)(0,485) END PICTURE NOTES .GRP L_ARROW 0 R_ARROW 0 PARA <0 0 0 0 1000 1 0 111> V_SPACE <0 250 0> SIZE 180000 L_SPACE 250 MARGINS <125 125 250 62> .TMP AT (41,466) RECOLOR ON TEMPLATE_FLAGS <5 14 0 0> T_POS <41 466 7021 5509> .VOID .TMP AT (41,5781) RECOLOR ON TEMPLATE_FLAGS <6 15 0 0> T_POS <41 5781 7021 10823> .VOID END .GRP END NOTES SLIDE_INFO SLIDE_STYLE <0 -1 1> LAYOUT_ID <0 1 2 3 3> END SLIDE_INFO PICTURE .TXT AT (2343,2950) RECOLOR ON BACKFILL <20 20 5 1000 0 0 0> THICKNESS 0 PARA <0 0 0 0 1000 34 0 111> V_SPACE <0 333 0> MARGINS <0 0 0 0> TXTXYOFF <0 183> T_PNTS (0,183)(0,0)(5930,0)(5930,2181)(0,2181)(0,183)(5930,183) .STR "^an- Ada Data Base Connectivity (ADBC) Model unifying ^an ODBC and native bindings?\n- SQL clients (GTK, ODBC)\n- AWS/ODBC bas ed administration client?\n- Datamodel Development Tools\n\n" .TXT AT (2361,1179) RECOLOR ON V_SPACE <0 500 0> TXTXYOFF <-39 357> T_PNTS (0,357)(0,0)(4709,0)(4709,462)(0,462)(0,357)(4709,357) .STR SIZE 360000 "Future Developments" END PICTURE NOTES .GRP BACKFILL <34 2 5 1000 0 0 0> THICKNESS 1 PARA <0 0 0 0 1000 1 0 111> L_SPACE 500 MARGINS <250 250 500 125> .TMP AT (41,466) RECOLOR ON TEMPLATE_FLAGS <5 14 0 0> T_POS <41 466 7021 5509> .VOID .TMP AT (41,5781) RECOLOR ON TEMPLATE_FLAGS <6 15 0 0> T_POS <41 5781 7021 10823> .VOID END .GRP END NOTES *END GRAPHICS gnade-1.6.2.orig/doc/ACT/gnade-12-07-2002.ppt0000644000175000017500000010600007523242426017404 0ustar lbrentalbrentaĞÏࡱá!şÿ şÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿıÿÿÿCşÿÿÿ   !"#$%&'()*+,-./0123456789:;<=>?@AşÿÿÿDşÿÿÿşÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿRoot Entry ÿÿÿÿÿÿÿÿd›Oφꪹ)èà:+BPowerPoint Document(ÿÿÿÿü+ü+ «}Current UserÿÿÿÿPicturesÿÿÿÿÿÿÿÿÿÿÿÿˆˆâşÿÿÿşÿÿÿ şÿÿÿ şÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿse Environment¡$#1ÿ#ğH ğ ƒ ğ0“޽h”Ÿ‹¿Àÿ ?ğ ¿ÿŞŞòòÿÿÿ{ğfñ€ &ğ ğ ğ¼ğ( ğ ğ ğd ğ  c ğ$‡¿ÿ ?ğ°Ğ ğà ğ ğ  ƒ ğ0€@ù$ƒ¿Àÿ ğ° @ Ğğà  ğ Ÿ¨RClick to edit Master text styles Second level Third level Fourth level Fifth level¢!    ª SğB ğ  s ğ*ÿÿÿ“޽h”Ÿ‹¿ÿ ?ğ ÿÿÿ¿¿¿ÿÿÿÉÊ šğ’0ğğ0ğ( ğ ğ ğB ğ s ğ*ÿÿÿ“޽h”Ÿ‹¿ÿ ?ğ ÿÿÿ¿¿¿ÿÿÿîèï€ù €ğx@ğğğ( ğ ğğp¢ ğÓ ğN€€ù$‚ƒ„…¿ ƒ¿ÀÿğÊ;ä  ğòŸ¨²Collection and maintenance of Ada 95 interfaces to as much RDBMS products as possible. Provide an integrated solution for application devlopment based upon common standards. ¡$³1pÿ³ğ΢ ğÓ ğN€Àù$‚ƒ„…¿ ƒ¿ÀÿğQ   ğPŸ¨Project Objectives¡"1@ÿğŠ ğ “ ğ6€ú$‚ƒ„‡¿ÿğØŒFBğà  ğ ğH ğ ƒ ğ0“޽h”Ÿ‹¿Àÿ ?ğ ¿ÿŞŞòòÿÿÿ{îNï€ù æğŞPğ'ğvğ( ğ ğğ” ğ  ğl´€¿¿¿ƒÿÿÿ†A‡Á ¿ÀÂÄËÎÑÕÿ12.5%ğ`¢Å ğ" ğ  ğh´G`'€ŞŞŞƒÿÿÿ†A‡Á¿ÀÂÄËÑÕÿ25%ğm^ô7 ğࢠğÓ ğN€@ú$‚ƒ„…¿ ƒ¿Àÿğ$º„y ğbŸ¨"GNADE - GNAT Database Environment¡$#1ÿ#ğ¼¢ ğà ğH€€ú$|¾‚t݃|¾„ø|¿ ƒ¿ÀÿğN‰‰N ğDŸ¨CThe¡$1pÿğÒ¢ ğÓ ğN€Àú$‚ƒ„…¿ ƒ¿ÀÿğÙe>³ ğTŸ¨Generic GNADE Model ¡$1àş$ğp ğ à ğH´ƒÿÿÿ¿ÀÂÄËÑÕÿğ݃†ğp ğ à ğH´ƒÿÿÿ¿ÀÂÄËÑÕÿğiƒ/ ğp ğ à ğH´ƒÿÿÿ¿ÀÂÄËÑÕÿğ‚ „FğÑ¢ ğÓ ğN€û$‚ƒ„…¿ ƒ¿Àÿğ°åš« ğSŸ¨Application Code¡&1pÿğÑ¢ ğÓ ğN€@û$‚ƒ„…¿ ƒ¿ÀÿğÉsà  ğSŸ¨Database Interface¡$1pÿğ:¢ ğÓ ğN€€û$‚ƒ„…¿ ƒ¿Àÿğá £è¦ ğ¼Ÿ¨.Relational Database ManaèÛé(š³Ô‰ òº/È 0ÒÕ·DTimes·DZapf Dingbats ·DSwiss0·DMorewingbats@·DDutchP·DHelvetica`·DCourier Swa©  @£nÿı?" dd@ÿÿïÿÿÿÿÿÿ  @@``€€ |ğtğÈšƒ     % /ğXrğ$ÿYrğ$ÿyac ğ$ƒ¿Àÿ@ñ÷ğó€Ğ‹ÿ úgşı4UdUd¶Éò0¶Ğ ¢şÿÿıÿÿpûppû@ ?Ù2Ú( ºMichael ErdmannOÙ Úğ0óŸ¨$GNAT Ada Database Environment GNADE¡Ø        ÿÿ¿ş¿şÿÿ¿ş¿şÿÿ¿ş¿şÿÿ¿ş¿şóóóó ó ó ó ó ó /ğóóóóóóóóóó êøÇ ï Ú`ğ ¿ÿŞŞòòÿÿÿ{£>ÿı?od ş@ÿÿïÿÿÿÿÿÿ,£ÿı? ldÿàÿ @ÿÿïÿÿÿÿÿÿ  5 ÿğÿ@  @ÿ`@ Pÿ€`  €ÿÿ £ÿı?odpÿğÿ@ÿÿïÿÿÿÿÿÿş   ş @@ş ``ş €€şP£Œÿı?od ş@ÿÿïÿÿÿÿÿÿ, ÿÿ   `£ p£>€£>ùK0 mğeğğığ( ğ ğğÎ ğ ƒ ğ0€ø$ƒ¿Àÿ ğ3@XŠğà  ğVŸ¨ Click to edit Master title style¢!ª !ğ ğ ƒ ğ0€@ø$ƒ¿Àÿ ğ'?êğà  ğ Ÿ¨RClick to edit Master text styles Second level Third level Fourth level Fifth level¢!    ª Sğ¹ ğ ƒ ğ0€€ø$ƒ¿Àÿ ğÀPàğà   ğAŸ¨*¡ úğ¾ ğ ƒ ğ0€Àø$ƒ¿Àÿ ğÀ€àğà  ğFŸ¨Page *¡ Øğ¬ ğ  ğ„‡B›CDEÁFÁƒÿÿÿ¿ÀÂÄË8cÿğÿ›@¬¬€ğß §ßğ¬ ğ  ğ„‡B–CDEÁFÁƒÿÿÿ¿ÀÂÄË8cÿğÿ–@¬¬€ğã–ãğࢠğÓ ğN€ù$‚ƒ„…¿ ƒ¿Àÿğ$º„y ğbŸ¨"GNADE - GNAT Databagement System (RDBMS)¡r 1pÿ1pÿ1pÿ ğjB ğ  ³ ğBƒÿÿÿ¿ÀÂÄËÑÕÿğƒ;;_ğ¢ ğ!Ó ğN€Àû$‚ƒ„…¿ ƒ¿ÀÿğÜ ×ïí  ğ‘Ÿ¨ (2) The application code used the data base interface (dbi) to excutes an SQL query. The data base interface executes the query via some driver software provided by the RDBMS vendor creating some result set in the address space of the RDBMS. ¡l[1ÿ¬1ÿ1ÿ[¬ğ3¢ ğ"Ó ğN€ü$‚ƒ„…¿ ƒ¿Àÿğô ×Í  𵟨u(3) The application reads the records of the result set via the DBI into the address space of the application. ¡$v1ÿvğjB ğ# ³ ğBƒÿÿÿ¿ÀÂÄËÑÕÿğ- 77{ ğ㢠ğ$Ó ğN€@ü$‚ƒ„…¿ ƒ¿ÀÿğKטÁ ğeŸ¨(1) DB := Connect( user => "gnade", password =>-...); (2) Result := Execute( DB, "select * from EMPLOYEES where name = 'Erdmann'"..) (3) while not End_Of(Result) loop Fetch( Result, mode => Next ); ....... ............ end loop; ¡D71 ÿ1ÿO1 ÿ1ÿ"1 ÿ)1 ÿ"1 ÿ1 ÿ1ÿ7  O  " ) "  ğ5¢ ğ%Ó ğN€€ü$‚ƒ„…¿ ƒ¿Àÿği ׸D  𷟨w(1) The application authorizes it self on the RDBMS in order to gain access to the data managed in the data base.¡$x1ÿxğÊ¢ ğ&Ó ğN€Àü$‚ƒ„…¿ ƒ¿Àÿğù“³N ğLŸ¨ GNADE Domain¡$ 1ÿ ğH ğ' ƒ ğ0“޽h”Ÿ‹¿Àÿ ?ğ ¿ÿŞŞòòÿÿÿ{îÕï€ù mğe`ğ,ğığ( ğ ğ(ğ[¢ ğ)Ó ğN€ı$‚ƒ„…¿ ƒ¿ÀÿğêW 3 ğİŸ¨WNative Bindings for: - MySQL - PostgreSQL - Oracle Call Interface (OCI)¡j1@ÿ1@ÿ61pÿ6ğ¢ ğ*Ó ğN€@ı$‚ƒ„…¿ ƒ¿ÀÿğB Aƒ  ğŸ¨}Binding to the ODBC 2.0 Interface - MySQL - PostgreSQL - Oracle - MS SQL Server, MimerSQL ........... ¡h&1@ÿV1@ÿ1@ÿ&VğÛ¢ ğ+Ó ğN€€ı$‚ƒ„…¿ ƒ¿Àÿğ5© ğ]Ÿ¨Supported Database Interfaces¡$1àş$ğH ğ, ƒ ğ0“޽h”Ÿ‹¿Àÿ ?ğ ¿ÿŞŞòòÿÿÿ{î‰ï€ù !ğpğ0ğ±ğ( ğ ğ-ğÍ¢ ğ.Ó ğN€Àı$‚ƒ„…¿ ƒ¿Àÿğ™ò§ ğOŸ¨Native Bindings¡$1àş$𤢠ğ/Ó ğN€ş$‚ƒ„…¿ ƒ¿Àÿğ¾Ø  ğ&Ÿ¨zNative bindings are Ada 95 implemenations of the vendor specific data base API. The bindings normally do follow naming conventions of the vendor implementation in order to ensure the reusability of the vendor documentation. GNADE does not explicitly promote the usage of native bindings in its tool chain but we are collecting and maintaining the bindings as far as possible! ¡*1pÿ¸1pÿ—1pÿ1pÿ*¸—ğH ğ0 ƒ ğ0“޽h”Ÿ‹¿Àÿ ?ğ ¿ÿŞŞòòÿÿÿ{î:ï€ù ÒğÊ€ğ5ğbğ( ğ ğ1ğŞ¢ ğ2Ó ğN€@ş$‚ƒ„…¿ ƒ¿Àÿğш&ä ğ`Ÿ¨ Pro & Con's of native Bindings¡$!1àş!$ğ¢ ğ3Ó ğN€€ş$‚ƒ„…¿ ƒ¿Àÿğg…  𗟨¥Pro: - Optimized with respect to the vendors RDBMS (i.e. transfer of large BLOB's). - In general a small interface - Normally good documentation by the vendor. ¡Ö1@ÿ1@ÿ1@ÿ,1pÿr1pÿ1àşÿÿ,rğ'¢ ğ4Ó ğN€Àş$‚ƒ„…¿ ƒ¿Àÿğ/ ˆÌÛ  𩟨ÛCon's: - Application becomes dependent on the Vendors Implementation - Usage of different vendors by the same application becomes difficult - Type conversion between SQL and the Ada 95 becomes an application task. ¡²1@ÿ1@ÿ1@ÿÒ1pÿ1àşÿÿÒğH ğ5 ƒ ğ0“޽h”Ÿ‹¿Àÿ ?ğ ¿ÿŞŞòòÿÿÿ{îXï€ù ğğèğIğ€ğ( ğ ğ6ğĞ¢ ğ7Ó ğN€ÿ$‚ƒ„…¿ ƒ¿Àÿğ­v» ğRŸ¨ODBC Interface (1)¡$1àş$ğp ğ8 à ğH´ƒÿÿÿ¿ÀÂÄËÑÕÿğo©5ğp ğ9 à ğH´ƒÿÿÿ¿ÀÂÄËÑÕÿğ:©ğp ğ: à ğH´òƒÿÿÿ¿ÀÂÄËÑÕÿğİ©£ ğÒ ğ; 3 ğª‡BoCŒDEÁFÁƒÿÿÿ¿ÀÂÄËÑÕÿğÿooŒŒ @¬¬¬¬¬`€ğ† ©ğË¢ ğ<Ó ğN€@ÿ$‚ƒ„…¿ ƒ¿Àÿğt‘ß ğMŸ¨ ODBC Bindings¡$1ÿğÌ¢ ğ=Ó ğN€€ÿ$‚ƒ„…¿ ƒ¿Àÿğ’ ^Sû  ğNŸ¨Driver Manager¡$1ÿğâ ğ>Ó ğN€Àÿ$‚ƒ„…¿ ƒ¿Àÿğ q  ğEŸ¨RDBMS¡$1ÿğÑ¢ ğ?Ó ğN€%‚ƒ„…¿ ƒ¿Àÿğì® ğSŸ¨Application Code¡&1ÿğp ğ@ à ğH´ƒÿÿÿ¿ÀÂÄËÑÕÿğ† ©i ğÌ¢ ğAÓ ğN€@%‚ƒ„…¿ ƒ¿ÀÿğÎ   ğNŸ¨ODBC libraries¡$1 ÿ ğjB ğB ³ ğBƒÿÿÿ¿ÀÂÄËÑÕÿğ0××6ğjB ğC ³ ğBƒÿÿÿ¿ÀÂÄËÑÕÿğĞĞÜğjB ğD ³ ğBƒÿÿÿ¿ÀÂÄËÑÕÿğŸ ËË ğ ¢ ğEÓ ğN€€%‚ƒ„…¿ ƒ¿ÀÿğöY) ğŸ¨MThe Ada 95 ODBC bindings are linked with the Driver Manager (DM) Interface. ¡$N1pÿNğA¢ ğFÓ ğN€À%‚ƒ„…¿ ƒ¿ÀÿğÖñSb  ğߨƒThe DM provides the ODBC API by translating the ODBC primitives into operations towards the RDBMS by invoking the RDBMS libraries.¡$„1pÿ„ğ¢ ğGÓ ğN€%‚ƒ„…¿ ƒ¿Àÿğ ñ±) ğŸ¨ÃThe RDBMS exports a set of ODBC libraries which are used by the DM to implement the ODBC operations. The RDBMS creates a result set which can be retrieved by the application record by record. ¡$Ä1pÿÄğ\¢ ğHÓ ğN€@%‚ƒ„…¿ ƒ¿Àÿğióì‚ ğŞŸ¨The application executes a SQL query on a data source (not a database). After execution of the query the application will fetch the result record by record. ¡$Ÿ1pÿŸğH ğI ƒ ğ0“޽h”Ÿ‹¿Àÿ ?ğ ¿ÿŞŞòòÿÿÿ{î£ï€ù ;ğ3 ğMğËğ( ğ ğJğÑ¢ ğKÓ ğN€€%‚ƒ„…¿ ƒ¿Àÿğ®Ç½ ğSŸ¨ODBC Interface (2)¡$1àş$𺢠ğLÓ ğN€À%‚ƒ„…¿ ƒ¿Àÿğùº± ğ<Ÿ¨ü- The interface between RDBMS and Application is based on so called defered buffers, which means together with a query addresses are passed to the ODBC interface which are pointing on the parameters which have to be applied for a query. select EMPNO from EMPLOYEES where NAME = is translated into: select EMPNO from EMPLOYEES where NAME = ? and a address which is bound to the which '?' denoted parameter. - The conversion between SQL data types and host data types is done in the ODBC driver. The mapping from host variable type to Ada 95 data type is done in the application. - The fields (e.g. EMPNO) in a record of the result set are accessed by binding deferred buffers before execution of the query. ¡$ı1pÿığH ğM ƒ ğ0“޽h”Ÿ‹¿Àÿ ?ğ ¿ÿŞŞòòÿÿÿ{îÇï€ù _ğW°ğRğïğ( ğ ğNğߢ ğOÓ ğN€%‚ƒ„…¿ ƒ¿ÀÿğßP}¸ ğaŸ¨!Pro & Con's of the ODBC Interface¡$"1àş"$ğ¢ ğPÓ ğN€@%‚ƒ„…¿ ƒ¿Àÿğ_y#  ğƒŸ¨µPro: - Widly accepted and provided by almost all database vendors. - Large code base. - Reuse of existing documentation. - Part of the type conversion is done in the ODBC driver ¡²1@ÿ1@ÿ1@ÿ®1pÿ1àşÿÿ®ğÇ¢ ğQÓ ğN€€%‚ƒ„…¿ ƒ¿Àÿğ¹ …jE  ğIŸ¨ŸCons: - Requires a driver manager which imposes additional complexity on the installation. - The use of deffered buffers makes the interface quite unsafe. ¡1@ÿ1@ÿ1@ÿ™1pÿÿÿ™ğH ğR ƒ ğ0“޽h”Ÿ‹¿Àÿ ?ğ ¿ÿŞŞòòÿÿÿ{î˜ï€ù 0ğ(Àğ$wğÀğ( ğ ğSğj ğT ³ ğB´ƒÿÿÿ¿ÀÂÄËÎÿğ Ö¥ƒ ğÜ¢ ğUÓ ğN€À%‚ƒ„…¿ ƒ¿ÀÿğÁ+Ó ğ^Ÿ¨Integration of SQL into Ada 95¡$1àş$ğ¬ ğV  ğ„‡BCDEÁFÁƒÿÿÿ¿ÀÂÄËÿğÿ@¬¬€ğİ—˜İğd ğW £ ğ<´ƒÿÿÿ¿ÀÂÄËÿğúêv À ğÆ ğX  ğ‡BŒCÆDEÁFÁƒÿÿÿ¿ÀÂÄËÿğÿãÆ©ÆŒã @¬¬¬¬¬`€ğı+·à ğ%¢ ğYÓ ğN€%‚ƒ„…¿ ƒ¿ÀÿğTîra  𧟨Ada 95 Source with embedded SQL¡l 1 ÿ1 ÿ1 ÿ    ğÍ¢ ğZÓ ğN€@%‚ƒ„…¿ ƒ¿Àÿğ< ö ğOŸ¨ESQL Translator¡$1ÿğÆ ğ[  ğ‡BŒCÆDEÁFÁƒÿÿÿ¿ÀÂÄËÿğÿãÆ©ÆŒã @¬¬¬¬¬`€ğ ÊV F ğË¢ ğ\Ó ğN€€%‚ƒ„…¿ ƒ¿Àÿğ, P¶ r  ğMŸ¨ Ada 95 source¡$1 ÿ ğÆ ğ]  ğ‡BŒCÆDEÁFÁƒÿÿÿ¿ÀÂÄËÿğÿãÆ©ÆŒã @¬¬¬¬¬`€ğäú† ªğÈ¢ ğ^Ó ğN€À%‚ƒ„…¿ ƒ¿ÀÿğŒ²³ Ø ğJŸ¨ SQL Source¡$ 1 ÿ  ğd ğ_ £ ğ<´ƒÿÿÿ¿ÀÂÄËÿğ† Õ İL ğâ ğ`Ó ğN€%‚ƒ„…¿ ƒ¿Àÿğ1[à… ğEŸ¨RDBMS¡$1ÿğÀ ğa  ğ˜‡BÖCPDEÁFÁ¿ÀÂÄËÎÿğÿÖÖPP @¬¬¬¬¬`€ğ° Ó©ğR2 ğb s ğ*¿ÀÂÄËÿğ=MíéğR2 ğc s ğ*¿ÀÂÄËÿğDä<ğ^B ğd “ ğ6ƒÿÿÿ¿ÀÂÄËÿğœAAéğ^B ğe “ ğ6ƒÿÿÿ¿ÀÂÄËÿğ‘ééŞğd ğf £ ğ<´ƒÿÿÿ¿ÀÂÄËÿğ GlğÑ¢ ğgÓ ğN€@%‚ƒ„…¿ ƒ¿Àÿğt#ñ ğSŸ¨Application Tables¡$1 ÿ ğd ğh £ ğ<´ƒÿÿÿ¿ÀÂÄËÿğü _ëß ğ¢ ğiÓ ğN€€%‚ƒ„…¿ ƒ¿Àÿğ* ¥ Ö  ğDŸ¨GNAT¡$1ÿğd ğj £ ğ<´ƒÿÿÿ¿ÀÂÄËÿğv nß_ ğjB ğk ³ ğBƒÿÿÿ¿ÀÂÄËÑÕÿğ^ ëm^ ğË¢ ğlÓ ğN€À%‚ƒ„…¿ ƒ¿Àÿğ# Ûp  ğMŸ¨ ODBC Bindings¡$1 ÿ ğjB ğm ³ ğBƒÿÿÿ¿ÀÂÄËÑÕÿğá[éáğd ğn £ ğ<´ƒÿÿÿ¿ÀÂÄËÿğôË ó›ğÈ¢ ğoÓ ğN€%‚ƒ„…¿ ƒ¿Àÿğ™f zñ ğJŸ¨ SQL Client¡$ 1ÿ ğjB ğp ³ ğBƒÿÿÿ¿ÀÂÄËÑÕÿğÊ Å ÊğjB ğq ³ ğBƒÿÿÿ¿ÀÂÄËÑÕÿğÅóÊğò¢ ğrÓ ğN€@%‚ƒ„…¿ ƒ¿Àÿğñ ä˜  ğtŸ¨Application Code¡H 1 ÿ1 ÿ   ğjB ğs ³ ğBƒÿÿÿ¿ÀÂÄËÑÕÿğÀ À À † ğjB ğt€ ³ ğBƒÿÿÿ¿ÀÂÄËÑÕÿ𧺠º ğjB ğu ³ ğBƒÿÿÿ¿ÀÂÄËÑÕÿğ^ ñ Ù ^ ğvB ğv Ó ğNƒÿÿÿ¿ÀÂÄËĞÑÓÕÿğÜó ğH ğw ƒ ğ0“޽h”Ÿ‹¿Àÿ ?ğ ¿ÿŞŞòòÿÿÿ{îYï€ ù ñğéĞğ{ğğ( ğ ğxğp¢ ğyÓ ğN€€%‚ƒ„…¿ ƒ¿Àÿğ B•‰  ğòŸ¨² - Ada Data Base Connectivity (ADBC) Model unifying ODBC and native bindings? - SQL clients (GTK, ODBC) - AWS/ODBC based administration client? - Datamodel Development Tools ¡$³1@ÿ³ğÑ¢ ğzÓ ğN€À%‚ƒ„…¿ ƒ¿Àÿğ£Mè­ ğSŸ¨Future Developments¡$1àş$ğH ğ{ ƒ ğ0“޽h”Ÿ‹¿Àÿ ?ğ ¿ÿŞŞòòÿÿÿ{ğ4ñ ôğìàğ~ğŠğ( ğ ğ|ğR ğ} 3 ğ¿ÿ ğ°Ğ ğà  ğB ğ~ s ğ*ÿÿÿ“޽h”Ÿ‹¿ÿ ?ğ ÿÿÿ¿¿¿ÿÿÿğ4ñ ôğìğğğŠğ( ğ ğğR ğ€ 3 ğ¿ÿ ğ°Ğ ğà  ğB ğ s ğ*ÿÿÿ“޽h”Ÿ‹¿ÿ ?ğ ÿÿÿ¿¿¿ÿÿÿğ4ñ ôğìğ„ğŠğ( ğ ğ‚ğR ğƒ 3 ğ¿ÿ ğ°Ğ ğà  ğB ğ„ s ğ*ÿÿÿ“޽h”Ÿ‹¿ÿ ?ğ ÿÿÿ¿¿¿ÿÿÿğ4ñ ôğìğ‡ğŠğ( ğ ğ…ğR ğ† 3 ğ¿ÿ ğ°Ğ ğà  ğB ğ‡ s ğ*ÿÿÿ“޽h”Ÿ‹¿ÿ ?ğ ÿÿÿ¿¿¿ÿÿÿğ4ñ ôğì ğŠğŠğ( ğ ğˆğR ğ‰ 3 ğ¿ÿ ğ°Ğ ğà  ğB ğŠ s ğ*ÿÿÿ“޽h”Ÿ‹¿ÿ ?ğ ÿÿÿ¿¿¿ÿÿÿğ4ñ ôğì0ğğŠğ( ğ ğ‹ğR ğŒ 3 ğ¿ÿ ğ°Ğ ğà  ğB ğ s ğ*ÿÿÿ“޽h”Ÿ‹¿ÿ ?ğ ÿÿÿ¿¿¿ÿÿÿğ4ñ ôğì@ğğŠğ( ğ ğğR ğ 3 ğ¿ÿ ğ°Ğ ğà  ğB ğ s ğ*ÿÿÿ“޽h”Ÿ‹¿ÿ ?ğ ÿÿÿ¿¿¿ÿÿÿğ4ñ ôğìPğ“ğŠğ( ğ ğ‘ğR ğ’ 3 ğ¿ÿ ğ°Ğ ğà  ğB ğ“ s ğ*ÿÿÿ“޽h”Ÿ‹¿ÿ ?ğ ÿÿÿ¿¿¿ÿÿÿğ4ñ ôğì`ğ–ğŠğ( ğ ğ”ğR ğ• 3 ğ¿ÿ ğ°Ğ ğà  ğB ğ– s ğ*ÿÿÿ“޽h”Ÿ‹¿ÿ ?ğ ÿÿÿ¿¿¿ÿÿÿğ4ñ  ôğìpğ™ğŠğ( ğ ğ—ğR ğ˜ 3 ğ¿ÿ ğ°Ğ ğà  ğB ğ™ s ğ*ÿÿÿ“޽h”Ÿ‹¿ÿ ?ğ ÿÿÿ¿¿¿ÿÿÿrd€ã² òâ8,1¦5è;HKóPÂVbmÃpÿq;swt³uïv+xgy£zß{õ¼ }ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿö_À‘ã‡}ô!şÿ €zğY(ÿÿÿûº¿û÷¿ß÷ßï€zğy(8ÿÿÿÿÿª«ÿÿUWÿÿª«ÿÿUWÿÿª«ÿÿUWÿÿª«ĞÏࡱá!şÿşÿà…ŸòùOh«‘+'³Ù0@m}Ë Ü è ô%GNAT Ada Database Environment GNADEerdmannFCreated by SummaryInformation(ÿÿÿÿÿÿÿÿÿÿÿÿ¸!+¸!+0DocumentSummaryInformation8ÿÿÿÿÿÿÿÿÿÿÿÿ"\;@X®ÿ¿"\;@X®ÿ¿ HÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿApplixware @(#)Version: 5.0(1375) Sat Jun 24 20:02:18 2000 5 (1375)@@¾uÌĞ)Â@ QÍK3ÂşÿÕÍÕœ.“—+,ù®0 ¡±á!şÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿgnade-1.6.2.orig/doc/ARG/0000755000175000017500000000000011040716254014553 5ustar lbrentalbrentagnade-1.6.2.orig/doc/ARG/AI-gnade.TXT0000644000175000017500000000401307500327423016521 0ustar lbrentalbrenta!standard A.XX (00) 02-05-25 AIXX-XXXX/XX !class amendment 00-11-28 !status work item 00-11-28 !status received 00-11-28 !priority Medium !difficulty Medium !subject Database Interface !summary $Id: AI-gnade.TXT,v 1.5 2002/06/08 07:15:31 merdmann Exp $ The SQLCLI packages provides access to RDBMS System. !problem A typical business application need to access data which is stored in large relational data base systems. In order to access this date, the application has to connect with the data bases management system, issue an query and collect the result. An application may have the need to connect different data base servers of different vendors at the same time. In addition to the contents of the database, meta information about tables, data sources etc. have to be available over this interface as well. Since the ISO92 SQLCLI interface is a widly used interface, Ada 95 applications should also be able to use this interface without limitations. !proposal Naming conventions are following this interface as mutch as possible. The SQLCLI interface is implmented by the following packages: SQLCLI - Basic Bindings SQLCLI.Desc - Driver features description SQLCLI.Info - Connection Information SQLCLI.Diag - Diagnostic Information SQLCLI.Connection_Attribute - Connection Attributes SQLCLI.Environment_Attribute- Environment Attributes SQLCLI.Statement_Attribute - Statement Attributes Since the ODBC interface is not type safe, several support packages are included to make the interface more convienient and safer to use: SQLCLI.Bind - Binding to deferred buffers !example !discussion Security of deferred buffers: The usage of deferred buffers as used by the SQLCI is directly exposed to the end user. The usage of the Bind package makes the it typesafe but not secure, since the refered address might not exist any more. !ACATS Test ACATS test(s) need to be created. !appendix gnade-1.6.2.orig/doc/Ada_2002/0000755000175000017500000000000011040716254015272 5ustar lbrentalbrentagnade-1.6.2.orig/doc/Ada_2002/MANIFEST0000644000175000017500000000015007424337736016436 0ustar lbrentalbrentaarchitecture.eps gnade.tex llncs.cls llncs.ind llncsdoc.sty splncs.bst toolchain.eps tools.eps gnade.ps gnade-1.6.2.orig/doc/Ada_2002/Makefile0000644000175000017500000000733407437504027016751 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/doc/Ada_2002/Makefile,v $ ## Description : Top level makefile for the documentation ## Author : Michael Erdmann, http://purl.org/net/michael.erdmann ## Created On : 22-12-2001 ## Last Modified By: $Author: merdmann $ ## Last Modified On: $Date: 2002/02/28 19:42:15 $ ## Status : $State: Exp $ ## ## Copyright (C) 2000-2001 ## ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ##----------------------------------------------------------------------------- all: check gnade.ps GNADEDIC=./gnade-words.master DISTNAME=paper42-28-02-02 gnade.ps: gnade.tex toolchain.eps architecture.eps elatex gnade.tex elatex gnade.tex dvips -o gnade.ps gnade.dvi xdvi gnade.dvi check: cat gnade.tex | aspell --mode=tex --lang=english \ --add-extra-dicts=$(GNADEDIC) -l | sort | uniq gnade.words: gnade.tex cat gnade.tex | aspell --lang=english --mode=tex -l \ | sort | uniq > gnade.words @echo @echo "1) review gnade.words file manually" @echo "2) make master" @exit 1 master: gnade.words aspell --lang=english create master $(GNADEDIC) < gnade.words final: gnade.ps rm -rf $(DISTNAME) mkdir -p $(DISTNAME) cat MANIFEST | cpio -pdmu $(DISTNAME) tar cvzf $(DISTNAME).tar.gz $(DISTNAME) ( cd $(DISTNAME) ; zip ../$(DISTNAME).zip *) rm -rf $(DISTNAME) clean: rm -rf *.aux *.log *.dvi *.toc *.ps *.bbl *.blg *.$ rm -rf gnade.words $(GNADEDIC) rm -rf *~ *.bak $(DISTNAME).zip $(DISTNAME).tar.gz $(DISTNAME) gnade-1.6.2.orig/doc/Ada_2002/README0000644000175000017500000000077707411134700016162 0ustar lbrentalbrentaThis directory contains all source code and all pictures for the Ada 2002 presentation of the GNADE Project How to build: make clean make master Ignore the error created by the makefile and edit the file gnade.words. After editing this file should contain only GNADE specific terms (e.g. SQL, DM, DBCS...) make master make check This returns a list of wrong words. If these are to mutch you have to run the aspell utility manually. Used Tools ========== xfig for pictures elatex for type setting gnade-1.6.2.orig/doc/Ada_2002/architecture.eps0000644000175000017500000001262607436510474020506 0ustar lbrentalbrenta%!PS-Adobe-2.0 EPSF-2.0 %%Title: architecture.eps %%Creator: fig2dev Version 3.2 Patchlevel 3c %%CreationDate: Mon Feb 25 19:47:27 2002 %%For: gnade@boavista.snafu.de () %%BoundingBox: 0 0 311 286 %%Magnification: 0.9400 %%EndComments /$F2psDict 200 dict def $F2psDict begin $F2psDict /mtrx matrix put /col-1 {0 setgray} bind def /col0 {0.000 0.000 0.000 srgb} bind def /col1 {0.000 0.000 1.000 srgb} bind def /col2 {0.000 1.000 0.000 srgb} bind def /col3 {0.000 1.000 1.000 srgb} bind def /col4 {1.000 0.000 0.000 srgb} bind def /col5 {1.000 0.000 1.000 srgb} bind def /col6 {1.000 1.000 0.000 srgb} bind def /col7 {1.000 1.000 1.000 srgb} bind def /col8 {0.000 0.000 0.560 srgb} bind def /col9 {0.000 0.000 0.690 srgb} bind def /col10 {0.000 0.000 0.820 srgb} bind def /col11 {0.530 0.810 1.000 srgb} bind def /col12 {0.000 0.560 0.000 srgb} bind def /col13 {0.000 0.690 0.000 srgb} bind def /col14 {0.000 0.820 0.000 srgb} bind def /col15 {0.000 0.560 0.560 srgb} bind def /col16 {0.000 0.690 0.690 srgb} bind def /col17 {0.000 0.820 0.820 srgb} bind def /col18 {0.560 0.000 0.000 srgb} bind def /col19 {0.690 0.000 0.000 srgb} bind def /col20 {0.820 0.000 0.000 srgb} bind def /col21 {0.560 0.000 0.560 srgb} bind def /col22 {0.690 0.000 0.690 srgb} bind def /col23 {0.820 0.000 0.820 srgb} bind def /col24 {0.500 0.190 0.000 srgb} bind def /col25 {0.630 0.250 0.000 srgb} bind def /col26 {0.750 0.380 0.000 srgb} bind def /col27 {1.000 0.500 0.500 srgb} bind def /col28 {1.000 0.630 0.630 srgb} bind def /col29 {1.000 0.750 0.750 srgb} bind def /col30 {1.000 0.880 0.880 srgb} bind def /col31 {1.000 0.840 0.000 srgb} bind def end save newpath 0 286 moveto 0 0 lineto 311 0 lineto 311 286 lineto closepath clip newpath 1.0 285.0 translate 1 -1 scale /cp {closepath} bind def /ef {eofill} bind def /gr {grestore} bind def /gs {gsave} bind def /sa {save} bind def /rs {restore} bind def /l {lineto} bind def /m {moveto} bind def /rm {rmoveto} bind def /n {newpath} bind def /s {stroke} bind def /sh {show} bind def /slc {setlinecap} bind def /slj {setlinejoin} bind def /slw {setlinewidth} bind def /srgb {setrgbcolor} bind def /rot {rotate} bind def /sc {scale} bind def /sd {setdash} bind def /ff {findfont} bind def /sf {setfont} bind def /scf {scalefont} bind def /sw {stringwidth} bind def /tr {translate} bind def /tnt {dup dup currentrgbcolor 4 -2 roll dup 1 exch sub 3 -1 roll mul add 4 -2 roll dup 1 exch sub 3 -1 roll mul add 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb} bind def /shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul 4 -2 roll mul srgb} bind def /DrawEllipse { /endangle exch def /startangle exch def /yrad exch def /xrad exch def /y exch def /x exch def /savematrix mtrx currentmatrix def x y tr xrad yrad sc 0 0 1 startangle endangle arc closepath savematrix setmatrix } def /$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def /$F2psEnd {$F2psEnteredState restore end} def $F2psBegin %%Page: 1 1 10 setmiterlimit 0.05640 0.05640 sc % % Fig objects follow % % Polyline 7.500 slw n 600 525 m 3300 525 l 3300 1125 l 600 1125 l cp gs col0 s gr % Polyline n 600 1725 m 3300 1725 l 3300 2325 l 600 2325 l cp gs col0 s gr % Polyline n 600 2925 m 3300 2925 l 3300 3525 l 600 3525 l cp gs col0 s gr % Polyline gs clippath 1770 1740 m 1830 1740 l 1830 1589 l 1800 1709 l 1770 1589 l cp eoclip n 1800 1125 m 1800 1725 l gs col0 s gr gr % arrowhead n 1770 1589 m 1800 1709 l 1830 1589 l 1770 1589 l cp gs 0.00 setgray ef gr col0 s % Polyline gs clippath 1770 2940 m 1830 2940 l 1830 2789 l 1800 2909 l 1770 2789 l cp eoclip n 1800 2325 m 1800 2925 l gs col0 s gr gr % arrowhead n 1770 2789 m 1800 2909 l 1830 2789 l 1770 2789 l cp gs 0.00 setgray ef gr col0 s /Times-Roman ff 180.00 scf sf 1275 900 m gs 1 -1 sc (Application Code) col0 sh gr /Times-Roman ff 180.00 scf sf 1275 2100 m gs 1 -1 sc (Database Interface) col0 sh gr /Times-Roman ff 180.00 scf sf 1125 3300 m gs 1 -1 sc (Database Control System) col0 sh gr % Ellipse n 1830 3884 540 134 0 360 DrawEllipse gs col0 s gr % Ellipse n 1819 4433 540 134 0 360 DrawEllipse gs col0 s gr % Polyline n 2370 3930 m 2370 4470 l gs col0 s gr % Polyline n 1290 3930 m 1290 4470 l gs col0 s gr % Polyline n 0 0 m 5475 0 l 5475 5025 l 0 5025 l cp gs col0 s gr % Polyline n 3600 525 m 5025 525 l 5025 1125 l 3600 1125 l cp gs col0 s gr % Polyline gs clippath 3285 3195 m 3285 3255 l 3436 3255 l 3316 3225 l 3436 3195 l cp eoclip n 4350 1125 m 4350 3225 l 3300 3225 l gs col0 s gr gr % arrowhead n 3436 3195 m 3316 3225 l 3436 3255 l 3436 3195 l cp gs 0.00 setgray ef gr col0 s % Polyline [15 45] 45 sd n 300 150 m 5175 150 l 5175 2625 l 300 2625 l cp gs col0 s gr [] 0 sd % Polyline gs clippath 1770 3915 m 1830 3915 l 1830 3764 l 1800 3884 l 1770 3764 l cp 1830 3510 m 1770 3510 l 1770 3661 l 1800 3541 l 1830 3661 l cp eoclip n 1800 3525 m 1800 3900 l gs col0 s gr gr % arrowhead n 1830 3661 m 1800 3541 l 1770 3661 l 1830 3661 l cp gs 0.00 setgray ef gr col0 s % arrowhead n 1770 3764 m 1800 3884 l 1830 3764 l 1770 3764 l cp gs 0.00 setgray ef gr col0 s /Times-Roman ff 180.00 scf sf 3750 900 m gs 1 -1 sc (SQL DDL/DML) col0 sh gr /Times-Roman ff 180.00 scf sf 3675 3450 m gs 1 -1 sc (CREATE TABLE \() col0 sh gr /Times-Roman ff 180.00 scf sf 3675 3675 m gs 1 -1 sc ( ........... \);) col0 sh gr /Times-Roman ff 180.00 scf sf 1875 2550 m gs 1 -1 sc (SELECT ...FROM ..) col0 sh gr /Times-Roman ff 180.00 scf sf 3675 3900 m gs 1 -1 sc (INSERT .....;) col0 sh gr $F2psEnd rs gnade-1.6.2.orig/doc/Ada_2002/architecture.fig0000644000175000017500000000342407436510474020460 0ustar lbrentalbrenta#FIG 3.2 Landscape Center Inches Letter 94.00 Single -2 1200 2 6 0 0 5475 5025 6 600 525 3300 3525 2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 600 525 3300 525 3300 1125 600 1125 600 525 2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 600 1725 3300 1725 3300 2325 600 2325 600 1725 2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 600 2925 3300 2925 3300 3525 600 3525 600 2925 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 1 1 1.00 60.00 120.00 1800 1125 1800 1725 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 1 1 1.00 60.00 120.00 1800 2325 1800 2925 4 0 0 50 0 0 12 0.0000 4 180 1305 1275 900 Application Code\001 4 0 0 50 0 0 12 0.0000 4 135 1470 1275 2100 Database Interface\001 4 0 0 50 0 0 12 0.0000 4 180 1950 1125 3300 Database Control System\001 -6 6 1200 3750 2370 4650 1 2 0 1 0 7 50 0 -1 0.000 1 0.0000 1830 3884 540 134 2370 3750 1290 4020 1 2 0 1 0 7 50 0 -1 0.000 1 0.0000 1819 4433 540 134 2359 4298 1279 4568 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 2370 3930 2370 4470 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 1290 3930 1290 4470 -6 6 0 0 5475 5025 2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 0 0 5475 0 5475 5025 0 5025 0 0 -6 2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 3600 525 5025 525 5025 1125 3600 1125 3600 525 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 3 1 1 1.00 60.00 120.00 4350 1125 4350 3225 3300 3225 2 2 2 1 0 11 50 0 -1 3.000 0 0 -1 0 0 5 300 150 5175 150 5175 2625 300 2625 300 150 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 1 2 1 1 1.00 60.00 120.00 1 1 1.00 60.00 120.00 1800 3525 1800 3900 4 0 0 50 0 0 12 0.0000 4 165 1215 3750 900 SQL DDL/DML\001 4 0 0 50 0 0 12 0.0000 4 180 1470 3675 3450 CREATE TABLE (\001 4 0 0 50 0 0 12 0.0000 4 180 750 3675 3675 ........... );\001 4 0 0 50 0 0 12 0.0000 4 135 1515 1875 2550 SELECT ...FROM ..\001 4 0 0 50 0 0 12 0.0000 4 165 960 3675 3900 INSERT .....;\001 -6 gnade-1.6.2.orig/doc/Ada_2002/gnade.tex0000644000175000017500000006016407437504027017111 0ustar lbrentalbrenta%% ---------------------------------------------------------------------------- %% -- %% GNADE : GNu Ada Database Environment -- %% -- %% Filename : $Source: /cvsroot/gnade/gnade/doc/Ada_2002/gnade.tex,v $ %% Description : Paper 42 - Draft for Ada 2002 %% Author : Michael Erdmann, http://purl.org/net/michael.erdmann %% Created On : 22-12-2003 %% Last Modified By: $Author: merdmann $ %% Last Modified On: $Date: 2002/02/28 19:42:15 $ %% Status : $State: Exp $ %% -- %% Copyright (C) 2000-2002 -- %% -- %% GNADE is copyrighted by the persons and institutions enumerated in the -- %% AUTHORS file. This file is located in the root directory of the -- %% GNADE distribution. -- %% -- %% GNADE is free software; you can redistribute it and/or modify it under -- %% terms of the GNU General Public License as published by the Free Soft- -- %% ware Foundation; either version 2, or (at your option) any later ver- -- %% sion. GNAT is distributed in the hope that it will be useful, but WITH- -- %% OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- %% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- %% for more details. You should have received a copy of the GNU General -- %% Public License distributed with GNAT; see file COPYING. If not, write -- %% to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- %% MA 02111-1307, USA. -- %% -- %% As a special exception, if other files instantiate generics from -- %% GNADE Ada units, or you link GNADE Ada units or libraries with other -- %% files to produce an executable, these units or libraries do not by -- %% itself cause the resulting executable to be covered by the GNU -- %% General Public License. This exception does not however invalidate -- %% any other reasons why the executable file might be covered by the -- %% GNU Public License. -- %% -- %% GNADE is implemented to work with GNAT, the GNU Ada compiler. -- %% -- %%----------------------------------------------------------------------------- \documentclass{llncs} \usepackage{epsfig} % \usepackage{makeidx} % allows for indexgeneration % \begin{document} % \frontmatter % for the preliminaries % \pagestyle{headings} % switches on printing of running heads \addtocmark{The GNADE Project} % additional mark in the TOC % \mainmatter % start of the contributions % \title{GNAT Ada Database Development Environment} % \titlerunning{Scope of the GNADE Project} \author{Michael Erdmann} \institute{ The GNADE Project,\\ \email{michael.erdmann@snafu.de},\\ WWW home page: \texttt{http://gnade.sourceforge.net/} } \maketitle % typeset the title of the contribution \begin{abstract} This article describes the results of the GNADE project which provides an Open Source licensed development environment for RDBMS based Ada 95 applications. \end{abstract} % \section{Introduction} % The Ada 95 standard provides no interface to relational data bases management systems. As a consequence a lot different approaches have been taken to connect Ada 95 application with RDBMS products. During a relatively small project which required a data base it became obvious that there is no open source licensed software environment available which allows to integrate SQL into Ada 95 in such a way that the application does not become dependent on the used data base implementation. The GNADE project was setup with the objective to overcome this situation by providing and maintaining over a long time, tools and support packages which make the use of SQL\footnote{ Structured Query Language} within Ada 95 seamless in the following sense: \begin{enumerate} \item The source code should be independent of the used data base control system. \item The tool chain should provide a migration path from other non open source products to GNADE. \end{enumerate} % % \subsection{Project Scope} The figure \ref{fig:arch} shows the typical development scenario involving RDBMS products. This model assumes, that the application is implemented as a client process for one or more data base servers. An application accesses tables (relations) in an data base control system (DBCS)\footnote{ Data Base Control System } by means of an interface library. This library allows the application to execute SQL queries formulated in SQL on the DBCS and to retrieve the query results (so called result sets) from the DBCS. At the same time, the structure of the tables are developed and installed in a development data base by means of SQL DDL/DML commands. The output of the development process is the Ada 95 source code and the table definitions in SQL. The scope of the GNADE project includes all issues from the support of the development of application code to the data base interface except for the data base control systems itself. \begin{figure}[tbhp] \begin{center} \leavevmode \epsfig{file=architecture.eps} \caption{GNADE Development Environment (Ref. Model)} \label{fig:arch} \end{center} \end{figure} \subsection{Implementation considerations} The following sections are presenting a short overview of the discussion and reasoning which lead to the current implementation. At the beginning of the project, three major questions had to be answered before any implementation attempt: \begin{description} \item{Q.1 -} What kind interface between application and RDBMS should be used? \item{Q.2 -} What is the best way to integrate SQL into Ada 95? \item{Q.3 -} Which compilers and platforms should and can be supported? \end{description} % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % The database interface % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \subsection{Database Interfaces} There are standardized interfaces like ODBC \footnote{Open Database Connectivity (ODBC)} and proprietary interfaces like development libraries provided by the DBCS vendors themselves. In order to make the application independent of the underlying interface type the first idea was to develop an abstract data base interface in order to allow applications to use both kinds of interfaces without any major change in the application code. There was a strong and intensive discussion including ACT and other developers about defining such an abstract API. The main argument for not introducing such an interface was the fact, that is would add a new standard to the zoo of already existing common interfaces without providing any additional gain for the developer. On top of this, such an API would impose additional data transformations for both types of interfaces which has negative impact on the interface performance. \footnote { The performance issue has to be seen in the correct context. The interface between the application and the DBCS is normally not intended for a large throughput because the idea is that the DBCS should do the major work of reducing the data to a reasonable sized result set. Please note, if the result set becomes to large it is very likely that the application code is doing some filtering which could have already been done in the DBCS. }. As a consequence the wide spread ODBC interface was selected as the primary data base interface for the GNADE project. Beside of the high availability of the interface, there is also a wide range of documents and text books about the ODBC interface available, which removes the burden of documenting the ODBC interface from the project. This extensive documentation base is expected to give the development environment a higher acceptance in the development community. Additionally the decision has been taken that proprietary Ada 95 bindings to PostgreSQL and MySQL are not in the scope of the tool chain any more, but still in the project scope. It was assumed that the native bindings have to be supported in order to take advantage of vendor specific data base features (e.g. high speed data path for BLOB's). % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % The ODBC Interface % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \subsubsection{The ODBC Interface} based on the ANSI and X/Open Standard \cite{iso92} is provided by most data base system vendors. In order to execute data base operations and to retrieve the results, the ODBC standard provides an API. This API is implemented by the so called driver manager (DM) which is normally a separate product (e.g UnixODBC) beside of the DBCS. The driver manager maps the ODBC API calls into the appropriate calls into the ODBC driver library provided by the installed DBCS. In order to address databases, the ODBC provides the concept of so called data sources. A data source specifies on which host which database has to be accessed using which driver. The binding between Ada 95 and the ODBC interface is in fact a binding between the functions exported by the DM libraries and the ODBC packages. The ODBC packages have been created manually based upon the ODBC specification\cite{iso92}. \subsection{Integration of SQL in Ada 95} The issue to integrate SQL into Ada 95 (or other languages) is not a new issue. In the past a lot of approaches have been taken, as for example SAMeDL \cite{samedl} or SQL language bindings \cite{racom}. All these approaches may be categorized into the following classes: \begin{enumerate} \item Approaches like \cite{racom} which bind the SQL language elements like \textit{select *} directly to Ada procedure calls like \textit{SELEC(``*''}. \item From some kind of specification language (e.g. SAMeDL \cite{samedl}) are Ada 95 packages generated which are providing methods used to access the data base by means of pre compiled queries. \item The source code contains the actual SQL code together with Ada 95 code (e.g. \cite{iso92}). A preprocessor expands the embedded SQL code into valid Ada code. \end{enumerate} The first approach was assumed as ineffective, because it requires a lot of data transformations until the query is executed. The SAMeDL approach based on the ISO standard requires a lot of implementation effort, because of a complex syntax of the language. But the major argument against it, was the fact that SAMeDL never became an established standard \footnote{The topic was dropped in 1997}. For embedded SQL solution the effort was clearly defined by the implementation of a preprocessor for embedded SQL where most of the work is left to the underlying data base system. Besides the estimated small effort, the fact that other products (e.g. Oracle, Informix) provide an embedded SQL translator was considered as a important success factor, because there is a potentially larger code base of embedded SQL code existing then for SAMeDL. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Embedded SQL % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \subsubsection{Embedded SQL and Ada 95.} The GNADE implementation is based upon the ISO 92 \cite{iso92} draft for embedded SQL with some commonly known extensions which have been added in order to provide a possible migration path for already existing embedded SQL code. This standard defines the key word \texttt{ EXEC SQL } which indicates the begin of an embedded SQL statement which is terminated by a semicolon. The syntax of embedded SQL statements resembles largely the syntax of the SQL language as shown in the example below: \begin{verbatim} EXEC SQL AT Company_Database DECLARE emp_cursor CURSOR FOR SELECT EMPNO, NAME, DEPTNO FROM EMPLOYEES WHERE MANAGER = :Manager_To_Find ; \end{verbatim} Since the structure of the query is the same as for normal SQL, a large part of the embedded SQL statements can be send unchanged to the underlying data base system except for the host variables which have to be treated according to the underlying DBCS interface (ODBC). This allows to test a query manually on a test database using an interactive query tool, before it is put into the actual code. In order to make queries more flexible so called dynamic SQL statements allow to define parts of the query at execution time (e.g. the WHERE clause). Embedded SQL statements do communicate with the application via so called host variables. A host variable provides either the input to a query or contains the data of a column in a row of a query result set. \begin{verbatim} procedure Get_Manager( manager : in Integer ) is EXEC SQL BEGIN DECLARE SECTION END-EXEC .... Manager_To_Find : INT := INT(manager) ; ..... EXEC SQL END DECLARE SECTION END-EXEC \end{verbatim} Host variables do follow the same visibility rules as normal Ada 95 variables which means the Manager\_To\_Find variable is only valid in the context of the Get\_Manager procedure above. \subsection{Compilers and Platforms} The GNAT \footnote{ GNU Ada Tool chain } compiler was selected as the primary development environment since it is available under the GNU license on the most popular platforms as Windows, Linux and Unix. Other compilers are currently not considered. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % The GNADE development Env. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{The GNADE Development Environment} In the GNADE environment an application is developed in Ada 95 including embedded SQL statements. As an extension to the ISO/92 standard the package may contain embedded SQL statement declaring the required tables. The embedded SQL translator creates from this source code a compilation unit by expanding the embedded SQL statements into Ada 95 code (ref. figure \ref{fig:toolchain}). Optionally a file is created by the preprocessor which contains all SQL commands needed to create the data base tables in any SQL compatible data base. The Ada 95 code generated by the translator has to be compiled and linked with the application environment to form the application. \begin{figure}[thbp] \begin{center} \leavevmode \epsfig{file=tools.eps} \caption{GNADE Development Environment} \label{fig:toolchain} \end{center} \end{figure} Embedded SQL statements are expanded by the ESQL preprocessor into Ada 95 code which uses the \textit{ESQL\_Support} package. This package binds to the driver manager interface and contains the helper procedures to execute a query via the ODBC interface, set and fetch host variables. A data base query via the ODBC interface generally executes the following steps: \begin{description} \item Step 1 - Prepare the execution of a query on the data base system. This yields a so called statement handle \item Step 2 - Bind the input parameter of a query to some memory locations where the input is stored. \item Step 3 - Execute the query. \item Step 4 - Bind the variable which will contain the results to columns. \item Step 5 - Until the end of the result set is not reached fetch the result from the server. The domains of the retrieved row are stored in the variables assigned by the previous step to each column. \item Step 6 - Return the statement handle. \end{description} The ODBC interface uses so called deferred buffers in order to transfer data between the application and the ODBC driver. A deferred buffer is a memory location in the user address space where the result of a query is stored. Since the address of the buffer is already passed over the ODBC interface in step 4, but the content is filled when fetching the data (step 5) from the DBCS via the fetch operation, they are called deferred buffers. This insecure ODBC feature is made invisible to the developer by the ESQL translator. Since cursors are handled by the ODBC interface, the embedded SQL translator has to intercept the \texttt{ DECLARE CURSOR } construct. The \textit{ESQL\_Support} package performs the mapping between SQL cursor names and statement handles of the ODBC interface internally. The \textit{ESQL\_Support} package provides in addition methods to convert between Ada 95 predefined data types and the data types as they are defined in ISO/92 \cite{iso92}. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Impelementation % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{Implementation} The implementation of the GNADE project has to meet the primary requirement of being self contained, which means the environment should not depend on packages which are not part of Ada 95. The size of the translator is about 3000 statements and relies completely on the pure Ada 95 libraries which makes the translator highly portable. The parser is implemented manually because the syntax of embedded SQL is relatively simple and in difference to normal parser's, the translator works like an editor, which reads in lines, detects embedded SQL statements, edits the result line depending on the SQL statement and writes out the result lines. The ODBC bindings of about 6500 statements have been manually generated and do not depend on any external Ada 95 packages. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Partability % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{Portability} Application which are implemented with GNADE for the same data base vendor, are portable over platforms without any problem. This is fairly proven because within the GNADE team different operating system have been used. Portability between database vendors is a problem because of the different implementation level of SQL and a different connect and authorization methods. In order to achieve such portability some simple rules have to be followed: \begin{enumerate} \item Use always uppercase table and domain names. \item Don't use any SQL extension of your vendor. \item Use always broadly supported SQL clauses. \end{enumerate} All the sample programs of the GNADE distribution are running correctly on three different RDBMS. \section{Migration of legacy code} Since there is no real migrated project known, the only experience is taken from example code of some DBCS vendors. One of the major problem in reusing embedded SQL code written for other vendors, is the fact that a lot of extension to the ISO/92 standard have been done by these vendors. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Experiences and Status % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{Experiences with Ada 95 } Ada 95 did allow to bind to the ODBC interface in such a way, that the commonly available documentation may reused by the developer even on code level. Judging from our current experiences Ada 95 encapsulates the deferred buffer handling of the ODBC interface in such a way, that the code stays portable between platforms (e.g Intel, SPARC Solaris). The same applies for the native bindings for MySQL and PostgreSQL where Ada 95 has to interface to even more data base specific communication areas. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Open Source % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{ Developing Open Source Software and Ada 95 } The development scenario for open source software is completely different to the daily work scenarios which are strongly bound to fixed development processes. The mechanisms which are driving the open source development is described in a very colorful way in the paper of Eric Raymond\cite{cath}. The typical boundary conditions of such projects are: \begin{enumerate} \item No budget at all. \item Unclear responsibilities, unstable working groups. \item The module owners are dropping out the project for personal reasons. \item Normally no sufficient documentation. \item A lot of platforms have to be supported, but they are not always available for testing. \end{enumerate} Under these constraints is Ada 95 an ideal language choice because of its build in high reliability and low maintenance efforts. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Status % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{ Current status and future of the GNADE project } The project has achieved its primary objective to provide stable open source licensed software which allows the integration SQL with Ada 95. The primary objectives of the future is to extend the number of supported platforms and data base products. This is supported by the fact, that the GNAT Ada 95 compiler is available for a wide range of platforms. \begin{table} \caption{Platforms supported by GNADE} \begin{center} \begin{tabular}{r@{\quad}rl} \hline \multicolumn{1}{l}{\rule{0pt}{12pt} Platform}&\multicolumn{2}{l}{Supported Database}\\[2pt] \hline\rule{0pt}{12pt} Linux & PostgreSQL & \\ Linux & MySQL& \\ Linux & MimerSQL& \\ Solaris & PostgreSQL& \\ Solaris & MimerSQL& \\ Windows & MySQL& \\ Windows & MS SQL Server& \\ Windows & Oracle 8i lite& \\[2pt] \hline \end{tabular} \end{center} \end{table} The range of native data base bindings will be extended (e.g. Oracle Call Interface) continuously, but the long term objective is to define a common data base API and to implement native bindings on basis of this API. This API call Ada Database Connectivity (ADBC) will provide a kernel API which contains the interface which is supported by most of the known open source and other available RDBMS products. In order to allow the use of embedded SQL in combination with native bindings it is planed to modify the embedded SQL translator in such a way that code is generated either for ODBC or the data base API interface. The first step of this initiative has been launched by distributing a draft of this API for discussion in the Ada community. % % ---- Bibliography ---- % \begin{thebibliography}{5} % \bibitem {racom} Proposed Binding Ada to Database Language SQL \\ Institute for Defense Analyses and \\ RACOM Computer Professionals March 1986. \bibitem {samedl} Database Programming Language \\ The SQL Ada module Description Language SAMeDL\\ ISO/IEC 12227:1994 \bibitem {iso92} X/Open CAE Specification "Data Management: SQL Call-Level Interface (CLI)" \\ ISO/IEC 9075-3:1995 (E) Call-Level Interface (SQL/CLI) \bibitem {cath} The Cathedral and the Bazaar\\ Eric Steven Raymond\\ August 2000. \end{thebibliography} \clearpage \end{document} gnade-1.6.2.orig/doc/Ada_2002/llncs.cls0000644000175000017500000012053607407734056017133 0ustar lbrentalbrenta% LLNCS DOCUMENT CLASS -- version 2.10 % for LaTeX2e % \NeedsTeXFormat{LaTeX2e}[1995/12/01] \ProvidesClass{llncs}[2001/08/14 v2.10 ^^Jexperimental LaTeX document class for Lecture Notes in Computer Science] % Options \let\if@envcntreset\iffalse \DeclareOption{envcountreset}{\let\if@envcntreset\iftrue} \DeclareOption{citeauthoryear}{\let\citeauthoryear=Y} \DeclareOption{oribibl}{\let\oribibl=Y} \let\if@custvec\iftrue \DeclareOption{orivec}{\let\if@custvec\iffalse} \let\if@envcntsame\iffalse \DeclareOption{envcountsame}{\let\if@envcntsame\iftrue} \let\if@envcntsect\iffalse \DeclareOption{envcountsect}{\let\if@envcntsect\iftrue} \let\if@runhead\iffalse \DeclareOption{runningheads}{\let\if@runhead\iftrue} \let\if@openbib\iffalse \DeclareOption{openbib}{\let\if@openbib\iftrue} % languages \let\switcht@@therlang\relax \def\ds@deutsch{\def\switcht@@therlang{\switcht@deutsch}} \def\ds@francais{\def\switcht@@therlang{\switcht@francais}} \DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}} \ProcessOptions \LoadClass[twoside]{article} \RequirePackage{multicol} % needed for the list of participants, index \setlength{\textwidth}{12.2cm} \setlength{\textheight}{19.3cm} \renewcommand\@pnumwidth{2em} \renewcommand\@tocrmarg{3.5em} % \def\@dottedtocline#1#2#3#4#5{% \ifnum #1>\c@tocdepth \else \vskip \z@ \@plus.2\p@ {\leftskip #2\relax \rightskip \@tocrmarg \advance\rightskip by 0pt plus 2cm \parfillskip -\rightskip \pretolerance=10000 \parindent #2\relax\@afterindenttrue \interlinepenalty\@M \leavevmode \@tempdima #3\relax \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip {#4}\nobreak \leaders\hbox{$\m@th \mkern \@dotsep mu\hbox{.}\mkern \@dotsep mu$}\hfill \nobreak \hb@xt@\@pnumwidth{\hfil\normalfont \normalcolor #5}% \par}% \fi} % \def\switcht@albion{% \def\abstractname{Abstract.} \def\ackname{Acknowledgement.} \def\andname{and} \def\lastandname{\unskip, and} \def\appendixname{Appendix} \def\chaptername{Chapter} \def\claimname{Claim} \def\conjecturename{Conjecture} \def\contentsname{Table of Contents} \def\corollaryname{Corollary} \def\definitionname{Definition} \def\examplename{Example} \def\exercisename{Exercise} \def\figurename{Fig.} \def\keywordname{{\bf Key words:}} \def\indexname{Index} \def\lemmaname{Lemma} \def\contriblistname{List of Contributors} \def\listfigurename{List of Figures} \def\listtablename{List of Tables} \def\mailname{{\it Correspondence to\/}:} \def\noteaddname{Note added in proof} \def\notename{Note} \def\partname{Part} \def\problemname{Problem} \def\proofname{Proof} \def\propertyname{Property} \def\propositionname{Proposition} \def\questionname{Question} \def\remarkname{Remark} \def\seename{see} \def\solutionname{Solution} \def\subclassname{{\it Subject Classifications\/}:} \def\tablename{Table} \def\theoremname{Theorem}} \switcht@albion % Names of theorem like environments are already defined % but must be translated if another language is chosen % % French section \def\switcht@francais{%\typeout{On parle francais.}% \def\abstractname{R\'esum\'e.}% \def\ackname{Remerciements.}% \def\andname{et}% \def\lastandname{ et}% \def\appendixname{Appendice} \def\chaptername{Chapitre}% \def\claimname{Pr\'etention}% \def\conjecturename{Hypoth\`ese}% \def\contentsname{Table des mati\`eres}% \def\corollaryname{Corollaire}% \def\definitionname{D\'efinition}% \def\examplename{Exemple}% \def\exercisename{Exercice}% \def\figurename{Fig.}% \def\keywordname{{\bf Mots-cl\'e:}} \def\indexname{Index} \def\lemmaname{Lemme}% \def\contriblistname{Liste des contributeurs} \def\listfigurename{Liste des figures}% \def\listtablename{Liste des tables}% \def\mailname{{\it Correspondence to\/}:} \def\noteaddname{Note ajout\'ee \`a l'\'epreuve}% \def\notename{Remarque}% \def\partname{Partie}% \def\problemname{Probl\`eme}% \def\proofname{Preuve}% \def\propertyname{Caract\'eristique}% %\def\propositionname{Proposition}% \def\questionname{Question}% \def\remarkname{Remarque}% \def\seename{voir} \def\solutionname{Solution}% \def\subclassname{{\it Subject Classifications\/}:} \def\tablename{Tableau}% \def\theoremname{Th\'eor\`eme}% } % % German section \def\switcht@deutsch{%\typeout{Man spricht deutsch.}% \def\abstractname{Zusammenfassung.}% \def\ackname{Danksagung.}% \def\andname{und}% \def\lastandname{ und}% \def\appendixname{Anhang}% \def\chaptername{Kapitel}% \def\claimname{Behauptung}% \def\conjecturename{Hypothese}% \def\contentsname{Inhaltsverzeichnis}% \def\corollaryname{Korollar}% %\def\definitionname{Definition}% \def\examplename{Beispiel}% \def\exercisename{\"Ubung}% \def\figurename{Abb.}% \def\keywordname{{\bf Schl\"usselw\"orter:}} \def\indexname{Index} %\def\lemmaname{Lemma}% \def\contriblistname{Mitarbeiter} \def\listfigurename{Abbildungsverzeichnis}% \def\listtablename{Tabellenverzeichnis}% \def\mailname{{\it Correspondence to\/}:} \def\noteaddname{Nachtrag}% \def\notename{Anmerkung}% \def\partname{Teil}% %\def\problemname{Problem}% \def\proofname{Beweis}% \def\propertyname{Eigenschaft}% %\def\propositionname{Proposition}% \def\questionname{Frage}% \def\remarkname{Anmerkung}% \def\seename{siehe} \def\solutionname{L\"osung}% \def\subclassname{{\it Subject Classifications\/}:} \def\tablename{Tabelle}% %\def\theoremname{Theorem}% } % Ragged bottom for the actual page \def\thisbottomragged{\def\@textbottom{\vskip\z@ plus.0001fil \global\let\@textbottom\relax}} \renewcommand\small{% \@setfontsize\small\@ixpt{11}% \abovedisplayskip 8.5\p@ \@plus3\p@ \@minus4\p@ \abovedisplayshortskip \z@ \@plus2\p@ \belowdisplayshortskip 4\p@ \@plus2\p@ \@minus2\p@ \def\@listi{\leftmargin\leftmargini \parsep 0\p@ \@plus1\p@ \@minus\p@ \topsep 8\p@ \@plus2\p@ \@minus4\p@ \itemsep0\p@}% \belowdisplayskip \abovedisplayskip } \frenchspacing \widowpenalty=10000 \clubpenalty=10000 \setlength\oddsidemargin {63\p@} \setlength\evensidemargin {63\p@} \setlength\marginparwidth {90\p@} \setlength\headsep {16\p@} \setlength\footnotesep{7.7\p@} \setlength\textfloatsep{8mm\@plus 2\p@ \@minus 4\p@} \setlength\intextsep {8mm\@plus 2\p@ \@minus 2\p@} \setcounter{secnumdepth}{2} \newcounter {chapter} \renewcommand\thechapter {\@arabic\c@chapter} \newif\if@mainmatter \@mainmattertrue \newcommand\frontmatter{\cleardoublepage \@mainmatterfalse\pagenumbering{Roman}} \newcommand\mainmatter{\cleardoublepage \@mainmattertrue\pagenumbering{arabic}} \newcommand\backmatter{\if@openright\cleardoublepage\else\clearpage\fi \@mainmatterfalse} \renewcommand\part{\cleardoublepage \thispagestyle{empty}% \if@twocolumn \onecolumn \@tempswatrue \else \@tempswafalse \fi \null\vfil \secdef\@part\@spart} \def\@part[#1]#2{% \ifnum \c@secnumdepth >-2\relax \refstepcounter{part}% \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}% \else \addcontentsline{toc}{part}{#1}% \fi \markboth{}{}% {\centering \interlinepenalty \@M \normalfont \ifnum \c@secnumdepth >-2\relax \huge\bfseries \partname~\thepart \par \vskip 20\p@ \fi \Huge \bfseries #2\par}% \@endpart} \def\@spart#1{% {\centering \interlinepenalty \@M \normalfont \Huge \bfseries #1\par}% \@endpart} \def\@endpart{\vfil\newpage \if@twoside \null \thispagestyle{empty}% \newpage \fi \if@tempswa \twocolumn \fi} \newcommand\chapter{\clearpage \thispagestyle{empty}% \global\@topnum\z@ \@afterindentfalse \secdef\@chapter\@schapter} \def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne \if@mainmatter \refstepcounter{chapter}% \typeout{\@chapapp\space\thechapter.}% \addcontentsline{toc}{chapter}% {\protect\numberline{\thechapter}#1}% \else \addcontentsline{toc}{chapter}{#1}% \fi \else \addcontentsline{toc}{chapter}{#1}% \fi \chaptermark{#1}% \addtocontents{lof}{\protect\addvspace{10\p@}}% \addtocontents{lot}{\protect\addvspace{10\p@}}% \if@twocolumn \@topnewpage[\@makechapterhead{#2}]% \else \@makechapterhead{#2}% \@afterheading \fi} \def\@makechapterhead#1{% % \vspace*{50\p@}% {\centering \ifnum \c@secnumdepth >\m@ne \if@mainmatter \large\bfseries \@chapapp{} \thechapter \par\nobreak \vskip 20\p@ \fi \fi \interlinepenalty\@M \Large \bfseries #1\par\nobreak \vskip 40\p@ }} \def\@schapter#1{\if@twocolumn \@topnewpage[\@makeschapterhead{#1}]% \else \@makeschapterhead{#1}% \@afterheading \fi} \def\@makeschapterhead#1{% % \vspace*{50\p@}% {\centering \normalfont \interlinepenalty\@M \Large \bfseries #1\par\nobreak \vskip 40\p@ }} \renewcommand\section{\@startsection{section}{1}{\z@}% {-18\p@ \@plus -4\p@ \@minus -4\p@}% {12\p@ \@plus 4\p@ \@minus 4\p@}% {\normalfont\large\bfseries\boldmath \rightskip=\z@ \@plus 8em\pretolerance=10000 }} \renewcommand\subsection{\@startsection{subsection}{2}{\z@}% {-18\p@ \@plus -4\p@ \@minus -4\p@}% {8\p@ \@plus 4\p@ \@minus 4\p@}% {\normalfont\normalsize\bfseries\boldmath \rightskip=\z@ \@plus 8em\pretolerance=10000 }} \renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}% {-18\p@ \@plus -4\p@ \@minus -4\p@}% {-0.5em \@plus -0.22em \@minus -0.1em}% {\normalfont\normalsize\bfseries\boldmath}} \renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}% {-12\p@ \@plus -4\p@ \@minus -4\p@}% {-0.5em \@plus -0.22em \@minus -0.1em}% {\normalfont\normalsize\itshape}} \renewcommand\subparagraph[1]{\typeout{LLNCS warning: You should not use \string\subparagraph\space with this class}\vskip0.5cm You should not use \verb|\subparagraph| with this class.\vskip0.5cm} \DeclareMathSymbol{\Gamma}{\mathalpha}{letters}{"00} \DeclareMathSymbol{\Delta}{\mathalpha}{letters}{"01} \DeclareMathSymbol{\Theta}{\mathalpha}{letters}{"02} \DeclareMathSymbol{\Lambda}{\mathalpha}{letters}{"03} \DeclareMathSymbol{\Xi}{\mathalpha}{letters}{"04} \DeclareMathSymbol{\Pi}{\mathalpha}{letters}{"05} \DeclareMathSymbol{\Sigma}{\mathalpha}{letters}{"06} \DeclareMathSymbol{\Upsilon}{\mathalpha}{letters}{"07} \DeclareMathSymbol{\Phi}{\mathalpha}{letters}{"08} \DeclareMathSymbol{\Psi}{\mathalpha}{letters}{"09} \DeclareMathSymbol{\Omega}{\mathalpha}{letters}{"0A} \let\footnotesize\small \if@custvec \def\vec#1{\mathchoice{\mbox{\boldmath$\displaystyle#1$}} {\mbox{\boldmath$\textstyle#1$}} {\mbox{\boldmath$\scriptstyle#1$}} {\mbox{\boldmath$\scriptscriptstyle#1$}}} \fi \def\squareforqed{\hbox{\rlap{$\sqcap$}$\sqcup$}} \def\qed{\ifmmode\squareforqed\else{\unskip\nobreak\hfil \penalty50\hskip1em\null\nobreak\hfil\squareforqed \parfillskip=0pt\finalhyphendemerits=0\endgraf}\fi} \def\getsto{\mathrel{\mathchoice {\vcenter{\offinterlineskip \halign{\hfil $\displaystyle##$\hfil\cr\gets\cr\to\cr}}} {\vcenter{\offinterlineskip\halign{\hfil$\textstyle##$\hfil\cr\gets \cr\to\cr}}} {\vcenter{\offinterlineskip\halign{\hfil$\scriptstyle##$\hfil\cr\gets \cr\to\cr}}} {\vcenter{\offinterlineskip\halign{\hfil$\scriptscriptstyle##$\hfil\cr \gets\cr\to\cr}}}}} \def\lid{\mathrel{\mathchoice {\vcenter{\offinterlineskip\halign{\hfil $\displaystyle##$\hfil\cr<\cr\noalign{\vskip1.2pt}=\cr}}} {\vcenter{\offinterlineskip\halign{\hfil$\textstyle##$\hfil\cr<\cr \noalign{\vskip1.2pt}=\cr}}} {\vcenter{\offinterlineskip\halign{\hfil$\scriptstyle##$\hfil\cr<\cr \noalign{\vskip1pt}=\cr}}} {\vcenter{\offinterlineskip\halign{\hfil$\scriptscriptstyle##$\hfil\cr <\cr \noalign{\vskip0.9pt}=\cr}}}}} \def\gid{\mathrel{\mathchoice {\vcenter{\offinterlineskip\halign{\hfil $\displaystyle##$\hfil\cr>\cr\noalign{\vskip1.2pt}=\cr}}} {\vcenter{\offinterlineskip\halign{\hfil$\textstyle##$\hfil\cr>\cr \noalign{\vskip1.2pt}=\cr}}} {\vcenter{\offinterlineskip\halign{\hfil$\scriptstyle##$\hfil\cr>\cr \noalign{\vskip1pt}=\cr}}} {\vcenter{\offinterlineskip\halign{\hfil$\scriptscriptstyle##$\hfil\cr >\cr \noalign{\vskip0.9pt}=\cr}}}}} \def\grole{\mathrel{\mathchoice {\vcenter{\offinterlineskip \halign{\hfil $\displaystyle##$\hfil\cr>\cr\noalign{\vskip-1pt}<\cr}}} {\vcenter{\offinterlineskip\halign{\hfil$\textstyle##$\hfil\cr >\cr\noalign{\vskip-1pt}<\cr}}} {\vcenter{\offinterlineskip\halign{\hfil$\scriptstyle##$\hfil\cr >\cr\noalign{\vskip-0.8pt}<\cr}}} {\vcenter{\offinterlineskip\halign{\hfil$\scriptscriptstyle##$\hfil\cr >\cr\noalign{\vskip-0.3pt}<\cr}}}}} \def\bbbr{{\rm I\!R}} %reelle Zahlen \def\bbbm{{\rm I\!M}} \def\bbbn{{\rm I\!N}} %natuerliche Zahlen \def\bbbf{{\rm I\!F}} \def\bbbh{{\rm I\!H}} \def\bbbk{{\rm I\!K}} \def\bbbp{{\rm I\!P}} \def\bbbone{{\mathchoice {\rm 1\mskip-4mu l} {\rm 1\mskip-4mu l} {\rm 1\mskip-4.5mu l} {\rm 1\mskip-5mu l}}} \def\bbbc{{\mathchoice {\setbox0=\hbox{$\displaystyle\rm C$}\hbox{\hbox to0pt{\kern0.4\wd0\vrule height0.9\ht0\hss}\box0}} {\setbox0=\hbox{$\textstyle\rm C$}\hbox{\hbox to0pt{\kern0.4\wd0\vrule height0.9\ht0\hss}\box0}} {\setbox0=\hbox{$\scriptstyle\rm C$}\hbox{\hbox to0pt{\kern0.4\wd0\vrule height0.9\ht0\hss}\box0}} {\setbox0=\hbox{$\scriptscriptstyle\rm C$}\hbox{\hbox to0pt{\kern0.4\wd0\vrule height0.9\ht0\hss}\box0}}}} \def\bbbq{{\mathchoice {\setbox0=\hbox{$\displaystyle\rm Q$}\hbox{\raise 0.15\ht0\hbox to0pt{\kern0.4\wd0\vrule height0.8\ht0\hss}\box0}} {\setbox0=\hbox{$\textstyle\rm Q$}\hbox{\raise 0.15\ht0\hbox to0pt{\kern0.4\wd0\vrule height0.8\ht0\hss}\box0}} {\setbox0=\hbox{$\scriptstyle\rm Q$}\hbox{\raise 0.15\ht0\hbox to0pt{\kern0.4\wd0\vrule height0.7\ht0\hss}\box0}} {\setbox0=\hbox{$\scriptscriptstyle\rm Q$}\hbox{\raise 0.15\ht0\hbox to0pt{\kern0.4\wd0\vrule height0.7\ht0\hss}\box0}}}} \def\bbbt{{\mathchoice {\setbox0=\hbox{$\displaystyle\rm T$}\hbox{\hbox to0pt{\kern0.3\wd0\vrule height0.9\ht0\hss}\box0}} {\setbox0=\hbox{$\textstyle\rm T$}\hbox{\hbox to0pt{\kern0.3\wd0\vrule height0.9\ht0\hss}\box0}} {\setbox0=\hbox{$\scriptstyle\rm T$}\hbox{\hbox to0pt{\kern0.3\wd0\vrule height0.9\ht0\hss}\box0}} {\setbox0=\hbox{$\scriptscriptstyle\rm T$}\hbox{\hbox to0pt{\kern0.3\wd0\vrule height0.9\ht0\hss}\box0}}}} \def\bbbs{{\mathchoice {\setbox0=\hbox{$\displaystyle \rm S$}\hbox{\raise0.5\ht0\hbox to0pt{\kern0.35\wd0\vrule height0.45\ht0\hss}\hbox to0pt{\kern0.55\wd0\vrule height0.5\ht0\hss}\box0}} {\setbox0=\hbox{$\textstyle \rm S$}\hbox{\raise0.5\ht0\hbox to0pt{\kern0.35\wd0\vrule height0.45\ht0\hss}\hbox to0pt{\kern0.55\wd0\vrule height0.5\ht0\hss}\box0}} {\setbox0=\hbox{$\scriptstyle \rm S$}\hbox{\raise0.5\ht0\hbox to0pt{\kern0.35\wd0\vrule height0.45\ht0\hss}\raise0.05\ht0\hbox to0pt{\kern0.5\wd0\vrule height0.45\ht0\hss}\box0}} {\setbox0=\hbox{$\scriptscriptstyle\rm S$}\hbox{\raise0.5\ht0\hbox to0pt{\kern0.4\wd0\vrule height0.45\ht0\hss}\raise0.05\ht0\hbox to0pt{\kern0.55\wd0\vrule height0.45\ht0\hss}\box0}}}} \def\bbbz{{\mathchoice {\hbox{$\mathsf\textstyle Z\kern-0.4em Z$}} {\hbox{$\mathsf\textstyle Z\kern-0.4em Z$}} {\hbox{$\mathsf\scriptstyle Z\kern-0.3em Z$}} {\hbox{$\mathsf\scriptscriptstyle Z\kern-0.2em Z$}}}} \let\ts\, \setlength\leftmargini {17\p@} \setlength\leftmargin {\leftmargini} \setlength\leftmarginii {\leftmargini} \setlength\leftmarginiii {\leftmargini} \setlength\leftmarginiv {\leftmargini} \setlength \labelsep {.5em} \setlength \labelwidth{\leftmargini} \addtolength\labelwidth{-\labelsep} \def\@listI{\leftmargin\leftmargini \parsep 0\p@ \@plus1\p@ \@minus\p@ \topsep 8\p@ \@plus2\p@ \@minus4\p@ \itemsep0\p@} \let\@listi\@listI \@listi \def\@listii {\leftmargin\leftmarginii \labelwidth\leftmarginii \advance\labelwidth-\labelsep \topsep 0\p@ \@plus2\p@ \@minus\p@} \def\@listiii{\leftmargin\leftmarginiii \labelwidth\leftmarginiii \advance\labelwidth-\labelsep \topsep 0\p@ \@plus\p@\@minus\p@ \parsep \z@ \partopsep \p@ \@plus\z@ \@minus\p@} \renewcommand\labelitemi{\normalfont\bfseries --} \renewcommand\labelitemii{$\m@th\bullet$} \setlength\arraycolsep{1.4\p@} \setlength\tabcolsep{1.4\p@} \def\tableofcontents{\chapter*{\contentsname\@mkboth{{\contentsname}}% {{\contentsname}}} \def\authcount##1{\setcounter{auco}{##1}\setcounter{@auth}{1}} \def\lastand{\ifnum\value{auco}=2\relax \unskip{} \andname\ \else \unskip \lastandname\ \fi}% \def\and{\stepcounter{@auth}\relax \ifnum\value{@auth}=\value{auco}% \lastand \else \unskip, \fi}% \@starttoc{toc}\if@restonecol\twocolumn\fi} \def\l@part#1#2{\addpenalty{\@secpenalty}% \addvspace{2em plus\p@}% % space above part line \begingroup \parindent \z@ \rightskip \z@ plus 5em \hrule\vskip5pt \large % same size as for a contribution heading \bfseries\boldmath % set line in boldface \leavevmode % TeX command to enter horizontal mode. #1\par \vskip5pt \hrule \vskip1pt \nobreak % Never break after part entry \endgroup} \def\@dotsep{2} \def\hyperhrefextend{\ifx\hyper@anchor\@undefined\else {chapter.\thechapter}\fi} \def\addnumcontentsmark#1#2#3{% \addtocontents{#1}{\protect\contentsline{#2}{\protect\numberline {\thechapter}#3}{\thepage}\hyperhrefextend}} \def\addcontentsmark#1#2#3{% \addtocontents{#1}{\protect\contentsline{#2}{#3}{\thepage}\hyperhrefextend}} \def\addcontentsmarkwop#1#2#3{% \addtocontents{#1}{\protect\contentsline{#2}{#3}{0}\hyperhrefextend}} \def\@adcmk[#1]{\ifcase #1 \or \def\@gtempa{\addnumcontentsmark}% \or \def\@gtempa{\addcontentsmark}% \or \def\@gtempa{\addcontentsmarkwop}% \fi\@gtempa{toc}{chapter}} \def\addtocmark{\@ifnextchar[{\@adcmk}{\@adcmk[3]}} \def\l@chapter#1#2{\addpenalty{-\@highpenalty} \vskip 1.0em plus 1pt \@tempdima 1.5em \begingroup \parindent \z@ \rightskip \@tocrmarg \advance\rightskip by 0pt plus 2cm \parfillskip -\rightskip \pretolerance=10000 \leavevmode \advance\leftskip\@tempdima \hskip -\leftskip {\large\bfseries\boldmath#1}\ifx0#2\hfil\null \else \nobreak \leaders\hbox{$\m@th \mkern \@dotsep mu.\mkern \@dotsep mu$}\hfill \nobreak\hbox to\@pnumwidth{\hss #2}% \fi\par \penalty\@highpenalty \endgroup} \def\l@title#1#2{\addpenalty{-\@highpenalty} \addvspace{8pt plus 1pt} \@tempdima \z@ \begingroup \parindent \z@ \rightskip \@tocrmarg \advance\rightskip by 0pt plus 2cm \parfillskip -\rightskip \pretolerance=10000 \leavevmode \advance\leftskip\@tempdima \hskip -\leftskip #1\nobreak \leaders\hbox{$\m@th \mkern \@dotsep mu.\mkern \@dotsep mu$}\hfill \nobreak\hbox to\@pnumwidth{\hss #2}\par \penalty\@highpenalty \endgroup} \def\l@author#1#2{\addpenalty{\@highpenalty} \@tempdima=\z@ %15\p@ \begingroup \parindent \z@ \rightskip \@tocrmarg \advance\rightskip by 0pt plus 2cm \pretolerance=10000 \leavevmode \advance\leftskip\@tempdima %\hskip -\leftskip \textit{#1}\par \penalty\@highpenalty \endgroup} \setcounter{tocdepth}{0} \newdimen\tocchpnum \newdimen\tocsecnum \newdimen\tocsectotal \newdimen\tocsubsecnum \newdimen\tocsubsectotal \newdimen\tocsubsubsecnum \newdimen\tocsubsubsectotal \newdimen\tocparanum \newdimen\tocparatotal \newdimen\tocsubparanum \tocchpnum=\z@ % no chapter numbers \tocsecnum=15\p@ % section 88. plus 2.222pt \tocsubsecnum=23\p@ % subsection 88.8 plus 2.222pt \tocsubsubsecnum=27\p@ % subsubsection 88.8.8 plus 1.444pt \tocparanum=35\p@ % paragraph 88.8.8.8 plus 1.666pt \tocsubparanum=43\p@ % subparagraph 88.8.8.8.8 plus 1.888pt \def\calctocindent{% \tocsectotal=\tocchpnum \advance\tocsectotal by\tocsecnum \tocsubsectotal=\tocsectotal \advance\tocsubsectotal by\tocsubsecnum \tocsubsubsectotal=\tocsubsectotal \advance\tocsubsubsectotal by\tocsubsubsecnum \tocparatotal=\tocsubsubsectotal \advance\tocparatotal by\tocparanum} \calctocindent \def\l@section{\@dottedtocline{1}{\tocchpnum}{\tocsecnum}} \def\l@subsection{\@dottedtocline{2}{\tocsectotal}{\tocsubsecnum}} \def\l@subsubsection{\@dottedtocline{3}{\tocsubsectotal}{\tocsubsubsecnum}} \def\l@paragraph{\@dottedtocline{4}{\tocsubsubsectotal}{\tocparanum}} \def\l@subparagraph{\@dottedtocline{5}{\tocparatotal}{\tocsubparanum}} \def\listoffigures{\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn \fi\section*{\listfigurename\@mkboth{{\listfigurename}}{{\listfigurename}}} \@starttoc{lof}\if@restonecol\twocolumn\fi} \def\l@figure{\@dottedtocline{1}{0em}{1.5em}} \def\listoftables{\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn \fi\section*{\listtablename\@mkboth{{\listtablename}}{{\listtablename}}} \@starttoc{lot}\if@restonecol\twocolumn\fi} \let\l@table\l@figure \renewcommand\listoffigures{% \section*{\listfigurename \@mkboth{\listfigurename}{\listfigurename}}% \@starttoc{lof}% } \renewcommand\listoftables{% \section*{\listtablename \@mkboth{\listtablename}{\listtablename}}% \@starttoc{lot}% } \ifx\oribibl\undefined \ifx\citeauthoryear\undefined \renewenvironment{thebibliography}[1] {\section*{\refname} \def\@biblabel##1{##1.} \small \list{\@biblabel{\@arabic\c@enumiv}}% {\settowidth\labelwidth{\@biblabel{#1}}% \leftmargin\labelwidth \advance\leftmargin\labelsep \if@openbib \advance\leftmargin\bibindent \itemindent -\bibindent \listparindent \itemindent \parsep \z@ \fi \usecounter{enumiv}% \let\p@enumiv\@empty \renewcommand\theenumiv{\@arabic\c@enumiv}}% \if@openbib \renewcommand\newblock{\par}% \else \renewcommand\newblock{\hskip .11em \@plus.33em \@minus.07em}% \fi \sloppy\clubpenalty4000\widowpenalty4000% \sfcode`\.=\@m} {\def\@noitemerr {\@latex@warning{Empty `thebibliography' environment}}% \endlist} \def\@lbibitem[#1]#2{\item[{[#1]}\hfill]\if@filesw {\let\protect\noexpand\immediate \write\@auxout{\string\bibcite{#2}{#1}}}\fi\ignorespaces} \newcount\@tempcntc \def\@citex[#1]#2{\if@filesw\immediate\write\@auxout{\string\citation{#2}}\fi \@tempcnta\z@\@tempcntb\m@ne\def\@citea{}\@cite{\@for\@citeb:=#2\do {\@ifundefined {b@\@citeb}{\@citeo\@tempcntb\m@ne\@citea\def\@citea{,}{\bfseries ?}\@warning {Citation `\@citeb' on page \thepage \space undefined}}% {\setbox\z@\hbox{\global\@tempcntc0\csname b@\@citeb\endcsname\relax}% \ifnum\@tempcntc=\z@ \@citeo\@tempcntb\m@ne \@citea\def\@citea{,}\hbox{\csname b@\@citeb\endcsname}% \else \advance\@tempcntb\@ne \ifnum\@tempcntb=\@tempcntc \else\advance\@tempcntb\m@ne\@citeo \@tempcnta\@tempcntc\@tempcntb\@tempcntc\fi\fi}}\@citeo}{#1}} \def\@citeo{\ifnum\@tempcnta>\@tempcntb\else \@citea\def\@citea{,\,\hskip\z@skip}% \ifnum\@tempcnta=\@tempcntb\the\@tempcnta\else {\advance\@tempcnta\@ne\ifnum\@tempcnta=\@tempcntb \else \def\@citea{--}\fi \advance\@tempcnta\m@ne\the\@tempcnta\@citea\the\@tempcntb}\fi\fi} \else \renewenvironment{thebibliography}[1] {\section*{\refname} \small \list{}% {\settowidth\labelwidth{}% \leftmargin\parindent \itemindent=-\parindent \labelsep=\z@ \if@openbib \advance\leftmargin\bibindent \itemindent -\bibindent \listparindent \itemindent \parsep \z@ \fi \usecounter{enumiv}% \let\p@enumiv\@empty \renewcommand\theenumiv{}}% \if@openbib \renewcommand\newblock{\par}% \else \renewcommand\newblock{\hskip .11em \@plus.33em \@minus.07em}% \fi \sloppy\clubpenalty4000\widowpenalty4000% \sfcode`\.=\@m} {\def\@noitemerr {\@latex@warning{Empty `thebibliography' environment}}% \endlist} \def\@cite#1{#1}% \def\@lbibitem[#1]#2{\item[]\if@filesw {\def\protect##1{\string ##1\space}\immediate \write\@auxout{\string\bibcite{#2}{#1}}}\fi\ignorespaces} \fi \else \@cons\@openbib@code{\noexpand\small} \fi \def\idxquad{\hskip 10\p@}% space that divides entry from number \def\@idxitem{\par\hangindent 10\p@} \def\subitem{\par\setbox0=\hbox{--\enspace}% second order \noindent\hangindent\wd0\box0}% index entry \def\subsubitem{\par\setbox0=\hbox{--\,--\enspace}% third \noindent\hangindent\wd0\box0}% order index entry \def\indexspace{\par \vskip 10\p@ plus5\p@ minus3\p@\relax} \renewenvironment{theindex} {\@mkboth{\indexname}{\indexname}% \thispagestyle{empty}\parindent\z@ \parskip\z@ \@plus .3\p@\relax \let\item\par \def\,{\relax\ifmmode\mskip\thinmuskip \else\hskip0.2em\ignorespaces\fi}% \normalfont\small \begin{multicols}{2}[\@makeschapterhead{\indexname}]% } {\end{multicols}} \renewcommand\footnoterule{% \kern-3\p@ \hrule\@width 2truecm \kern2.6\p@} \newdimen\fnindent \fnindent1em \long\def\@makefntext#1{% \parindent \fnindent% \leftskip \fnindent% \noindent \llap{\hb@xt@1em{\hss\@makefnmark\ }}\ignorespaces#1} \long\def\@makecaption#1#2{% \vskip\abovecaptionskip \sbox\@tempboxa{{\bfseries #1.} #2}% \ifdim \wd\@tempboxa >\hsize {\bfseries #1.} #2\par \else \global \@minipagefalse \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}% \fi \vskip\belowcaptionskip} \def\fps@figure{htbp} \def\fnum@figure{\figurename\thinspace\thefigure} \def \@floatboxreset {% \reset@font \small \@setnobreak \@setminipage } \def\fps@table{htbp} \def\fnum@table{\tablename~\thetable} \renewenvironment{table} {\setlength\abovecaptionskip{0\p@}% \setlength\belowcaptionskip{10\p@}% \@float{table}} {\end@float} \renewenvironment{table*} {\setlength\abovecaptionskip{0\p@}% \setlength\belowcaptionskip{10\p@}% \@dblfloat{table}} {\end@dblfloat} \long\def\@caption#1[#2]#3{\par\addcontentsline{\csname ext@#1\endcsname}{#1}{\protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}}\begingroup \@parboxrestore \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par \endgroup} % LaTeX does not provide a command to enter the authors institute % addresses. The \institute command is defined here. \newcounter{@inst} \newcounter{@auth} \newcounter{auco} \newdimen\instindent \newbox\authrun \newtoks\authorrunning \newtoks\tocauthor \newbox\titrun \newtoks\titlerunning \newtoks\toctitle \def\clearheadinfo{\gdef\@author{No Author Given}% \gdef\@title{No Title Given}% \gdef\@subtitle{}% \gdef\@institute{No Institute Given}% \gdef\@thanks{}% \global\titlerunning={}\global\authorrunning={}% \global\toctitle={}\global\tocauthor={}} \def\institute#1{\gdef\@institute{#1}} \def\institutename{\par \begingroup \parskip=\z@ \parindent=\z@ \setcounter{@inst}{1}% \def\and{\par\stepcounter{@inst}% \noindent$^{\the@inst}$\enspace\ignorespaces}% \setbox0=\vbox{\def\thanks##1{}\@institute}% \ifnum\c@@inst=1\relax \else \setcounter{footnote}{\c@@inst}% \setcounter{@inst}{1}% \noindent$^{\the@inst}$\enspace \fi \ignorespaces \@institute\par \endgroup} \def\@fnsymbol#1{\ensuremath{\ifcase#1\or\star\or{\star\star}\or {\star\star\star}\or \dagger\or \ddagger\or \mathchar "278\or \mathchar "27B\or \|\or **\or \dagger\dagger \or \ddagger\ddagger \else\@ctrerr\fi}} \def\inst#1{\unskip$^{#1}$} \def\fnmsep{\unskip$^,$} \def\email#1{{\tt#1}} \AtBeginDocument{\@ifundefined{url}{\def\url#1{#1}}{}% \@ifpackageloaded{babel}{% \@ifundefined{extrasenglish}{}{\addto\extrasenglish{\switcht@albion}}% \@ifundefined{extrasfrenchb}{}{\addto\extrasfrenchb{\switcht@francais}}% \@ifundefined{extrasgerman}{}{\addto\extrasgerman{\switcht@deutsch}}% }{\switcht@@therlang}% } \def\homedir{\~{ }} \def\subtitle#1{\gdef\@subtitle{#1}} \clearheadinfo \renewcommand\maketitle{\newpage \refstepcounter{chapter}% \stepcounter{section}% \setcounter{section}{0}% \setcounter{subsection}{0}% \setcounter{figure}{0} \setcounter{table}{0} \setcounter{equation}{0} \setcounter{footnote}{0}% \begingroup \parindent=\z@ \renewcommand\thefootnote{\@fnsymbol\c@footnote}% \if@twocolumn \ifnum \col@number=\@ne \@maketitle \else \twocolumn[\@maketitle]% \fi \else \newpage \global\@topnum\z@ % Prevents figures from going at top of page. \@maketitle \fi \thispagestyle{empty}\@thanks % \def\\{\unskip\ \ignorespaces}\def\inst##1{\unskip{}}% \def\thanks##1{\unskip{}}\def\fnmsep{\unskip}% \instindent=\hsize \advance\instindent by-\headlineindent \if!\the\toctitle!\addcontentsline{toc}{title}{\@title}\else \addcontentsline{toc}{title}{\the\toctitle}\fi \if@runhead \if!\the\titlerunning!\else \edef\@title{\the\titlerunning}% \fi \global\setbox\titrun=\hbox{\small\rm\unboldmath\ignorespaces\@title}% \ifdim\wd\titrun>\instindent \typeout{Title too long for running head. Please supply}% \typeout{a shorter form with \string\titlerunning\space prior to \string\maketitle}% \global\setbox\titrun=\hbox{\small\rm Title Suppressed Due to Excessive Length}% \fi \xdef\@title{\copy\titrun}% \fi % \if!\the\tocauthor!\relax {\def\and{\noexpand\protect\noexpand\and}% \protected@xdef\toc@uthor{\@author}}% \else \def\\{\noexpand\protect\noexpand\newline}% \protected@xdef\scratch{\the\tocauthor}% \protected@xdef\toc@uthor{\scratch}% \fi \addcontentsline{toc}{author}{\toc@uthor}% \if@runhead \if!\the\authorrunning! \value{@inst}=\value{@auth}% \setcounter{@auth}{1}% \else \edef\@author{\the\authorrunning}% \fi \global\setbox\authrun=\hbox{\small\unboldmath\@author\unskip}% \ifdim\wd\authrun>\instindent \typeout{Names of authors too long for running head. Please supply}% \typeout{a shorter form with \string\authorrunning\space prior to \string\maketitle}% \global\setbox\authrun=\hbox{\small\rm Authors Suppressed Due to Excessive Length}% \fi \xdef\@author{\copy\authrun}% \markboth{\@author}{\@title}% \fi \endgroup \setcounter{footnote}{0}% \clearheadinfo} % \def\@maketitle{\newpage \markboth{}{}% \def\lastand{\ifnum\value{@inst}=2\relax \unskip{} \andname\ \else \unskip \lastandname\ \fi}% \def\and{\stepcounter{@auth}\relax \ifnum\value{@auth}=\value{@inst}% \lastand \else \unskip, \fi}% \begin{center}% \let\newline\\ {\Large \bfseries\boldmath \pretolerance=10000 \@title \par}\vskip .8cm \if!\@subtitle!\else {\large \bfseries\boldmath \vskip -.65cm \pretolerance=10000 \@subtitle \par}\vskip .8cm\fi \setbox0=\vbox{\setcounter{@auth}{1}\def\and{\stepcounter{@auth}}% \def\thanks##1{}\@author}% \global\value{@inst}=\value{@auth}% \global\value{auco}=\value{@auth}% \setcounter{@auth}{1}% {\lineskip .5em \noindent\ignorespaces \@author\vskip.35cm} {\small\institutename} \end{center}% } % definition of the "\spnewtheorem" command. % % Usage: % % \spnewtheorem{env_nam}{caption}[within]{cap_font}{body_font} % or \spnewtheorem{env_nam}[numbered_like]{caption}{cap_font}{body_font} % or \spnewtheorem*{env_nam}{caption}{cap_font}{body_font} % % New is "cap_font" and "body_font". It stands for % fontdefinition of the caption and the text itself. % % "\spnewtheorem*" gives a theorem without number. % % A defined spnewthoerem environment is used as described % by Lamport. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \def\@thmcountersep{} \def\@thmcounterend{.} \def\spnewtheorem{\@ifstar{\@sthm}{\@Sthm}} % definition of \spnewtheorem with number \def\@spnthm#1#2{% \@ifnextchar[{\@spxnthm{#1}{#2}}{\@spynthm{#1}{#2}}} \def\@Sthm#1{\@ifnextchar[{\@spothm{#1}}{\@spnthm{#1}}} \def\@spxnthm#1#2[#3]#4#5{\expandafter\@ifdefinable\csname #1\endcsname {\@definecounter{#1}\@addtoreset{#1}{#3}% \expandafter\xdef\csname the#1\endcsname{\expandafter\noexpand \csname the#3\endcsname \noexpand\@thmcountersep \@thmcounter{#1}}% \expandafter\xdef\csname #1name\endcsname{#2}% \global\@namedef{#1}{\@spthm{#1}{\csname #1name\endcsname}{#4}{#5}}% \global\@namedef{end#1}{\@endtheorem}}} \def\@spynthm#1#2#3#4{\expandafter\@ifdefinable\csname #1\endcsname {\@definecounter{#1}% \expandafter\xdef\csname the#1\endcsname{\@thmcounter{#1}}% \expandafter\xdef\csname #1name\endcsname{#2}% \global\@namedef{#1}{\@spthm{#1}{\csname #1name\endcsname}{#3}{#4}}% \global\@namedef{end#1}{\@endtheorem}}} \def\@spothm#1[#2]#3#4#5{% \@ifundefined{c@#2}{\@latexerr{No theorem environment `#2' defined}\@eha}% {\expandafter\@ifdefinable\csname #1\endcsname {\global\@namedef{the#1}{\@nameuse{the#2}}% \expandafter\xdef\csname #1name\endcsname{#3}% \global\@namedef{#1}{\@spthm{#2}{\csname #1name\endcsname}{#4}{#5}}% \global\@namedef{end#1}{\@endtheorem}}}} \def\@spthm#1#2#3#4{\topsep 7\p@ \@plus2\p@ \@minus4\p@ \refstepcounter{#1}% \@ifnextchar[{\@spythm{#1}{#2}{#3}{#4}}{\@spxthm{#1}{#2}{#3}{#4}}} \def\@spxthm#1#2#3#4{\@spbegintheorem{#2}{\csname the#1\endcsname}{#3}{#4}% \ignorespaces} \def\@spythm#1#2#3#4[#5]{\@spopargbegintheorem{#2}{\csname the#1\endcsname}{#5}{#3}{#4}\ignorespaces} \def\@spbegintheorem#1#2#3#4{\trivlist \item[\hskip\labelsep{#3#1\ #2\@thmcounterend}]#4} \def\@spopargbegintheorem#1#2#3#4#5{\trivlist \item[\hskip\labelsep{#4#1\ #2}]{#4(#3)\@thmcounterend\ }#5} % definition of \spnewtheorem* without number \def\@sthm#1#2{\@Ynthm{#1}{#2}} \def\@Ynthm#1#2#3#4{\expandafter\@ifdefinable\csname #1\endcsname {\global\@namedef{#1}{\@Thm{\csname #1name\endcsname}{#3}{#4}}% \expandafter\xdef\csname #1name\endcsname{#2}% \global\@namedef{end#1}{\@endtheorem}}} \def\@Thm#1#2#3{\topsep 7\p@ \@plus2\p@ \@minus4\p@ \@ifnextchar[{\@Ythm{#1}{#2}{#3}}{\@Xthm{#1}{#2}{#3}}} \def\@Xthm#1#2#3{\@Begintheorem{#1}{#2}{#3}\ignorespaces} \def\@Ythm#1#2#3[#4]{\@Opargbegintheorem{#1} {#4}{#2}{#3}\ignorespaces} \def\@Begintheorem#1#2#3{#3\trivlist \item[\hskip\labelsep{#2#1\@thmcounterend}]} \def\@Opargbegintheorem#1#2#3#4{#4\trivlist \item[\hskip\labelsep{#3#1}]{#3(#2)\@thmcounterend\ }} \if@envcntsect \def\@thmcountersep{.} \spnewtheorem{theorem}{Theorem}[section]{\bfseries}{\itshape} \else \spnewtheorem{theorem}{Theorem}{\bfseries}{\itshape} \if@envcntreset \@addtoreset{theorem}{section} \else \@addtoreset{theorem}{chapter} \fi \fi %definition of divers theorem environments \spnewtheorem*{claim}{Claim}{\itshape}{\rmfamily} \spnewtheorem*{proof}{Proof}{\itshape}{\rmfamily} \if@envcntsame % alle Umgebungen wie Theorem. \def\spn@wtheorem#1#2#3#4{\@spothm{#1}[theorem]{#2}{#3}{#4}} \else % alle Umgebungen mit eigenem Zaehler \if@envcntsect % mit section numeriert \def\spn@wtheorem#1#2#3#4{\@spxnthm{#1}{#2}[section]{#3}{#4}} \else % nicht mit section numeriert \if@envcntreset \def\spn@wtheorem#1#2#3#4{\@spynthm{#1}{#2}{#3}{#4} \@addtoreset{#1}{section}} \else \def\spn@wtheorem#1#2#3#4{\@spynthm{#1}{#2}{#3}{#4} \@addtoreset{#1}{chapter}}% \fi \fi \fi \spn@wtheorem{case}{Case}{\itshape}{\rmfamily} \spn@wtheorem{conjecture}{Conjecture}{\itshape}{\rmfamily} \spn@wtheorem{corollary}{Corollary}{\bfseries}{\itshape} \spn@wtheorem{definition}{Definition}{\bfseries}{\itshape} \spn@wtheorem{example}{Example}{\itshape}{\rmfamily} \spn@wtheorem{exercise}{Exercise}{\itshape}{\rmfamily} \spn@wtheorem{lemma}{Lemma}{\bfseries}{\itshape} \spn@wtheorem{note}{Note}{\itshape}{\rmfamily} \spn@wtheorem{problem}{Problem}{\itshape}{\rmfamily} \spn@wtheorem{property}{Property}{\itshape}{\rmfamily} \spn@wtheorem{proposition}{Proposition}{\bfseries}{\itshape} \spn@wtheorem{question}{Question}{\itshape}{\rmfamily} \spn@wtheorem{solution}{Solution}{\itshape}{\rmfamily} \spn@wtheorem{remark}{Remark}{\itshape}{\rmfamily} \def\@takefromreset#1#2{% \def\@tempa{#1}% \let\@tempd\@elt \def\@elt##1{% \def\@tempb{##1}% \ifx\@tempa\@tempb\else \@addtoreset{##1}{#2}% \fi}% \expandafter\expandafter\let\expandafter\@tempc\csname cl@#2\endcsname \expandafter\def\csname cl@#2\endcsname{}% \@tempc \let\@elt\@tempd} \def\theopargself{\def\@spopargbegintheorem##1##2##3##4##5{\trivlist \item[\hskip\labelsep{##4##1\ ##2}]{##4##3\@thmcounterend\ }##5} \def\@Opargbegintheorem##1##2##3##4{##4\trivlist \item[\hskip\labelsep{##3##1}]{##3##2\@thmcounterend\ }} } \renewenvironment{abstract}{% \list{}{\advance\topsep by0.35cm\relax\small \leftmargin=1cm \labelwidth=\z@ \listparindent=\z@ \itemindent\listparindent \rightmargin\leftmargin}\item[\hskip\labelsep \bfseries\abstractname]} {\endlist} \newdimen\headlineindent % dimension for space between \headlineindent=1.166cm % number and text of headings. \def\ps@headings{\let\@mkboth\@gobbletwo \let\@oddfoot\@empty\let\@evenfoot\@empty \def\@evenhead{\normalfont\small\rlap{\thepage}\hspace{\headlineindent}% \leftmark\hfil} \def\@oddhead{\normalfont\small\hfil\rightmark\hspace{\headlineindent}% \llap{\thepage}} \def\chaptermark##1{}% \def\sectionmark##1{}% \def\subsectionmark##1{}} \def\ps@titlepage{\let\@mkboth\@gobbletwo \let\@oddfoot\@empty\let\@evenfoot\@empty \def\@evenhead{\normalfont\small\rlap{\thepage}\hspace{\headlineindent}% \hfil} \def\@oddhead{\normalfont\small\hfil\hspace{\headlineindent}% \llap{\thepage}} \def\chaptermark##1{}% \def\sectionmark##1{}% \def\subsectionmark##1{}} \if@runhead\ps@headings\else \ps@empty\fi \setlength\arraycolsep{1.4\p@} \setlength\tabcolsep{1.4\p@} \endinput gnade-1.6.2.orig/doc/Ada_2002/llncs.ind0000644000175000017500000000050407410161106017074 0ustar lbrentalbrenta% This is LLNCS.IND the handmade demonstration % file for an author index from Springer-Verlag % for Lecture Notes in Computer Science, % version 2.2 for LaTeX2e % \begin{theindex} \item Abt~I. \idxquad{7} \item Ahmed~T. \idxquad{3} \item Zimmermann~W. \idxquad{11} \end{theindex} gnade-1.6.2.orig/doc/Ada_2002/llncsdoc.sty0000644000175000017500000000271507407734056017655 0ustar lbrentalbrenta% This is LLNCSDOC.STY the modification of the % LLNCS class file for the documentation of % the class itself. % \def\AmS{{\protect\usefont{OMS}{cmsy}{m}{n}% A\kern-.1667em\lower.5ex\hbox{M}\kern-.125emS}} \def\AmSTeX{{\protect\AmS-\protect\TeX}} % \def\ps@myheadings{\let\@mkboth\@gobbletwo \def\@oddhead{\hbox{}\hfil\small\rm\rightmark \qquad\thepage}% \def\@oddfoot{}\def\@evenhead{\small\rm\thepage\qquad \leftmark\hfil}% \def\@evenfoot{}\def\sectionmark##1{}\def\subsectionmark##1{}} \ps@myheadings % \setcounter{tocdepth}{2} % \renewcommand{\labelitemi}{--} \newenvironment{alpherate}% {\renewcommand{\labelenumi}{\alph{enumi})}\begin{enumerate}}% {\end{enumerate}\renewcommand{\labelenumi}{enumi}} % \def\bibauthoryear{\begingroup \def\thebibliography##1{\section*{References}% \small\list{}{\settowidth\labelwidth{}\leftmargin\parindent \itemindent=-\parindent \labelsep=\z@ \usecounter{enumi}}% \def\newblock{\hskip .11em plus .33em minus -.07em}% \sloppy \sfcode`\.=1000\relax}% \def\@cite##1{##1}% \def\@lbibitem[##1]##2{\item[]\if@filesw {\def\protect####1{\string ####1\space}\immediate \write\@auxout{\string\bibcite{##2}{##1}}}\fi\ignorespaces}% \begin{thebibliography}{} \bibitem[1982]{clar:eke3} Clarke, F., Ekeland, I.: Nonlinear oscillations and boundary-value problems for Hamiltonian systems. Arch. Rat. Mech. Anal. {\bf 78} (1982) 315--333 \end{thebibliography} \endgroup} gnade-1.6.2.orig/doc/Ada_2002/splncs.bst0000644000175000017500000005147407407734056017335 0ustar lbrentalbrenta% BibTeX bibliography style `splncs' % An attempt to match the bibliography style required for use with % numbered references in Springer Verlag's "Lecture Notes in Computer % Science" series. (See Springer's documentation for llncs.sty for % more details of the suggested reference format.) Note that this % file will not work for author-year style citations. % Use \documentclass{llncs} and \bibliographystyle{splncs}, and cite % a reference with (e.g.) \cite{smith77} to get a "[1]" in the text. % Copyright (C) 1999 Jason Noble. % Last updated: Thursday 20 May 1999, 13:22:19 % % Based on the BibTeX standard bibliography style `unsrt' ENTRY { address author booktitle chapter edition editor howpublished institution journal key month note number organization pages publisher school series title type volume year } {} { label } INTEGERS { output.state before.all mid.sentence after.sentence after.block after.authors between.elements} FUNCTION {init.state.consts} { #0 'before.all := #1 'mid.sentence := #2 'after.sentence := #3 'after.block := #4 'after.authors := #5 'between.elements := } STRINGS { s t } FUNCTION {output.nonnull} { 's := output.state mid.sentence = { " " * write$ } { output.state after.block = { add.period$ write$ newline$ "\newblock " write$ } { output.state after.authors = { ": " * write$ newline$ "\newblock " write$ } { output.state between.elements = { ", " * write$ } { output.state before.all = 'write$ { add.period$ " " * write$ } if$ } if$ } if$ } if$ mid.sentence 'output.state := } if$ s } FUNCTION {output} { duplicate$ empty$ 'pop$ 'output.nonnull if$ } FUNCTION {output.check} { 't := duplicate$ empty$ { pop$ "empty " t * " in " * cite$ * warning$ } 'output.nonnull if$ } FUNCTION {output.bibitem} { newline$ "\bibitem{" write$ cite$ write$ "}" write$ newline$ "" before.all 'output.state := } FUNCTION {fin.entry} { write$ newline$ } FUNCTION {new.block} { output.state before.all = 'skip$ { after.block 'output.state := } if$ } FUNCTION {stupid.colon} { after.authors 'output.state := } FUNCTION {insert.comma} { output.state before.all = 'skip$ { between.elements 'output.state := } if$ } FUNCTION {new.sentence} { output.state after.block = 'skip$ { output.state before.all = 'skip$ { after.sentence 'output.state := } if$ } if$ } FUNCTION {not} { { #0 } { #1 } if$ } FUNCTION {and} { 'skip$ { pop$ #0 } if$ } FUNCTION {or} { { pop$ #1 } 'skip$ if$ } FUNCTION {new.block.checka} { empty$ 'skip$ 'new.block if$ } FUNCTION {new.block.checkb} { empty$ swap$ empty$ and 'skip$ 'new.block if$ } FUNCTION {new.sentence.checka} { empty$ 'skip$ 'new.sentence if$ } FUNCTION {new.sentence.checkb} { empty$ swap$ empty$ and 'skip$ 'new.sentence if$ } FUNCTION {field.or.null} { duplicate$ empty$ { pop$ "" } 'skip$ if$ } FUNCTION {emphasize} { duplicate$ empty$ { pop$ "" } { "" swap$ * "" * } if$ } FUNCTION {bold} { duplicate$ empty$ { pop$ "" } { "\textbf{" swap$ * "}" * } if$ } FUNCTION {parens} { duplicate$ empty$ { pop$ "" } { "(" swap$ * ")" * } if$ } INTEGERS { nameptr namesleft numnames } FUNCTION {format.springer.names} { 's := #1 'nameptr := s num.names$ 'numnames := numnames 'namesleft := { namesleft #0 > } { s nameptr "{vv~}{ll}{, jj}{, f{.}.}" format.name$ 't := nameptr #1 > { namesleft #1 > { ", " * t * } { numnames #1 > { ", " * } 'skip$ if$ t "others" = { " et~al." * } { "" * t * } if$ } if$ } 't if$ nameptr #1 + 'nameptr := namesleft #1 - 'namesleft := } while$ } FUNCTION {format.names} { 's := #1 'nameptr := s num.names$ 'numnames := numnames 'namesleft := { namesleft #0 > } { s nameptr "{vv~}{ll}{, jj}{, f.}" format.name$ 't := nameptr #1 > { namesleft #1 > { ", " * t * } { numnames #2 > { "," * } 'skip$ if$ t "others" = { " et~al." * } { " \& " * t * } if$ } if$ } 't if$ nameptr #1 + 'nameptr := namesleft #1 - 'namesleft := } while$ } FUNCTION {format.authors} { author empty$ { "" } { author format.springer.names } if$ } FUNCTION {format.editors} { editor empty$ { "" } { editor format.springer.names editor num.names$ #1 > { ", eds." * } { ", ed." * } if$ } if$ } FUNCTION {format.title} { title empty$ { "" } { title "t" change.case$ } if$ } FUNCTION {n.dashify} { 't := "" { t empty$ not } { t #1 #1 substring$ "-" = { t #1 #2 substring$ "--" = not { "--" * t #2 global.max$ substring$ 't := } { { t #1 #1 substring$ "-" = } { "-" * t #2 global.max$ substring$ 't := } while$ } if$ } { t #1 #1 substring$ * t #2 global.max$ substring$ 't := } if$ } while$ } FUNCTION {format.date} { year empty$ { "there's no year in " cite$ * warning$ } 'year if$ } FUNCTION {format.btitle} { title emphasize } FUNCTION {tie.or.space.connect} { duplicate$ text.length$ #3 < { "~" } { " " } if$ swap$ * * } FUNCTION {either.or.check} { empty$ 'pop$ { "can't use both " swap$ * " fields in " * cite$ * warning$ } if$ } FUNCTION {format.bvolume} { volume empty$ { "" } { "Volume" volume tie.or.space.connect series empty$ 'skip$ { " of " * series emphasize * } if$ add.period$ "volume and number" number either.or.check } if$ } FUNCTION {format.number.series} { volume empty$ { number empty$ { series field.or.null } { output.state mid.sentence = { "number" } { "Number" } if$ number tie.or.space.connect series empty$ { "there's a number but no series in " cite$ * warning$ } { " in " * series * } if$ } if$ } { "" } if$ } FUNCTION {format.edition} { edition empty$ { "" } { output.state mid.sentence = { edition "l" change.case$ " edn." * } { edition "t" change.case$ " edn." * } if$ } if$ } INTEGERS { multiresult } FUNCTION {multi.page.check} { 't := #0 'multiresult := { multiresult not t empty$ not and } { t #1 #1 substring$ duplicate$ "-" = swap$ duplicate$ "," = swap$ "+" = or or { #1 'multiresult := } { t #2 global.max$ substring$ 't := } if$ } while$ multiresult } FUNCTION {format.pages} { pages empty$ { "" } { pages multi.page.check { "" pages n.dashify tie.or.space.connect } { "" pages tie.or.space.connect } if$ } if$ } FUNCTION {format.vol} { volume bold } FUNCTION {pre.format.pages} { pages empty$ 'skip$ { duplicate$ empty$ { pop$ format.pages } { " " * pages n.dashify * } if$ } if$ } FUNCTION {format.chapter.pages} { chapter empty$ 'format.pages { type empty$ { "chapter" } { type "l" change.case$ } if$ chapter tie.or.space.connect pages empty$ 'skip$ { " " * format.pages * } if$ } if$ } FUNCTION {format.in.ed.booktitle} { booktitle empty$ { "" } { editor empty$ { "In: " booktitle emphasize * } { "In " format.editors * ": " * booktitle emphasize * } if$ } if$ } FUNCTION {empty.misc.check} { author empty$ title empty$ howpublished empty$ month empty$ year empty$ note empty$ and and and and and { "all relevant fields are empty in " cite$ * warning$ } 'skip$ if$ } FUNCTION {format.thesis.type} { type empty$ 'skip$ { pop$ type "t" change.case$ } if$ } FUNCTION {format.tr.number} { type empty$ { "Technical Report" } 'type if$ number empty$ { "t" change.case$ } { number tie.or.space.connect } if$ } FUNCTION {format.article.crossref} { key empty$ { journal empty$ { "need key or journal for " cite$ * " to crossref " * crossref * warning$ "" } { "In {\em " journal * "\/}" * } if$ } { "In " key * } if$ " \cite{" * crossref * "}" * } FUNCTION {format.crossref.editor} { editor #1 "{vv~}{ll}" format.name$ editor num.names$ duplicate$ #2 > { pop$ " et~al." * } { #2 < 'skip$ { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" = { " et~al." * } { " and " * editor #2 "{vv~}{ll}" format.name$ * } if$ } if$ } if$ } FUNCTION {format.book.crossref} { volume empty$ { "empty volume in " cite$ * "'s crossref of " * crossref * warning$ "In " } { "Volume" volume tie.or.space.connect " of " * } if$ " \cite{" * crossref * "}" * } FUNCTION {format.incoll.inproc.crossref} { editor empty$ editor field.or.null author field.or.null = or { key empty$ { booktitle empty$ { "need editor, key, or booktitle for " cite$ * " to crossref " * crossref * warning$ "" } { "" } if$ } { "" } if$ } { "" } if$ " \cite{" * crossref * "}" * } FUNCTION {and.the.note} { note output note empty$ 'skip$ { add.period$ } if$ } FUNCTION {article} { output.bibitem format.authors "author" output.check stupid.colon format.title "title" output.check new.block crossref missing$ { journal emphasize "journal" output.check format.vol output format.date parens output format.pages output } { format.article.crossref output.nonnull format.pages output } if$ and.the.note fin.entry } FUNCTION {book} { output.bibitem author empty$ { format.editors "author and editor" output.check } { format.authors output.nonnull crossref missing$ { "author and editor" editor either.or.check } 'skip$ if$ } if$ stupid.colon format.btitle "title" output.check new.sentence crossref missing$ { format.edition output format.bvolume output new.block format.number.series output new.sentence publisher "publisher" output.check address empty$ 'skip$ { insert.comma } if$ address output format.date parens output } { format.book.crossref output.nonnull } if$ and.the.note fin.entry } FUNCTION {booklet} { output.bibitem format.authors output stupid.colon format.title "title" output.check howpublished address new.block.checkb howpublished output address empty$ 'skip$ { insert.comma } if$ address output format.date parens output and.the.note fin.entry } FUNCTION {inbook} { output.bibitem author empty$ { format.editors "author and editor" output.check } { format.authors output.nonnull crossref missing$ { "author and editor" editor either.or.check } 'skip$ if$ } if$ stupid.colon crossref missing$ { chapter output new.block format.number.series output new.sentence "In:" output format.btitle "title" output.check new.sentence format.edition output format.bvolume output publisher "publisher" output.check address empty$ 'skip$ { insert.comma } if$ address output format.date parens output } { chapter output new.block format.incoll.inproc.crossref output.nonnull } if$ format.pages output and.the.note fin.entry } FUNCTION {incollection} { output.bibitem format.authors "author" output.check stupid.colon format.title "title" output.check new.block crossref missing$ { format.in.ed.booktitle "booktitle" output.check new.sentence format.bvolume output format.number.series output new.block format.edition output publisher "publisher" output.check address empty$ 'skip$ { insert.comma } if$ address output format.date parens output format.pages output } { format.incoll.inproc.crossref output.nonnull format.chapter.pages output } if$ and.the.note fin.entry } FUNCTION {inproceedings} { output.bibitem format.authors "author" output.check stupid.colon format.title "title" output.check new.block crossref missing$ { format.in.ed.booktitle "booktitle" output.check new.sentence format.bvolume output format.number.series output address empty$ { organization publisher new.sentence.checkb organization empty$ 'skip$ { insert.comma } if$ organization output publisher empty$ 'skip$ { insert.comma } if$ publisher output format.date parens output } { insert.comma address output.nonnull organization empty$ 'skip$ { insert.comma } if$ organization output publisher empty$ 'skip$ { insert.comma } if$ publisher output format.date parens output } if$ } { format.incoll.inproc.crossref output.nonnull } if$ format.pages output and.the.note fin.entry } FUNCTION {conference} { inproceedings } FUNCTION {manual} { output.bibitem author empty$ { organization empty$ 'skip$ { organization output.nonnull address output } if$ } { format.authors output.nonnull } if$ stupid.colon format.btitle "title" output.check author empty$ { organization empty$ { address new.block.checka address output } 'skip$ if$ } { organization address new.block.checkb organization output address empty$ 'skip$ { insert.comma } if$ address output } if$ new.sentence format.edition output format.date parens output and.the.note fin.entry } FUNCTION {mastersthesis} { output.bibitem format.authors "author" output.check stupid.colon format.title "title" output.check new.block "Master's thesis" format.thesis.type output.nonnull school empty$ 'skip$ { insert.comma } if$ school "school" output.check address empty$ 'skip$ { insert.comma } if$ address output format.date parens output and.the.note fin.entry } FUNCTION {misc} { output.bibitem format.authors "author" output.check stupid.colon format.title "title" output.check howpublished new.block.checka howpublished output format.date parens output and.the.note fin.entry empty.misc.check } FUNCTION {phdthesis} { output.bibitem format.authors "author" output.check stupid.colon format.btitle "title" output.check new.block "PhD thesis" format.thesis.type output.nonnull school empty$ 'skip$ { insert.comma } if$ school "school" output.check address empty$ 'skip$ { insert.comma } if$ address output format.date parens output and.the.note fin.entry } FUNCTION {proceedings} { output.bibitem editor empty$ { organization empty$ { "" } { organization output stupid.colon } if$ } { format.editors output.nonnull stupid.colon } if$ format.btitle "title" output.check new.block crossref missing$ { format.in.ed.booktitle "booktitle" output.check new.sentence format.bvolume output format.number.series output address empty$ { organization publisher new.sentence.checkb organization empty$ 'skip$ { insert.comma } if$ organization output publisher empty$ 'skip$ { insert.comma } if$ publisher output format.date parens output } { insert.comma address output.nonnull organization empty$ 'skip$ { insert.comma } if$ organization output publisher empty$ 'skip$ { insert.comma } if$ publisher output format.date parens output } if$ } { format.incoll.inproc.crossref output.nonnull } if$ and.the.note fin.entry } FUNCTION {techreport} { output.bibitem format.authors "author" output.check stupid.colon format.title "title" output.check new.block format.tr.number output.nonnull institution empty$ 'skip$ { insert.comma } if$ institution "institution" output.check address empty$ 'skip$ { insert.comma } if$ address output format.date parens output and.the.note fin.entry } FUNCTION {unpublished} { output.bibitem format.authors "author" output.check stupid.colon format.title "title" output.check new.block note "note" output.check format.date parens output fin.entry } FUNCTION {default.type} { misc } MACRO {jan} {"January"} MACRO {feb} {"February"} MACRO {mar} {"March"} MACRO {apr} {"April"} MACRO {may} {"May"} MACRO {jun} {"June"} MACRO {jul} {"July"} MACRO {aug} {"August"} MACRO {sep} {"September"} MACRO {oct} {"October"} MACRO {nov} {"November"} MACRO {dec} {"December"} MACRO {acmcs} {"ACM Computing Surveys"} MACRO {acta} {"Acta Informatica"} MACRO {cacm} {"Communications of the ACM"} MACRO {ibmjrd} {"IBM Journal of Research and Development"} MACRO {ibmsj} {"IBM Systems Journal"} MACRO {ieeese} {"IEEE Transactions on Software Engineering"} MACRO {ieeetc} {"IEEE Transactions on Computers"} MACRO {ieeetcad} {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"} MACRO {ipl} {"Information Processing Letters"} MACRO {jacm} {"Journal of the ACM"} MACRO {jcss} {"Journal of Computer and System Sciences"} MACRO {scp} {"Science of Computer Programming"} MACRO {sicomp} {"SIAM Journal on Computing"} MACRO {tocs} {"ACM Transactions on Computer Systems"} MACRO {tods} {"ACM Transactions on Database Systems"} MACRO {tog} {"ACM Transactions on Graphics"} MACRO {toms} {"ACM Transactions on Mathematical Software"} MACRO {toois} {"ACM Transactions on Office Information Systems"} MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"} MACRO {tcs} {"Theoretical Computer Science"} READ STRINGS { longest.label } INTEGERS { number.label longest.label.width } FUNCTION {initialize.longest.label} { "" 'longest.label := #1 'number.label := #0 'longest.label.width := } FUNCTION {longest.label.pass} { number.label int.to.str$ 'label := number.label #1 + 'number.label := label width$ longest.label.width > { label 'longest.label := label width$ 'longest.label.width := } 'skip$ if$ } EXECUTE {initialize.longest.label} ITERATE {longest.label.pass} FUNCTION {begin.bib} { preamble$ empty$ 'skip$ { preamble$ write$ newline$ } if$ "\begin{thebibliography}{" longest.label * "}" * write$ newline$ } EXECUTE {begin.bib} EXECUTE {init.state.consts} ITERATE {call.type$} FUNCTION {end.bib} { newline$ "\end{thebibliography}" write$ newline$ } EXECUTE {end.bib} gnade-1.6.2.orig/doc/Ada_2002/toolchain.eps0000644000175000017500000002734207412652221017774 0ustar lbrentalbrenta%!PS-Adobe-2.0 EPSF-2.0 %%Title: toolchain.eps %%Creator: fig2dev Version 3.2 Patchlevel 3c %%CreationDate: Mon Dec 24 13:16:21 2001 %%For: gnade@boavista.snafu.de () %%BoundingBox: 0 0 398 543 %%Magnification: 0.8000 %%EndComments /$F2psDict 200 dict def $F2psDict begin $F2psDict /mtrx matrix put /col-1 {0 setgray} bind def /col0 {0.000 0.000 0.000 srgb} bind def /col1 {0.000 0.000 1.000 srgb} bind def /col2 {0.000 1.000 0.000 srgb} bind def /col3 {0.000 1.000 1.000 srgb} bind def /col4 {1.000 0.000 0.000 srgb} bind def /col5 {1.000 0.000 1.000 srgb} bind def /col6 {1.000 1.000 0.000 srgb} bind def /col7 {1.000 1.000 1.000 srgb} bind def /col8 {0.000 0.000 0.560 srgb} bind def /col9 {0.000 0.000 0.690 srgb} bind def /col10 {0.000 0.000 0.820 srgb} bind def /col11 {0.530 0.810 1.000 srgb} bind def /col12 {0.000 0.560 0.000 srgb} bind def /col13 {0.000 0.690 0.000 srgb} bind def /col14 {0.000 0.820 0.000 srgb} bind def /col15 {0.000 0.560 0.560 srgb} bind def /col16 {0.000 0.690 0.690 srgb} bind def /col17 {0.000 0.820 0.820 srgb} bind def /col18 {0.560 0.000 0.000 srgb} bind def /col19 {0.690 0.000 0.000 srgb} bind def /col20 {0.820 0.000 0.000 srgb} bind def /col21 {0.560 0.000 0.560 srgb} bind def /col22 {0.690 0.000 0.690 srgb} bind def /col23 {0.820 0.000 0.820 srgb} bind def /col24 {0.500 0.190 0.000 srgb} bind def /col25 {0.630 0.250 0.000 srgb} bind def /col26 {0.750 0.380 0.000 srgb} bind def /col27 {1.000 0.500 0.500 srgb} bind def /col28 {1.000 0.630 0.630 srgb} bind def /col29 {1.000 0.750 0.750 srgb} bind def /col30 {1.000 0.880 0.880 srgb} bind def /col31 {1.000 0.840 0.000 srgb} bind def end save newpath 0 543 moveto 0 0 lineto 398 0 lineto 398 543 lineto closepath clip newpath -49.0 624.0 translate 1 -1 scale /cp {closepath} bind def /ef {eofill} bind def /gr {grestore} bind def /gs {gsave} bind def /sa {save} bind def /rs {restore} bind def /l {lineto} bind def /m {moveto} bind def /rm {rmoveto} bind def /n {newpath} bind def /s {stroke} bind def /sh {show} bind def /slc {setlinecap} bind def /slj {setlinejoin} bind def /slw {setlinewidth} bind def /srgb {setrgbcolor} bind def /rot {rotate} bind def /sc {scale} bind def /sd {setdash} bind def /ff {findfont} bind def /sf {setfont} bind def /scf {scalefont} bind def /sw {stringwidth} bind def /tr {translate} bind def /tnt {dup dup currentrgbcolor 4 -2 roll dup 1 exch sub 3 -1 roll mul add 4 -2 roll dup 1 exch sub 3 -1 roll mul add 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb} bind def /shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul 4 -2 roll mul srgb} bind def /reencdict 12 dict def /ReEncode { reencdict begin /newcodesandnames exch def /newfontname exch def /basefontname exch def /basefontdict basefontname findfont def /newfont basefontdict maxlength dict def basefontdict { exch dup /FID ne { dup /Encoding eq { exch dup length array copy newfont 3 1 roll put } { exch newfont 3 1 roll put } ifelse } { pop pop } ifelse } forall newfont /FontName newfontname put newcodesandnames aload pop 128 1 255 { newfont /Encoding get exch /.notdef put } for newcodesandnames length 2 idiv { newfont /Encoding get 3 1 roll put } repeat newfontname newfont definefont pop end } def /isovec [ 8#055 /minus 8#200 /grave 8#201 /acute 8#202 /circumflex 8#203 /tilde 8#204 /macron 8#205 /breve 8#206 /dotaccent 8#207 /dieresis 8#210 /ring 8#211 /cedilla 8#212 /hungarumlaut 8#213 /ogonek 8#214 /caron 8#220 /dotlessi 8#230 /oe 8#231 /OE 8#240 /space 8#241 /exclamdown 8#242 /cent 8#243 /sterling 8#244 /currency 8#245 /yen 8#246 /brokenbar 8#247 /section 8#250 /dieresis 8#251 /copyright 8#252 /ordfeminine 8#253 /guillemotleft 8#254 /logicalnot 8#255 /hyphen 8#256 /registered 8#257 /macron 8#260 /degree 8#261 /plusminus 8#262 /twosuperior 8#263 /threesuperior 8#264 /acute 8#265 /mu 8#266 /paragraph 8#267 /periodcentered 8#270 /cedilla 8#271 /onesuperior 8#272 /ordmasculine 8#273 /guillemotright 8#274 /onequarter 8#275 /onehalf 8#276 /threequarters 8#277 /questiondown 8#300 /Agrave 8#301 /Aacute 8#302 /Acircumflex 8#303 /Atilde 8#304 /Adieresis 8#305 /Aring 8#306 /AE 8#307 /Ccedilla 8#310 /Egrave 8#311 /Eacute 8#312 /Ecircumflex 8#313 /Edieresis 8#314 /Igrave 8#315 /Iacute 8#316 /Icircumflex 8#317 /Idieresis 8#320 /Eth 8#321 /Ntilde 8#322 /Ograve 8#323 /Oacute 8#324 /Ocircumflex 8#325 /Otilde 8#326 /Odieresis 8#327 /multiply 8#330 /Oslash 8#331 /Ugrave 8#332 /Uacute 8#333 /Ucircumflex 8#334 /Udieresis 8#335 /Yacute 8#336 /Thorn 8#337 /germandbls 8#340 /agrave 8#341 /aacute 8#342 /acircumflex 8#343 /atilde 8#344 /adieresis 8#345 /aring 8#346 /ae 8#347 /ccedilla 8#350 /egrave 8#351 /eacute 8#352 /ecircumflex 8#353 /edieresis 8#354 /igrave 8#355 /iacute 8#356 /icircumflex 8#357 /idieresis 8#360 /eth 8#361 /ntilde 8#362 /ograve 8#363 /oacute 8#364 /ocircumflex 8#365 /otilde 8#366 /odieresis 8#367 /divide 8#370 /oslash 8#371 /ugrave 8#372 /uacute 8#373 /ucircumflex 8#374 /udieresis 8#375 /yacute 8#376 /thorn 8#377 /ydieresis] def /Times-Roman /Times-Roman-iso isovec ReEncode /Helvetica-Bold /Helvetica-Bold-iso isovec ReEncode /$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def /$F2psEnd {$F2psEnteredState restore end} def $F2psBegin %%Page: 1 1 10 setmiterlimit 0.04800 0.04800 sc % % Fig objects follow % /Times-Roman-iso ff 120.00 scf sf 3600 12075 m gs 1 -1 sc 90.0 rot ( WHERE MANAGER = :Manager_To_Find ; ) col0 sh gr /Times-Roman-iso ff 120.00 scf sf 3300 12075 m gs 1 -1 sc 90.0 rot ( SELECT EMPNO, NAME, DEPTNO ) col0 sh gr /Times-Roman-iso ff 120.00 scf sf 3000 12000 m gs 1 -1 sc 90.0 rot (EXEC SQL) col0 sh gr /Times-Roman-iso ff 120.00 scf sf 3450 12075 m gs 1 -1 sc 90.0 rot ( FROM EMPLOYEES) col0 sh gr /Times-Roman-iso ff 120.00 scf sf 3150 12000 m gs 1 -1 sc 90.0 rot ( DECLARE emp_cursor CURSOR FOR ) col0 sh gr /Times-Roman-iso ff 120.00 scf sf 3825 12000 m gs 1 -1 sc 90.0 rot (EXEC SQL AT DB01 ) col0 sh gr /Times-Roman-iso ff 120.00 scf sf 3975 12000 m gs 1 -1 sc 90.0 rot ( OPEN emp_cursor ;) col0 sh gr /Times-Roman-iso ff 120.00 scf sf 4500 11700 m gs 1 -1 sc 90.0 rot ( FETCH FROM emp_cursor ) col0 sh gr /Times-Roman-iso ff 120.00 scf sf 4650 11775 m gs 1 -1 sc 90.0 rot ( INTO :empno, :name, :depno INDICATOR :depno_ind ; ) col0 sh gr /Times-Roman-iso ff 120.00 scf sf 4350 11700 m gs 1 -1 sc 90.0 rot (EXEC SQL) col0 sh gr /Times-Roman-iso ff 120.00 scf sf 7350 10050 m gs 1 -1 sc 90.0 rot (Bind\(....\);) col0 sh gr /Times-Roman-iso ff 120.00 scf sf 7650 10050 m gs 1 -1 sc 90.0 rot (Fetch\(...\);) col0 sh gr /Times-Roman-iso ff 120.00 scf sf 7500 10050 m gs 1 -1 sc 90.0 rot (Execute\( "select...."\);) col0 sh gr % Polyline 7.500 slw n 6150 12525 m 6150 8475 l 6600 8475 l 6600 12525 l cp gs col0 s gr /Times-Roman-iso ff 180.00 scf sf 6450 10500 m gs 1 -1 sc 90.0 rot (Embedded SQL Translator) dup sw pop 2 div neg 0 rm col0 sh gr /Times-Roman-iso ff 120.00 scf sf 7425 12150 m gs 1 -1 sc 90.0 rot (create table) col0 sh gr /Times-Roman-iso ff 120.00 scf sf 7575 12000 m gs 1 -1 sc 90.0 rot (Employees \( .... \)) col0 sh gr % Polyline n 1680 8475 m 1275 8475 1275 12195 405 arcto 4 {pop} repeat 1275 12600 5520 12600 405 arcto 4 {pop} repeat 5925 12600 5925 8880 405 arcto 4 {pop} repeat 5925 8475 1680 8475 405 arcto 4 {pop} repeat cp gs col0 s gr % Polyline n 4725 8250 m 4725 6600 l 5625 6600 l 5625 8250 l cp gs col0 s gr % Polyline n 2850 5925 m 2850 3525 l 3450 3525 l 3450 5925 l cp gs col0 s gr % Polyline n 3750 5925 m 3750 3525 l 4350 3525 l 4350 5925 l cp gs col0 s gr % Polyline [15 45] 45 sd n 2700 6525 m 2700 2925 l 4500 2925 l 4500 6525 l cp gs col0 s gr [] 0 sd % Polyline n 2250 4725 m 2850 4725 l gs col0 s gr % Polyline n 4350 4725 m 4725 4725 l gs col0 s gr % Polyline n 5625 4725 m 6225 4725 l gs col0 s gr % Polyline n 4725 5925 m 4725 3525 l 5625 3525 l 5625 5925 l cp gs col0 s gr % Polyline n 6225 5925 m 6225 3525 l 6900 3525 l 6900 5925 l cp gs col0 s gr % Polyline n 7050 5925 m 7050 3525 l 7950 3525 l 7950 5925 l cp gs col0 s gr % Polyline [15 45] 45 sd n 6000 6525 m 6000 2925 l 8175 2925 l 8175 6525 l cp gs col0 s gr [] 0 sd % Polyline n 1425 5925 m 1425 3525 l 2250 3525 l 2250 5925 l cp gs col0 s gr % Polyline gs clippath 1905 5910 m 1845 5910 l 1845 6061 l 1875 5941 l 1905 6061 l cp eoclip n 4725 7500 m 1875 7500 l 1875 5925 l gs col0 s gr gr % arrowhead n 1905 6061 m 1875 5941 l 1845 6061 l 1905 6061 l cp gs 0.00 setgray ef gr col0 s % Polyline n 7065 10800 m 6975 10800 6975 12435 90 arcto 4 {pop} repeat 6975 12525 7935 12525 90 arcto 4 {pop} repeat 8025 12525 8025 10890 90 arcto 4 {pop} repeat 8025 10800 7065 10800 90 arcto 4 {pop} repeat cp gs col0 s gr % Polyline n 7065 8475 m 6975 8475 6975 10410 90 arcto 4 {pop} repeat 6975 10500 7935 10500 90 arcto 4 {pop} repeat 8025 10500 8025 8565 90 arcto 4 {pop} repeat 8025 8475 7065 8475 90 arcto 4 {pop} repeat cp gs col0 s gr % Polyline gs clippath 5610 7470 m 5610 7530 l 5761 7530 l 5641 7500 l 5761 7470 l cp eoclip n 5625 7500 m 8400 7500 l 8400 9525 l 8025 9525 l gs col0 s gr gr % arrowhead n 5761 7470 m 5641 7500 l 5761 7530 l 5761 7470 l cp gs 0.00 setgray ef gr col0 s % Polyline gs clippath 7530 5910 m 7470 5910 l 7470 6061 l 7500 5941 l 7530 6061 l cp eoclip n 8025 11700 m 8775 11700 l 8775 6900 l 7500 6900 l 7500 5925 l gs col0 s gr gr % arrowhead n 7530 6061 m 7500 5941 l 7470 6061 l 7530 6061 l cp gs 0.00 setgray ef gr col0 s % Polyline n 1050 1725 m 9300 1725 l 9300 12975 l 1050 12975 l cp gs col0 s gr /Times-Roman-iso ff 120.00 scf sf 2325 12000 m gs 1 -1 sc 90.0 rot (EXEC SQL BEGIN DECLARE SECTION END-EXEC ) col0 sh gr /Times-Roman-iso ff 120.00 scf sf 2700 12000 m gs 1 -1 sc 90.0 rot (EXEC SQL END DECLARE SECTION END-EXEC ) col0 sh gr /Helvetica-Bold-iso ff 120.00 scf sf 2850 12150 m gs 1 -1 sc 90.0 rot (begin) col0 sh gr /Times-Roman-iso ff 120.00 scf sf 4200 12000 m gs 1 -1 sc 90.0 rot (loop) col0 sh gr /Times-Roman-iso ff 120.00 scf sf 5325 12000 m gs 1 -1 sc 90.0 rot (end loop;) col0 sh gr /Times-Roman-iso ff 120.00 scf sf 1575 12150 m gs 1 -1 sc 90.0 rot (DECLARE TABLE EMPLOYEES) col0 sh gr /Helvetica-Bold-iso ff 120.00 scf sf 1950 12150 m gs 1 -1 sc 90.0 rot (procedure Find_Manager\( ) col0 sh gr /Helvetica-Bold-iso ff 120.00 scf sf 2100 12000 m gs 1 -1 sc 90.0 rot (manager : in Integer \) is) col0 sh gr /Times-Roman-iso ff 120.00 scf sf 2475 11850 m gs 1 -1 sc 90.0 rot ( Manager_To_Find : INT := INT\(manager\) ; ) col0 sh gr /Helvetica-Bold-iso ff 120.00 scf sf 5550 12150 m gs 1 -1 sc 90.0 rot (end Find_Manager;) col0 sh gr /Times-Roman-iso ff 180.00 scf sf 5175 7875 m gs 1 -1 sc 90.0 rot (GNU Ada 95) col0 sh gr /Times-Roman-iso ff 180.00 scf sf 5400 7875 m gs 1 -1 sc 90.0 rot (Compiler) col0 sh gr /Times-Roman-iso ff 180.00 scf sf 8400 3675 m gs 1 -1 sc 180.0 rot ( ) col0 sh gr /Times-Roman-iso ff 180.00 scf sf 3225 5625 m gs 1 -1 sc 90.0 rot (ESQL_Support Package) col0 sh gr /Times-Roman-iso ff 180.00 scf sf 4050 5550 m gs 1 -1 sc 90.0 rot (Ada 95 ODBC Bindings) col0 sh gr /Times-Roman-iso ff 180.00 scf sf 1875 5400 m gs 1 -1 sc 90.0 rot (Application Code) col0 sh gr /Times-Roman-iso ff 180.00 scf sf 5175 5550 m gs 1 -1 sc 90.0 rot (Driver Manager Library) col0 sh gr /Times-Roman-iso ff 180.00 scf sf 6600 5700 m gs 1 -1 sc 90.0 rot (ODBC Driver of Database) col0 sh gr /Times-Roman-iso ff 180.00 scf sf 7500 5550 m gs 1 -1 sc 90.0 rot (Database Control System) col0 sh gr /Times-Roman-iso ff 180.00 scf sf 6300 2625 m gs 1 -1 sc 90.0 rot (Database) col0 sh gr /Times-Roman-iso ff 180.00 scf sf 6525 2625 m gs 1 -1 sc 90.0 rot (Product) col0 sh gr /Times-Roman-iso ff 180.00 scf sf 3000 2625 m gs 1 -1 sc 90.0 rot (GNADE) col0 sh gr /Times-Roman-iso ff 180.00 scf sf 4950 2925 m gs 1 -1 sc 90.0 rot (Driver Manager) col0 sh gr /Times-Roman-iso ff 180.00 scf sf 5175 2925 m gs 1 -1 sc 90.0 rot (Product) col0 sh gr $F2psEnd rs gnade-1.6.2.orig/doc/Ada_2002/toolchain.fig0000644000175000017500000001126607412652221017750 0ustar lbrentalbrenta#FIG 3.2 Landscape Center Inches Letter 100.00 Single -2 1200 2 6 1800 2475 4725 3225 6 1800 2475 4650 3225 4 0 0 50 0 0 8 0.0000 4 105 2805 1800 3150 WHERE MANAGER = :Manager_To_Find ; \001 4 0 0 50 0 0 8 0.0000 4 90 2355 1800 2850 SELECT EMPNO, NAME, DEPTNO \001 4 0 0 50 0 0 8 0.0000 4 105 600 1875 2550 EXEC SQL\001 4 0 0 50 0 0 8 0.0000 4 75 1515 1800 3000 FROM EMPLOYEES\001 -6 4 0 0 50 0 0 8 0.0000 4 105 2790 1875 2700 DECLARE emp_cursor CURSOR FOR \001 -6 6 1875 3300 3150 3600 4 0 0 50 0 0 8 0.0000 4 105 1260 1875 3375 EXEC SQL AT DB01 \001 4 0 0 50 0 0 8 0.0000 4 105 1275 1875 3525 OPEN emp_cursor ;\001 -6 6 2100 3825 5400 4275 4 0 0 50 0 0 8 0.0000 4 105 1725 2175 4050 FETCH FROM emp_cursor \001 4 0 0 50 0 0 8 0.0000 4 120 3270 2100 4200 INTO :empno, :name, :depno INDICATOR :depno_ind ; \001 4 0 0 50 0 0 8 0.0000 4 105 600 2175 3900 EXEC SQL\001 -6 6 3825 6750 4950 7275 4 0 0 50 0 0 8 0.0000 4 105 465 3825 6900 Bind(....);\001 4 0 0 50 0 0 8 0.0000 4 105 510 3825 7200 Fetch(...);\001 4 0 0 50 0 0 8 0.0000 4 105 1110 3825 7050 Execute( "select....");\001 -6 6 1350 5700 5400 6150 2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 1350 5700 5400 5700 5400 6150 1350 6150 1350 5700 4 1 0 50 0 0 12 0.0000 4 165 2010 3375 6000 Embedded SQL Translator\001 -6 6 1725 6900 2775 7200 4 0 0 50 0 0 8 0.0000 4 75 600 1725 6975 create table\001 4 0 0 50 0 0 8 0.0000 4 120 855 1875 7125 Employees ( .... )\001 -6 2 4 0 1 0 7 50 0 -1 0.000 0 0 27 0 0 5 5400 5475 5400 825 1275 825 1275 5475 5400 5475 2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 5625 4275 7275 4275 7275 5175 5625 5175 5625 4275 2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 7950 2400 10350 2400 10350 3000 7950 3000 7950 2400 2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 7950 3300 10350 3300 10350 3900 7950 3900 7950 3300 2 2 2 1 0 7 50 0 -1 3.000 0 0 -1 0 0 5 7350 2250 10950 2250 10950 4050 7350 4050 7350 2250 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 9150 1800 9150 2400 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 9150 3900 9150 4275 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 9150 5175 9150 5775 2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 7950 4275 10350 4275 10350 5175 7950 5175 7950 4275 2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 7950 5775 10350 5775 10350 6450 7950 6450 7950 5775 2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 7950 6600 10350 6600 10350 7500 7950 7500 7950 6600 2 2 2 1 0 7 50 0 -1 3.000 0 0 -1 0 0 5 7350 5550 10950 5550 10950 7725 7350 7725 7350 5550 2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 7950 975 10350 975 10350 1800 7950 1800 7950 975 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 3 1 1 1.00 60.00 120.00 6375 4275 6375 1425 7950 1425 2 4 0 1 0 7 50 0 -1 0.000 0 0 6 0 0 5 3075 7575 3075 6525 1350 6525 1350 7575 3075 7575 2 4 0 1 0 7 50 0 -1 0.000 0 0 6 0 0 5 5400 7575 5400 6525 3375 6525 3375 7575 5400 7575 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 1 4 1 1 1.00 60.00 120.00 6375 5175 6375 7950 4350 7950 4350 7575 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 5 1 1 1.00 60.00 120.00 2175 7575 2175 8325 6975 8325 6975 7050 7950 7050 2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 12150 600 12150 8850 900 8850 900 600 12150 600 4 0 0 50 0 0 8 0.0000 4 105 2925 1875 1875 EXEC SQL BEGIN DECLARE SECTION END-EXEC \001 4 0 0 50 0 0 8 0.0000 4 105 2805 1875 2250 EXEC SQL END DECLARE SECTION END-EXEC \001 4 0 0 50 0 18 8 0.0000 4 120 330 1725 2400 begin\001 4 0 0 50 0 0 8 0.0000 4 105 225 1875 3750 loop\001 4 0 0 50 0 0 8 0.0000 4 105 465 1875 4875 end loop;\001 4 0 0 50 0 0 8 0.0000 4 75 1785 1725 1125 DECLARE TABLE EMPLOYEES\001 4 0 0 50 0 18 8 0.0000 4 135 1575 1725 1500 procedure Find_Manager( \001 4 0 0 50 0 18 8 0.0000 4 135 1380 1875 1650 manager : in Integer ) is\001 4 0 0 50 0 0 8 0.0000 4 105 2445 2025 2025 Manager_To_Find : INT := INT(manager) ; \001 4 0 0 50 0 18 8 0.0000 4 120 1155 1725 5100 end Find_Manager;\001 4 0 0 50 0 0 12 0.0000 4 135 990 6000 4725 GNU Ada 95\001 4 0 0 50 0 0 12 0.0000 4 180 675 6000 4950 Compiler\001 4 0 0 50 0 0 12 1.5708 4 15 135 10200 7950 \001 4 0 0 50 0 0 12 0.0000 4 180 1830 8250 2775 ESQL_Support Package\001 4 0 0 50 0 0 12 0.0000 4 180 1800 8325 3600 Ada 95 ODBC Bindings\001 4 0 0 50 0 0 12 0.0000 4 180 1305 8475 1425 Application Code\001 4 0 0 50 0 0 12 0.0000 4 180 1785 8325 4725 Driver Manager Library\001 4 0 0 50 0 0 12 0.0000 4 135 2010 8175 6150 ODBC Driver of Database\001 4 0 0 50 0 0 12 0.0000 4 180 1950 8325 7050 Database Control System\001 4 0 0 50 0 0 12 0.0000 4 135 735 11250 5850 Database\001 4 0 0 50 0 0 12 0.0000 4 135 585 11250 6075 Product\001 4 0 0 50 0 0 12 0.0000 4 135 660 11250 2550 GNADE\001 4 0 0 50 0 0 12 0.0000 4 180 1200 10950 4500 Driver Manager\001 4 0 0 50 0 0 12 0.0000 4 135 585 10950 4725 Product\001 gnade-1.6.2.orig/doc/Ada_2002/tools.eps0000644000175000017500000002766307414664350017172 0ustar lbrentalbrenta%!PS-Adobe-2.0 EPSF-2.0 %%Title: tools.eps %%Creator: fig2dev Version 3.2 Patchlevel 3c %%CreationDate: Fri Dec 21 19:00:14 2001 %%For: gnade@boavista.snafu.de () %%BoundingBox: 0 0 430 543 %%Magnification: 0.8000 %%EndComments /$F2psDict 200 dict def $F2psDict begin $F2psDict /mtrx matrix put /col-1 {0 setgray} bind def /col0 {0.000 0.000 0.000 srgb} bind def /col1 {0.000 0.000 1.000 srgb} bind def /col2 {0.000 1.000 0.000 srgb} bind def /col3 {0.000 1.000 1.000 srgb} bind def /col4 {1.000 0.000 0.000 srgb} bind def /col5 {1.000 0.000 1.000 srgb} bind def /col6 {1.000 1.000 0.000 srgb} bind def /col7 {1.000 1.000 1.000 srgb} bind def /col8 {0.000 0.000 0.560 srgb} bind def /col9 {0.000 0.000 0.690 srgb} bind def /col10 {0.000 0.000 0.820 srgb} bind def /col11 {0.530 0.810 1.000 srgb} bind def /col12 {0.000 0.560 0.000 srgb} bind def /col13 {0.000 0.690 0.000 srgb} bind def /col14 {0.000 0.820 0.000 srgb} bind def /col15 {0.000 0.560 0.560 srgb} bind def /col16 {0.000 0.690 0.690 srgb} bind def /col17 {0.000 0.820 0.820 srgb} bind def /col18 {0.560 0.000 0.000 srgb} bind def /col19 {0.690 0.000 0.000 srgb} bind def /col20 {0.820 0.000 0.000 srgb} bind def /col21 {0.560 0.000 0.560 srgb} bind def /col22 {0.690 0.000 0.690 srgb} bind def /col23 {0.820 0.000 0.820 srgb} bind def /col24 {0.500 0.190 0.000 srgb} bind def /col25 {0.630 0.250 0.000 srgb} bind def /col26 {0.750 0.380 0.000 srgb} bind def /col27 {1.000 0.500 0.500 srgb} bind def /col28 {1.000 0.630 0.630 srgb} bind def /col29 {1.000 0.750 0.750 srgb} bind def /col30 {1.000 0.880 0.880 srgb} bind def /col31 {1.000 0.840 0.000 srgb} bind def end save newpath 0 543 moveto 0 0 lineto 430 0 lineto 430 543 lineto closepath clip newpath -10.0 627.0 translate 1 -1 scale /cp {closepath} bind def /ef {eofill} bind def /gr {grestore} bind def /gs {gsave} bind def /sa {save} bind def /rs {restore} bind def /l {lineto} bind def /m {moveto} bind def /rm {rmoveto} bind def /n {newpath} bind def /s {stroke} bind def /sh {show} bind def /slc {setlinecap} bind def /slj {setlinejoin} bind def /slw {setlinewidth} bind def /srgb {setrgbcolor} bind def /rot {rotate} bind def /sc {scale} bind def /sd {setdash} bind def /ff {findfont} bind def /sf {setfont} bind def /scf {scalefont} bind def /sw {stringwidth} bind def /tr {translate} bind def /tnt {dup dup currentrgbcolor 4 -2 roll dup 1 exch sub 3 -1 roll mul add 4 -2 roll dup 1 exch sub 3 -1 roll mul add 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb} bind def /shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul 4 -2 roll mul srgb} bind def /reencdict 12 dict def /ReEncode { reencdict begin /newcodesandnames exch def /newfontname exch def /basefontname exch def /basefontdict basefontname findfont def /newfont basefontdict maxlength dict def basefontdict { exch dup /FID ne { dup /Encoding eq { exch dup length array copy newfont 3 1 roll put } { exch newfont 3 1 roll put } ifelse } { pop pop } ifelse } forall newfont /FontName newfontname put newcodesandnames aload pop 128 1 255 { newfont /Encoding get exch /.notdef put } for newcodesandnames length 2 idiv { newfont /Encoding get 3 1 roll put } repeat newfontname newfont definefont pop end } def /isovec [ 8#055 /minus 8#200 /grave 8#201 /acute 8#202 /circumflex 8#203 /tilde 8#204 /macron 8#205 /breve 8#206 /dotaccent 8#207 /dieresis 8#210 /ring 8#211 /cedilla 8#212 /hungarumlaut 8#213 /ogonek 8#214 /caron 8#220 /dotlessi 8#230 /oe 8#231 /OE 8#240 /space 8#241 /exclamdown 8#242 /cent 8#243 /sterling 8#244 /currency 8#245 /yen 8#246 /brokenbar 8#247 /section 8#250 /dieresis 8#251 /copyright 8#252 /ordfeminine 8#253 /guillemotleft 8#254 /logicalnot 8#255 /hyphen 8#256 /registered 8#257 /macron 8#260 /degree 8#261 /plusminus 8#262 /twosuperior 8#263 /threesuperior 8#264 /acute 8#265 /mu 8#266 /paragraph 8#267 /periodcentered 8#270 /cedilla 8#271 /onesuperior 8#272 /ordmasculine 8#273 /guillemotright 8#274 /onequarter 8#275 /onehalf 8#276 /threequarters 8#277 /questiondown 8#300 /Agrave 8#301 /Aacute 8#302 /Acircumflex 8#303 /Atilde 8#304 /Adieresis 8#305 /Aring 8#306 /AE 8#307 /Ccedilla 8#310 /Egrave 8#311 /Eacute 8#312 /Ecircumflex 8#313 /Edieresis 8#314 /Igrave 8#315 /Iacute 8#316 /Icircumflex 8#317 /Idieresis 8#320 /Eth 8#321 /Ntilde 8#322 /Ograve 8#323 /Oacute 8#324 /Ocircumflex 8#325 /Otilde 8#326 /Odieresis 8#327 /multiply 8#330 /Oslash 8#331 /Ugrave 8#332 /Uacute 8#333 /Ucircumflex 8#334 /Udieresis 8#335 /Yacute 8#336 /Thorn 8#337 /germandbls 8#340 /agrave 8#341 /aacute 8#342 /acircumflex 8#343 /atilde 8#344 /adieresis 8#345 /aring 8#346 /ae 8#347 /ccedilla 8#350 /egrave 8#351 /eacute 8#352 /ecircumflex 8#353 /edieresis 8#354 /igrave 8#355 /iacute 8#356 /icircumflex 8#357 /idieresis 8#360 /eth 8#361 /ntilde 8#362 /ograve 8#363 /oacute 8#364 /ocircumflex 8#365 /otilde 8#366 /odieresis 8#367 /divide 8#370 /oslash 8#371 /ugrave 8#372 /uacute 8#373 /ucircumflex 8#374 /udieresis 8#375 /yacute 8#376 /thorn 8#377 /ydieresis] def /Times-Roman /Times-Roman-iso isovec ReEncode /Helvetica-Bold /Helvetica-Bold-iso isovec ReEncode /$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def /$F2psEnd {$F2psEnteredState restore end} def $F2psBegin %%Page: 1 1 10 setmiterlimit 0.04800 0.04800 sc % % Fig objects follow % /Times-Roman-iso ff 120.00 scf sf 2775 12150 m gs 1 -1 sc 90.0 rot ( WHERE MANAGER = :Manager_To_Find ; ) col0 sh gr /Times-Roman-iso ff 120.00 scf sf 2475 12150 m gs 1 -1 sc 90.0 rot ( SELECT EMPNO, NAME, DEPTNO ) col0 sh gr /Times-Roman-iso ff 120.00 scf sf 2175 12075 m gs 1 -1 sc 90.0 rot (EXEC SQL) col0 sh gr /Times-Roman-iso ff 120.00 scf sf 2625 12150 m gs 1 -1 sc 90.0 rot ( FROM EMPLOYEES) col0 sh gr /Times-Roman-iso ff 120.00 scf sf 2325 12075 m gs 1 -1 sc 90.0 rot ( DECLARE emp_cursor CURSOR FOR ) col0 sh gr /Times-Roman-iso ff 120.00 scf sf 3000 12075 m gs 1 -1 sc 90.0 rot (EXEC SQL AT DB01 ) col0 sh gr /Times-Roman-iso ff 120.00 scf sf 3150 12075 m gs 1 -1 sc 90.0 rot ( OPEN emp_cursor ;) col0 sh gr /Times-Roman-iso ff 120.00 scf sf 3675 11775 m gs 1 -1 sc 90.0 rot ( FETCH FROM emp_cursor ) col0 sh gr /Times-Roman-iso ff 120.00 scf sf 3825 11850 m gs 1 -1 sc 90.0 rot ( INTO :empno, :name, :depno INDICATOR :depno_ind ; ) col0 sh gr /Times-Roman-iso ff 120.00 scf sf 3525 11775 m gs 1 -1 sc 90.0 rot (EXEC SQL) col0 sh gr % Polyline 7.500 slw n 225 1800 m 9150 1800 l 9150 13050 l 225 13050 l cp gs col0 s gr % Polyline n 855 8550 m 450 8550 450 12270 405 arcto 4 {pop} repeat 450 12675 4695 12675 405 arcto 4 {pop} repeat 5100 12675 5100 8955 405 arcto 4 {pop} repeat 5100 8550 855 8550 405 arcto 4 {pop} repeat cp gs col0 s gr % Polyline n 5450 12300 m 5450 8850 l 6150 8850 l 6150 12300 l cp gs col0 s gr % Polyline gs clippath 7365 8055 m 7365 7995 l 7213 7995 l 7333 8025 l 7213 8055 l cp eoclip n 7050 8025 m 7350 8025 l gs col0 s gr gr % arrowhead n 7213 8055 m 7333 8025 l 7213 7995 l col0 s % Polyline n 3900 8325 m 3900 6675 l 4800 6675 l 4800 8325 l cp gs col0 s gr % Polyline n 6555 8400 m 6450 8400 6450 10620 105 arcto 4 {pop} repeat 6450 10725 7995 10725 105 arcto 4 {pop} repeat 8100 10725 8100 8505 105 arcto 4 {pop} repeat 8100 8400 6555 8400 105 arcto 4 {pop} repeat cp gs col0 s gr % Polyline n 6555 11175 m 6450 11175 6450 12795 105 arcto 4 {pop} repeat 6450 12900 7995 12900 105 arcto 4 {pop} repeat 8100 12900 8100 11280 105 arcto 4 {pop} repeat 8100 11175 6555 11175 105 arcto 4 {pop} repeat cp gs col0 s gr % Polyline n 2025 6000 m 2025 3600 l 2625 3600 l 2625 6000 l cp gs col0 s gr % Polyline n 2925 6000 m 2925 3600 l 3525 3600 l 3525 6000 l cp gs col0 s gr % Polyline [15 45] 45 sd n 1875 6600 m 1875 3000 l 3675 3000 l 3675 6600 l cp gs col0 s gr [] 0 sd % Polyline n 1425 4800 m 2025 4800 l gs col0 s gr % Polyline n 3525 4800 m 3900 4800 l gs col0 s gr % Polyline n 4800 4800 m 5400 4800 l gs col0 s gr % Polyline n 3900 6000 m 3900 3600 l 4800 3600 l 4800 6000 l cp gs col0 s gr % Polyline n 5400 6000 m 5400 3600 l 6075 3600 l 6075 6000 l cp gs col0 s gr % Polyline n 6225 6000 m 6225 3600 l 7125 3600 l 7125 6000 l cp gs col0 s gr % Polyline [15 45] 45 sd n 5175 6600 m 5175 3000 l 7350 3000 l 7350 6600 l cp gs col0 s gr [] 0 sd % Polyline n 600 6000 m 600 3600 l 1425 3600 l 1425 6000 l cp gs col0 s gr % Polyline gs clippath 4785 7545 m 4785 7605 l 4936 7605 l 4816 7575 l 4936 7545 l cp eoclip n 8100 9600 m 8550 9600 l 8550 7575 l 4800 7575 l gs col0 s gr gr % arrowhead n 4936 7545 m 4816 7575 l 4936 7605 l 4936 7545 l cp gs 0.00 setgray ef gr col0 s % Polyline gs clippath 6780 5985 m 6720 5985 l 6720 6136 l 6750 6016 l 6780 6136 l cp eoclip n 8100 12075 m 8850 12075 l 8850 7050 l 6750 7050 l 6750 6000 l gs col0 s gr gr % arrowhead n 6780 6136 m 6750 6016 l 6720 6136 l 6780 6136 l cp gs 0.00 setgray ef gr col0 s % Polyline n 3900 7575 m 1050 7575 l 1050 6000 l gs col0 s gr /Times-Roman-iso ff 120.00 scf sf 1500 12075 m gs 1 -1 sc 90.0 rot (EXEC SQL BEGIN DECLARE SECTION END-EXEC ) col0 sh gr /Times-Roman-iso ff 120.00 scf sf 1875 12075 m gs 1 -1 sc 90.0 rot (EXEC SQL END DECLARE SECTION END-EXEC ) col0 sh gr /Helvetica-Bold-iso ff 120.00 scf sf 2025 12225 m gs 1 -1 sc 90.0 rot (begin) col0 sh gr /Times-Roman-iso ff 120.00 scf sf 3375 12075 m gs 1 -1 sc 90.0 rot (loop) col0 sh gr /Times-Roman-iso ff 120.00 scf sf 4500 12075 m gs 1 -1 sc 90.0 rot (end loop;) col0 sh gr /Times-Roman-iso ff 120.00 scf sf 750 12225 m gs 1 -1 sc 90.0 rot (DECLARE TABLE EMPLOYEES) col0 sh gr /Helvetica-Bold-iso ff 120.00 scf sf 1125 12225 m gs 1 -1 sc 90.0 rot (procedure Find_Manager\( ) col0 sh gr /Helvetica-Bold-iso ff 120.00 scf sf 1275 12075 m gs 1 -1 sc 90.0 rot (manager : in Integer \) is) col0 sh gr /Times-Roman-iso ff 120.00 scf sf 1650 11925 m gs 1 -1 sc 90.0 rot ( Manager_To_Find : INT := INT\(manager\) ; ) col0 sh gr /Helvetica-Bold-iso ff 120.00 scf sf 4725 12225 m gs 1 -1 sc 90.0 rot (end Find_Manager;) col0 sh gr /Times-Roman-iso ff 120.00 scf sf 6975 12525 m gs 1 -1 sc 90.0 rot (create table) col0 sh gr /Times-Roman-iso ff 120.00 scf sf 7125 12375 m gs 1 -1 sc 90.0 rot (Employees \( .... \)) col0 sh gr /Times-Roman-iso ff 180.00 scf sf 5850 10575 m gs 1 -1 sc 90.0 rot (Embedded SQL Translator) dup sw pop 2 div neg 0 rm col0 sh gr /Times-Roman-iso ff 120.00 scf sf 6675 10200 m gs 1 -1 sc 90.0 rot (Bind\(....\);) col0 sh gr /Times-Roman-iso ff 120.00 scf sf 6975 10200 m gs 1 -1 sc 90.0 rot (Fetch\(...\);) col0 sh gr /Times-Roman-iso ff 120.00 scf sf 6825 10200 m gs 1 -1 sc 90.0 rot (Execute\( "select...."\);) col0 sh gr /Times-Roman-iso ff 180.00 scf sf 4350 7950 m gs 1 -1 sc 90.0 rot (GNU Ada 95) col0 sh gr /Times-Roman-iso ff 180.00 scf sf 4575 7950 m gs 1 -1 sc 90.0 rot (Compiler) col0 sh gr /Times-Roman-iso ff 180.00 scf sf 7575 3750 m gs 1 -1 sc 180.0 rot ( ) col0 sh gr /Times-Roman-iso ff 180.00 scf sf 2400 5700 m gs 1 -1 sc 90.0 rot (ESQL_Support Package) col0 sh gr /Times-Roman-iso ff 180.00 scf sf 3225 5625 m gs 1 -1 sc 90.0 rot (Ada 95 ODBC Bindings) col0 sh gr /Times-Roman-iso ff 180.00 scf sf 1050 5475 m gs 1 -1 sc 90.0 rot (Application Code) col0 sh gr /Times-Roman-iso ff 180.00 scf sf 4350 5625 m gs 1 -1 sc 90.0 rot (Driver Manager Library) col0 sh gr /Times-Roman-iso ff 180.00 scf sf 5775 5775 m gs 1 -1 sc 90.0 rot (ODBC Driver of Database) col0 sh gr /Times-Roman-iso ff 180.00 scf sf 6675 5625 m gs 1 -1 sc 90.0 rot (Database Control System) col0 sh gr /Times-Roman-iso ff 180.00 scf sf 5475 2700 m gs 1 -1 sc 90.0 rot (Database) col0 sh gr /Times-Roman-iso ff 180.00 scf sf 5700 2700 m gs 1 -1 sc 90.0 rot (Product) col0 sh gr /Times-Roman-iso ff 180.00 scf sf 2175 2700 m gs 1 -1 sc 90.0 rot (GNADE) col0 sh gr /Times-Roman-iso ff 180.00 scf sf 4125 3000 m gs 1 -1 sc 90.0 rot (Driver Manager) col0 sh gr /Times-Roman-iso ff 180.00 scf sf 4350 3000 m gs 1 -1 sc 90.0 rot (Product) col0 sh gr /Times-Roman-iso ff 150.00 scf sf 7800 5850 m gs 1 -1 sc 90.0 rot (Ada 95 code with) col0 sh gr /Times-Roman-iso ff 150.00 scf sf 8175 6000 m gs 1 -1 sc 90.0 rot (expanded SQL statements) col0 sh gr $F2psEnd rs gnade-1.6.2.orig/doc/Ada_2002/tools.fig0000644000175000017500000001146107414664350017135 0ustar lbrentalbrenta#FIG 3.2 Landscape Center Inches Letter 100.00 Single -2 1200 2 6 1800 2475 4725 3225 6 1800 2475 4650 3225 4 0 0 50 0 0 8 0.0000 4 105 2805 1800 3150 WHERE MANAGER = :Manager_To_Find ; \001 4 0 0 50 0 0 8 0.0000 4 90 2355 1800 2850 SELECT EMPNO, NAME, DEPTNO \001 4 0 0 50 0 0 8 0.0000 4 105 600 1875 2550 EXEC SQL\001 4 0 0 50 0 0 8 0.0000 4 75 1515 1800 3000 FROM EMPLOYEES\001 -6 4 0 0 50 0 0 8 0.0000 4 105 2790 1875 2700 DECLARE emp_cursor CURSOR FOR \001 -6 6 1875 3300 3150 3600 4 0 0 50 0 0 8 0.0000 4 105 1260 1875 3375 EXEC SQL AT DB01 \001 4 0 0 50 0 0 8 0.0000 4 105 1275 1875 3525 OPEN emp_cursor ;\001 -6 6 2100 3825 5400 4275 4 0 0 50 0 0 8 0.0000 4 105 1725 2175 4050 FETCH FROM emp_cursor \001 4 0 0 50 0 0 8 0.0000 4 120 3270 2100 4200 INTO :empno, :name, :depno INDICATOR :depno_ind ; \001 4 0 0 50 0 0 8 0.0000 4 105 600 2175 3900 EXEC SQL\001 -6 2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 12150 600 12150 9525 900 9525 900 600 12150 600 2 4 0 1 0 7 50 0 -1 0.000 0 0 27 0 0 5 5400 5475 5400 825 1275 825 1275 5475 5400 5475 2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 1650 5825 5100 5825 5100 6525 1650 6525 1650 5825 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 0 0 1.00 60.00 120.00 5925 7425 5925 7725 2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 5625 4275 7275 4275 7275 5175 5625 5175 5625 4275 2 4 0 1 0 7 50 0 -1 0.000 0 0 7 0 0 5 5550 8475 5550 6825 3225 6825 3225 8475 5550 8475 2 4 0 1 0 7 50 0 -1 0.000 0 0 7 0 0 5 2775 8475 2775 6825 1050 6825 1050 8475 2775 8475 2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 7950 2400 10350 2400 10350 3000 7950 3000 7950 2400 2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 7950 3300 10350 3300 10350 3900 7950 3900 7950 3300 2 2 2 1 0 7 50 0 -1 3.000 0 0 -1 0 0 5 7350 2250 10950 2250 10950 4050 7350 4050 7350 2250 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 9150 1800 9150 2400 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 9150 3900 9150 4275 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 9150 5175 9150 5775 2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 7950 4275 10350 4275 10350 5175 7950 5175 7950 4275 2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 7950 5775 10350 5775 10350 6450 7950 6450 7950 5775 2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 7950 6600 10350 6600 10350 7500 7950 7500 7950 6600 2 2 2 1 0 7 50 0 -1 3.000 0 0 -1 0 0 5 7350 5550 10950 5550 10950 7725 7350 7725 7350 5550 2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 7950 975 10350 975 10350 1800 7950 1800 7950 975 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 4 1 1 1.00 60.00 120.00 4350 8475 4350 8925 6375 8925 6375 5175 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 5 1 1 1.00 60.00 120.00 1875 8475 1875 9225 6900 9225 6900 7125 7950 7125 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 3 6375 4275 6375 1425 7950 1425 4 0 0 50 0 0 8 0.0000 4 105 2925 1875 1875 EXEC SQL BEGIN DECLARE SECTION END-EXEC \001 4 0 0 50 0 0 8 0.0000 4 105 2805 1875 2250 EXEC SQL END DECLARE SECTION END-EXEC \001 4 0 0 50 0 18 8 0.0000 4 120 330 1725 2400 begin\001 4 0 0 50 0 0 8 0.0000 4 105 225 1875 3750 loop\001 4 0 0 50 0 0 8 0.0000 4 105 465 1875 4875 end loop;\001 4 0 0 50 0 0 8 0.0000 4 75 1785 1725 1125 DECLARE TABLE EMPLOYEES\001 4 0 0 50 0 18 8 0.0000 4 135 1575 1725 1500 procedure Find_Manager( \001 4 0 0 50 0 18 8 0.0000 4 135 1380 1875 1650 manager : in Integer ) is\001 4 0 0 50 0 0 8 0.0000 4 105 2445 2025 2025 Manager_To_Find : INT := INT(manager) ; \001 4 0 0 50 0 18 8 0.0000 4 120 1155 1725 5100 end Find_Manager;\001 4 0 0 50 0 0 8 0.0000 4 75 600 1425 7350 create table\001 4 0 0 50 0 0 8 0.0000 4 120 855 1575 7500 Employees ( .... )\001 4 1 0 50 0 0 12 0.0000 4 165 2010 3375 6225 Embedded SQL Translator\001 4 0 0 50 0 0 8 0.0000 4 105 465 3750 7050 Bind(....);\001 4 0 0 50 0 0 8 0.0000 4 105 510 3750 7350 Fetch(...);\001 4 0 0 50 0 0 8 0.0000 4 105 1110 3750 7200 Execute( "select....");\001 4 0 0 50 0 0 12 0.0000 4 135 990 6000 4725 GNU Ada 95\001 4 0 0 50 0 0 12 0.0000 4 180 675 6000 4950 Compiler\001 4 0 0 50 0 0 12 1.5708 4 15 135 10200 7950 \001 4 0 0 50 0 0 12 0.0000 4 180 1830 8250 2775 ESQL_Support Package\001 4 0 0 50 0 0 12 0.0000 4 180 1800 8325 3600 Ada 95 ODBC Bindings\001 4 0 0 50 0 0 12 0.0000 4 180 1305 8475 1425 Application Code\001 4 0 0 50 0 0 12 0.0000 4 180 1785 8325 4725 Driver Manager Library\001 4 0 0 50 0 0 12 0.0000 4 135 2010 8175 6150 ODBC Driver of Database\001 4 0 0 50 0 0 12 0.0000 4 180 1950 8325 7050 Database Control System\001 4 0 0 50 0 0 12 0.0000 4 135 735 11250 5850 Database\001 4 0 0 50 0 0 12 0.0000 4 135 585 11250 6075 Product\001 4 0 0 50 0 0 12 0.0000 4 135 660 11250 2550 GNADE\001 4 0 0 50 0 0 12 0.0000 4 180 1200 10950 4500 Driver Manager\001 4 0 0 50 0 0 12 0.0000 4 135 585 10950 4725 Product\001 4 0 0 50 0 0 10 0.0000 4 105 1065 8100 8175 Ada 95 code with\001 4 0 0 50 0 0 10 0.0000 4 135 1575 7950 8550 expanded SQL statements\001 gnade-1.6.2.orig/doc/ado/0000755000175000017500000000000011040716254014705 5ustar lbrentalbrentagnade-1.6.2.orig/doc/ado/README0000644000175000017500000000010307310506123015554 0ustar lbrentalbrentaThis directory contains the working documents for the ADO desgin. gnade-1.6.2.orig/doc/ado/ado.txt0000644000175000017500000002504507311451521016216 0ustar lbrentalbrentaFrom - Sun Jun 10 10:02:37 2001 Return-path: Envelope-to: michael.erdmann@snafu.de Delivery-date: Sat, 02 Jun 2001 15:46:15 +0200 Received: from mail.snafu.de [213.73.102.4] by localhost with POP3 (fetchmail-5.5.0) for erdmann@localhost (single-drop); Fri, 01 Jun 2001 15:56:18 +0200 (CEST) Received: from mercury.rus.uni-stuttgart.de ([129.69.1.226]) by smart.visp-europe.psi.com with esmtp (Exim 3.22 #1) id 156BjL-0002Rp-00 for michael.erdmann@snafu.de; Sat, 02 Jun 2001 15:46:15 +0200 Received: from localhost ([127.0.0.1] helo=mercury.rus.uni-stuttgart.de) by mercury.rus.uni-stuttgart.de with esmtp (Exim 3.12 #4) id 156Bj9-00065S-00; Sat, 02 Jun 2001 15:46:03 +0200 Received: from charybdis.rus.uni-stuttgart.de ([129.69.1.58]) by mercury.rus.uni-stuttgart.de with esmtp (Exim 3.12 #4) id 156BiO-000658-00 for gnade-dev@cert.uni-stuttgart.de; Sat, 02 Jun 2001 15:45:16 +0200 Received: from mail2.passagen.se (mail2.passagen.se [195.163.107.11]) by charybdis.rus.uni-stuttgart.de with ESMTP id PAA27397 for ; Sat, 2 Jun 2001 15:45:25 +0200 (MET DST) env-from (sunef@hem.passagen.se) Received: from sufhempc (t5o73p18.telia.com [213.64.24.18]) by mail2.passagen.se (8.9.3/8.9.3/1.22) with SMTP id for ; Sat, 2 Jun 2001 15:45:20 +0200 (MET DST) Message-ID: <008301c0eb6a$5d6c4010$0c00a8c0@net.home> From: "Sune Falck" To: "gnade" References: <2BCC6E341F63C543B83AB5BF1953268B03A52B@mewtu.familiepfeifer.de> <002801c0e94b$ff59d430$0c00a8c0@net.home> <3B168681.3BE239B2@snafu.de> <000c01c0ea04$d8cbfd70$0c00a8c0@net.home> <000701c0ea0a$b4b49540$0c00a8c0@net.home> <3B1778DA.56D42882@snafu.de> Subject: Re: [Gnade-dev] GNADE where to go ? a MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by charybdis.rus.uni-stuttgart.de id PAA27397 Sender: gnade-dev-admin@cert.uni-stuttgart.de Errors-To: gnade-dev-admin@cert.uni-stuttgart.de X-BeenThere: gnade-dev@cert.uni-stuttgart.de X-Mailman-Version: 2.0.1 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Dev. issues of the GNU Ada Database Environment (GNADE) Project. List-Unsubscribe: , List-Archive: Date: Sat, 2 Jun 2001 15:46:00 +0200 X-UIDL: f907a14c5a6f7e0ab470a7ced6976ff8 X-Mozilla-Status: 8013 X-Mozilla-Status2: 00000000 ----- Original Message ----- >From: "Michael Erdmann" >I have put your proposal into some packages. What >do you think! >J=FCrgen, Floarin any objections against GNU.ADO? I dont >like the name ADO which should mean "Ada Data Objects" ??! >My idea would be to setup this abstract interface and >make a test implementation using postgres and afterwards >the ODBC interface. ------------------------------------------------- My opinion is that it is going to fast into the coding phase - What I mis= s is a fundamental discussion about the role and interaction of the different objects. Using formal packages with correct headers and so on just makes the whole picture more difficult to grasp and understand at this moment (for me). I would prefer to stay in some kind of concise pseudo code until the desi= gn has matured. One example - There is a fundamental difference between a query (select) returning a result set and a sql statement doing a change to the database (update/insert/delete) and only returning the number of affected rows. The select is more like an Open of an existing file and the other operati= ons are more direct Command actions. Should we handle the cases differently ? In MS ADO there is no need for an explicit Command object when doing a select returning a result set if there are no parameters. One can also skip the connection object and give a valid connection string instead of a pointer to a connection object as .ActiveConnection. Should we strive for the same flexibility or should we only have one way to achieve the result. I see no need to duplicate MS ADO in Ada but the goal should be to that the Ada Data Objects has a clean and simple to use design. Sune Falck =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D The following is from the doc of MS ADO 2.6. The ADO Object Model ADO requires only nine objects and four collections to provide its entire functionality. The following table introduces them. Connection object Represents a unique session with a data source. In the case of a client/server database system, it may be equivalent to an actual network connection to the server. Depending on the functionality supported by the provider, some collections, methods, or properties of a Connection object may not be available. Command object Used to define a specific command, such as a SQL query, intended to run against a data source. Recordset object Represents the entire set of records from a base table or the results of = an executed command. All Recordset objects consist of records (rows) and fie= lds (columns). Record object Represents a single row of data, either from a Recordset or from the provider. This record could represent a database record or some other typ= e of object such as a file or directory, depending upon your provider. Stream object Represents a stream of binary or text data. For example, an XML document = can be loaded into a stream for command input or returned from certain provid= ers as the results of a query. A Stream object can be used to manipulate fiel= ds or records containing these streams of data. Parameter object Represents a parameter or argument associated with a Command object, base= d on a parameterized query or stored procedure. Field object Represents a column of data with a common data type. Each Field object corresponds to a column in the Recordset. Property object Represents a characteristic of an ADO object that is defined by the provider. ADO objects have two types of properties: built-in and dynamic. Built-in properties are those properties implemented in ADO and immediate= ly available to any new object. The Property object is a container for dynam= ic properties, defined by the underlying provider. Error object Contains details about data access errors that pertain to a single operat= ion involving the provider. Fields collection Contains all the Field objects of a Recordset or Record object. Properties collection Contains all the Property objects for a specific instance of an object. Parameters collection Contains all the Parameter objects of a Command object. Errors collection Contains all the Error objects created in response to a single provider-related failure. -------------------------------- Making a Connection To connect to a data source, you must specify a connection string, the parameters of which might differ for each provider and data source. For m= ore information, see Creating the Connection String. ADO most commonly opens a connection by using the Connection object Open method. The syntax for the Open method is shown here: Dim connection as New ADODB.Connection connection.Open ConnectionString, UserID, Password, OpenOptions Alternatively, you can invoke a shortcut technique, Recordset.Open, to op= en an implicit connection and issue a command over that connection in one operation. Do this by passing in a valid connection string as the ActiveConnection argument to the Open method. Here is the syntax for each method in Visual Basic: Dim recordset as ADODB.Recordset Set recordset =3D New ADODB.Recordset recordset.Open Source, ActiveConnection, CursorType, LockType, Options Note When should you use a Connection object vs. the Recordset.Open shortcut? Use the Connection object if you plan to open more than one Recordset, or when executing multiple commands. A connection is still created by ADO implicitly when you use the Recordset.Open shortcut. Creating and Executing a Simple Command ----------------------------------------- Though not a typical usage of the Command object, the following code show= s the basic method of using the Command object to execute a command against= a data source. In this case, it is a row-returning command, so it returns t= he results of the command execution into a Recordset object. 'BeginBasicCmd Dim objConn As ADODB.Connection Dim objCmd As New ADODB.Command Dim objRs As ADODB.Recordset objCmd.CommandText =3D "SELECT OrderID, OrderDate, " & _ "RequiredDate, ShippedDate " & _ "FROM Orders " & _ "WHERE CustomerID =3D 'ALFKI' " & _ "ORDER BY OrderID" objCmd.CommandType =3D adCmdText ' Connect to the data source. Set objConn =3D GetNewConnection objCmd.ActiveConnection =3D objConn ' Execute once and display... Set objRs =3D objCmd.Execute Debug.Print "ALFKI" Do While Not objRs.EOF Debug.Print vbTab & objRs(0) & vbTab & objRs(1) & vbTab & _ objRs(2) & vbTab & objRs(3) objRs.MoveNext Loop 'clean up objRs.Close objConn.Close Set objConn =3D Nothing Set objCmd =3D Nothing 'EndBasicCmd The command to be executed is specified with the CommandText property. Note Several examples in this section call a utility function, GetNewConnection, to establish a connection with the data provider. To av= oid redundancy, it is listed only once, here: 'BeginNewConnection Private Function GetNewConnection() As ADODB.Connection Dim oCn As New ADODB.Connection Dim sCnStr As String sCnStr =3D "Provider=3DSQLOLEDB;Data Source=3DMySrvr;" & _ "User Id=3DMyId;Password=3D123aBc;Database=3DNorthwind;" oCn.Open sCnStr Set GetNewConnection =3D oCn End Function 'EndNewConnection _______________________________________________ gnade-dev mailing list gnade-dev@cert.uni-stuttgart.de http://cert.uni-stuttgart.de/mailman/listinfo/gnade-dev gnade-1.6.2.orig/doc/ado/classes.ag0000644000175000017500000003226607311451521016663 0ustar lbrentalbrenta*BEGIN GRAPHICS VERSION=500/420 ENCODING=7BIT ** "Creator" gnade ** "Creation Date" Sat Jun 9 16:59:33 2001 ** "Creation Version" 5 (1375) ** "Revisor" gnade ** "Last Modified" Sun Jun 10 21:08:10 2001 ** "Last Modified Version" 5 (1375) FONT "Times" "Zapf Dingbats" "Helvetica" END FONT SESSION WIN_SIZE <15107 11667> STICKY ON AUTOGRID ON VIEW <0 0 0 1 1 0> GRID_DPI 1000 GRID_FACTOR 125 UNITS <1000 3 "Zo."> PAGEZEROS <394 -106> PAGEWID 11693 PAGEHYT 8268 PRINTWID 11693 PRINTHYT 8268 PRINTLAND ON PRINTMARG <394 394 394 394> SLIDE_STYLE <0 -1 1> PARA <0 0 0 0 1000 1 1 111> REZ <0 2000 2000 -2 30> END SESSION PART "Class" .GRP FIXED ON .GRP .GRP .RECT AT (4375,3375) PNTS (0,0)(1125,0)(1125,375)(0,375)(0,0) .TXT AT (4500,3418) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 MARGINS <0 0 0 0> TXTXYOFF <-5 82> T_PNTS (0,82)(0,0)(596,0)(596,85)(0,85)(0,82)(596,82) .STR V_SPACE <0 111 0> FONT 2 SIZE 80000 "Class Name" END .GRP .RECT AT (4375,3750) BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 V_SPACE <0 250 0> FONT 0 SIZE 180000 MARGINS <125 125 250 62> PNTS (0,0)(1125,0)(1125,375)(0,375)(0,0) .TXT AT (4496,3795) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 MARGINS <0 0 0 0> TXTXYOFF <-1 80> T_PNTS (0,80)(0,0)(466,0)(466,82)(0,82)(0,80)(466,80) .STR V_SPACE <0 111 0> FONT 2 SIZE 80000 "Attributes" .RECT AT (4375,4125) BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 V_SPACE <0 250 0> FONT 0 SIZE 180000 MARGINS <125 125 250 62> PNTS (0,0)(1125,0)(1125,375)(0,375)(0,0) .TXT AT (4499,4168) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 MARGINS <0 0 0 0> TXTXYOFF <-4 82> T_PNTS (0,82)(0,0)(537,0)(537,106)(0,106)(0,82)(537,82) .STR V_SPACE <0 111 0> FONT 2 SIZE 80000 "Operations" END .GRP END .GRP PART "Compartment" .GRP FIXED ON BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 V_SPACE <0 250 0> FONT 0 SIZE 180000 MARGINS <125 125 250 62> .GRP .RECT AT (5750,3125) PNTS (0,0)(1125,0)(1125,375)(0,375)(0,0) .TXT AT (5875,3168) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 MARGINS <0 0 0 0> TXTXYOFF <-5 82> T_PNTS (0,82)(0,0)(596,0)(596,85)(0,85)(0,82)(596,82) .STR V_SPACE <0 111 0> FONT 2 SIZE 80000 "Class Name" END .GRP END .GRP PART "Implementation Class" .GRP FIXED ON BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 STYLE 4 L_ARROW 1 V_SPACE <0 250 0> FONT 0 SIZE 180000 MARGINS <125 125 250 62> .GRP .RECT AT (5000,3375) STYLE 0 L_ARROW 0 PNTS (0,0)(1125,0)(1125,250)(0,250)(0,0) .TXT AT (5125,3426) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 MARGINS <0 0 0 0> TXTXYOFF <-5 74> T_PNTS (0,74)(0,0)(461,0)(461,99)(0,99)(0,74)(461,74) .STR V_SPACE <0 111 0> FONT 2 SIZE 80000 "<>" .LINE AT (6125,3500) BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 STYLE 4 R_ARROW 1 V_SPACE <0 250 0> FONT 0 SIZE 180000 MARGINS <125 125 250 62> PNTS (1375,0)(0,0) .TXT AT (6500,3301) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 STYLE 0 R_ARROW 0 MARGINS <0 0 0 0> T_PNTS (0,74)(0,0)(461,0)(461,99)(0,99)(0,74)(461,74) .STR V_SPACE <0 111 0> FONT 2 SIZE 80000 "<>" END .GRP END .GRP PART "Interface" .GRP FIXED ON BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 STYLE 4 L_ARROW 1 V_SPACE <0 250 0> FONT 0 SIZE 180000 MARGINS <125 125 250 62> .GRP .RECT AT (7875,5375) PNTS (0,0)(1000,0)(1000,500)(0,500)(0,0) .GRP .LINE AT (6125,5625) L_ARROW 0 PNTS (1750,0)(0,0) .LINE AT (6125,5000) R_ARROW 8 PNTS (0,625)(0,0) END .GRP END .GRP .GRP L_ARROW 1 R_ARROW 0 .RECT AT (7875,3750) PNTS (0,0)(1000,0)(1000,500)(0,500)(0,0) .LINE AT (6750,4000) L_ARROW 0 R_ARROW 3 PNTS (1125,0)(0,0) END .GRP .GRP L_ARROW 1 R_ARROW 0 .RECT AT (5625,3250) STYLE 0 L_ARROW 0 PNTS (0,0)(1125,0)(1125,375)(0,375)(0,0) .TXT AT (5750,3294) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 MARGINS <0 0 0 0> TXTXYOFF <-5 81> T_PNTS (0,81)(0,0)(677,0)(677,83)(0,83)(0,81)(677,81) .STR V_SPACE <0 111 0> FONT 2 SIZE 80000 "<>" .RECT AT (5625,3625) BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 V_SPACE <0 250 0> FONT 0 SIZE 180000 MARGINS <125 125 250 62> PNTS (0,0)(1125,0)(1125,1375)(0,1375)(0,0) .TXT AT (5749,3668) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 MARGINS <0 0 0 0> TXTXYOFF <-4 82> T_PNTS (0,82)(0,0)(537,0)(537,106)(0,106)(0,82)(537,82) .STR V_SPACE <0 111 0> FONT 2 SIZE 80000 "Operations" END .GRP END .GRP PART "using" .GRP FIXED ON BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 STYLE 4 L_ARROW 1 V_SPACE <0 250 0> FONT 0 SIZE 180000 MARGINS <125 125 250 62> .GRP .LINE AT (5250,4875) PNTS (1125,0)(0,0) .TXT AT (5628,4750) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 STYLE 0 L_ARROW 0 MARGINS <0 0 0 0> TXTXYOFF <-5 80> T_PNTS (0,80)(0,0)(516,0)(516,105)(0,105)(0,80)(516,80) .STR V_SPACE <0 111 0> FONT 2 SIZE 80000 "<>" END .GRP END .GRP PART "Service" .GRP BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 STYLE 4 V_SPACE <0 250 0> FONT 0 SIZE 180000 MARGINS <125 125 250 62> .GRP .ELL AT (9500,1000) STYLE 0 PNTS (0,0)(250,0)(250,250)(0,250)(0,0) .LINE AT (7375,1125) PNTS (2125,0)(0,0) .TXT AT (9375,668) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 HOR_JUST CENTER MARGINS <0 0 0 0> TXTXYOFF <-5 82> T_PNTS (0,82)(0,0)(648,0)(648,304)(0,304)(0,82)(648,82) .STR V_SPACE <0 111 0> FONT 2 SIZE 80000 "Generic Data\nInterface\n" END .GRP END .GRP PART "Highlevel_Class" .GRP FIXED ON BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 V_SPACE <0 250 0> FONT 0 SIZE 180000 HOR_JUST LEFT MARGINS <125 125 250 62> .GRP .RECT AT (2250,1125) PNTS (0,0)(1250,0)(1250,375)(0,375)(0,0) .TXT AT (2533,1271) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 MARGINS <0 0 0 0> T_PNTS (0,82)(0,0)(551,0)(551,85)(0,85)(0,82)(551,82) .STR V_SPACE <0 111 0> FONT 2 SIZE 80000 "Connection" END .GRP END .GRP PART "Comment" .GRP FIXED ON BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 V_SPACE <0 250 0> FONT 0 SIZE 180000 MARGINS <125 125 250 62> .GRP .TXT AT (3125,5366) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 STYLE 4 MARGINS <0 0 0 0> TXTXYOFF <0 60> T_PNTS (0,60)(0,0)(1048,0)(1048,161)(0,161)(0,60)(1048,60) .STR STYLE 0 V_SPACE <0 83 0> FONT 2 SIZE 60000 "contains only the number of " .STR "\nprocessed record" .RECT AT (3000,5250) BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 STYLE 4 V_SPACE <0 250 0> FONT 0 SIZE 180000 MARGINS <125 125 250 62> XYRAD <310 93> PNTS (0,0)(1250,0)(1250,375)(0,375)(0,0) .LINE AT (2500,5437) R_ARROW 7 PNTS (500,0)(0,0) END .GRP END .GRP SLIDE_INFO SLIDE_STYLE <0 -1 1> END SLIDE_INFO PICTURE .TXT AT (6697,6377) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 STYLE 0 R_ARROW 0 BOLD ON MARGINS <0 0 0 0> TXTXYOFF <0 123> T_PNTS (0,123)(0,0)(2951,0)(2951,568)(0,568)(0,123)(2951,123) .STR V_SPACE <0 167 0> FONT 2 SIZE 120000 "Generic Data Interface for Ada 95\n" .STR SIZE 100000 "$Revision: 1.2 $ $Date: 2001/06/12 17:37:21 $\nMichael Erdmann" .STR V_SPACE <0 111 0> SIZE 120000 "\n" .LINE AT (2875,1500) BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 L_ARROW 3 V_SPACE <0 250 0> FONT 0 SIZE 180000 BOLD OFF MARGINS <125 125 250 62> PNTS (0,0)(0,875) .RECT AT (2250,2375) L_ARROW 0 HOR_JUST CENTER XYRAD <0 0> PNTS (0,0)(1250,0)(1250,375)(0,375)(0,0) .TXT AT (2515,2466) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 BOLD ON MARGINS <0 0 0 0> TXTXYOFF <-4 81> T_PNTS (0,81)(0,0)(716,0)(716,195)(0,195)(0,81)(716,81) .STR V_SPACE <0 111 0> FONT 2 SIZE 80000 "<>\nCommand" .GRP BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 V_SPACE <0 250 0> FONT 0 SIZE 180000 BOLD OFF HOR_JUST LEFT MARGINS <125 125 250 62> .RECT AT (2250,1125) PNTS (0,0)(1250,0)(1250,375)(0,375)(0,0) .TXT AT (2533,1271) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 BOLD ON MARGINS <0 0 0 0> TXTXYOFF <-5 82> T_PNTS (0,82)(0,0)(600,0)(600,85)(0,85)(0,82)(600,82) .STR V_SPACE <0 111 0> FONT 2 SIZE 80000 "Connection" END .GRP .RECT AT (1250,4000) BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 V_SPACE <0 250 0> FONT 0 SIZE 180000 BOLD OFF MARGINS <125 125 250 62> PNTS (0,0)(1250,0)(1250,375)(0,375)(0,0) .TXT AT (1513,4091) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 BOLD ON MARGINS <0 0 0 0> TXTXYOFF <0 81> T_PNTS (0,81)(0,0)(721,0)(721,207)(0,207)(0,81)(721,81) .STR V_SPACE <0 111 0> FONT 2 SIZE 80000 "<>\nResult_Set" .LINE AT (2500,2750) BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 L_ARROW 3 V_SPACE <0 250 0> FONT 0 SIZE 180000 BOLD OFF MARGINS <125 125 250 62> PNTS (0,0)(0,250) .LINE AT (1875,3000) L_ARROW 0 PNTS (0,0)(625,0) .POL AT (1875,3000) PNTS (0,0)(0,250) .TXT AT (2998,1875) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 MARGINS <0 0 0 0> TXTXYOFF <0 80> T_PNTS (0,80)(0,0)(1526,0)(1526,304)(0,304)(0,80)(1526,80) .STR V_SPACE <0 111 0> FONT 2 SIZE 80000 BOLD ON "Assigned To" .STR BOLD OFF "\nThe connection maintains a list\nof all commands still active ." .RECT AT (5250,3250) BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 V_SPACE <0 250 0> FONT 0 SIZE 180000 MARGINS <125 125 250 62> PNTS (0,0)(1250,0)(1250,375)(0,375)(0,0) .TXT AT (5755,3397) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 BOLD ON MARGINS <0 0 0 0> TXTXYOFF <-8 80> T_PNTS (0,80)(0,0)(262,0)(262,82)(0,82)(0,80)(262,80) .STR V_SPACE <0 111 0> FONT 2 SIZE 80000 "Error" .RECT AT (1250,3250) BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 V_SPACE <0 250 0> FONT 0 SIZE 180000 BOLD OFF MARGINS <125 125 250 62> PNTS (0,0)(1250,0)(1250,375)(0,375)(0,0) .TXT AT (1727,3396) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 BOLD ON MARGINS <0 0 0 0> TXTXYOFF <-5 82> T_PNTS (0,82)(0,0)(315,0)(315,107)(0,107)(0,82)(315,82) .STR V_SPACE <0 111 0> FONT 2 SIZE 80000 "Query" .LINE AT (3250,2750) BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 L_ARROW 3 V_SPACE <0 250 0> FONT 0 SIZE 180000 BOLD OFF MARGINS <125 125 250 62> PNTS (0,0)(0,250) .LINE AT (3250,3000) L_ARROW 0 PNTS (0,0)(625,0) .POL AT (3875,3000) PNTS (0,0)(0,250) .RECT AT (3250,3250) PNTS (0,0)(1250,0)(1250,375)(0,375)(0,0) .TXT AT (3681,3397) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 BOLD ON MARGINS <0 0 0 0> TXTXYOFF <-7 81> T_PNTS (0,81)(0,0)(425,0)(425,83)(0,83)(0,81)(425,81) .STR V_SPACE <0 111 0> FONT 2 SIZE 80000 "Modifier" .LINE AT (1875,3625) BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 L_ARROW 3 V_SPACE <0 250 0> FONT 0 SIZE 180000 BOLD OFF MARGINS <125 125 250 62> PNTS (0,0)(0,375) .LINE AT (3875,3625) PNTS (0,0)(0,375) .LINE AT (3500,2500) L_ARROW 0 PNTS (0,0)(2375,0) .LINE AT (5875,2500) R_ARROW 1 PNTS (0,0)(0,750) .TXT AT (3840,2375) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 R_ARROW 0 MARGINS <0 0 0 0> TXTXYOFF <-5 82> T_PNTS (0,82)(0,0)(410,0)(410,107)(0,107)(0,82)(410,82) .STR V_SPACE <0 111 0> FONT 2 SIZE 80000 "Creating" .RECT AT (1250,4750) BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 V_SPACE <0 250 0> FONT 0 SIZE 180000 MARGINS <125 125 250 62> PNTS (0,0)(1250,0)(1250,375)(0,375)(0,0) .TXT AT (1500,4918) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 BOLD ON MARGINS <0 0 0 0> T_PNTS (0,82)(0,0)(755,0)(755,107)(0,107)(0,82)(755,82) .STR V_SPACE <0 111 0> FONT 2 SIZE 80000 "Query_Record" .LINE AT (1875,4375) BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 L_ARROW 1 V_SPACE <0 250 0> FONT 0 SIZE 180000 BOLD OFF MARGINS <125 125 250 62> PNTS (0,0)(0,375) .RECT AT (3250,4000) L_ARROW 0 PNTS (0,0)(1250,0)(1250,375)(0,375)(0,0) .TXT AT (3513,4091) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 BOLD ON MARGINS <0 0 0 0> TXTXYOFF <0 81> T_PNTS (0,81)(0,0)(721,0)(721,207)(0,207)(0,81)(721,81) .STR V_SPACE <0 111 0> FONT 2 SIZE 80000 "<>\nResult_Set" .RECT AT (3250,4750) BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 V_SPACE <0 250 0> FONT 0 SIZE 180000 BOLD OFF MARGINS <125 125 250 62> PNTS (0,0)(1250,0)(1250,375)(0,375)(0,0) .TXT AT (3502,4919) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 BOLD ON MARGINS <0 0 0 0> TXTXYOFF <-7 81> T_PNTS (0,81)(0,0)(864,0)(864,96)(0,96)(0,81)(864,81) .STR V_SPACE <0 111 0> FONT 2 SIZE 80000 "Modifier_Record" .LINE AT (3875,4375) BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 L_ARROW 1 V_SPACE <0 250 0> FONT 0 SIZE 180000 BOLD OFF MARGINS <125 125 250 62> PNTS (0,0)(0,375) .GRP L_ARROW 0 .TXT AT (5125,4865) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 STYLE 4 MARGINS <0 0 0 0> TXTXYOFF <0 61> T_PNTS (0,61)(0,0)(1044,0)(1044,162)(0,162)(0,61)(1044,61) .STR STYLE 0 V_SPACE <0 83 0> FONT 2 SIZE 60000 "contains only the number of " .STR "\nprocessed record" .RECT AT (5000,4750) BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 STYLE 4 V_SPACE <0 250 0> FONT 0 SIZE 180000 MARGINS <125 125 250 62> XYRAD <310 93> PNTS (0,0)(1250,0)(1250,375)(0,375)(0,0) .LINE AT (4500,4937) R_ARROW 7 PNTS (500,0)(0,0) END .GRP .TXT AT (4336,2699) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 R_ARROW 0 MARGINS <0 0 0 0> TXTXYOFF <0 60> T_PNTS (0,60)(0,0)(1074,0)(1074,228)(0,228)(0,60)(1074,60) .STR STYLE 0 V_SPACE <0 83 0> FONT 2 SIZE 60000 "The error insance is created\nby the command only in case\nof e rrors." .RECT AT (4250,2625) BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 STYLE 4 V_SPACE <0 250 0> FONT 0 SIZE 180000 MARGINS <125 125 250 62> PNTS (0,0)(1250,0)(1250,375)(0,375)(0,0) .LINE AT (4875,3000) STYLE 0 R_ARROW 7 PNTS (0,0)(375,250) END PICTURE *END GRAPHICS gnade-1.6.2.orig/doc/ado/command.txt0000644000175000017500000000304307315413774017077 0ustar lbrentalbrenta Command Class ============= Used to define a specific command (e.g a SQL query) intended to run against a data source. The command syntax and semantics is defined by the data source only. This is the root class of all operations done on the data sources. Constructor =========== Attributes ========== Bind - Parameters of the command. Parameters refere to place holders in the command string which are numbered by a positive number. Set - Set a parameter to a fixed value State - Indicating the internal state of the command: Idle - No command associated with the command Prepared - The statement has been preparedby the underlying source. Executing - data source still executing Success - Succes Connection- the connection instance where this command is created/prepared. Methods ======= None Interfaces ========== The following abstract procedures are expected to be implemented in the underlying command implementations: Open - abstract interface to be implemented Close - Drop - Example ======= con : Connection....Object; cmd : Command.Handle; X : Integer; begin Open( con, "......"); cmd := Create_Query( con, "SELECT * FROM EMPLOYEES WEHRE empno > ? AND PROMOTION=?"); Bind( cmd, 1, X ); Set( cmd, 2, 1 ); Result := Execute( cmd ); Close( cmd ); end ; gnade-1.6.2.orig/doc/ado/connection.txt0000644000175000017500000000265507315413774017630 0ustar lbrentalbrenta Connection Class ================ This class represents a unique session with a data source. The term data source covers a wide range from SQL bases dbcs to files which some kind of internal structures (e.g. XML). Depending on the functionality supported by the source, some collections, methods, or properties of a Connection object may not be available. Constructors ============ None Attributes ========== State - Status of the connection which may idle, active Mode - Returns the open mode of the connection Version - Version of the data source Id - Identifier provided by the data source Methods ======= Open - Connect to a certain data source Close - Close the connection to the data source Modify_Command- create a new Modifier instance. Query_Command - create a new Query instance. Exceptions ========== Open_Failure - Failure to open the the data source Mode_Error - Trying to execute a write operation on a read only connection. Usage_Error - Trying top open a connections wich already is open Helpers ======= Is_Open - True if connection is active Example ======= procedure Test is con : Connection.ODBC.Object; begin Open( con, "db=gnade login=gnade passwd=gnade", Mode => Query ); .........perform data manipulations ...... Close( con ); exception when Connection_Failure => end Test; gnade-1.6.2.orig/doc/ado/error.txt0000644000175000017500000000151107313060331016571 0ustar lbrentalbrenta Error Class =========== Contains details about data access errors that pertain to a single operation involving the provider. The error object stores all errors occured during execution of a single command. Constructors ============ Attributes ========== Error::Integer - Return the n-th error Errors::Natural - Number of stored errors Methods ======= Reset - Reset the error object Helpers ======= Interfaces ========== Example ======= procedure Get_Data( con : in out Connection.Object'Class ) is --- cmd : Command.Handle := Create_Query( con, "select *.....") ; err : ..Error.ODBC.Object; begin result := Execute( con, cmd, err ); exception when Others => for i in 1..Errors(err) loop ... Handle Error(i) .... end loop; end; gnade-1.6.2.orig/doc/ado/field.txt0000644000175000017500000000314107313060331016524 0ustar lbrentalbrentaField Class =========== A field maintains the actual value of a field in the result set. Constructors ============ Create - Returns a field handle Destroy - Attributes ========== Name - Name of a field Pos - Position of a field Methods ======= Value - Set or get a value. This procedure/function should be provided for all common Ada 95 data types. Value( in out field, integer ) Value( field ) return integer; Interfaces ========== Example ======= C : Connection.ODBC.Instance; Q : Query.Handle; Result : Result_Set.Instance; Connection.Open (C, "....."); -- this dispatches depending on the connection type into -- different implementations of a query. Q := Query.Open ( C, "SELECT FIRST_NAME, LAST_NAME FROM TABLE WHERE EMPNO>?"); Set( Q, 1, 2001 ); ...... -- execute the result set but using a handle makes the code -- independant from the implementation of the connction Result := Execute(Q); declare last_name : Field.Handle := Field.Create( Result, "LAST_NAME " ); first_Name : Field.Handle := Field.Create( Result, 1 ); begin while not Result_Set.End_Of_Result_Set (Result) loop Text_IO.Put( Value( last_name ) ); Text_IO.Put( Value( first_name ) ); Result_Set.Next (Result); end loop; exception when Connection_Closed => ..... when Others => ..... end ; Result_Set.Drop (Result); -- this drops the fields as well. Query.Close (Q); Conection.CLose (C); gnade-1.6.2.orig/doc/ado/gdac.ag0000644000175000017500000004007207310506123016114 0ustar lbrentalbrenta*BEGIN GRAPHICS VERSION=500/420 ENCODING=7BIT ** "Creator" gnade ** "Creation Date" Sat Jun 9 16:59:33 2001 ** "Creation Version" 5 (1375) ** "Revisor" gnade ** "Last Modified" Sat Jun 9 22:56:40 2001 ** "Last Modified Version" 5 (1375) FONT "Times" "Zapf Dingbats" "Helvetica" END FONT SESSION WIN_SIZE <15107 11667> STICKY ON AUTOGRID ON VIEW <0 0 0 1 1 0> GRID_DPI 1000 GRID_FACTOR 125 UNITS <1000 3 "Zo."> PAGEZEROS <394 -106> PAGEWID 11693 PAGEHYT 8268 PRINTWID 11693 PRINTHYT 8268 PRINTLAND ON PRINTMARG <394 394 394 394> SLIDE_STYLE <0 -1 1> PARA <0 0 0 0 1000 1 1 111> REZ <0 1000 1000 -3362 -2261> END SESSION PART "Class" .GRP FIXED ON .GRP .GRP .RECT AT (4375,3375) PNTS (0,0)(1125,0)(1125,375)(0,375)(0,0) .TXT AT (4500,3418) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 MARGINS <0 0 0 0> TXTXYOFF <-5 82> T_PNTS (0,82)(0,0)(596,0)(596,85)(0,85)(0,82)(596,82) .STR V_SPACE <0 111 0> FONT 2 SIZE 80000 "Class Name" END .GRP .RECT AT (4375,3750) BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 V_SPACE <0 250 0> FONT 0 SIZE 180000 MARGINS <125 125 250 62> PNTS (0,0)(1125,0)(1125,375)(0,375)(0,0) .TXT AT (4496,3795) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 MARGINS <0 0 0 0> TXTXYOFF <-1 80> T_PNTS (0,80)(0,0)(466,0)(466,82)(0,82)(0,80)(466,80) .STR V_SPACE <0 111 0> FONT 2 SIZE 80000 "Attributes" .RECT AT (4375,4125) BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 V_SPACE <0 250 0> FONT 0 SIZE 180000 MARGINS <125 125 250 62> PNTS (0,0)(1125,0)(1125,375)(0,375)(0,0) .TXT AT (4499,4168) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 MARGINS <0 0 0 0> TXTXYOFF <-4 82> T_PNTS (0,82)(0,0)(537,0)(537,106)(0,106)(0,82)(537,82) .STR V_SPACE <0 111 0> FONT 2 SIZE 80000 "Operations" END .GRP END .GRP PART "Compartment" .GRP FIXED ON BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 V_SPACE <0 250 0> FONT 0 SIZE 180000 MARGINS <125 125 250 62> .GRP .RECT AT (5750,3125) PNTS (0,0)(1125,0)(1125,375)(0,375)(0,0) .TXT AT (5875,3168) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 MARGINS <0 0 0 0> TXTXYOFF <-5 82> T_PNTS (0,82)(0,0)(596,0)(596,85)(0,85)(0,82)(596,82) .STR V_SPACE <0 111 0> FONT 2 SIZE 80000 "Class Name" END .GRP END .GRP PART "Implementation Class" .GRP FIXED ON BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 STYLE 4 L_ARROW 1 V_SPACE <0 250 0> FONT 0 SIZE 180000 MARGINS <125 125 250 62> .GRP .RECT AT (5000,3375) STYLE 0 L_ARROW 0 PNTS (0,0)(1125,0)(1125,250)(0,250)(0,0) .TXT AT (5125,3426) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 MARGINS <0 0 0 0> TXTXYOFF <-5 74> T_PNTS (0,74)(0,0)(461,0)(461,99)(0,99)(0,74)(461,74) .STR V_SPACE <0 111 0> FONT 2 SIZE 80000 "<>" .LINE AT (6125,3500) BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 STYLE 4 R_ARROW 1 V_SPACE <0 250 0> FONT 0 SIZE 180000 MARGINS <125 125 250 62> PNTS (1375,0)(0,0) .TXT AT (6500,3301) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 STYLE 0 R_ARROW 0 MARGINS <0 0 0 0> T_PNTS (0,74)(0,0)(461,0)(461,99)(0,99)(0,74)(461,74) .STR V_SPACE <0 111 0> FONT 2 SIZE 80000 "<>" END .GRP END .GRP PART "Interface" .GRP FIXED ON BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 STYLE 4 L_ARROW 1 V_SPACE <0 250 0> FONT 0 SIZE 180000 MARGINS <125 125 250 62> .GRP .RECT AT (7875,5375) PNTS (0,0)(1000,0)(1000,500)(0,500)(0,0) .GRP .LINE AT (6125,5625) L_ARROW 0 PNTS (1750,0)(0,0) .LINE AT (6125,5000) R_ARROW 8 PNTS (0,625)(0,0) END .GRP END .GRP .GRP L_ARROW 1 R_ARROW 0 .RECT AT (7875,3750) PNTS (0,0)(1000,0)(1000,500)(0,500)(0,0) .LINE AT (6750,4000) L_ARROW 0 R_ARROW 3 PNTS (1125,0)(0,0) END .GRP .GRP L_ARROW 1 R_ARROW 0 .RECT AT (5625,3250) STYLE 0 L_ARROW 0 PNTS (0,0)(1125,0)(1125,375)(0,375)(0,0) .TXT AT (5750,3294) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 MARGINS <0 0 0 0> TXTXYOFF <-5 81> T_PNTS (0,81)(0,0)(677,0)(677,83)(0,83)(0,81)(677,81) .STR V_SPACE <0 111 0> FONT 2 SIZE 80000 "<>" .RECT AT (5625,3625) BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 V_SPACE <0 250 0> FONT 0 SIZE 180000 MARGINS <125 125 250 62> PNTS (0,0)(1125,0)(1125,1375)(0,1375)(0,0) .TXT AT (5749,3668) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 MARGINS <0 0 0 0> TXTXYOFF <-4 82> T_PNTS (0,82)(0,0)(537,0)(537,106)(0,106)(0,82)(537,82) .STR V_SPACE <0 111 0> FONT 2 SIZE 80000 "Operations" END .GRP END .GRP PART "using" .GRP FIXED ON BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 STYLE 4 L_ARROW 1 V_SPACE <0 250 0> FONT 0 SIZE 180000 MARGINS <125 125 250 62> .GRP .LINE AT (5250,4875) PNTS (1125,0)(0,0) .TXT AT (5628,4750) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 STYLE 0 L_ARROW 0 MARGINS <0 0 0 0> TXTXYOFF <-5 80> T_PNTS (0,80)(0,0)(516,0)(516,105)(0,105)(0,80)(516,80) .STR V_SPACE <0 111 0> FONT 2 SIZE 80000 "<>" END .GRP END .GRP PART "Service" .GRP BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 STYLE 4 V_SPACE <0 250 0> FONT 0 SIZE 180000 MARGINS <125 125 250 62> .GRP .ELL AT (9500,1000) STYLE 0 PNTS (0,0)(250,0)(250,250)(0,250)(0,0) .LINE AT (7375,1125) PNTS (2125,0)(0,0) .TXT AT (9375,668) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 HOR_JUST CENTER MARGINS <0 0 0 0> TXTXYOFF <-5 82> T_PNTS (0,82)(0,0)(648,0)(648,304)(0,304)(0,82)(648,82) .STR V_SPACE <0 111 0> FONT 2 SIZE 80000 "Generic Data\nInterface\n" END .GRP END .GRP SLIDE_INFO SLIDE_STYLE <0 -1 1> END SLIDE_INFO PICTURE .RECT AT (875,625) BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 V_SPACE <0 250 0> FONT 0 SIZE 180000 HOR_JUST LEFT MARGINS <125 125 250 62> PNTS (0,0)(1125,0)(1125,375)(0,375)(0,0) .TXT AT (1077,716) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 BOLD ON HOR_JUST CENTER MARGINS <0 0 0 0> TXTXYOFF <-4 81> T_PNTS (0,81)(0,0)(716,0)(716,195)(0,195)(0,81)(716,81) .STR V_SPACE <0 111 0> FONT 2 SIZE 80000 "<>\nConnection" .RECT AT (875,1000) BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 V_SPACE <0 250 0> FONT 0 SIZE 180000 BOLD OFF HOR_JUST LEFT MARGINS <125 125 250 62> PNTS (0,0)(1125,0)(1125,625)(0,625)(0,0) .TXT AT (1000,1125) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 FONT 2 SIZE 80000 MARGINS <0 0 0 0> TXTXYOFF <0 61> T_PNTS (0,61)(0,0)(693,0)(693,413)(0,413)(0,61)(693,61) .STR V_SPACE <0 111 0> "\n" .STR SIZE 60000 "State::State_Type\n" .STR "Version::Number" .STR "\nId::String\n" .STR "Mode::Mode_Type" .RECT AT (875,1625) BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 V_SPACE <0 250 0> FONT 0 SIZE 180000 MARGINS <125 125 250 62> PNTS (0,0)(1125,0)(1125,625)(0,625)(0,0) .TXT AT (1000,1689) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 MARGINS <0 0 0 0> T_PNTS (0,61)(0,0)(812,0)(812,404)(0,404)(0,61)(812,61) .STR V_SPACE <0 83 0> FONT 2 SIZE 60000 "Open::void" .STR "\nClose::void" .STR "\nNew_Query:Query" .STR "\nNew_Modifier:Modfier\nExecute::Result_Set" .LINE AT (2000,875) BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 STYLE 4 R_ARROW 3 V_SPACE <0 250 0> FONT 0 SIZE 180000 MARGINS <125 125 250 62> PNTS (4250,0)(0,0) .RECT AT (3125,1794) STYLE 0 R_ARROW 0 HOR_JUST CENTER PNTS (0,0)(1125,0)(1125,375)(0,375)(0,0) .TXT AT (3327,1885) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 BOLD ON MARGINS <0 0 0 0> TXTXYOFF <-4 81> T_PNTS (0,81)(0,0)(716,0)(716,195)(0,195)(0,81)(716,81) .STR V_SPACE <0 111 0> FONT 2 SIZE 80000 "<>\nCommand" .RECT AT (3125,2169) BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 V_SPACE <0 250 0> FONT 0 SIZE 180000 BOLD OFF HOR_JUST LEFT MARGINS <125 125 250 62> PNTS (0,0)(1125,0)(1125,500)(0,500)(0,0) .TXT AT (3250,2189) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 MARGINS <0 0 0 0> TXTXYOFF <0 61> T_PNTS (0,61)(0,0)(645,0)(645,394)(0,394)(0,61)(645,61) .STR V_SPACE <0 83 0> FONT 2 SIZE 60000 "Command_String" .STR V_SPACE <0 111 0> SIZE 80000 "\n" .STR SIZE 60000 "Result\nParamete" .STR SIZE 80000 "r\n" .RECT AT (3125,2669) BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 V_SPACE <0 250 0> FONT 0 SIZE 180000 MARGINS <125 125 250 62> PNTS (0,0)(1125,0)(1125,375)(0,375)(0,0) .TXT AT (3230,2830) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 MARGINS <0 0 0 0> TXTXYOFF <0 0> T_PNTS (0,0)(0,0)(1,0)(1,1)(0,1)(0,0)(1,0) .STR V_SPACE <0 111 0> FONT 2 SIZE 80000 "\n" .GRP BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 STYLE 4 L_ARROW 1 V_SPACE <0 250 0> FONT 0 SIZE 180000 MARGINS <125 125 250 62> .LINE AT (2000,2000) PNTS (1125,0)(0,0) .TXT AT (2378,1875) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 STYLE 0 L_ARROW 0 MARGINS <0 0 0 0> TXTXYOFF <-5 80> T_PNTS (0,80)(0,0)(516,0)(516,105)(0,105)(0,80)(516,80) .STR V_SPACE <0 111 0> FONT 2 SIZE 80000 "<>" END .GRP .RECT AT (3125,3500) BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 V_SPACE <0 250 0> FONT 0 SIZE 180000 MARGINS <125 125 250 62> PNTS (0,0)(1125,0)(1125,375)(0,375)(0,0) .TXT AT (3345,3591) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 BOLD ON HOR_JUST CENTER MARGINS <0 0 0 0> TXTXYOFF <-4 81> T_PNTS (0,81)(0,0)(716,0)(716,207)(0,207)(0,81)(716,81) .STR V_SPACE <0 111 0> FONT 2 SIZE 80000 "<>\nResult_Set" .RECT AT (3125,3875) BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 V_SPACE <0 250 0> FONT 0 SIZE 180000 BOLD OFF HOR_JUST LEFT MARGINS <125 125 250 62> PNTS (0,0)(1125,0)(1125,375)(0,375)(0,0) .TXT AT (3245,3939) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 MARGINS <0 0 0 0> TXTXYOFF <0 61> T_PNTS (0,61)(0,0)(945,0)(945,366)(0,366)(0,61)(945,61) .STR V_SPACE <0 83 0> FONT 2 SIZE 60000 "End_Of_Result_Set::Bool" .STR "\nSize::Natural" .STR V_SPACE <0 111 0> "\n" .STR SIZE 80000 "\n" .RECT AT (3125,4250) BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 V_SPACE <0 250 0> FONT 0 SIZE 180000 MARGINS <125 125 250 62> PNTS (0,0)(1125,0)(1125,625)(0,625)(0,0) .TXT AT (3245,4314) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 MARGINS <0 0 0 0> TXTXYOFF <0 60> T_PNTS (0,60)(0,0)(635,0)(635,420)(0,420)(0,60)(635,60) .STR V_SPACE <0 83 0> FONT 2 SIZE 60000 "Next::Record" .STR "\nPrevious::Record" .STR "\nMove_To_End" .STR "\nMove_To_Begin" .STR V_SPACE <0 111 0> "\n" .RECT AT (6250,750) BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 V_SPACE <0 250 0> FONT 0 SIZE 180000 MARGINS <125 125 250 62> PNTS (0,0)(1125,0)(1125,1250)(0,1250)(0,0) .TXT AT (6375,875) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 MARGINS <0 0 0 0> TXTXYOFF <0 80> T_PNTS (0,80)(0,0)(816,0)(816,748)(0,748)(0,80)(816,80) .STR V_SPACE <0 111 0> FONT 2 SIZE 80000 BOLD ON "Implementation\nclass for:" .STR BOLD OFF "\n\nODBC\nPostgreSQL\nMySQL\nXML etc." .LINE AT (5000,1125) BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 STYLE 4 V_SPACE <0 250 0> FONT 0 SIZE 180000 MARGINS <125 125 250 62> PNTS (1250,0)(0,0) .LINE AT (5000,1125) PNTS (0,0)(0,875) .LINE AT (4250,2000) R_ARROW 3 PNTS (750,0)(0,0) .TXT AT (2250,3500) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 STYLE 0 R_ARROW 0 MARGINS <0 0 0 0> TXTXYOFF <-5 80> T_PNTS (0,80)(0,0)(516,0)(516,105)(0,105)(0,80)(516,80) .STR V_SPACE <0 111 0> FONT 2 SIZE 80000 "<>" .GRP BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 STYLE 4 V_SPACE <0 250 0> FONT 0 SIZE 180000 MARGINS <125 125 250 62> .ELL AT (9500,1000) STYLE 0 PNTS (0,0)(250,0)(250,250)(0,250)(0,0) .LINE AT (7375,1125) PNTS (2125,0)(0,0) .TXT AT (9375,668) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 HOR_JUST CENTER MARGINS <0 0 0 0> TXTXYOFF <-5 82> T_PNTS (0,82)(0,0)(648,0)(648,304)(0,304)(0,82)(648,82) .STR V_SPACE <0 111 0> FONT 2 SIZE 80000 "Generic Data\nInterface\n" END .GRP .LINE AT (5250,1375) BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 STYLE 4 V_SPACE <0 250 0> FONT 0 SIZE 180000 HOR_JUST LEFT MARGINS <125 125 250 62> PNTS (1000,0)(0,0) .LINE AT (5250,1375) PNTS (0,0)(0,2250) .LINE AT (4250,3625) R_ARROW 3 PNTS (1000,0)(0,0) .RECT AT (5000,4375) STYLE 0 R_ARROW 0 PNTS (0,0)(1125,0)(1125,375)(0,375)(0,0) .TXT AT (5202,4466) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 BOLD ON HOR_JUST CENTER MARGINS <0 0 0 0> TXTXYOFF <-4 81> T_PNTS (0,81)(0,0)(716,0)(716,194)(0,194)(0,81)(716,81) .STR V_SPACE <0 111 0> FONT 2 SIZE 80000 "<" .STR ">" .STR "\nRecord" .RECT AT (5000,4750) BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 V_SPACE <0 250 0> FONT 0 SIZE 180000 BOLD OFF HOR_JUST LEFT MARGINS <125 125 250 62> PNTS (0,0)(1125,0)(1125,500)(0,500)(0,0) .TXT AT (5125,4814) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 MARGINS <0 0 0 0> TXTXYOFF <0 61> T_PNTS (0,61)(0,0)(603,0)(603,477)(0,477)(0,61)(603,61) .STR V_SPACE <0 83 0> FONT 2 SIZE 60000 "Get::" .STR "\nSet::" .STR V_SPACE <0 111 0> SIZE 80000 "\n\n\n" .RECT AT (5000,5250) BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 V_SPACE <0 250 0> FONT 0 SIZE 180000 MARGINS <125 125 250 62> PNTS (0,0)(1125,0)(1125,375)(0,375)(0,0) .TXT AT (5125,5301) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 MARGINS <0 0 0 0> TXTXYOFF <-5 74> T_PNTS (0,74)(0,0)(425,0)(425,99)(0,99)(0,74)(425,74) .STR V_SPACE <0 111 0> FONT 2 SIZE 80000 "" .LINE AT (4250,4500) BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 STYLE 4 L_ARROW 1 V_SPACE <0 250 0> FONT 0 SIZE 180000 MARGINS <125 125 250 62> PNTS (750,0)(0,0) .TXT AT (4375,4375) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 STYLE 0 L_ARROW 0 MARGINS <0 0 0 0> TXTXYOFF <-5 80> T_PNTS (0,80)(0,0)(516,0)(516,105)(0,105)(0,80)(516,80) .STR V_SPACE <0 111 0> FONT 2 SIZE 80000 "<>" .LINE AT (5500,1625) BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 STYLE 4 V_SPACE <0 250 0> FONT 0 SIZE 180000 MARGINS <125 125 250 62> PNTS (750,0)(0,0) .LINE AT (5500,1625) R_ARROW 3 PNTS (0,0)(0,2750) .LINE AT (1375,3625) L_ARROW 1 R_ARROW 0 PNTS (1750,0)(0,0) .LINE AT (1375,2250) L_ARROW 0 PNTS (0,0)(0,1375) .LINE AT (9625,1250) STYLE 0 L_ARROW 4 PNTS (0,0)(0,2250) .GRP L_ARROW 0 .TXT AT (8427,2179) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 R_ARROW 7 BOLD ON HOR_JUST CENTER MARGINS <0 0 0 0> TXTXYOFF <0 82> T_PNTS (0,82)(0,0)(605,0)(605,85)(0,85)(0,82)(605,82) .STR R_ARROW 0 V_SPACE <0 111 0> FONT 2 SIZE 80000 "\nConnection" .LINE AT (9250,2220) BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 R_ARROW 7 V_SPACE <0 250 0> FONT 0 SIZE 180000 BOLD OFF HOR_JUST LEFT MARGINS <125 125 250 62> PNTS (0,0)(375,0) END .GRP .GRP R_ARROW 0 .TXT AT (8466,2543) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 R_ARROW 7 BOLD ON HOR_JUST CENTER MARGINS <0 0 0 0> TXTXYOFF <-5 82> T_PNTS (0,82)(0,0)(533,0)(533,85)(0,85)(0,82)(533,82) .STR R_ARROW 0 V_SPACE <0 111 0> FONT 2 SIZE 80000 "Command" .LINE AT (9250,2584) BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 R_ARROW 7 V_SPACE <0 250 0> FONT 0 SIZE 180000 BOLD OFF HOR_JUST LEFT MARGINS <125 125 250 62> PNTS (0,0)(375,0) END .GRP .GRP R_ARROW 0 .TXT AT (8452,2874) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 R_ARROW 7 BOLD ON HOR_JUST CENTER MARGINS <0 0 0 0> TXTXYOFF <-8 82> T_PNTS (0,82)(0,0)(565,0)(565,97)(0,97)(0,82)(565,82) .STR R_ARROW 0 V_SPACE <0 111 0> FONT 2 SIZE 80000 "Result_Set" .LINE AT (9250,2915) BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 R_ARROW 7 V_SPACE <0 250 0> FONT 0 SIZE 180000 BOLD OFF HOR_JUST LEFT MARGINS <125 125 250 62> PNTS (0,0)(375,0) END .GRP .GRP R_ARROW 0 .TXT AT (8548,3251) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 R_ARROW 7 BOLD ON HOR_JUST CENTER MARGINS <0 0 0 0> TXTXYOFF <-8 80> T_PNTS (0,80)(0,0)(368,0)(368,82)(0,82)(0,80)(368,80) .STR R_ARROW 0 V_SPACE <0 111 0> FONT 2 SIZE 80000 "Record" .LINE AT (9250,3291) BACKFILL <1 0 0 0 0 0 0> THICKNESS 1 R_ARROW 7 V_SPACE <0 250 0> FONT 0 SIZE 180000 BOLD OFF HOR_JUST LEFT MARGINS <125 125 250 62> PNTS (0,0)(375,0) END .GRP .TXT AT (6697,6377) BACKFILL <1 0 5 1000 0 0 0> THICKNESS 0 R_ARROW 0 BOLD ON MARGINS <0 0 0 0> TXTXYOFF <0 123> T_PNTS (0,123)(0,0)(2948,0)(2948,568)(0,568)(0,123)(2948,123) .STR V_SPACE <0 167 0> FONT 2 SIZE 120000 "Generic Data Interface for Ada 95\n" .STR SIZE 100000 "$Revision: 1.3 $ $Date: 2001/06/09 20:51:31 $\nMichael Erdmann" .STR V_SPACE <0 111 0> SIZE 120000 "\n" .TXT AT (3250,2750) V_SPACE <0 250 0> FONT 0 SIZE 180000 BOLD OFF TXTXYOFF <-5 74> T_PNTS (0,74)(0,0)(425,0)(425,99)(0,99)(0,74)(425,74) .STR V_SPACE <0 111 0> FONT 2 SIZE 80000 "" END PICTURE *END GRAPHICS gnade-1.6.2.orig/doc/ado/modifier.txt0000644000175000017500000000252007313060332017240 0ustar lbrentalbrentaModify ====== This is command which does change the contents of the underlying data source. This is a subclass of the command class. Attributes ========== State - Open/Closed Num_Params - Number of parameter marks (?) in the sql statement, available if State = Open Methods ======= Open - Initiate instance Close - Release resources Execute - Execute the modification command. Returns the number of inserted/updated or deleted rows. Set - Set the parameter value n Interfaces ========== Example ======= con : Connection.Instance; cmd : Modifier.Handle; X : Integer := 1; Y : Integer := 2; Result : Natural; begin Connection.Open (con, "......"); cmd := Modify.Open (con, "INSERT INTO XYZ VALUES (?, ?)"); Parameter (cmd, 1, X); -- Sets the address for param 1 Parameter (cmd, 2, Y); -- Sets the address for param 2 Result := Execute (cmd); Close (Cmd); Connection.Commit (Con); Modifier.Open (cmd, con, "INSERT INTO XYZ VALUES (?, ?)"); Modifier.Set (Cmd, 1, X) -- Sets the value Modifier.Set (Cmd, 2, Y); Result := Execute (cmd); Modifier.Set (Cmd, 1, 1234); -- Sets the value Modify.Set (Cmd, 2, 5678); Result := Execute (Cmd); Close (Cmd); Connection.Commit (Con) Close (Con); end ; gnade-1.6.2.orig/doc/ado/query.txt0000644000175000017500000000243507313060332016614 0ustar lbrentalbrenta Command Query ============= A query is a command which does not change the contents of the underlying data source. This is a subclass of the command class. Constructors ============ Open - The open command implemented in the connection class creates a query instance specific for the selected connection. Initiate a query inst ance. The optionaly given command may be prepared by the underlying data source. Only a reference on the object will be returned. Close - Dstroys the query instance. Attributes ========== State - Open/Closed Num_Params - Number of parameter marks (?) in the sql statement, available if State = Open Methods ======= Execute - Execute the command on the underlying data source. Returns a Result_Set Interfaces ========== Example ======= Con : Connection.ODBC.Instance; Qry : Query.Handle; X : Integer; begin Connection.Open (Con, "......"); Qry := Query.Open (Con, "SELECT ID FROM EMPLOYEES WHERE ID > ?"); Set(Qry, 1, 1002); -- Sets the parameter 1 to 1002 Result := Execute (Qry); .................. Close (Qry); COnnection.Close (Conn); end ; gnade-1.6.2.orig/doc/ado/record.txt0000644000175000017500000000122607313060332016722 0ustar lbrentalbrenta Record Class ============ Attributes ========== Field - Each field in the record has an attribute. The fields are numbered from 1..N. Methods ======= Interfaces ========== Example ======= ............ c : Connection.....Object; Result : Result_Set.Handle; R : Record.Handle; name : String( 1..40 ); empno : Integer ; begin ..... Result := Execute( c ); while not End_of_Result_Set( Result ) loop declare R : Record.Handle := Next( Result ); begin empno := Field( R, 1 ); Copy_Field( R, 2, name ); end; end loop; Close( Result ); end ; gnade-1.6.2.orig/doc/ado/resultset.txt0000644000175000017500000000251107312460037017501 0ustar lbrentalbrenta Result_Set Class ================ This class maintaines a complete result set as is created by a query. Every command on the data source is expected to create records in a certain order which are stored in the result set. The result set maintaines the state of the cursor, which is used to browse througth the result set returning records. Constructors ============ Attributes ========== Size - Returns the number of records in the result set. Not always available Position - Returns the position of the cursor in the result set. End_Of_Result_Set - Indicates the end of the result set Field_Count - Number of result fields Methods ======= Next - Move to next row in the result set Drop - Drop the result set at the source and release resources Interfaces ========== Example ======= C : Connection.Instance; Q : Query.Instance; Result : Result_Set.Instance; Connection.Open (C, "....."); Query.Open (Q, C, "SELECT FIRST_NAME, LAST_NAME FROM TABLE"); Result := Execute(Q); while not Result_Set.End_Of_Result_Set (Result) loop .... moving the cursor throught the result set ... Result_Set.Next (Result); end loop; Result_Set.Drop (Result); Query.Close (Q); Conection.CLose (C); gnade-1.6.2.orig/doc/ado/template.txt0000644000175000017500000000017207306666442017276 0ustar lbrentalbrenta Connection Class ================ Attributes ========== Methods ======= Interfaces ========== Example ======= gnade-1.6.2.orig/doc/build/0000755000175000017500000000000011040716276015245 5ustar lbrentalbrentagnade-1.6.2.orig/doc/build/Makefile0000644000175000017500000001104610056104653016703 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/doc/build/Makefile,v $ ## Description : Top level makefile for the documentation -- ## Author : Juergen Pfeifer -- ## Created On : 17-Jan-2001 -- ## Last Modified By: $Author: merdmann $ -- ## Last Modified On: $Date: 2004/05/29 13:01:31 $ -- ## Status : $State: Exp $ -- ## -- ## Copyright (C) 2000-2004 -- ## -- ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## This makefile builds the various documentation formats. The input ## is SGML docbook. ## ## If the aspell utility is installed on the system, a gobal spell check ## is done which summarizes all misspellings. If the number of ## errors is large consider the execution of a real spellcheck run. ## ## Restrictions ## ============ ## - Spellcheck is based upon the aspell utility. ## ## References ## ========== ## None ## ## sinclude ../../make.conf ## ## ## LOG=docbuild.log DOCBASE=gnade PARTS=$(DOCBASE).sgml esql.sgml odbc.sgml bindings.sgml \ gpl.sgml gfdl.sgml faq.sgml porting.sgml gnudb.sgml \ ado.sgml tools.sgml TARGETS= $(docdir)/html/$(DOCBASE).html \ $(docdir)/$(DOCBASE).ps \ $(docdir)/$(DOCBASE).pdf ## ## for all we do nothing ## all :: ## ## Build the documentation and check if possible spelling errors. ## documentation :: $(TARGETS) gps_index.xml cp gps_index.xml $(docdir) doc :: $(MAKE) USED_SPELLCHECKER="" documentation ## ## Generate PDF documents ## $(docdir)/$(DOCBASE).pdf :: $(docdir)/$(DOCBASE).ps ps2pdf $(docdir)/$(DOCBASE).ps $(docdir)/$(DOCBASE).pdf $(docdir)/$(DOCBASE).ps :: $(DOCBASE).tex $(DOCBUILDER) --ps --log=$(LOG) --target=$@ $(DOCBASE) $(docdir)/html/$(DOCBASE).html :: $(DOCBASE).tex $(DOCBUILDER) --html --log=$(LOG) --target=$@ $(DOCBASE) rm -rf $(docdir)/html -mkdir -p $(docdir)/html -mv *.html *.htm $(docdir)/html $(DOCBASE).tex :: $(PARTS) $(DOCBUILDER) --tex --log=$(LOG) $(DOCBASE).sgml clean :: rm -f *.aux *.log *.tex *.dvi *.out *.pdf *.htm *.html *~ *.bak distclean :: clean rm -f *.dvi *.ps *.pdf *.rtf rm -rf $(docdir)/html rm -rf $(docdir)/*.pdf gnade-1.6.2.orig/doc/build/ado.sgml0000644000175000017500000001433007433455371016704 0ustar lbrentalbrenta ADBC - Ada Database Connectivity Introduction The intention of the ADBC packages is to provide an data base API which allowes to implement application independent of the used data base system. This interface has to be understood as an experimental interface which is under permanent discussion in the Ada 95 community. The discussion will be done via comp.lang.ada and the gnade development list. The GNADE package will contain only the stable versions of the ADBC interface. All intermediate versions will be released as seperate packages. The interface does not rely on any other components of the GNADE project and can be used stand alone. Basic Concepts This chpater gives an overview of the concepts of the ADBC interface. The ADBC interface is based upon the following major components: Hostvariables Statements Resultsets Hostvariables Host variables are used to transfer data between the data base and the application. In a query the hostvariables are indicated by a name preceeded by an ':' in a query. The API allowes to associcate Ada 95 host variables with these names. An Ada 95 hostvariable provides the value and the additional attribute Is_Null to the application programmer, which means the variable is has a value or is not set. Driver dependencies Not all database drivers do provide the null indication for a colon in the result set. As a consequence the driver may not be able to support this. The driver should always return true and a defined value. Statements Statements are SQL command string where the hostvariables are marked by a ':' character. In the example belowm the variable myname may be used is an input parameter for the query select * from employees where name = :myname Resultset Using the ADO Interface A Sample Application For the communication with the underlying database the application uses a so called connection object. The connection object uses a so called driver handle in order to communication with the database specific driver. The code fragment below shows how to declare a connection to a MySQL data base. procedure Client is ............. X : Driver.Handle := Driver.MySQL.Create; C : Connection.Object(X); ............. In order to connect to the data base, the Connect method has to be invoked as shown below, where the parameters do depend on the actual data base used. begin ... Connect(C, "gnade", Password => "", Database => "gnade" ); After the connection has been established statements for execution may be prepared. In order to do so, the method prepare has to be invoked as shown below. -- prepare a query S := Prepare( C, "select empno, name, firstname from EMPLOYEES " & "where empno > :emp and name = :id ;"); Bind(S, "id", V ); Bind(S, "emp", E ); This method analysis the given statements for so called hostvariables and invokes the underlying data base in order to evaluate an execution plan. The following Bind commands connect the hostvariables V and E with the host variable names "id" and "emp". The variables V,E are input parameters for the query. In order to execute the query, the following code fragment is used: -- execute a query Value( V, "Bundy" ); Value( E, 50 ); R := Execute(C, S ); This fragment sets the values of the two hostviariables V and E and executes the statement denoted by S on the connection C. The result of this execution is the result set denoted by the variable R. A result set denotes all all records which are generated by the execution of an SQL query statement. -- retrieve the result declare package D_Empname is new String_Domain( Size => Name_Type'Length, Result => R, Name => "name"); package D_Firstname is new String_Domain( Size => Name_Type'Length, Result => R, Name => "firstname"); package D_Empno is new Integer_Domain( Number_Type => Empno_Type, Result => R, Name => "empno"); begin while not End_Of_Result(R) loop Fetch( R ); Put_Line(Integer'Image(D_Empno.Value) & " " & D_Empname.Value & D_Firstname.Value ); end loop; end ; Deallocate( R ); Building a Sample Application Things to know gnade-1.6.2.orig/doc/build/bindings.sgml0000644000175000017500000001141310054066330017717 0ustar lbrentalbrenta Native Bindings Introduction to native bindings The GNADE project supplies bindings to client libraries of commonly known data bases systems. The intention of bindings is often to provide an API which reflects special features of a data base. There for there is currently no unified interface for all data base bindings available. MySQL bindings The following example is stored under ./samples/mysql. It requires the installed client libraries of the MySQL product. The MYSQL API An instance of the MySQL.Object type represents the data base on application level. All operations on the data base are performed on this data type. Each issued query is identified by a query id which issued to refer to the query. Every program has to connect and authorize at the data base. This is done by the Methods User, Password and Connect as shown in the example below. The data base is selected by the primitive Select_DB. MySQL native binding - Connecting to the database. with GNU.DB.MySQL; use GNU.DB.MySQL; with GNU.DB; use GNU.DB ; dBase : MySQL.Object; qId : MySQL.Query_ID; begin Initialize( dBase ); User( dBase, "gnade" ); Password( dBase, "" ); Connect( dBase, "localhost" ); Select_DB( dBase, "testdb" ); A query is send by the method Query to the data base. The query string is a normal SQL query or DML command. The result set of a query is described by a so called query identifier with the type Query_ID. The result set is generated at the time where the Query method is executed. MySQL native binding - Executing a query ..... qID := Query( dBase, "select * from Test where id='Otto'"); Put_Line( "Nbr of Rows:" & Integer'Image(Nbr_of_Rows(dBase, qID)) ); .... The result set may be reed out by means of the Next method as it is shown below. MySQL native binding - Accessing the result set ........ while true loop declare Insert_Time : Time; begin Nbr_Tuples := Nbr_Tuples + 1; Put_Line( "'" & To_String( String_Field( dBase, qId, "id" ) ) & "'" ); Insert_Time := Date_Field( dBase, qID, 2); Next( dBase, qID ); exception when Field_Parse_Error => Put_Line("Field parse error"); Next( dBase, qID ); when Others => raise; end; end loop; ......... After the result set has been processed the query context has to be returned to MySQL via the Drop_Query method. If the application intends to disconnect completely, the data base instance should be Finalized as shown below. MySQL native binding - Dropping the query ..... Drop_Query( dBase, qID ); Finalize( dBase ); ..... NOTE All data types are allocated a part of the result set. The only known deviation are blobs. The function Get_Blob_Field returns a dynamically allocated by array which need the be deallocated by the application explicitly by means for the Free procedure. If this is not done your application will loose memory. Building programs with MySQL The MySQL API stored in the library adamysql uses the client library of MySQL, which means the following linker options have to be passed to gnatmake: gnatmake .... -largs .. L/usr/lib/mysql -ladamysql -lmysqlclient A sample makefile is stored under ./samples/mysql. Postgres bindings gnade-1.6.2.orig/doc/build/esql.sgml0000644000175000017500000011034407773060575017114 0ustar lbrentalbrenta GNU Embedded SQL Translator for Ada 95 Introduction to Embedded SQL The GNU Embedded SQL Translator for Ada 95 reads a Ada 95 source file containing an Ada 95 package which contains embedded SQL Commands. A typical code fragment which is embedded into a normal Ada 95 source text is shown below: Example for Embedded SQL EXEC SQL AT DB01x SELECT LOCATION INTO :dep_location FROM departments WHERE DEPTNO = :depno ; if SQLCODE not in SQL_STANDARD.NOT_FOUND then Put_Line( "Employee : " & Trim(To_String(Name),Right) & -- bug " working in dep. " & INT'Image(depno) & -- " located at " & Trim(To_String(dep_location),Right) ); end if; .............. Embedded SQL commands are always preceded by the string EXEC SQL. According to ISO/92 all text following until the semicolon forms the query which has to be send to the DBCS. The communication between the SQL query and the application code is done by means of so called host variables. A host variable contains either a parameter as input to a query or the result of a query after the query has been executed by the DBCS. A host variable in an SQL query is marked by a preceding colon (':'). Host variables are declared in a specially marked declare section, where the ISO/92 standard allows only a limited number of data types which may be used for host variables. These data types are defined in the package SQL_STANDARD. In order to communicate to data bases, ESQL uses in each ESQL statement an optional data base identifier. This identifier is assigned by means of a connect statement to a data base as shown below. First of all is the connection identifier declared to be DB01. ........ EXEC SQL DECLARE DB01 DATABASE ; ......... begin EXEC SQL CONNECT "gnade" IDENTIFIED BY "xxxxxxx" BY DB01 TO "DEMO_DB" ; end; Later, during the initialization of the package, we connect as user "gnade" with the password "xxxxxx" to the database "DEMO_DB". The connection which will be used will be referred as DB01 in all ESQL statements. The name DEMO_DB refers to the data source name in the ODBC setup. Embedded SQL Syntax Specification The GNU Ada 95 Embedded SQL The ESQL translator is based on the ISO/92 standard for Embedded SQL, but a lot of issues have been left out there. In order to allow comfortable coding several extensions have been added, which have been derived from other popular ESQL dialects for Ada 95. These add ons are not specially marked, because i believe without these extensions it would not possible to implement an application. Embedded SQL statement Every embedded SQL Statement has the same general structure shown as below. For each query the programmer may specify the data bases where the query has to be applied. If the data base is not explicitly specified, the default data base connection is assumed. Syntax: <embedded SQL statement> ::= <SQL prefix> statement or declaration [ <SQL terminator> ] <statement or declaration> ::= | <include clause> | <database clause> | <connect clause> | <declare clause> | <temporary table declaration> | <dynamic sql clause> | <query clause> | <fetch clause> | <embedded SQL declare section> <embedded exception declaration> ; <SQL prefix> ::= EXEC SQL [ <DB clause> ] [ <for clause>] <SQL terminator> ::= END-EXEC | <semicolon> | <right paren> ; <DB clause> ::= AT <name> <for clause> ::= FOR <expression> (not yet implemented) <include clause> ::= <include_sqlca_clause> | <include_handles> ; <declare clause> ::= <declare_db_clause> | <declare_table_clause> | <declare cursor> ; Embedded SQL Statements EXEC SQL AT db01 select * from employees ; This example sends a query to the db01. All components of the ESQL statement which are not part of the esql grammar will be copied directly into the query which is to be sent to the dbcs. SQL Query and FETCH clause A query may be issued by either defining a cursor or a direct query where only one row is expected. The syntax for the later case is shown below. <query> ::= 'SELECT' <column list> 'INTO' <host variable list> 'WHERE'...... rest of query ...... ; <host variable list> ::= <variable> [ ['INDICATOR'] <variable> | <host variable list> | <empty> ; <variable> :: = ':' <identifier> ; The esql handles this statement as a normal SQL statement but removing the 'INTO' clause from the SQL string which is sent to the dbcs. The host variables listed in the <host variable list> are used to store the columns of the query result. <fetch clause;> ::= 'FETCH' <source;> 'INTO' <host variable list> ; <source;> := { <empty> | 'FROM' <cursor> | 'USING' [ 'STATEMENT' ] <statementname> } Either a cursor name or a statement name (see dynamic sql) may be given as a source for the fetch command. If the source if left empty, a unnamed cusrsor will be assumed. ATTENTION The unnamed cursor has a global nature, which means there is only one unnamed cursor which is reallocated for each query. Any subsequent query with an unnamed cursor will destroy the previously allocated result sets. Embedded SQL declare section This section contains all definitions of host variables. Note, that not all data types are allowed for a variable in this section. Syntax: <embedded SQL declare section> ::= <embedded SQL begin declare> [ <embedded character set declaration> ] [ <host variable definition> ... ] <embedded SQL end declare> <embedded character set declaration> ::= SQL NAMES ARE <character set specification> <embedded SQL begin declare> ::= <SQL prefix> BEGIN DECLARE SECTION [ <SQL terminator> ] <embedded SQL end declare> ::= <SQL prefix> END DECLARE SECTION [ <SQL terminator> ] <host variable definition> ::= <Host Identifiers> ':' <Ada type specification> [ ':=' <Ada initial values> ';' ] <embedded variable name> ::= ':' <host identifier> <host identifier> ::= <Ada host identifier> <Host identifiers> ::= <host identifier> | <host identifier> ',' <host identifiers> <Ada type specification> ::= <Ada qualified type specification> | <Ada unqualified type specification> <Ada qualified type specification> ::= 'SQL_STANDARD.' <Ada unqualified type specification> <Ada unqualified type specification> ::= CHAR [ CHARACTER SET [ IS ] <character set specification> ] '(' 1..<length>')' | BIT '(' 1 .. <length> ')' | SMALLINT | INT | REAL | DOUBLE_PRECISION | SQLCODE_TYPE | SQLSTATE_TYPE | INDICATOR_TYPE | GNADE.<GNADE specific type> Character set declaration is not supported. If the pedantic option (-pedantic) has been set, a warning will be issued and every thing will be skipped until the next semicolon. Ada support host variable definitions in the scope of a subprogram. The current implementation of esql does not follow the scope of Ada. This will cause warning, that the type of a host variable is changed. The translator will issue an Error if the -pedantic has been set if the type is not one of the ones listed above. If the -pedantic switch is not used only a warning is issued. The context clauses regarding the SQL_STANDARD and other packages has to be added to the source by the developer. The translator will add only those packages which are needed to interface with ODBC. The correctness of the identifier will not be checked by the translator except for lexical rules which are needed to parse the code. The Ada compiler has to verify the validity of the identifier. Implementation Note The Character set modifier is not supported. It is simply discarded and a warning is issued, that the construct is not supported. Embedded Exception Declaration The clause may be used to define the handling of certain conditions after a query. The result of the query is evaluated and the action as defined in the action clause is executed. Syntax: <embedded exception declaration> ::= WHENEVER <condition> <condition action> <condition> ::= SQLERROR | NOT FOUND | SQLWARNING <condition action> ::= CONTINUE | <go to> | RAISE <host_exception> | DO <target> | STOP <go to> ::= { GOTO | GO TO } <goto target> <goto target> ::= <host label identifier> A defined condition is applies to the next SQL query. By using the switch the code generator may be forced to apply whenever clause to all embedded SQL statements until the next whenever clause occurs. Exception Actions GOTO The translator inserts a goto statement to the label specified in the target. RAISE The translator inserts a raise statement with an exception as specified in the target. The exception information will contain the line number of the query in the input source file and the package name. Additionally the contents of the message in the SQLCA is added. DO The procedure named in the target specification is called. CONTINUE This clause will reset all previous actions for the given condition.
Handling of return codes The following variables will be inserted automatically on package level. package body XXX is SQLCODE : SQL_STANDARD...; SQLSTATE : SQL_STANDARD...; These variables will be updated after every query send to the data base. This variable may be used to check the result of a query. The elaboration of the WHENEVER clause is based on these variables as well. Please note, this method is not thread save. SQL Communication Area The GNU.DB.ESQL_SUPPORT package provides a so called SQL communication area type. This area contains informations about the result of the last query. Syntax: <include_sqlca_clause> ::= INCLUDE SQLCA This statement will insert a SQLCA in the Ada 95 code. If this is done in the declare section of a procedure as shown below, the SQLCA will be declared local to the procedure. Local SQLCA in procedures procedure Print_Departement( departement : in Integer ) is --- EXEC SQL BEGIN DECLARE SECTION END-EXEC Name : CHAR(1..15) := (others=>32); ............. Salary : DOUBLE_PRECISION := 0.0; EXEC SQL END DECLARE SECTION END-EXEC EXEC SQL INCLUDE SQLCA ; -- Make a private SQLCA begin ..... EXEC SQL AT DB01 DECLARE emp_cursor CURSOR FOR SELECT EMPNO, FIRSTNAME, NAME, JOB, MANAGER, SALARY FROM employees WHERE deptno = :Depno ; .... end; The application may access the contents by using the variable name SQLCA in the application code. This method is preferable in a multi thread environment, because it avoids interferences between threads through the global variables SQLCODE and SQLSTATE. The SQLCA provides several fields containing usefull information about the most recently executed query as shown below: type SQLCA_Type is record Message : aliased String(1..255 ); State : aliased SQLSTATE_TYPE; SqlCode : aliased SQLCODE_TYPE; Affected_Rows : aliased Integer := 0; end record; The parameter Affected_Rows contains the number of rows affected by the last query. State and SqlCode do contain the result code of the last query. The SqlCode should not be used any more because the State information contains more information. The field Message contains a string generated by the underlying dbcs containing information bout the most recent error. Connection Handling In order to connect to a data base, the data base identifier to be used has to be defined first. This identifier is a simple name which may be used in the AT clause of an embedded SQL statement and is declared by means of the "declare_db_clause". This clause will insert at the source where the clause is invoked a Ada statement declaring a connection object. Syntax: <connect_clause> ::= CONNECT [ user ] [ BY <Connection> ] [ TO <db_name> ] [ AS <name> ] [ IDENTIFIED BY <password> ] [ ON [COMMUNICATION|ATHORIZATION|OTHER] ERROR [RAISE|GOTO|DO] <target> ] <declare_db_clause> ::= DECLARE <name> DATABASE As shown in the example below, the declare_db_clause may be used in the argument list of a procedure. Using DB connections as procedure arguments procedure Print_Employee( His_Number : Integer; EXEC SQL DECLARE DB01x DATABASE ) is --- ........... --- begin empno := INT(His_Number); EXEC SQL WHENEVER NOT FOUND DO Not_Found; EXEC SQL AT DB01x SELECT NAME, DEPTNO INTO :name, :depno FROM employees WHERE EMPNO = :empno ; ..................... end Print_Employee; This construct allows to write library packages using data base connections as arguments. The 'ON' clause is used to define the handling of errors which may occure during connection. Please note, that the execution of a procedure is straigth forward, which means after the procedure returns the execution continues after the connect statement! Implementation Note The data base connection variable inserted by this statement has the name GNADE_DB_<db_name> and is of the type ESQL_Support.CONNECTION_Handle. Such a name should never be used in the application code. There are situation where you might want to build a general purpose package which contains ESQL statements. In such a situation you may either pass the data base as an argument of each procedure/function of this package as shown below: procedure ...( EXEC SQL DECLARE DB DATABASE ) is begin EXEC SQL AT DB ........ ; end X; If this is to expensive you may implement a common procedure which sets the database globaly. procedure Initialize( EXEC SQL DECLARE DB DATABASE ) is begin EXEC SQL AT MYDB DATABASE IS DB ; end Initialize; Implementation Note Using this approach special you have to ensure that always the correct database is active before calling any operation from your utility package. This approach should be used if you are dealing with only one data base. Cursor Handling A cursor is a declares a SQL query with its input and result parameters. The result set is created when the cursor is opened. The syntax for declaring, opening and closing a cursor is shown below. 'DECLARE' <name> [ 'REOPENABLE' | 'LOCAL' ] 'CURSOR' 'FOR' <sql query> 'OPEN' <name> 'CLOSE' <name> ['FINAL'] LOCAL cursors are only defined within the scope of the block where the nearest DECLARE section is. If the scope is left, the cursor and the associated result set are deleted. Local Cursors As shown in the example below, the cursor emp_cursor will only be valid in the scope of the procedure Print_Departement: procedure Print_Departement( .......... ... departement : in Integer ) is EXEC SQL BEGIN DECLARE SECTION ; .... Depno : INT := INT( Departement ); .... EXEC SQL END DECLARE SECTION ; begin EXEC SQL AT DB01 DECLARE emp_cursor LOCAL CURSOR FOR SELECT EMPNO, FIRSTNAME, NAME, JOB, MANAGER, SALARY FROM employees WHERE deptno = :Depno ORDER BY EMPNO, NAME; ....... Normally it is not possible to open the same cursor twice. The type REOPENABLE has been introduced, in order to allow the recursive opening of cursors. This feature may also be emulated by means of recursive procedures with local cursors. If the cursor type is omitted the cursor and its associated result set to exist only once. Mixing ODBC and embedded SQLcode In order to allow mixed use of ODBC and ESQL constructs to access the ODBC handles has been added to the translator. The construct below allows to access either the statement handle or the connection handle of the specified data base name. <include_handle> ::= 'INCLUDE' { 'STATEMENT' 'HANDLE' [ <cursor>] | 'CONNECTION' 'HANDLE' } 'OF' [ <dbname>] In case of the statement handle, the name of the cursor may be specified. If no cursor is given, the statement handle of the last query will be returned. Accessing ODBC handles H : SQLHSTMT; C : SQLHDBC ; ... EXEC SQL AT DB01x SELECT LOCATION INTO :dep_location FROM DEPARTMENTS WHERE DEPTNO = :depno ; ...... -- get the ODBC handles H := EXEC SQL INCLUDE STATEMENT HANDLE OF DB01x ; C := EXEC SQL INCLUDE CONNECTION HANDLE OF DB01x ; Dynamic SQL Currently only the syntax for dynamic SQL is supported. The idea of dynamic SQL is that the application can generate a query by generating a string. This query is executed by the data base and the application may access the result set. This can be achieved by either using the ODBC bindings directly or by using the dynamic SQL constructs as they are provided by the embedded SQL translator. The name of a statement (<statement_name>) is defined in a DECLARE clause. Each dynamic SQL command is identified by such a name. As for ODBC, the esql translator provides a prepare and an execute method. With the prepare clause the query is sent to the underlying data base system, but no result set is yet created. This very much comparable with declaring a cursor. After the query has been prepared, the query is executed by means of the execute clause. <dynamic sql clause > ::= <prepare clause> | <execute clause> | <close statement clause> ; The prepare clause takes as input the statement name and the query string, which is simply a Ada 95 string variable. Any parameters in the query are marked by means of a '?' character. The host variables of the parameters are listed in the USING clause the the prepare statement. <prepare clause> ::= 'PREPARE' <statement_name> 'FROM' { <name> | <string> } [ 'USING' <hostvars> ] ; The execute clause takes the name of the statement as input for execution. If the USING section in the prepare clause was not included, the parameters of the statement may be assigned latest at this point via the USING clause in this statement. <execute_clause> ::= 'EXECUTE' <statement_name> [ 'USING' <hostvars> ] ; The close statement clause is used to close the cursor associated with the statement it sef. <close statement clause > ::= 'CLOSE' 'STATEMENT' <statement_name> ; The result set of the execute is accessed via the FETCH clause as for normal cursors as shown in the following example. Using dynamic SQL EXEC SQL END DECLARE SECTION END-EXEC EXEC SQL DECLARE test_sql STATEMENT ; S : constant String := "SELECT NAME FROM employees WHERE EMPNO = ?"; begin EXEC SQL CONNECT $DBUSER IDENTIFIED BY $DBPASSWD BY DB01 TO $DBSOURCE ; EXEC SQL AT DB01 PREPARE test_sql FROM S USING :EMPNO ; EMPNO := 5; EXEC SQL AT DB01 EXECUTE test_sql USING :NAME :NAME_IND ; loop EXEC SQL AT DB01 FETCH USING STATEMENT test_sql INTO :name :name_ind ; exit when SQLCODE in SQL_STANDARD.NOT_FOUND; Put_Line( "Result " & To_String( name ) ); end loop; CLOSE STATEMENT test_sql; GNADE Specific Datatypes The GNADE ESQL translator supports implementation defined data types as e.g. VARCHAR in order to simplify the implementation of Ada 95 applications. The specifications of these types is done in the SQL_STANDARD.GNADE package. <GNADE impl. specific types> ::= 'VARCHAR ( ' <max> ')', | 'VARBINARY ( ' <max> ')' ; The type VARCHAR is used to handle strings with variable length. The descriminant in the VHARCHAR type specifies the maximal size of a string. The application programmer may use the operations Is_Null and Length to figure out if the variable contains data and the length of the data. An application example is shown below. Additional examples may found in the samples/esql directory. Using VARCHAR with Ada.Strings; use Ada.Strings; with sql_standard; use sql_standard; with gnu.db.esql_Support; use gnu.db.esql_support; use gnu.db; procedure Test is val : String := "FIRSTNAME"; -- declare host and program variables EXEC SQL BEGIN DECLARE SECTION; ENAME : GNADE.VARCHAR(50); EMPNO : sql_standard.int; SQLCODE : sql_standard.sqlcode_type; -- for ANSI mode SQLSTATE : sql_standard.sqlstate_type; -- ANSI mode tt : GNADE.VARCHAR ( 50 ); EXEC SQL END DECLARE SECTION; SQL_ERROR : exception; SQL_WARNING : exception; begin EXEC SQL CONNECT $DBUSER IDENTIFIED BY $DBPASSWD TO $DBSOURCE ; To_VARCHAR( "Michael", tt ); EXEC SQL SELECT empno, name INTO :EMPNO, :ENAME FROM employees WHERE FIRSTNAME = :tt ; Put_Line( "empno : " & Integer'Image(Integer(empno)) ); Put_Line( "found name : " & To_String( ename ) ); end Test;
The ESQL Translator Compilation Process A ESQL module is either a package or a file containing only a single compilation unit (procedure). The file containing the Ada 95 code is read in by the translator which translates all ESQL statements into Ada 95 statements. The name of the output file is generated by replacing the extension of the file name with ".adb". Any extension may be used, but by convention the extension ".adq" is used. If you are using make, add the following lines to your makefile and process works automatically. .SUFFIXES: .adb .adq ESQL=esql .adq.adb: $(ESQL) $(ESQLFLAGS) $*.adq The resulting adb file has to be compiled as it is well known using the GNAT. Implementation Note The generated code is based on a support package, which is used to interface with ODBC. All object names generated by the translator begin with the string GNADE_. It is strongly recommended to avoid such names in the application code in order to avoid an conflicts. Invocation of the GNU ESQL Translator (gesql) gesql -pedantic -debugcode -iso92 -nosqlstate -limit number -schema file -debug -v -s -h, --help -gnatnosref -Dname=value file The command translates embedded SQL statement into Ada 95 for the give input file(s) and writes out for each input file an Ada 95 output file by replacing the extension of the input file by ".adb". Options -pedantic The translator will complain about non ISO/92 constructs, even if they are supported. Default is off. -debugcode If this switch is set, debug code is inserted after each query. Default is off. -iso92 If set, a whenever clause is always active till the next whenever clause. The default is off. -nosqlstate If set, the SQLSTATE and SQLCODE variable is not inserted automatically any more. This switch might be used to minimize the porting effort for PRO*Ada code. -limit number Set the maximum number of error before the translator terminates. -debug If this switch is set, the esql translator outputs debugging information. This output should be sent in with bug reports. Default is off. -s No copyright messages are printed at all. -v Verbose mode -schema file If the embedded SQL code contains declare table clauses, the table declaration is mapped into a SQL create table command. This switch is valid for all files compiled after wards. -connectpkg name This switch includes the named package into the expanded Ada 95 source code. This might be used if you like to extend the connection type. -gnatnosref Suppress the insertion of the GNAT pragma Source_Reference. This switch is usefull if you are using some kind of preprocessor on embedded SQL files which are already including this pragma (e.g gnatprep -s). -Dname=value Substitute all occurences of $name in the source file by the given value. This might saves a gnatprep run.
Building Applications using ESQL Using ESQL with make The program listing below shows a minimal Makefile which compile the source file nobel.gpq with embessed SQL code into a program with the name nobel_co (see samples/standalone). A minimal Makefile ESQLFLAGS = $(DEBUG) -v -s -pedantic $(FLAGS) # use always the local esql translator ESQL=gesql DBUSER=gnade DBPASSWD=gnade DBSOURCE=gnade DBAUTH= -DDBUSER=\"$(DBUSER)\" \ -DDBPASSWD=\"$(DBPASSWD)\" \ -DDBSOURCE=\"$(DBSOURCE)\" ## ## New compiler rule ## .SUFFIXES: .adb .gpq .gpq.adb: $(ESQL) $(ESQLFLAGS) $(DBAUTH) $*.gpq all :: nobel_co ## ## nobel_co ## nobel.adb: nobel.gpq nobel_co: nobel_co.adb nobel.adb nobel.ads gnatmake nobel_co -o nobel_co `gnade-config --libs` ### clean: rm -rf $(PROGRAMS) b~*.* *.o *.ali core *~ *~*~ bb.out rm -rf nobel.adb Additional command Line Interface Options An application build with the ESQL translator will support the following command line options. application --esql-warnings --esql-errors Options --esql-warnings If this flag is set, warnigns generated by the esql support package will be printed into standard out. This option is only valid if the Warning procedure has not been overloaded. --esql-errors Errors issued by the esql support package will be printed into standard out. This option id only valid if the Error procedure has not been overloaded.
Redirecting ESQL Support output Since the ESQL support package creates some diagnostic printouts it may be interesting to redirect these messages towards any destination. This might be done by overloading the type Connection_Type of the GNU.DB.ESQL_Support.ODBC package and providing implementations of the Error, Warning and Connect procedures. Redirecting ESQL diagnostics package Dynamic_Connect is type My_Connect_Type is new ODBC.Connection_Type with record .... your extensions ..... end record; procedure Error( C : in My_Connect_Type; T : in String ); procedure Warning( C : in My_Connect_Type; T : in String ); function Connect( Source : in String; UserName : in String; Password : in String ) return ODBC.Connection_Handle; end Dynamic_Connect; The implementation might be found in samples/esql.
gnade-1.6.2.orig/doc/build/faq.sgml0000644000175000017500000000515110023312350016663 0ustar lbrentalbrenta Frequently asked questions This section contains the FAQ's of the GNADE project. Q: How to setup an application development environment Simply copy the contents of the directory samples/standalone to the place where are going to develop you application and modify the makefile accordingly. Q: How can i use GPS with GNADE Pls. refere to the section in the reference. Q: How to handle strings in where clauses I like to use strings in the WHERE clause of a query, but nothing seems to work. In such a situation a length indicator is needed. This is done by adding the INDICATOR keyword as shown below. Using a string in the WHERE clause EXEC SQL BEGIN DECLARE SECTION END-EXEC firstname : CHAR(1..80); .. EXEC SQL END DECLARE SECTION END-EXEC move( name, firstname ); namelength := INDICATOR_TYPE(name'Legnth); SELECT number, ............... contact_postcode, contact_country INTO :stu_number, ............... :stu_contact_postcode, :stu_contact_country FROM STUDENT WHERE name_first = :firstname INDICATOR :namelength Since GNADE version 1.1.9 the data type VARCHAR has been introduced which already includes the length indicator. Q: How to handle connection failures Intercept the DATABASE_ERROR exception as shown below. Intercpetion connection errors begin EXEC SQL CONNECT $DBUSER IDENTIFIED BY $DBPASSWD BY DB01 TO $DBSOURCE ; -- Hallo Test ............... exception when GNU.DB.SQLCLI.DATABASE_ERROR => Put_Line("Connection Error"); ..................... when Others => raise; In addition GNADE esql provide the ON clause in the CONNECT statement which allows to intercept communication and authorization errors. gnade-1.6.2.orig/doc/build/gfdl.sgml0000644000175000017500000004761707257167121017070 0ustar lbrentalbrenta GNU Free Documentation License Version 1.1, March 2000
Copyright (C) 2000 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
PREAMBLE The purpose of this License is to make a manual, textbook, or other written document "free" in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others. This License is a kind of "copyleft", which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software. We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference. APPLICABILITY AND DEFINITIONS This License applies to any manual or other work that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. The "Document", below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as "you". A "Modified Version" of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language. A "Secondary Section" is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document's overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (For example, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them. The "Invariant Sections" are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. The "Cover Texts" are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License. A "Transparent" copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, whose contents can be viewed and edited directly and straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup has been designed to thwart or discourage subsequent modification by readers is not Transparent. A copy that is not "Transparent" is called "Opaque". Examples of suitable formats for Transparent copies include plain ASCII without markup, Texinfo input format, LaTeX input format, SGML or XML using a publicly available DTD, and standard-conforming simple HTML designed for human modification. Opaque formats include PostScript, PDF, proprietary formats that can be read and edited only by proprietary word processors, SGML or XML for which the DTD and/or processing tools are not generally available, and the machine-generated HTML produced by some word processors for output purposes only. The "Title Page" means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, "Title Page" means the text near the most prominent appearance of the work's title, preceding the beginning of the body of the text. VERBATIM COPYING You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3. You may also lend copies, under the same conditions stated above, and you may publicly display copies. COPYING IN QUANTITY If you publish printed copies of the Document numbering more than 100, and the Document's license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects. If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages. If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a publicly-accessible computer-network location containing a complete Transparent copy of the Document, free of added material, which the general network-using public has access to download anonymously at no charge using public-standard network protocols. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public. It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document. MODIFICATIONS You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version: Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the original publisher of that version gives permission. List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has less than five). State on the Title page the name of the publisher of the Modified Version, as the publisher. Preserve all the copyright notices of the Document. Add an appropriate copyright notice for your modifications adjacent to the other copyright notices. Include, immediately after the copyright notices, a license notice giving the public permission to use the Modified Version under the terms of this License, in the form shown in the Addendum below. Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document's license notice. Include an unaltered copy of this License. Preserve the section entitled "History", and its title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the Title Page. If there is no section entitled "History" in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence. Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the "History" section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission. In any section entitled "Acknowledgements" or "Dedications", preserve the section's title, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein. Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles. Delete any section entitled "Endorsements". Such a section may not be included in the Modified Version. Do not retitle any existing section as "Endorsements" or to conflict in title with any Invariant Section. If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version's license notice. These titles must be distinct from any other section titles. You may add a section entitled "Endorsements", provided it contains nothing but endorsements of your Modified Version by various parties--for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard. You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one. The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version. COMBINING DOCUMENTS You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice. The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work. In the combination, you must combine any sections entitled "History" in the various original documents, forming one section entitled "History"; likewise combine any sections entitled "Acknowledgements", and any sections entitled "Dedications". You must delete all sections entitled "Endorsements." COLLECTIONS OF DOCUMENTS You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects. You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document. AGGREGATION WITH INDEPENDENT WORKS A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, does not as a whole count as a Modified Version of the Document, provided no compilation copyright is claimed for the compilation. Such a compilation is called an "aggregate", and this License does not apply to the other self-contained works thus compiled with the Document, on account of their being thus compiled, if they are not themselves derivative works of the Document. If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one quarter of the entire aggregate, the Document's Cover Texts may be placed on covers that surround only the Document within the aggregate. Otherwise they must appear on covers around the whole aggregate. TRANSLATION Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License provided that you also include the original English version of this License. In case of a disagreement between the translation and the original English version of this License, the original English version will prevail. TERMINATION You may not copy, modify, sublicense, or distribute the Document except as expressly provided for under this License. Any other attempt to copy, modify, sublicense or distribute the Document is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. FUTURE REVISIONS OF THIS LICENSE The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See http://www.gnu.org/copyleft/. Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this License "or any later version" applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation.
gnade-1.6.2.orig/doc/build/gnade.sgml0000644000175000017500000007122310056104653017210 0ustar lbrentalbrenta ]> GNADE User's Guide GNADE, The GNat Ada Database Environment Version 1.5.3 Document Revision $Revision: 1.45 $ $Date: 2004/05/29 13:01:31 $ Version 1.3 Michael Erdmann The Ada for Linux Team
Berlin
Georgenhausen
March 2001: First Edition. May 2001: Release of 1.1.5. Nov 2001: Release of 1.2.0. Feb 2002: Release of 1.3.0. May 2002: Release of 1.3.3. Sept. 2002: Release of 1.3.7. Apr. 2003: Release of 1.4.2. Aug. 2003: Release of 1.5.0. Mar. 2004: Release of 1.6.0. $Revision: 1.45 $ $Date: 2004/05/29 13:01:31 $ $Author: merdmann $ 2001, 2002 J.Pfeifer, M. Erdmann
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with the Front-Cover Texts being "The GNat Ada Database Environment". A copy of the license is included in the section entitled "GNU Free Documentation License".
Preface This document describes the GNADE project application and implementation wise. The document is intended as a living document for developers and users of the GNADE project. Introduction Project Objectives The objective of the GNADE project is to provide an open source environment of tools and libraries in order to integrate SQL into Ada 95. In order to achieve this ODBC and embedded SQL have be selected as platform. ODBC provides the interface between application code and the underlying dbcs. This interface has been selected because most if the commonly used data bases are providing ODBC. Embedded SQL (ESQL) provides the framework to integrate SQL queries into the Ada code. ESQL has been selected because there exists a huge amount of legacy code which could be reused. Even ESQL is standardized there are a lot of different implementations around. The ESQL translator in this project tries to merge several ESQL dialects into a single translator. In long terms the project will provide means to integrate features which are not part of the ISO/92 ESQL specification via extensions of ESQL. Software License The GNU Public License (GPL) applies with the following extension to all software components of this project. As a special exception, if other files instantiate generics from GNADE Ada units, or you link GNADE Ada units or libraries with other files to produce an executable, these units or libraries do not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License. Trademarks Red Hat is a registered trademark of Red Hat, Inc.. Linux is a registered trademark of Linus Torvalds. UNIX is a registered trademark of The Open Group. Alpha is a registered trademark of the Digital Equipment Corporation. Windowsis a registered trademark of the Microsoft Corporation. Supported Databases and OS platforms The table below given an overview about the supported operating systems and databases. For the detailed versions for each product, consult the release notes of the relevant GNADE version. Supported Platforms Linux Redhat 7.0 Postures Automatically handled by the configure script Linux Redhat 7.0 MySQL Automatically handled by the configure script Linux Redhat 7.0 MimerSQL Automatically handled by the configure script SuSe 7.0 Postgres Automatically handled by the configure script Windows NT Postgres The makefile in ./win32 do not support any automatic configuration and installation of the test database. Windows NT Mimer The makefile in ./win32 do not support any automatic configuration and installation of the test database. Windows 2000 MySQL The makefile in ./win32 do not support any automatic configuration and installation of the test database. Windows 98 Oracle 8i This is not completly automatically installed.
Getting started The GNADE project distribution is currently distributed as development snapshot and installable packages. The development snapshot needs to be recompiled on the target system since it does not contains any binary files. The installable packages are only available for the platforms below: Linux The following RPM's are available this platform: gnade-X.Y.Z-NNN.src.rpm This package contains the source code ready to compile for the linux platform. gnade-X.Y.Z-NNN.i686.rpm This package contains precomplied binaries and all required libraries to build ODBC based applications. Windows 2000/98/XP setup.exe The setup for windows provides precompiled executables and libaries for windows and a source tree of the GNADE sources. The development package contains the sources for all platforms so far supported. GNADE support the two major platforms Windows NT and Unix/Linux. The following sections are describing the installation steps for both platforms. Building GNADE on different platforms Installation of the development snapshot on a Unix like systems After you obtained the source code from the net you need to install and compile it. This chapter describes this first steps of installing the environment onto your system. Unpacking the distribution The source code is normally distributed as compressed tar file. To unpack the distribution execute the command: gunzip -c gnade-src-x.y.z.tar.gz | tar xvf - This will unpack the directory tree of the development environment. Configuring the GNADE installation The GNADE environment may be configured to a certain extend. The file make.conf.in contains some parameters which might be adopted to the needs of your system. After unpacking the distribution change into the top level directory of the GNADE release. Before you run the configure script examine the contents of the file etc/config.site. site_bindir="/usr/bin" site_libdir="/usr/lib" site_adadir="/usr/lib/ada" Because system wide installation of GNADE depends on the type of your system please adopt the following parameters in make.conf.in before executing the configure script as shown below. cd gnade-src-.... ./configure [ --sampledb=<database> ] [ <native> ] The configure script allowes you to by means of the --sampledb to create a test data base. Additionaly you may give a list of RDBMS producs for which you like to build native bindings. If nothing is given, only the ODBC interfaces relevant part of GNADE will be build. For the supported data base products please check the README file in the gnade directory. If you don't have one of the supported data bases on your system then omit the database. As a result the samples code will be compiled except the code for native bindings, but the sample data base will not be available. Preparation of the test data base In order to allow the installation of the test database, most of the commonly known dbcs's require a data base user to be installed. This normally required certain DBA privileges. There for this step is expected to be done manual as shown below (The name of the user, the name of the data base is specified in make.conf.in). su <dbcs root> gmake createuser The user may be deleted by the command make removeuser. In order to test the functionality of the data base you may create the test data base already at this point by the following commands: gmake removedb gmake createdb This will create a database gnade which contains at least the table EMPLOYEES which may be checked manually. Mimer SQL In case of Mimer SQL the user is created as root, but the make createdb command has to be executed as the same user which is used to run the test examples. If thus is not done, the examples will fail! Compiling To build the GNADE executable enter the command below: gmake all This will build all components of the GNADE project and the test data base is this has not been done previously. Installing GNADE globally on the system The development environment is self containing, which means as long as applications are developed in the directory where GNADE is installed and the make files are used, all components are taken from the GNADE lib directory. This method limits the use to one user. In order to make GNADE available to all users on your system you need to install the GNADE libraries. Installation is done as root by executing the directory the following command: gmake install This should install the libraries of the GNADE project in your system. Integration with IDE Products The GNADE environment provides limited support for the GPS product of ACT by integrating this document into the GPS help system. In order to integrate with GPS, the environment variable GPS_DOC_PATH has to include the installation directory of GNADE (e.g. /usr/local/gnade/doc). Building the development snapshot on Windows NT/XP Unpacking the distribution The source code is normally distributed as ZIP file, which is easy to unpack by means of Windows utilities as e.g WinZip. From the DOS command line use: unzip gnade-src-arch-version.zip cd gnade-src-arch-version This will unpack the directory tree of the development environment. Configuring the release The configuation is based upon the configuration file make.conf.win32 which is located in the root directory of the destribution. Normally you do not need to change anything in this configuration file. To be sure please review the contents of this file before you contiune. In oder to configure GNADE run the command below in the root directory of the GNADE distribution. configure Compiling the distribution As for Unix the compilation process is based upon the execution of a Makefile. In order to compile the distribution perform the following commands: gmake Installation on your system There is no automatic procedure doing so, but after compilation the result will be located in the following directories an can be moved to suitable places in your system. win32-bin contains all executables of GNADE win32-lib Contains all libaries win32-include Contains all Ada specification and body files win32-libexec All executables which are only used by gnade it self win32-doc All documentation is stored here after production. For windows this directory is nt used. shared All shared resources are stored here including the GNADE SDK project file. is nt used. Using the pre compiled packaged Installation of RPM files on Linux Systems First time installation of the RPM is done by means of the following command: rpm -ivh gnade-X.Y.Z-build-arch.rpm If a version of GNADE has been installed previously deinstall this version before installing the new version. rpm -e gnade-X.Y.Z The installation will provide a variable GNADE_BASEPATH which points to the installation directory of GNADE. The individual user on the system needs to add the GNADE project file to his ADA_PROJECT_PATH if he/she wants to use this project file. ADA_PROJECT_PATH=$ADA_PROJECT_PATH:$GNADE_PATH/shared Since the binaries release does not contain the gnade source tree, this package needs also to be installed if you want to do some changes to the GNADE software it self.This packages is simply installed by executing the command: rpm -ivh gnade-X.Y.Z-build-src.rpm Installation on Windows like systems Download the windows setup file and execute the setup program in any directory. The installation program will prompt for the place where GNADE is to be installed. Select any place you feel is reasonable. The default is c:\gnade. GNADE Addon Packages Each release of the GNADE project provides several add on packages. These individual packages are candiates for later integration into the GNADE source distribution. In order to install such packages the GNADE source distribution has to be installed and these packages have to be installed on top of this distribution. In order to install add on packages change into the base directory of the GNADE project and follow the instructions below: OCI - Oracle Call Interface This package provides an API for Oracle. cd dbi gunzip -c oci-source-version.tar.gz | tar xvf - cd oci-source-version make GSQL - Generic SQL Interface This package provides a small application based upon the ODBC interface. The application allowes to create tables and the queries. This is still an experimental application. The GUI implementation will be reworked as soon as possible by switching to glade. To build the software you need GtkAda installed and execute the following commands in the installation directory of GNADE. cd contrib gunzip -c gsql-source-version.tar.gz | tar xvf - cd gsql-source-version gmake Integration with IDES from other vendors Using Emacs The GNADE project uses several file extension which are not commonly defined in the emacs default configuration. As a consequence syntax high ligthing is not activated. In order to activate syntax highlighting again the following lines have to be added to to .emacs file in your home directory: (setq auto-mode-alist (append '(("\\.C$" . c++-mode) ("\\.cc$" . c++-mode) ("\\.hh$" . c++-mode) ("\\.adq$" . ada-mode) ("\\.gpq$" . ada-mode) ("\\.gpb$" . ada-mode) ("\\.c$" . c-mode) ("\\.h$" . c-mode)) auto-mode-alist)) Using GPS GNADE integrates with GPS to a certain extend. For more details please refere to the corresponding chapter later in the book. Using the release with your database The GNADE package provides a small test data base for the examples stored under ./samples. The Makefile assumes for each supported data base vendor X a ./samples/X directory where the example code for the native binding is stored. The ODBC bases examples are using all the same data base stored under ./samples/sample_db. This data base contains the tables EMPLOYEES and DEPARTEMENTS. If your data base is not supported If your data base is not supported the test data base has to be installed manually or preferably the data base has to be included in the configuration process which is described in the following. The DML commands to create the data base are contained in the gnade.postgres.sql file which can be used as a template for the new data base. The following files have to be created for the new DBCS vendor X. Makefile.X This Makefile has the targets createuser, removeuser and createdb, removedb. gnade.X.sql This file contains the DML's for the creation of the data base. README.X This file contains a data base specific readme which is shown after createdb, removedb. removeuser.X, createuser.X These files do contains the command required to create a data base user which is allowed to create tables and able to read the gnade data base. Installation of the ODBC Interface In order to allow the test programs to connect to the data base via odbc the following entry has to be added either to /etc/odbc.ini or .odbc.ini on Unix systems. During the process of configuration, templates for the ODBC wise installation of the data base are prepared under ./samples/sample_db as shown below. /etc/odbc.ini entry for the test data base [DEMO_DB] Description = Demo Database for GNADE Driver = PostgreSQL Database = gnade Servername = localhost Port = 5432 ReadOnly = No RowVersioning = No ShowSystemTables = No ShowOidColumn = No FakeOidIndex = No ConnSettings = Trace = Yes TraceFile = sql.log Prepared Example Programs All examples are located in the directories samples and contrib. In the directory samples you will find the following files and directories: Makefile This is the makefile which builds all examples esql Several examples demonstrating the features of the esql translator. All example programs are using the test database as it is generated while building the GNADE distribution. Examples of embedded SQL simple This demonstrates a simple like SELECT. There are two version demonstrating the capability to process different comilation units. nobel_co This examples demonstrates the uage of nested cusrsors and enhanced connection management. dynamic A nice example for using dynamic sql with the esql translator. attachment This example demonstrates the usage of the GNADE SQL types VARCHAR and VARBINARY. This example allows to store/delete and retrieve the contents of a file from a test database.
mysql Example for the MySQL native bindings This example creates it's own data base called "testdb" and issues a query. The query result is printed out. odbc An example how to use the ODBC interface directly. A simple example that executes a query on the gnade test data base. postgres Example for the Postgres native bindings A simple example that executes a query on the gnade test data base.
Contact The home page for the project is located at http://gnade.sourceforge.net. All project activities are maintained at http://sourcefroge.net/projects/gnade All technical communication regarding the GNADE project is done via a mailing list which is hosted at http://cert.uni-stuttgart.de/mailman/listinfo/gnade-dev. The coordination of the development work is done by:
Michael Erdmann Michael.Erdmann@snafu.de
Authors These are the authors and copyright holders of the GNADE software (in alphabetical order of their last name): Denis Chalon denis.chalon@itris.fr Dimitry Anisimkov anisimkov@yahoo.com François Fabien fr.fabien@infonie.fr Juergen Pfeifer juergen.pfeifer@gmx.net Julio Cano julius_bip@yahoo.com Michael Erdmann michael.erdmann@snafu.de Stephen Leake stephen_leake@acm.org Sune Falck sunef@hem.passagen.se
&docesql; &docodbc; &bindings; &ado; &oci &tools &gps &faq &gnudb &porting &gfdl &gpl
gnade-1.6.2.orig/doc/build/gnade.words0000644000175000017500000000324207307201761017403 0ustar lbrentalbrentaadamysql adb adq aka aliased API ATTR BININSTALL cd ConnectionHandle ConnSettings contrib createdb createuser db DBA dBase dbcs DBCS dbcs's dbi debugcode dep depno Depno deptno DEPTNO DLL DM DML DML's DocBook DSN DTD dvi emp empno EMPNO EndFlag ENV EnvironmentHandle Erdmann esql ESQL ESQLFLAGS FakeOidIndex Falck firstname Firstname FIRSTNAME Firstname'Access Firstname'Length generics Georgenhausen gnade GNADE gnatmake gnuada goto GOTO GPL gunzip Hereinafter html ini INI Juergen Jürgen ladamysql largs LaTeX Len'Access LIBINSTALL licensor lmysqlclient localhost makefile Makefile Makefiles Manager'Access MERCHANTABILITY Mimer MimerSQL multi mysql MySQL MYSQL Name'Access Name'Length Nbr noiso nosqlstate odbc ODBC OV PARAM paren pdf PDF Pfeifer postgres Postgres PostgreSQL PostScript qId qID readme README ReadOnly Redhat redistributors releasenotes removedb removeuser REOPENABLE RowVersioning Servername ServerName sf SGML ShowOidColumn ShowSystemTables SLONG SMALLINT sql SQL SQLAllocHandle SQLBindCol SQLBindParameter sqlca SQLCA SQLCancel SQLCloseCursor SQLCODE SQLColumns SQLCommit SQLConnect SQLCopyDesc SQLDescribeCol SQLDisconnect SQLEndTran SQLERROR SQLExecDirect SQLExecute SQLFetch SQLFetchScroll SQLFixNTS SQLFreeHandle SQLFreeStmt SQLGetConnectAttr SQLGetCursorName SQLGetData SQLGetDiagField SQLGetDiagRec SQLGetEnvAttr SQLGetFunctions SQLGetInfo SQLGetStmtAttr SQLGetTypeInfo SQLINTEGER SQLNativeSql SQLNumParams SQLNumResultCols SQLParamData SQLPrepare SQLPutData SQLRowCount SQLSetEnvAttr SQLSpecialColumns SQLSTATE SQLStatistics SQLTables SQLWARNING src StatementHandle STMT su sublicense Sune SuSe testdb Texinfo Torvalds TraceFile tuple Tuples UNICes UserName usr WinZip gnade-1.6.2.orig/doc/build/gnudb.sgml0000644000175000017500000000711107303720124017222 0ustar lbrentalbrenta The GNU.DB Packages GNU.DB.ESQL_Support This package contains procedure and functions common to all data base interfaces used by the gesql. Most of the functions located in this package are dedicated to the mapping between ISO/92 and Ada 95 data types. String related type conversion with SQL_STANDARD; use SQL_STANDARD; with GNU.DB.ESQL_SUPPORT; use GNU.DB.ESQL_SUPPORT; function To_String( Item : in SQL_STANDARD.CHAR ) return String; procedure To_String( Item : in SQL_STANDARD.CHAR; Target : out String ); procedure Move( S : in String ; C : out Sql_Standard.Char ); These function is used to convert between ISO/92 Strings and the Ada String type. SQL Communication Area This package contains the definition of the SQL communication area, which is updated after each issued sql query. type SQLCA_Type is record Message : aliased String(1..255 ); State : aliased SQLSTATE_TYPE; SqlCode : aliased SQLCODE_TYPE; end record; The field Message contains a string which is generated by the underlying dbcs in case of errors as informational string. State and SQLCODE contain the result of the last query. The state variable is a string of 4 characters. The first 2 characters denote the class of the state. The constants SUCCESS_CLASS, WARNING_CLASS and NOT-FOUND_CLASS may be used to distinguish the different error classes as shown below: if SQLCA.State(1..2) = NOTFOUND_CLASS then ..... end if; Exceptions This package defines some implementation defined exceptions. Out_Of_Resources : exception ; No_Reopenable_Cursor : exception ; The Out_Of_Resources exception is raised by the ESQL_Support module in case where no more internal resources are available. Normally there is no recovery possible and the application should terminate cleanly. The exception No_Reopenable_Cursor is raised, if a cursor is opened which is not declared as reopen able or local. ODBC related packages The packages supporting the ODBC interface ar listed below: GNU.DB.SQLCLI.Bind GNU.DB.sqlcli-connection_attribute-debug.ads GNU.DB.Sqlcli.Connection_attribute GNU.DB.Sqlcli.Desc GNU.DB.Sqlcli.Diag GNU.DB.Sqlcli.Dispatch GNU.DB.Sqlcli.Environment_attribute-debug GNU.DB.Sqlcli.Environment_attribute GNU.DB.Sqlcli.Generic_attr-bitmap_attribute GNU.DB.Sqlcli.Generic_attr-boolean_attribute GNU.DB.Sqlcli.Generic_attr-boolean_string_attribute GNU.DB.Sqlcli.Generic_attr-context_attribute GNU.DB.Sqlcli.Generic_attr-enumerated_attribute GNU.DB.Sqlcli.Generic_attr-integer_attribute GNU.DB.Sqlcli.Generic_attr-pointer_attribute GNU.DB.Sqlcli.Generic_attr-string_attribute GNU.DB.Sqlcli.Generic_attr-unsigned_attribute GNU.DB.Sqlcli.Generic_attr GNU.DB.Sqlcli.Info-debug GNU.DB.Sqlcli.Info GNU.DB.Sqlcli.Statement_attribute-debug GNU.DB.Sqlcli.Statement_attribute GNU.DB.Sqlcli gnade-1.6.2.orig/doc/build/gpl.sgml0000644000175000017500000003564707262711147016735 0ustar lbrentalbrenta GNU Public License (GPL) Version 2 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS gnade-1.6.2.orig/doc/build/gps.sgml0000644000175000017500000000464010033070410016706 0ustar lbrentalbrenta GNADE and the GPS from ACT Introduction The GNADE project components integrate with GPS of ACT by means of help files, usage of project files and some external tools. After installation of the GNADE package by means of RPM (Linux) or Setup.exe program (Windows), GNADE provides a top level project file which contains most of the defintiontion needed to use GNADE. The location of this project file called gnade.gpr is defined by the environment variable GNADE_BASEPATH. This variable needs to be included in the ADA_PROJECT_PATH allowing the GNAT and GPS to access this project file. GPS Project Files After installation of the GNADE components a typical project file for a project using embedded SQL is shown below: with "gnade"; project Nobel is for Languages use ("Ada"); for Source_Dirs use ("."); for Object_Dir use "."; for Main use ("nobel_co.adb" ); for Exec_Dir use "."; package Linker is for Default_Switches ("ada") use ("-g", LibOpt, "-lgnadeaux", "-lgnadeodbc", "-L" & gnade.DMLOC, "-l" & gnade.DMLIB ); end Linker; package Binder is for Default_Switches ("ada") use ("-static"); end Binder; package Compiler is for Default_Switches ("ada") use ("-g", GNADE.IncludeOPT ); end Compiler; package Builder is for Default_Switches ("ada") use ("-s", "-m", "-g", "-gnatQ", GNADE.IncludeOPT); end Builder; package Ide is for Vcs_Kind use "CVS"; end Ide; end Nobel; Most of the common defintions are taken from the common GNADE project files. If your are developing a pure ODBC Option it will be sufficient to execute "Build" "Make" "Project" from the GPS Menu. If you are developing SW involving the esql translator a preprocessing run on the embedded SQL source is needed before compiling the source. Unfortunatly the GPS does not allow to execute preprocessor runs. Therefore you have to rely on a Makefile doing the job. This can be done by means of "Build" "Make" "Custom Make". gnade-1.6.2.orig/doc/build/gps_index.xml0000644000175000017500000000032607711546325017756 0ustar lbrentalbrenta gnade.html GNU Ada Database Environment (GNADE) General /Help/GNADE gnade-1.6.2.orig/doc/build/oci.sgml0000644000175000017500000000352407433455371016716 0ustar lbrentalbrenta OCI - Oracle Call Interface Introduction Basic Concepts Hostvariables Statements select * from employees where name = :myname Resultset Using the OCI packages A Sample Application select * from employees where name = :myname Building a Sample Application The Ada95 Interface to Oracle® RDBMS~Y is depend only from Oracle Call Interface library (OCI). The applications using the OCI should be linked with a static or dynamic OCI libraries provided by Oracle corporation. The descriptions of linking for the different UNIX platforms is in the "Oracle Administrator's Reference" chapters "Oracle Call Interface" and "Oracle Precompiler and Oracle Call Interface Linking and Makefiles" There are written that for the UNIX platforms you should do linking like the $ORACLE_HOME/rdbms/demo/demo_rdbms.mk does. Things to know gnade-1.6.2.orig/doc/build/odbc.sgml0000644000175000017500000004561407603124702017047 0ustar lbrentalbrenta ODBC bindings for Ada 95 Introduction to ODBC The ODBC interface provides an interface between applications and an underlying data base in such a way, that the application code does not depend on the underlying data base. The ODBC interface consists of a so called driver manager and the ODBC driver it self. The driver manager (DM) is a library that on one site offers the specified ODBC API to applications. The DM therefore is what you essentially link to your application. But in large parts the DM routines are only stubs. At run time the DM decides which database to access and based on the type of the database which vendors database ODBC driver to load. So basically most DM implementations require that the OS supports dynamic linking and that the database vendors provide the database site of the ODBC drivers as dynamic loadable entity (aka DLL or shared libraries). But the DM does more than just to provide these stubs and the dynamic linking of the corresponding implementations. As ODBC evolves over time, the DM is also responsible to handle the situation that with a new version of ODBC new API entries are defined, but they are not available in a database driver because this driver was developed when an earlier version of ODBC was the rule (for example we now have ODBC 3.52 and the MySQL ODBC driver is written for ODBC 2.5x). So an application might link against an ODBC 3.52 DM and use all the new and hot ODBC entries, although the database used doesn't have them in its ODBC driver. The DM usually reacts in one of two ways: it raises an error indicating an unsupported call. it emulates the new call by translating it to a previous (maybe deprecated) call or series of calls. Funny enough this happens quite often and the way how to emulate a new call by existing ones is in most cases exactly described in the ODBC spec. The mechanism how to select the right driver is system dependent, but the principal idea is that you have some kind of repository where you associate logical names with configuration information telling the DM the specifics which driver to load. On Win32 this repository can be the registry or so called DSN-files, on UNIX this is mostly an ODBC.INI file containing the information in some structured fashion. The application opens the database by specifying such a logical name and its the task of the DM to consult the repository and to dynamically load the right database driver. In this way, a carefully written application can not only be written in a database independent fashion (using the ODBC API), but also the resulting binary can be dynamically configured to use different databases. This is what makes ODBC so successful on Win32 and will make it more and more important also on UNICes. You can write very generic data aware code ranging from applications like MS Access that can operate on any database that supports ODBC, to GUI widgets like data grids that you can incorporate into your GUI application and that binds "magically" to nearly any database you want. The database ODBC driver is typically a sharable object that implements the ODBC interface on the database site and is loaded by the DM. In theory - although quite uncommon - you may link such a driver directly to your application. This will work if your application makes only ODBC calls that are implemented by the ODBC version used when writing the database driver. Your application then is written in a database independent fashion, but the binary is bound to a specific database. Using the Ada 95 ODBC Bindings General remarks The ODBC binding for Ada 95 presented in this project is a thin binding to the ODBC interface following the naming conventions of ODBC which means most of the commonly available code examples may be applied to Ada 95 only with minor changes due to the fact, that C and Ada 95 are completely different languages. Therefore we will not describe the ODBC API here in detail. Please read the original documentation from Microsoft or any other source you can find. We will discuss here only the binding specific aspects. A minimal odbc example A code fragments of minimal ODBC program are shown below. The code fragment consists of three basic sections, the initialization code, the connections to the data base and the query it self (the source code is found in the samples/odbc directory). Preparing data of the ODBC driver SQLAllocHandle (SQL_HANDLE_ENV, SQL_NULL_HANDLE, EnvironmentHandle); SQLSetEnvAttr (EnvironmentHandle, Environment_Attribute_ODBC_Version' (Attribute => SQL_ATTR_ODBC_VERSION, Value => SQL_OV_ODBC3)); SQLAllocHandle (SQL_HANDLE_DBC, EnvironmentHandle, ConnectionHandle); This section connects to the data base. In this case named by the name "gnade" with the password "gnade". Connecting to the data base via ODBC SQLConnect (ConnectionHandle => ConnectionHandle, ServerName => "DEMO_DB", UserName => "gnade", Authentication => "gnade"); After the connection has been established, the query has to be done. Let us assume a query like: SELECT name, firstname FROM employees WHERE manager = :name; Assuming this query, the query will be sent to the dbcs by means of the SQLPrepare method. This will not create any result set, but it binds the command to the previously allocated statement handle. Preparing the Query via ODBC declare ...... Name, Firstname : aliased Name_String; Len_Firstname, Len_Name : aliased SQLINTEGER; begin SQLAllocHandle (SQL_HANDLE_STMT, ConnectionHandle, StatementHandle); SQLPrepare (StatementHandle, "SELECT " & QuoteIdentifier ("name") & ", " & QuoteIdentifier ("firstname") & " FROM " & QuoteIdentifier ("employees") & " " & "WHERE " & QuoteIdentifier ("manager") & " = ? " & "ORDER BY " & QuoteIdentifier ("name") & "," & QuoteIdentifier ("firstname")); Using host variable with ODBC The host variable :name is substituted by a '?' sign in the query and the Ada 95 variable "Search_Manager". The columns name and first name of the query are bound the the Ada 95 host variable Name and Firstname. MB.SQLBindParameter (StatementHandle, 1, SQL_PARAM_INPUT, SQL_C_SLONG, SQL_INTEGER, 0, 0, Search_Manager'Access, 0, Len'Access); SB.SQLBindCol (StatementHandle, 1, SQL_C_CHAR, Name'Access, Name'Length, Len_Name'Access); SB.SQLBindCol (StatementHandle, 2, SQL_C_CHAR, Firstname'Access, Firstname'Length, Len_Firstname'Access); Creating the result set for a query Finally the result set is created by executing the query at the data base. SQLExecute (StatementHandle); Fetching data of the result set via ODBC The following section reads in one result tuple after the other by means of the SQLFetch method. The result is stored in the host variable which have been specified in the SQLBindCol methods in the previous steps. declare EndFlag : Boolean := False; begin loop exit when EndFlag; SQLFetch (StatementHandle); SQLFixNTS (String (Name), Len_Name); SQLFixNTS (String (Firstname), Len_Firstname); Put (String (Name (1 .. Integer (Len_Name)))); Put (", "); Put (String (Firstname (1 .. Integer (Len_Firstname)))); New_Line; end loop; exception when No_Data => EndFlag := True; end; end; After the result set has been processed, the we disconnect from the data base and return all held resources to the odbc driver. SQLCommit (ConnectionHandle); SQLDisconnect (ConnectionHandle); SQLFreeHandle (SQL_HANDLE_DBC, ConnectionHandle); SQLFreeHandle (SQL_HANDLE_ENV, EnvironmentHandle); Implemented ODBC methods The methods exported by the odbc packages do follow the same naming conventions as the ODBC standard. The methods listed below are implemented in this release. SQLAllocHandle SQLBindCol SQLBindParameter SQLCancel SQLCloseCursor SQLColumns SQLConnect SQLCopyDesc SQLDescribeCol SQLDisconnect SQLEndTran SQL_Error_Message SQLExecDirect SQLExecute SQLFetch SQLFetchScroll SQLFreeHandle SQLFreeStmt SQLGetConnectAttr SQLGetCursorName SQLGetData SQLGetDiagField SQLGetDiagRec SQLGetEnvAttr SQLGetFunctions SQLGetInfo SQLGetStmtAttr SQLGetTypeInfo SQL_LEN_BINARY_ATTR SQL_LEN_DATA_AT_EXEC SQLNativeSql SQLNumParams SQLNumResultCols SQLParamData SQLPrepare SQLPutData SQLRowCount SQLSetEnvAttr SQLSpecialColumns SQLStatistics SQLTables Building ODBC based programs The root package of the ODBC binding is GNU.DB.SQLCLI. We've chosen the name SQLCLI to indicate that our main focus is to implement at least the Command Level Interface (CLI) of SQL/92. ODBC is an enhanced implementation of CLI. Depending on your platform you must add the path to the package sources and the compiled files to you ADA_INCLUDE_PATH and ADA_OBJECTS_PATH. If you're using a platform that supports shared libraries, the libadaodbc.so file should be in a directory searched by your dynamic linker automatically or you must add the directory containing this file to your LD_LIBRARY_PATH. The ODBC binding references the calls offered by an ODBC driver manager. The GNADE project doesn't implement its own driver manager, but it relies on the one you are using on your system. Please consult your system documentation to find the name of the library that implements the driver manager. On Linux we suggest to use the unixODBC driver manager (http://www.unixodbc.org). If you use this one, you have to add "-largs -lodbc" to your gnatmake arguments if you want to compile an ODBC program. Ada95 aspects of the ODBC binding The ODBC API typically maintains a set of resources on behalf of the calling application, such as an ODBC Environment, Connections, Statements etc. All those resources have attributes that can be set or get by an application. These attributes have different data types. As a rather low level API ODBC is oriented to wards low level languages like C. For the above mentioned access to the attributes of various resources the API implements calls in such a way that you have to specify a pointer to a chunk of memory and a parameter containing the length of this area in bytes and then the API fills the area of memory with data or reads data from the area. It's up to the caller to make sure that the so described memory area contains valid data of a type expected by the call. A "C" language prototype of a typical call of this category looks like this: SQLRETURN SQLGetConnectAttr( SQLHDBC ConnectionHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER *StringLength); SQLRETURN SQLSetConnectAttr( SQLHDBC ConnectionHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER StringLength); The parameter "Attribute" is actually an enumeration. An integer number denotes the attribute you're interested in. Different attributes have different data types and there is no rule for the mapping of attributes to their type. You have to read the documentation! We think this is not the level of type safety we should provide to Ada95 clients of this API. We therefore implemented the following scheme to deal with this mapping problem. We will not describe the internals of this scheme here, but how to use it in your application. The core of the mapping mechanism is the generic package GNU.DB.SQLCLI.Dispatch which you never will instantiate directly. Lets for example take the connection attributes of the ODBC API to demonstrate the use. You'll find the connection attribute handling in the package GNU.DB.SQLCLI.Connection_Attribute. What you find there is an enumeration type named SQL_CONNECTION_ATTRIBUTE. This type represents the plain SQLINTEGER parameter of the above mentioned C API call. In this package you'll find these instantiations: package Connection_Attributes is new GNU.DB.SQLCLI.Generic_Attr (Context => SQLHDBC, T => SQL_CONNECTION_ATTRIBUTE, Base => SQLINTEGER, Get => Get_Connect_Attr, Set => Set_Connect_Attr, Default_Context => Null_Handle); subtype Connection_Attribute is Connection_Attributes.Attribute_Value_Pair; package Dispatch is new GNU.DB.SQLCLI (Connection_Attribute); The generic package GNU.DB.SQLCLI.Generic_Attr defines an abstract tagged type Attribute_Value_Pair. This type has a single component: "Attribute", which is of the enumeration type to be mapped (formal parameter T in the above instantiation). There exist derived types from this abstract type for the various data types that are possible as attributes (bitmap, boolean, boolean_string, context, enumerated, integer, pointer, string, unsigned). All these derived types add one additional component to the abstract base type: "Value" whose type is selected according to the needs of the attribute to be mapped. The dispatch package has the instantiation of the generic as parameter and does set up internally all mappings necessary to return a correctly typed Attribute_Value_Pair'Class for an attribute enumeration value. The C API calls now translate into these Ada95 calls: function SQLGetConnectAttr (ConnectionHandle : SQLHDBC; Attribute : SQL_CONNECTION_ATTRIBUTE; MaxLength : SQLSMALLINT := SQL_MAX_OPTION_STRING_LENGTH) return Connection_Attribute'Class; procedure SQLSetConnectAttr (ConnectionHandle : in SQLHDBC; AttrRec : in Connection_Attribute'Class); If you look into the package GNU.DB.SQLCLI.Connection_Attribute you for example find there this definition type ACCESS_MODE is (SQL_MODE_READ_WRITE, SQL_MODE_READ_ONLY); for ACCESS_MODE'Size use SQLINTEGER'Size; SQL_MODE_DEFAULT : constant ACCESS_MODE := SQL_MODE_READ_WRITE; package Dsp_Access_Mode is new Dispatch.A_Enumerated (SQL_ATTR_ACCESS_MODE, ACCESS_MODE, SQLINTEGER, "ACCESS_MODE"); subtype Connection_Attribute_Mode is Dsp_Access_Mode.Info; From this you can see that the connection attribute SQL_ATTR_ACCESS_MODE is mapped to an enumerated type ACCESS_MODE. So a call to set the access mode looks like this: SQLSetConnectAttr (connHandle, Connection_Attribute_Mode'( Attribute => SQL_ATTR_ACCESS_MODE, Value => SQL_MODE_READ_ONLY) ); and a call to get the attribute may look like this: declare attr : Connection_Attribute_Mode; begin attr := Connection_Attribute_Mode( SQLGetConnectAttr (connHandle, SQL_ATTR_ACCESS_MODE) ); end; Note that the type conversion is required to do the dynamic type check of the function return which returns a Connection_Attribute'Class value. You'll find this technique in these packages: GNU.DB.SQLCLI.Info GNU.DB.SQLCLI.Connection_Attribute GNU.DB.SQLCLI.Statement_Attribute GNU.DB.SQLCLI.Environment_Attribute Due to the dynamic type checking implemented for the attribute handling, all calls dealing with attributes will cost some more cycles than a direct call to the plain C API. All other ODBC calls are a very thin layer around the C API. As attribute set/get calls are rare compared to queries etc. this is acceptable. But it explains while a - in theory - thin binding is compiled into a rather huge library. This is because all the type mapping information is compiled into the library. gnade-1.6.2.orig/doc/build/porting.sgml0000644000175000017500000000275407333022311017611 0ustar lbrentalbrenta Porting legacy code This section describes the migration steps for migrating from legacy code to GNADE embedded SQL. Because only a limited number of ports have been performed this section will evolve over the time. Migrating from Oracle to GNADE The Oracle product seems to have a lot of extension compared to ISO/92. Migrating from Oracle to GNADE using ODBC has to be done manually. Host variables All host variables have to be moved into the DECLARE section and the types of these variables has to be reworked as it is required by ISO/92. Query Results The default SQLCA with the name ORACLE does not exist. Due to the fact, that the contents of the GNADE SQLCA is different this code has to be reworked manually. Others The ESQL translator of Oracle supports non ISO/92 WHENEVER clauses which are supported by the GNU ESQL translator as well. Due to the fact, that ODBC requires different parameters for the CONNECT clause this has to be reworked as well. gnade-1.6.2.orig/doc/build/tools.sgml0000644000175000017500000001333307646316101017274 0ustar lbrentalbrenta GNADE command line tools Introduction The GNADE project provides some elementary command line tools on top of the ODBC interface. lsodbc - Display data source information lsodbc -u login -l password -l source Display all available information about all or a certain odbc source. Options -u login [-l password] The login name used for the database associated with the source name. This makes only sense if the contents of a certain data source has to be checked, since the login/passwd is only sent once and it will be applied to all given data sources, which is proably not correct. -l Show longest format of the available information.
sql - execute an sql command sql -u login -l password -q -h source sql query Execute an sql command on the given data source. The result of the query will be printed into stdout. If the -q switch is not given a copyright notice and a header line will be printed out. Options -u login [-l password] The login name used for the database associated with the source name. This makes only sense if the contents of a certain data source has to be checked, since the login/passwd is only sent once and it will be applied to all given data sources, which is proably not correct. -q Run quiet by not printing out the copyright and other notices. -h Print out a help message.
exp - export a table from a data base exp -u login -l password -q -h source table [-f filename] Export the named table located in the given data source into a file. The named file is intended for the use by the imp (import) tool. Options -u login [-l password] The login name used for the database associated with the source name. This makes only sense if the contents of a certain data source has to be checked, since the login/passwd is only sent once and it will be applied to all given data sources, which is proably not correct. -f filename Specifies the name of the export file. If not given the name tablename.exp will be used. This option is only allowed after a table name has been given. -q Run quiet by not printing out the copyright and other notices. -h Print out a help message.
imp - import data into a table from export files imp -u login -l password -q -h source table file Import one or more export file into a table which is located in the data source specified by the source parameter. Options -u login [-l password] The login name used for the database associated with the source name. This makes only sense if the contents of a certain data source has to be checked, since the login/passwd is only sent once and it will be applied to all given data sources, which is proably not correct. -q Run quiet by not printing out the copyright and other notices. -h Print out a help message.
gnade-1.6.2.orig/doc/releasenotes/0000755000175000017500000000000011040716254016633 5ustar lbrentalbrentagnade-1.6.2.orig/doc/releasenotes/note_0.9d.html0000644000175000017500000001564607257421346021246 0ustar lbrentalbrenta No title

GNU Ada 95 Database Developement Environment - (GNADE)

Version 0.9d

J. Pfeifer / M.Erdmann

25.3.2001

Content

This release provides a thin binding to the ODBC interfaces, an embedded SQL translator which processes Ada 95 sources with embedded SQL, some basic documentation and some samples demonstrating the basic functionality. The release is targted for Linux based systems but is expected to work on other *nix systems as well.

The software is distributed as compressed (gzip) tar file named:

gnade-src-linux-gnu-0.9d.tar.gz

Contact

Bug Reports http://sourcefore.net/projects/gnade M.Erdmann
GNADE Discussions http://cert.uni-stuttgart.de/mailman/listinfo/gnade-dev Florian Weimer
Project Page http://gnade.sourceforge.net/ M.Erdmann
Dev. Coordination Michael.Erdmann@snafu.de M.Erdmann

Authors

The following authors have contributed to this release::

Jürgen Pfeifer juergen.pfeifer@gmx.net>
Michael Erdmann Michael.Erdmann@snafu.de
Sune Falck sunef@hem.passagen.se
Florin Weimer Florian.Weimer@RUS.Uni-Stuttgart.DE

License

The GNU Public License (GPL) applies with the following extension to all software components in this release

As a special exception, if other files instantiate generics from GNADE Ada units, or you link GNADE Ada units or libraries with other files to produce an executable, these units or libraries do not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.

The documentation has been put under the Free GNU Documentation License.

Fixed Problems

Bug Ref. Short Description Comments
411143 configure does not fail. The configure.in script has been updated and aborts if the library check failes or one of the GNAT components is missing.

Known Problems

Bug Ref. Short Description Comments
411141 Missing ";" for "EXEC SQL DECLARE DB01 D This problem may be bypassed by putting a semicolon in the source code.

The documentation is only distributed as HTML format, because the pdf files generated by docbook are faulty.

Installation

The installation of this software requires the following components:

Component Version Source
gzip
tar
autoconf 2-13-9
make 3.79.1 GNU
gnat 1.13p GNU

In order to install and compile the distribution in your working directory, perform the following steps:

gunzip -c gnade-src-linux-gnu-<version>.tar.gz | tar xvf -
cd gnade-src-linux-gnu-0.9d
./configure <dbname>
make clean
make all

gnade-1.6.2.orig/doc/releasenotes/note_0.9e.html0000644000175000017500000002045607261437214021236 0ustar lbrentalbrenta No title

GNU Ada 95 Database Developement Environment - (GNADE)

Version 0.9e

J. Pfeifer / M.Erdmann

30.3.2001

Content

This release provides a thin binding to the ODBC interfaces, an embedded SQL translator which processes Ada 95 sources with embedded SQL, some basic documentation and some samples demonstrating the basic functionality. The release is targted for Linux and Windows NT Systems.

The software of this release is contained in the following files:

File Contents
gnade-src-0.9e.tar.gz Complete GNADE distribution GNU compressed tar file
gnade-src-0.9e.zip Complete GNADE distribution as ZIP file.

Contact

Bug Reports http://sourcefore.net/projects/gnade M.Erdmann
GNADE Discussions http://cert.uni-stuttgart.de/mailman/listinfo/gnade-dev Florian Weimer
Project Page http://gnade.sourceforge.net/ M.Erdmann
Dev. Coordination Michael.Erdmann@snafu.de M.Erdmann

Authors

The following authors have contributed to this release:

Jürgen Pfeifer juergen.pfeifer@gmx.net>
Michael Erdmann Michael.Erdmann@snafu.de
Sune Falck sunef@hem.passagen.se
Florin Weimer Florian.Weimer@RUS.Uni-Stuttgart.DE

License

The GNU Public License (GPL) applies with the following extension to all software components in this release

As a special exception, if other files instantiate generics from GNADE Ada units, or you link GNADE Ada units or libraries with other files to produce an executable, these units or libraries do not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.

The documentation has been put under the Free GNU Documentation License.

Fixed Problems

Bug Ref. Short Description Comments
411143 configure does not fail. The configure.in script has been updated and aborts if the library check failes or one of the GNAT components is missing.

Known Problems

Bug Ref. Short Description Comments
411141 Missing ";" for "EXEC SQL DECLARE DB01 D This problem may be bypassed by putting a semicolon in the source code.

The documentation is only distributed as HTML format, because the pdf files generated by docbook are faulty.

Installation

The installation of this software requires the following components:

Component Version Source
gzip
unzip
zip
tar
autoconf*1 2-13-9
make 3.79.1 GNU
gnat 1.13p GNU
gawk GNU

Note 1:

autconf is only required on Linux/Unix Systems for windows a special set of makefiles is provided.

In order to install and compile the distribution under Unix in your working directory, perform the following steps:

$ gunzip -c gnade-src-linux-gnu-<version>.tar.gz | tar xvf -
$ cd gnade-src-linux-gnu-<version>
$ ./configure <dbname>
$ make clean
$ make all

For window users a zip file is provided. In order to install perform the following steps:

> unzip gnade-src-linux-gnu-<version>.zip
> cd gnade-src-linux-gnu-<version>/win32
> make 
                                   
This will build the gnade software on your system. 
gnade-1.6.2.orig/doc/releasenotes/note_0.9f.html0000644000175000017500000002050007261437214021225 0ustar lbrentalbrenta No title

GNU Ada 95 Database Developement Environment - (GNADE)

Version 0.9f

J. Pfeifer / M.Erdmann

31.3.2001

Content

This release provides a thin binding to the ODBC interfaces, an embedded SQL translator which processes Ada 95 sources with embedded SQL, some basic documentation and some samples demonstrating the basic functionality. The release is targted for Linux and Windows NT Systems.

The software and documentation of this release is contained in the following files:

File Contents
gnade-src-0.9f.tar.gz Complete GNADE distribution GNU compressed tar file
gnade-src-0.9f.zip Complete GNADE distribution as ZIP file.

Contact

Bug Reports http://sourcefore.net/projects/gnade M.Erdmann
GNADE Discussions http://cert.uni-stuttgart.de/mailman/listinfo/gnade-dev Florian Weimer
Project Page http://gnade.sourceforge.net/ M.Erdmann
Dev. Coordination Michael.Erdmann@snafu.de M.Erdmann

Authors

The following authors have contributed to this release:

Jürgen Pfeifer juergen.pfeifer@gmx.net>
Michael Erdmann Michael.Erdmann@snafu.de
Sune Falck sunef@hem.passagen.se
Florin Weimer Florian.Weimer@RUS.Uni-Stuttgart.DE

License

The GNU Public License (GPL) applies with the following extension to all software components in this release

As a special exception, if other files instantiate generics from GNADE Ada units, or you link GNADE Ada units or libraries with other files to produce an executable, these units or libraries do not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.

The documentation has been put under the Free GNU Documentation License.

Fixed Problems

Bug Ref. Short Description Comments
411143 configure does not fail. The configure.in script has been updated and aborts if the library check failes or one of the GNAT components is missing.

Known Problems

Bug Ref. Short Description Comments
411141 Missing ";" for "EXEC SQL DECLARE DB01 D This problem may be bypassed by putting a semicolon in the source code.

The documentation is only distributed as HTML format, because the pdf files generated by docbook are faulty.

Installation

The installation of this software requires the following components:

Component Version Source
gzip
unzip
zip
tar
autoconf*1 2-13-9
make 3.79.1 GNU
gnat 1.13p GNU
gawk GNU

Note 1:

autconf is only required on Linux/Unix Systems for windows a special set of makefiles is provided.

In order to install and compile the distribution under Unix in your working directory, perform the following steps:

$ gunzip -c gnade-src-linux-gnu-<version>.tar.gz | tar xvf -
$ cd gnade-src-linux-gnu-<version>
$ ./configure <dbname>
$ make clean
$ make all

For window users a zip file is provided. In order to install perform the following steps:

> unzip gnade-src-linux-gnu-<version>.zip
> cd gnade-src-linux-gnu-<version>/win32
> make 
                                   
This will build the gnade software on your system. 
gnade-1.6.2.orig/doc/releasenotes/note_0.9h.html0000644000175000017500000002216407264076225021243 0ustar lbrentalbrenta No title

GNU Ada 95 Database Developement Environment - (GNADE)

Version 0.9h

J. Pfeifer / M.Erdmann

31.3.2001

Content

This release provides a thin binding to the ODBC interfaces, an embedded SQL translator which processes Ada 95 sources with embedded SQL, some basic documentation and some samples demonstrating the basic functionality. The release is targeted for Linux and Windows NT Systems.

The software and documentation of this release is contained in the following files:

File Contents
gnade-src-0.9h.tar.gz Complete GNADE distribution GNU compressed tar file
gnade-src-0.9h.zip Complete GNADE distribution as ZIP file.

Contact

Bug Reports http://sourcefore.net/projects/gnade M.Erdmann
GNADE Discussions http://cert.uni-stuttgart.de/mailman/listinfo/gnade-dev Florian Weimer
Project Page http://gnade.sourceforge.net/

http://sourcefore.net/projects/gnade

M.Erdmann
Dev. Coordination Michael.Erdmann@snafu.de M.Erdmann

Authors

The following authors have contributed to this release:

Jürgen Pfeifer juergen.pfeifer@gmx.net>
Michael Erdmann Michael.Erdmann@snafu.de412931
Sune Falck sunef@hem.passagen.se
Florin Weimer Florian.Weimer@RUS.Uni-Stuttgart.DE

License

The GNU Public License (GPL) applies with the following extension to all software components in this release

As a special exception, if other files instantiate generics from GNADE Ada units, or you link GNADE Ada units or libraries with other files to produce an executable, these units or libraries do not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.

The documentation has been put under the Free GNU Documentation License.

Fixed Problems

Bug Ref. Short Description Comments
411143 configure does not fail. The configure.in script has been updated and aborts if the library check failes or one of the GNAT components is missing
412931 Ada compiler not found On FreeBSD and Solaris the ada compiler is not found even it is there. The configuration procedure assumes the name of the compiler based on the build OS name.
412885 Distribution not instalble on Solaris A prebuild version of the configure script was missing. If the target system does not support autoconf, the files in ./autoconf should never touched.
412884 HTML Documentation files where missing The prebuild version of the documentation was missing. The make dist traget has been changed.

Known Problems

Bug Ref. Short Description Comments
411141 Missing ";" for "EXEC SQL DECLARE DB01 D This problem may be bypassed by putting a semicolon in the source code.

The documentation is only distributed as HTML format, because the pdf files generated by docbook are faulty.

Installation

The installation of this software requires the following components:

Component Version Source
gzip
unzip
zip
tar
autoconf*1 2-13-9
make 3.79.1 GNU
gnat 1.13p GNU
gawk GNU

Note 1:

autconf is only required on Linux/Unix Systems for windows a special set of makefiles is provided.

Installation on Linux/Unix

$ gunzip -c gnade-src-linux-gnu-<version>.tar.gz | tar xvf -
$ cd gnade-src-linux-gnu-<version>
$ ./configure <dbname>
$ make clean
$ make all

Installation on Windows NT

For window users a zip file is provided. In order to install perform the following steps:

> unzip gnade-src-linux-gnu-<version>.zip
> cd gnade-src-linux-gnu-<version>/win32
> make 
                                   
This will build the gnade software on your system. 
gnade-1.6.2.orig/doc/releasenotes/note_0.9i.html0000644000175000017500000003610407263021367021237 0ustar lbrentalbrenta No title

GNU Ada 95 Database Developement Environment - (GNADE)

Version 0.9i

Editor M.Erdmann

4.4.2001

Content

This release provides a thin binding to the ODBC interfaces, an embedded SQL translator which processes Ada 95 sources with embedded SQL, some basic documentation and some sample code demonstrating the basic functionality of the package. This release supports the first time MySQL database for Linux and Windows.

This release is targeted for the operating systems Linux, Solaris and Windows NT/2000 Systems.

The software and documentation of this release is contained in the following files:

File Size in Bytes Contents
gnade-src-0.9i.tar.gz 235762 Complete GNADE distribution GNU compressed tar file
gnade-src-0.0i.zip 406511 Complete GNADE distribution as ZIP file.

Restrictions

The configure script is known to fail on Solaris 8 and other operating system.

Copyright, License and Authors

The GNU Public License (GPL) applies with the following extension to all software components in this release

As a special exception, if other files instantiate generics from GNADE Ada units, or you link GNADE Ada units or libraries with other files to produce an executable, these units or libraries do not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.

The documentation has been put under the Free GNU Documentation License.

These are the authors and copyright holders of the GNADE software:

Jürgen Pfeifer juergen.pfeifer@gmx.net>
Michael Erdmann Michael.Erdmann@snafu.de412931
Sune Falck sunef@hem.passagen.se

Contact

Bug Reports http://sourcefore.net/projects/gnade M.Erdmann
GNADE Discussions http://cert.uni-stuttgart.de/mailman/listinfo/gnade-dev Florian Weimer
Project Page http://gnade.sourceforge.net/

http://sourcefore.net/projects/gnade

M.Erdmann
Dev. Coordination Michael.Erdmann@snafu.de M.Erdmann

Fixed Problems

Bug Ref. Version

Short Description

Comments
411143 0.9g configure does not fail. The configure.in script has been updated and aborts if the library check failes or one of the GNAT components is missing
412931 0.9h Ada compiler not found On FreeBSD and Solaris the ada compiler is not found even it is there. The configuration procedure assumes the name of the compiler based on the build OS name.
412885 0.9h Distribution not instalable on Solaris A prebuild version of the configure script was missing. If the target system does not support autoconf, the files in ./autoconf should never touched.
412884 0.9h HTML Documentation files where missing The prebuild version of the documentation was missing. The make dist traget has been changed.
413658 0.9i MyODBC 2.50.36 failes with 0.9h The offending SQL primitive has been removed.
413660 0.9i Long_String looks not nice Patch from Sune Falck has been inserted

Known Problems

Bug Ref. Short Description Comments
411141 Missing ";" for "EXEC SQL DECLARE DB01 D This problem may be bypassed by putting a semicolon

in the source code.

The documentation is only distributed as HTML format, because the pdf files generated by docbook are faulty.

Installation

The installation of this software requires the following components:

Component Version Origin
gzip GNU
unzip GNU
zip
tar
autoconf*1 2-13-9 GNU
make 3.79.1 GNU
gnat 1.13p ALT distribution
gawk GNU

Note 1:

autconf is only required on Linux/Unix Systems for windows a special set of makefiles is provided.

Installation on Linux/Unix

In order to install the GNADE release perform the following steps:

$ gunzip -c gnade-src-linux-gnu-<version>.tar.gz | tar xvf -
$ cd gnade-src-linux-gnu-<version>
$ ./configure <dbname>

Depending on the installation of the data base you have specified in the configure script command, you have to execute the following step either by using a DBA account our you may use your own user account.

$ su ..dba..
$ make createuser

After the creation of the data base user, the final build may be done by:

$ make

If this installation procedure failes you may use the Makefile under ./win32. This makefile is known to work at least on Solaris well if the correct driver manager is installed (see section other components).

Installation on Windows NT

For window users a zip file is provided. In order to install perform the following steps:

> unzip gnade-src-linux-gnu-<version>.zip
> cd gnade-src-linux-gnu-<version>/win32
> make 
                                   
The issue regarding the installation of a data base user has to be dony by hand. 
The windows makefile  uses the make.conf file which is prebuild by the ./configure script. Any configuration
change has to be done there. Please refere to the README file in ./win32.

Other components

The following Driver Manager are known to work with the release:

Component Description Version Operating System Comments
iODBC ODBC Driver Manager 3.50 Solaris 8 www.iodbc.org
unixODC ODBC Driver Manager 1.8.12-2 Linux www.unixodbc.org


The following data base products are known to work with this release:
Component Description Version Operating System Distribution/Source of the release
Postgres Postgres Database 3.50 Linux RedHat 7.0
Lunix SuSe 7.0
Windows NT
MySQL MySQL Database

MyODBC

3.23.22

2.50.36-1

Linux www.mysql.com
MySQL Database

MyODBC

3.23.35a

2.50.36

Windows 2000 www.mysql.com

Contributions

Special regards to the following persons which have contributed to the project:

Florian Weimer Florian.Weimer@RUS.Uni-Stuttgart.DE
François Fabien. fr.fabien@infonie.fr
Pascal Obry p.obry@wanadoo.fr

gnade-1.6.2.orig/doc/releasenotes/note_0.9j.html0000644000175000017500000003634207263162245021245 0ustar lbrentalbrenta No title

GNU Ada 95 Database Developement Environment - (GNADE)

Version 0.9j

Editor M.Erdmann

4.4.2001

Content

This release provides a thin binding to the ODBC interfaces, an embedded SQL translator which processes Ada 95 sources with embedded SQL, some basic documentation and some sample code demonstrating the basic functionality of the package.

This release supports the first time MySQL database for Linux and Windows.

This release is targeted for the operating systems Linux, Solaris and Windows NT/2000 Systems.

The software and documentation of this release is contained in the following files:

File Size in Bytes Contents
gnade-src-0.9j.tar.gz 245259 Complete GNADE distribution GNU compressed tar file
gnade-src-0.9j.zip 445876 Complete GNADE distribution as ZIP file.

Restrictions

The configure script is known to fail on Solaris 8 and other operating system.

Copyright, License and Authors

The GNU Public License (GPL) applies with the following extension to all software components in this release

As a special exception, if other files instantiate generics from GNADE Ada units, or you link GNADE Ada units or libraries with other files to produce an executable, these units or libraries do not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.

The documentation has been put under the Free GNU Documentation License.

These are the authors and copyright holders of the GNADE software:

Jürgen Pfeifer juergen.pfeifer@gmx.net>
Michael Erdmann Michael.Erdmann@snafu.de412931
Sune Falck sunef@hem.passagen.se

Contact

Bug Reports http://sourcefore.net/projects/gnade M.Erdmann
GNADE Discussions http://cert.uni-stuttgart.de/mailman/listinfo/gnade-dev Florian Weimer
Project Page http://gnade.sourceforge.net/

http://sourcefore.net/projects/gnade

M.Erdmann
Dev. Coordination Michael.Erdmann@snafu.de M.Erdmann

Fixed Problems

Bug Ref. Version

Short Description

Comments
411143 0.9g configure does not fail. The configure.in script has been updated and aborts if the library check failes or one of the GNAT components is missing
412931 0.9h Ada compiler not found On FreeBSD and Solaris the ada compiler is not found even it is there. The configuration procedure assumes the name of the compiler based on the build OS name.
412885 0.9h Distribution not instalable on Solaris A prebuild version of the configure script was missing. If the target system does not support autoconf, the files in ./autoconf should never touched.
412884 0.9h HTML Documentation files where missing The prebuild version of the documentation was missing. The make dist traget has been changed.
413658 0.9i MyODBC 2.50.36 failes with 0.9h The offending SQL primitive has been removed.
413660 0.9i Long_String looks not nice Patch from Sune Falck has been inserted
413687 0.9j test sample gnerates exception Change in esql_support. Pointer not intialized.

Known Problems

Bug Ref. Short Description Comments
411141 Missing ";" for "EXEC SQL DECLARE DB01 D This problem may be bypassed by putting a semicolon

in the source code.

The documentation is only distributed as HTML format, because the pdf files generated by docbook are faulty.

Installation

The installation of this software requires the following components:

Component Version Origin
gzip GNU
unzip GNU
zip
tar
autoconf*1 2-13-9 GNU
make 3.79.1 GNU
gnat 1.13p ALT distribution
gawk GNU

Note 1:

autconf is only required on Linux/Unix Systems for windows a special set of makefiles is provided.

Installation on Linux/Unix

In order to install the GNADE release perform the following steps:

$ gunzip -c gnade-src-linux-gnu-<version>.tar.gz | tar xvf -
$ cd gnade-src-linux-gnu-<version>
$ ./configure <dbname>

Depending on the installation of the data base you have specified in the configure script command, you have to execute the following step either by using a DBA account our you may use your own user account.

$ su ..dba..
$ make createuser

After the creation of the data base user, the final build may be done by:

$ make

If this installation procedure failes you may use the Makefile under ./win32. This makefile is known to work at least on Solaris well if the correct driver manager is installed (see section other components).

Installation on Windows NT

For window users a zip file is provided. In order to install perform the following steps:

> unzip gnade-src-linux-gnu-<version>.zip
> cd gnade-src-linux-gnu-<version>/win32
> make 
                                   
The issue regarding the installation of a data base user has to be dony by hand. 
The windows makefile  uses the make.conf file which is prebuild by the ./configure script. Any configuration
change has to be done there. Please refere to the README file in ./win32.

Other components

The following Driver Manager are known to work with the release:

Component Description Version Operating System Comments
iODBC ODBC Driver Manager 3.50 Solaris 8 www.iodbc.org
unixODC ODBC Driver Manager 1.8.12-2 Linux www.unixodbc.org


The following data base products are known to work with this release:
Component Description Version Operating System Distribution/Source of the release
Postgres Postgres Database 3.50 Linux RedHat 7.0
Lunix SuSe 7.0
Windows NT
MySQL MySQL Database

MyODBC

3.23.22

2.50.36-1

Linux www.mysql.com
MySQL Database

MyODBC

3.23.35a

2.50.36

Windows 2000 www.mysql.com

Contributions

Special regards to the following persons which have contributed to the project:

Florian Weimer Florian.Weimer@RUS.Uni-Stuttgart.DE
François Fabien. fr.fabien@infonie.fr
Pascal Obry p.obry@wanadoo.fr

gnade-1.6.2.orig/doc/releasenotes/note_0.9k.html0000644000175000017500000004667407264374043021261 0ustar lbrentalbrenta No title

GNU Ada 95 Database Developement Environment - (GNADE)

Version 0.9k

Editor M.Erdmann

9.4.2001

Content

This release 0.9k is a preview on the planned version 1.0 of the GNADE project. It is intended for the platforms Linux, Solaris and Windows NT/2000 and features:

  • An extensive thin Ada 95 binding to the ODBC interfaces.
  • ISO/92 complient embedded SQL translator which processes Ada 95 packages creating Ada 95 modules working on top the of the ODBC interface.
  • Installation support for some commonly known data base products (see below).
  • Documentation in html format.
  • Native Ada 95 bindings for MySQL and Postgres.

New in this release are several bug fixes and the first time support for the MimerSQL Database.

The following data base products are known to work with this release, assuming, that you are using the correct driver manager (see section "Other Components").

Component Description Version OS Distribution/Source of the release
Postgres Postgres Database 7.0.3 www.postgresql.org
3.50 Lunix RedHat 7.0
Lunix SuSe 7.0
Windows NT
Mimer Mimer SQL RDBMS www.mimer.com
8.2.1B Solaris 8
8.2.3B Linux RedHat 7.0
MySQL MySQL Database

MyODBC

3.23.22

2.50.36-1

Linux www.mysql.com
MySQL Database

MyODBC

3.23.35a

2.50.36

Windows 2000 www.mysql.com

The software and documentation of this release is contained in the following files:

File Size in Bytes Contents
gnade-src-0.9k.tar.gz 248348 Complete GNADE distribution GNU compressed tar file
gnade-src-0.9k.zip 420612 Complete GNADE distribution as ZIP file.

Copyright, License and Authors

The GNU Public License (GPL) applies with the following extension to all software components in this release

As a special exception, if other files instantiate generics from GNADE Ada units, or you link GNADE Ada units or libraries with other files to produce an executable, these units or libraries do not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.

The documentation has been put under the Free GNU Documentation License.

The authors and copyright holders of the GNADE project are:

Jürgen Pfeifer juergen.pfeifer@gmx.net>
Michael Erdmann Michael.Erdmann@snafu.de
Sune Falck sunef@hem.passagen.se

Contact

Bug Reports http://sourcefore.net/projects/gnade M.Erdmann
GNADE Discussions http://cert.uni-stuttgart.de/mailman/listinfo/gnade-dev

gnade-dev@cert.uni-stuttgart.de

Florian Weimer
Project Page http://gnade.sourceforge.net/

http://sourcefore.net/projects/gnade

M.Erdmann
Dev. Coordination Michael.Erdmann@snafu.de M.Erdmann

Restrictions

  • The configuration procedure for Solaris has not been tested completly. If it failes please use the Makefiles in the directory ./win32. These files are known to build a working installation under Solaris.
  • The documentation is only distributed as HTML format, because the pdf files generated by docbook are faulty.

Fixed Problems

Bug Ref. Version Short Description Comments
411143 0.9g configure does not fail. The configure.in script has been updated and aborts if the library check failes or one of the GNAT components is missing
412931 0.9h Ada compiler not found On FreeBSD and Solaris the ada compiler is not found even it is there. The configuration procedure assumes the name of the compiler based on the build OS name.
412885 0.9h Distribution not instalable on Solaris A prebuild version of the configure script was missing. If the target system does not support autoconf, the files in ./autoconf should never touched.
412884 0.9h HTML Documentation files where missing The prebuild version of the documentation was missing. The make dist traget has been changed.
413658 0.9i MyODBC 2.50.36 failes with 0.9h The offending SQL primitive has been removed.
413660 0.9i Long_String looks not nice Patch from Sune Falck has been inserted
413687 0.9j test sample gnerates exception Change in esql_support. Pointer not intialized.
414349 0.9k cp failes on Solaris Depending on the OS, different options are used for the cp command.
414350 0.9k Install not found on Solaris The autoconf specific fallback procedures are used which means the install-sh script will be used in case of problems.
414351 0.9k configure terminates on Solaris wih erro The -e parameter for the test command is not supported by Solaris. The parameter -f seems to be more comonly supported.
413687 0.9k test sample gnerates exception A patch has been recevied from Mr. Obry solving the problen in esql_support.adb.
414526 0.9k configure - make directories executed ./configure checks the result of auotconf/configure
414583 0.9k Wrong error message for errors in sql qu Patch from S. Falck added.

Known Problems

Bug Ref. Short Description Comments
411141 Missing ";" for "EXEC SQL DECLARE DB01 D This problem may be bypassed by putting a semicolon

in the source code.

Installation

The installation of this software requires the following components:

Component Version Origin
gzip GNU
unzip GNU
zip
tar
autoconf*1 2-13-9 GNU
make 3.79.1 GNU
gnat 1.13p ALT distribution
gawk GNU

The autoconf utility is only required on Linux/Unix Systems if the configuration scripts have to be changed. For window systems a special set of makefiles in the directory ./win32 is provided which are not using the autoconf facility.

Installation on Linux/Unix

Unpacking and Configuratiuon

$ gunzip -c gnade-src-linux-gnu-<version>.tar.gz | tar xvf -
$ cd gnade-src-linux-gnu-<version>
$ ./configure <dbname>

As dbname the following values are allowed.

  • mimer - MimerSQL
  • postgres - PostgresSQL
  • MySQL - MySQL

If the value is obmitted, all subsequent steps regarding the data base installation may be skiped.

Installation of the Database

Depending on the installation of the data base you have specified in the configure script command, you have to execute the following step either by using a DBA account our you may use your own user account.

$ su ..dba..
$ make createuser

After the database and the database uer has been configured, the ODBC interface has to be configured. The directory ./samples/sample_db contains sample files for the unixODBC driver manager. The files odbc.ini.sample odbcinst.ini.sample have to be copied to /etc/odbc.ini and /etc/ odbcinst.ini.sample.

Compiling an testing

After the creation of the data base user, the final build may be done by:

$ make

Test code is located under ./samples. In order to test the functionality of the ODBC interface youse the examples in ./odbc or ./esql.

If it does not work

If this installation procedure failes you may use the Makefile under ./win32. This makefile is known to work at least on Solaris well if the correct driver manager is installed (see section other components).

Installation on Windows NT

For window users a zip file is provided. In order to install perform the following steps:

> unzip gnade-src-linux-gnu-<version>.zip
> cd gnade-src-linux-gnu-<version>/win32
> make 
                                   
The issue regarding the installation of a data base user has to be dony by hand. 
The windows makefile  uses the make.conf file which is prebuild by the ./configure script. Any configuration
change has to be done there. Please refere to the README file in ./win32.

Other components

The following Driver Manager are known to work with the release:

Component Description Version Operating System Comments
iODBC ODBC Driver Manager 3.0.4 Windows NT www.iodbc.org
unixODC ODBC Driver Manager 1.8.12-2 Linux www.unixodbc.org
2.0.5 Solaris 8

www.unixodbc.org


Warning:

The iODBC 3.04 implementation on Solaris seems to have a problem with the handling of cursor
states. It should not be used. 


Contributions

Special regards to the following persons which have contributed to the project:

Florian Weimer Florian.Weimer@RUS.Uni-Stuttgart.DE
François Fabien. fr.fabien@infonie.fr
Pascal Obry p.obry@wanadoo.fr

gnade-1.6.2.orig/doc/releasenotes/note_0.9l.html0000644000175000017500000004653607265133610021251 0ustar lbrentalbrenta No title

GNU Ada 95 Database Development Environment - (GNADE)

Version 0.9l

Editor M.Erdmann

9.4.2001

Content

This release 0.9l is a preview on the planned version 1.0 of the GNADE project. It is intended for the platforms Linux, Solaris and Windows NT/2000 and features:

  • An extensive thin Ada 95 binding to the ODBC interfaces.
  • ISO/92 compliant embedded SQL translator which processes Ada 95 packages creating Ada 95 modules working on top the of the ODBC interface.
  • Installation support for some commonly known data base products (see below).
  • Documentation in html format.
  • Native Ada 95 bindings for MySQL and Postgres.

New in this release are several bug fixes and the first time support for the MimerSQL Database. Additionaly some spelling errors have been fixed and the PROBLEMS file has been removed.

The following data base products are known to work with this release, assuming, that you are using the correct driver manager (see section "Other Components").

Component Description Version OS Distribution/Source of the release
Postgres PostgreSQL Database 7.0.3
Linux - Redhat 7.0
Linux - SuSe 7.0
Solaris 7
Windows NT/2000
www.postgresql.org
Mimer Mimer SQL RDBMS 8.2
Solaris 7/8
Linux
Windows NT
www.mimer.com
MySQL MySQL Database

MyODBC
3.23.22

2.50.36-1

Linux www.mysql.com
3.23.35a

2.50.36

Windows 2000 www.mysql.com

The software and documentation of this release is contained in the following files:

File Size in Bytes Contents
gnade-src-0.9l.tar.gz 255682 Complete GNADE distribution GNU compressed tar file
gnade-src-0.9l.zip 427284 Complete GNADE distribution as ZIP file.

Copyright, License and Authors

The GNU Public License (GPL) applies with the following extension to all software components in this release

As a special exception, if other files instantiate generics from GNADE Ada units, or you link GNADE Ada units or libraries with other files to produce an executable, these units or libraries do not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.

The documentation has been put under the Free GNU Documentation License.

The authors and copyright holders of the GNADE project are:

Jürgen Pfeifer juergen.pfeifer@gmx.net>
Michael Erdmann Michael.Erdmann@snafu.de
Sune Falck sunef@hem.passagen.se

Contact

Bug Reports http://sourcefore.net/projects/gnade M.Erdmann
GNADE Discussions http://cert.uni-stuttgart.de/mailman/listinfo/gnade-dev

gnade-dev@cert.uni-stuttgart.de

Florian Weimer
Project Page http://gnade.sourceforge.net/

http://sourcefore.net/projects/gnade

M.Erdmann
Dev. Coordination Michael.Erdmann@snafu.de M.Erdmann

Restrictions

  • The configuration procedure for Solaris has not been tested completely. If it fails please use the Makefiles in the directory ./win32. These files are known to build a working installation under Solaris.
  • The documentation is only distributed as HTML format, because the pdf files generated by docbook are faulty.

Fixed Problems

Bug Ref. Version Short Description Comments
411143 0.9g configure does not fail. The configure.in script has been updated and aborts if the library check fails or one of the GNAT components is missing
412931 0.9h Ada compiler not found On FreeBSD and Solaris the Ada compiler is not found even it is there. The configuration procedure assumes the name of the compiler based on the build OS name.
412885 0.9h Distribution not installable on Solaris A prebuilt version of the configure script was missing. If the target system does not support autoconf, the files in ./autoconf should never touched.
412884 0.9h HTML Documentation files where missing The prebuilt version of the documentation was missing. The make dist target has been changed.
413658 0.9i MyODBC 2.50.36 fails with 0.9h The offending SQL primitive has been removed.
413660 0.9i Long_String looks not nice Patch from Sune Falck has been inserted
413687 0.9j test sample generates exception Change in esql_support. Pointer not initialized.
414349 0.9k cp fails on Solaris Depending on the OS, different options are used for the cp command.
414350 0.9k Install not found on Solaris The autoconf specific fallback procedures are used which means the install-sh script will be used in case of problems.
414351 0.9k configure terminates on Solaris with error The -e parameter for the test command is not supported by Solaris. The parameter -f seems to be more commonly supported.
413687 0.9k test sample generates exception A patch has been received from Mr. Obry solving the problem in esql_support.adb.
414526 0.9k configure - make directories executed ./configure checks the result of auotconf/configure
414583 0.9k Wrong error message for errors in sql qu Patch from S. Falck added.

Known Problems

Bug Ref. Short Description Comments
411141 Missing ";" for "EXEC SQL DECLARE DB01 D This problem may be bypassed by putting a semicolon

in the source code.

Installation

The installation of this software requires the following components:

Component Version Origin
gzip 1.2.4 GNU
unzip 5.42 Infozip
zip 2.2 Infozip
tar - GNU or native
autoconf*1 2-13-9 GNU
make 3.79.1 GNU
gnat 3.13p ALT distribution
gawk 3.0.3 GNU

The autoconf utility is only required on Linux/Unix Systems if the configuration scripts have to be changed. For window systems a special set of makefiles in the directory ./win32 is provided which are not using the autoconf facility.

Installation on Linux/Unix

Unpacking and Configuration

$ gunzip -c gnade-src-linux-gnu-<version>.tar.gz | tar xvf -
$ cd gnade-src-linux-gnu-<version>
$ ./configure <dbname>

As dbname the following values are allowed.

  • mimer - MimerSQL
  • postgres - PostgreSQL
  • MySQL - MySQL

If the value is omitted, all subsequent steps regarding the data base installation may be skipped.

Installation of the Database

Depending on the installation of the data base you have specified in the configure script command, you have to execute the following step either by using a DBA account our you may use your own user account.

$ su ..dba..
$ make createuser

After the database and the database user has been configured, the ODBC interface has to be configured. The directory ./samples/sample_db contains sample files for the unixODBC driver manager. The files odbc.ini.sample odbcinst.ini.sample have to be copied to /etc/odbc.ini and /etc/ odbcinst.ini.sample.

Compiling an testing

After the creation of the data base user, the final build may be done by:

$ make

Test code is located under ./samples. In order to test the functionality of the ODBC interface use the examples in ./odbc or ./esql.

If it does not work

If this installation procedure fails you may use the Makefile under ./win32. This makefile is known to work at least on Solaris well if the correct driver manager is installed (see section other components).

Installation on Windows NT

For window users a zip file is provided. In order to install perform the following steps:

> unzip gnade-src-linux-gnu-<version>.zip
> cd gnade-src-linux-gnu-<version>/win32
> make 
                                   
The issue regarding the installation of a data base user has to be done by hand. 
The windows makefile  uses the make.conf file which is prebuilt by the ./configure script. Any configuration
change has to be done there. Please refer to the README file in ./win32.

Other components

The following Driver Manager are known to work with the release:

Component Description Version Operating System Comments
unixODC ODBC Driver Manager 1.8.12-2 Linux www.unixodbc.org
2.0.5 Solaris 8

www.unixodbc.org

The iODBC 3.04 implementation on Solaris seems to have a problem with the handling of cursor states. It should not be used.

Contributions

Special regards to the following persons which have contributed to the project:

Florian Weimer Florian.Weimer@RUS.Uni-Stuttgart.DE
François Fabien. fr.fabien@infonie.fr
Pascal Obry p.obry@wanadoo.fr

gnade-1.6.2.orig/doc/releasenotes/note_0.9m.html0000644000175000017500000004710407265665330021253 0ustar lbrentalbrenta No title

GNU Ada 95 Database Development Environment - (GNADE)

Version 0.9m

Editor M.Erdmann

13.4.2001

Content

This release 0.9m is a preview on the planned version 1.0 of the GNADE project. It is intended for the platforms Linux, Solaris and Windows NT/2000 and features:

  • An extensive thin Ada 95 binding to the ODBC interfaces.
  • ISO/92 compliant embedded SQL translator which processes Ada 95 packages creating Ada 95 modules working on top the of the ODBC interface.
  • Installation support for some commonly known data base products (see below).
  • Documentation in html format.
  • Native Ada 95 bindings for MySQL and Postgres.

New in this release are several bug fixes and the first time support for the MimerSQL Database. Additionally the documentation building process is preceeded by a spell checking step, if the aspell utility is installed.

The following data base products are known to work with this release, assuming, that you are using the correct driver manager (see section "Other Components").

Component Description Version OS Distribution/Source of the release
Postgres PostgreSQL Database 7.0.3
Linux - Redhat 7.0
Linux - SuSe 7.0
Solaris 7
Windows NT/2000
www.postgresql.org
Mimer Mimer SQL RDBMS 8.2
Solaris 7/8
Linux
Windows NT
www.mimer.com
MySQL MySQL Database

MyODBC
3.23.22

2.50.36-1

Linux www.mysql.com
3.23.35a

2.50.36

Windows 2000 www.mysql.com

The software and documentation of this release is contained in the following files:

File Size in Bytes Contents
gnade-src-0.9m.tar.gz 258089 Complete GNADE distribution GNU compressed tar file
gnade-src-0.9m.zip 429917 Complete GNADE distribution as ZIP file.

Copyright, License and Authors

The GNU Public License (GPL) applies with the following extension to all software components in this release

As a special exception, if other files instantiate generics from GNADE Ada units, or you link GNADE Ada units or libraries with other files to produce an executable, these units or libraries do not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.

The documentation has been put under the Free GNU Documentation License.

The authors and copyright holders of the GNADE project are:

Jürgen Pfeifer juergen.pfeifer@gmx.net>
Michael Erdmann Michael.Erdmann@snafu.de
Sune Falck sunef@hem.passagen.se

Contact

Bug Reports http://sourcefore.net/projects/gnade M.Erdmann
GNADE Discussions http://cert.uni-stuttgart.de/mailman/listinfo/gnade-dev

gnade-dev@cert.uni-stuttgart.de

Florian Weimer
Project Page http://gnade.sourceforge.net/

http://sourcefore.net/projects/gnade

M.Erdmann
Dev. Coordination Michael.Erdmann@snafu.de M.Erdmann

Restrictions

  • The configuration procedure for Solaris has not been tested completely. If it fails please use the Makefiles in the directory ./win32. These files are known to build a working installation under Solaris.
  • The documentation is only distributed as HTML format, because the pdf files generated by docbook are faulty.

Fixed Problems

Bug Ref. Fixed with Version Short Description Comments
411143 0.9g configure does not fail. The configure.in script has been updated and aborts if the library check fails or one of the GNAT components is missing
412931 0.9h Ada compiler not found On FreeBSD and Solaris the Ada compiler is not found even it is there. The configuration procedure assumes the name of the compiler based on the build OS name.
412885 0.9h Distribution not installable on Solaris A prebuilt version of the configure script was missing. If the target system does not support autoconf, the files in ./autoconf should never touched.
412884 0.9h HTML Documentation files where missing The prebuilt version of the documentation was missing. The make dist target has been changed.
413658 0.9i MyODBC 2.50.36 fails with 0.9h The offending SQL primitive has been removed.
413660 0.9i Long_String looks not nice Patch from Sune Falck has been inserted
413687 0.9j test sample generates exception Change in esql_support. Pointer not initialized.
414349 0.9k cp fails on Solaris Depending on the OS, different options are used for the cp command.
414350 0.9k Install not found on Solaris The autoconf specific fallback procedures are used which means the install-sh script will be used in case of problems.
414351 0.9k configure terminates on Solaris with error The -e parameter for the test command is not supported by Solaris. The parameter -f seems to be more commonly supported.
413687 0.9k test sample generates exception A patch has been received from Mr. Obry solving the problem in esql_support.adb.
414526 0.9k configure - make directories executed ./configure checks the result of auotconf/configure
414583 0.9k Wrong error message for errors in sql qu Patch from S. Falck added.
415224 0.9m V0.9l windows example are not build GNUmakefile from S. Falck added
416018 0.9m Misstyped online help esql updated.

Known Problems

Bug Ref. Short Description Comments
411141 Missing ";" for "EXEC SQL DECLARE DB01 D This problem may be bypassed by putting a semicolon

in the source code.

Installation

The installation of this software requires the following components:

Component Version Origin
gzip 1.2.4 GNU
unzip 5.42 Infozip
zip 2.2 Infozip
tar - GNU or native
autoconf*1 2-13-9 GNU
make 3.79.1 GNU
gnat 3.13p ALT distribution
gawk 3.0.3 GNU

The autoconf utility is only required on Linux/Unix Systems if the configuration scripts have to be changed. For window systems a special set of makefiles in the directory ./win32 is provided which are not using the autoconf facility.

Installation on Linux/Unix

Unpacking and Configuration

$ gunzip -c gnade-src-linux-gnu-<version>.tar.gz | tar xvf -
$ cd gnade-src-linux-gnu-<version>
$ ./configure <dbname>

As dbname the following values are allowed.

  • mimer - MimerSQL
  • postgres - PostgreSQL
  • MySQL - MySQL

If the value is omitted, all subsequent steps regarding the data base installation may be skipped.

Installation of the Database

Depending on the installation of the data base you have specified in the configure script command, you have to execute the following step either by using a DBA account our you may use your own user account.

$ su ..dba..
$ make createuser

After the database and the database user has been configured, the ODBC interface has to be configured. The directory ./samples/sample_db contains sample files for the unixODBC driver manager. The files odbc.ini.sample odbcinst.ini.sample have to be copied to /etc/odbc.ini and /etc/ odbcinst.ini.sample.

Compiling an testing

After the creation of the data base user, the final build may be done by:

$ make

Test code is located under ./samples. In order to test the functionality of the ODBC interface use the examples in ./odbc or ./esql.

If it does not work

If this installation procedure fails you may use the Makefile under ./win32. This makefile is known to work at least on Solaris well if the correct driver manager is installed (see section other components).

Installation on Windows NT

For window users a zip file is provided. In order to install perform the following steps:

> unzip gnade-src-linux-gnu-<version>.zip
> cd gnade-src-linux-gnu-<version>/win32
> make 
                                   
The issue regarding the installation of a data base user has to be done by hand. 
The windows makefile  uses the make.conf file which is prebuilt by the ./configure script. Any configuration
change has to be done there. Please refer to the README file in ./win32.

Other components

The following Driver Manager are known to work with the release:

Component Description Version Operating System Comments
unixODC ODBC Driver Manager 1.8.12-2 Linux www.unixodbc.org
2.0.5 Solaris 8

www.unixodbc.org

The iODBC 3.04 implementation on Solaris seems to have a problem with the handling of cursor states. It should not be used.

Contributions

Special regards to the following persons which have contributed to the project:

Florian Weimer Florian.Weimer@RUS.Uni-Stuttgart.DE
François Fabien. fr.fabien@infonie.fr
Pascal Obry p.obry@wanadoo.fr

gnade-1.6.2.orig/doc/releasenotes/note_0.9n.html0000644000175000017500000005052707273334650021254 0ustar lbrentalbrenta No title

GNU Ada 95 Database Development Environment - (GNADE)

Version 0.9n

Editor M.Erdmann

31.4.2001

Content

This release 0.9m is a preview on the planned version 1.0 of the GNADE project. It is intended for the platforms Linux, Solaris and Windows NT/2000 and features:

  • An extensive thin Ada 95 binding to the ODBC interfaces.
  • ISO/92 compliant embedded SQL translator which processes Ada 95 packages creating Ada 95 modules working on top the of the ODBC interface.
  • Installation support for some commonly known data base products (see below).
  • Documentation in html format.
  • Native Ada 95 bindings for MySQL and Postgres.

New in this release include the following changes:

  • New include clause which do allow to access the ODBC handles via embedded SQL This allows to mix embedded SQL and low level ODBC programing in a single source (see chpter in documentation)
  • DECLARE TABLE is used to gnerate parts of the schema files (-schema option)
  • The syntax for dynmaic SQL is included, but no code is generated yet.
  • The ODBC Documentation has been updated.

The documentation is available as html format only (./doc/html/gnade.html). The sgml sources are not part of the release.

The following data base products are known to work with this release, assuming, that you are using the correct driver manager (see section "Other Components").

Component Description Version OS Distribution/Source of the release
Postgres PostgreSQL Database 7.0.3
Linux - Redhat 7.0
Linux - SuSe 7.0
Solaris 7
Windows NT/2000
www.postgresql.org
Mimer Mimer SQL RDBMS 8.2
Solaris 7/8
Linux
Windows NT
www.mimer.com
MySQL MySQL Database

MyODBC
3.23.22

2.50.36-1

Linux www.mysql.com
3.23.35a

2.50.36

Windows 2000 www.mysql.com

The software and documentation of this release is contained in the following files:

File Size in Bytes Contents
gnade-src-0.9m.tar.gz 258089 Complete GNADE distribution GNU compressed tar file
gnade-src-0.9m.zip 429917 Complete GNADE distribution as ZIP file.

Copyright, License and Authors

The GNU Public License (GPL) applies with the following extension to all software components in this release

As a special exception, if other files instantiate generics from GNADE Ada units, or you link GNADE Ada units or libraries with other files to produce an executable, these units or libraries do not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.

The documentation has been put under the Free GNU Documentation License.

The authors and copyright holders of the GNADE project are:

Jürgen Pfeifer juergen.pfeifer@gmx.net>
Michael Erdmann Michael.Erdmann@snafu.de
Sune Falck sunef@hem.passagen.se

Contact

Bug Reports http://sourcefore.net/projects/gnade M.Erdmann
GNADE Discussions http://cert.uni-stuttgart.de/mailman/listinfo/gnade-dev

gnade-dev@cert.uni-stuttgart.de

Florian Weimer
Project Page http://gnade.sourceforge.net/

http://sourcefore.net/projects/gnade

M.Erdmann
Dev. Coordination Michael.Erdmann@snafu.de M.Erdmann

Restrictions

  • The configuration procedure for Solaris has not been tested completely. If it fails please use the Makefiles in the directory ./win32. These files are known to build a working installation under Solaris.
  • The documentation is only distributed as HTML format, because the pdf files generated by docbook are faulty.

Fixed Problems

Bug Ref. Fixed with Version Short Description Comments
411143 0.9g configure does not fail. The configure.in script has been updated and aborts if the library check fails or one of the GNAT components is missing
412931 0.9h Ada compiler not found On FreeBSD and Solaris the Ada compiler is not found even it is there. The configuration procedure assumes the name of the compiler based on the build OS name.
412885 0.9h Distribution not installable on Solaris A prebuilt version of the configure script was missing. If the target system does not support autoconf, the files in ./autoconf should never touched.
412884 0.9h HTML Documentation files where missing The prebuilt version of the documentation was missing. The make dist target has been changed.
413658 0.9i MyODBC 2.50.36 fails with 0.9h The offending SQL primitive has been removed.
413660 0.9i Long_String looks not nice Patch from Sune Falck has been inserted
413687 0.9j test sample generates exception Change in esql_support. Pointer not initialized.
414349 0.9k cp fails on Solaris Depending on the OS, different options are used for the cp command.
414350 0.9k Install not found on Solaris The autoconf specific fallback procedures are used which means the install-sh script will be used in case of problems.
414351 0.9k configure terminates on Solaris with error The -e parameter for the test command is not supported by Solaris. The parameter -f seems to be more commonly supported.
413687 0.9k test sample generates exception A patch has been received from Mr. Obry solving the problem in esql_support.adb.
414526 0.9k configure - make directories executed ./configure checks the result of auotconf/configure
414583 0.9k Wrong error message for errors in sql qu Patch from S. Falck added.
415224 0.9m V0.9l windows example are not build GNUmakefile from S. Falck added
416018 0.9m Misstyped online help esql updated.

Known Problems

Bug Ref. Short Description Comments
411141 Missing ";" for "EXEC SQL DECLARE DB01 D This problem may be bypassed by putting a semicolon

in the source code.

Installation

The installation of this software requires the following components:

Component Version Origin
gzip 1.2.4 GNU
unzip 5.42 Infozip
zip 2.2 Infozip
tar - GNU or native
autoconf*1 2-13-9 GNU
make 3.79.1 GNU
gnat 3.13p ALT distribution
gawk 3.0.3 GNU

The autoconf utility is only required on Linux/Unix Systems if the configuration scripts have to be changed. For window systems a special set of makefiles in the directory ./win32 is provided which are not using the autoconf facility.

Installation on Linux/Unix

Unpacking and Configuration

$ gunzip -c gnade-src-linux-gnu-<version>.tar.gz | tar xvf -
$ cd gnade-src-linux-gnu-<version>
$ ./configure <dbname>

As dbname the following values are allowed.

  • mimer - MimerSQL
  • postgres - PostgreSQL
  • MySQL - MySQL

If the value is omitted, all subsequent steps regarding the data base installation may be skipped.

Installation of the Database

Depending on the installation of the data base you have specified in the configure script command, you have to execute the following step either by using a DBA account our you may use your own user account.

$ su ..dba..
$ make createuser

After the database and the database user has been configured, the ODBC interface has to be configured. The directory ./samples/sample_db contains sample files for the unixODBC driver manager. The files odbc.ini.sample odbcinst.ini.sample have to be copied to /etc/odbc.ini and /etc/ odbcinst.ini.sample.

Compiling an testing

After the creation of the data base user, the final build may be done by:

$ make

Test code is located under ./samples. In order to test the functionality of the ODBC interface use the examples in ./odbc or ./esql.

If it does not work

If this installation procedure fails you may use the Makefile under ./win32. This makefile is known to work at least on Solaris well if the correct driver manager is installed (see section other components).

Installation on Windows NT

For window users a zip file is provided. In order to install perform the following steps:

> unzip gnade-src-linux-gnu-<version>.zip
> cd gnade-src-linux-gnu-<version>/win32
> make 
                                   
The issue regarding the installation of a data base user has to be done by hand. 
The windows makefile  uses the make.conf file which is prebuilt by the ./configure script. Any configuration
change has to be done there. Please refer to the README file in ./win32.

Other components

The following Driver Manager are known to work with the release:

Component Description Version Operating System Comments
unixODC ODBC Driver Manager 1.8.12-2 Linux www.unixodbc.org
2.0.5 Solaris 8

www.unixodbc.org

The iODBC 3.04 implementation on Solaris seems to have a problem with the handling of cursor states. It should not be used.

Contributions

Special regards to the following persons which have contributed to the project:

Florian Weimer Florian.Weimer@RUS.Uni-Stuttgart.DE
François Fabien. fr.fabien@infonie.fr
Pascal Obry p.obry@wanadoo.fr

gnade-1.6.2.orig/doc/releasenotes/note_0.9o.html0000644000175000017500000005366307274733155021265 0ustar lbrentalbrenta No title

GNU Ada 95 Database Development Environment - (GNADE)

Version 0.9o

Editor M.Erdmann

5.5.2001

Content

This release 0.9m is a preview on the planned version 1.0 of the GNADE project. It is intended for the platforms Linux, Solaris and Windows NT/2000 and features:

  • An extensive thin Ada 95 binding to the ODBC interfaces.
  • ISO/92 compliant embedded SQL translator which processes Ada 95 packages creating Ada 95 modules working on top the of the ODBC interface.
  • Installation support for some commonly known data base products (see below).
  • Documentation in html format.
  • Native Ada 95 bindings for MySQL and Postgres.

New in this release is:

  • New include clause which do allow to access the ODBC handles via embedded SQL. This allows to mix embedded SQL and low level ODBC programing in a single source (see chpter in documentation)
  • DECLARE TABLE is used to gnerate parts of the schema files (-schema option)
  • The syntax for dynmaic SQL is included, but no code is generated yet.
  • The ODBC Documentation has been updated.
  • The Option -compiler has been added to allow the support of spcifica of different Ada 95 compiliers

Supported Databases

Even the GNADE project except for the native data base bindings is expected to work with all ODBC compilent data base products, the following products are known to work with GNADE assuming, that you are using the correct driver manager (see section "Other Components").

The GNADE project installation procedure provides for theses product test data bases. If your data base is not liseted below, the GNADE project will be very likely usable but the test data base has to be installed manually.

Component Description Version OS Distribution/Source of the release
Postgres PostgreSQL Database 7.0.3
Linux - Redhat 7.0
Linux - SuSe 7.0
Solaris 7
Windows NT/2000
www.postgresql.org
Mimer Mimer SQL RDBMS 8.2
Solaris 7/8
Linux
Windows NT
www.mimer.com
MySQL MySQL Database

MyODBC
3.23.22

2.50.36-1

Linux www.mysql.com
3.23.35a

2.50.36

Windows 2000 www.mysql.com

The software and documentation of this release is contained in the following files:

File Size in Bytes Contents
gnade-src-0.9o.tar.gz 273737 Complete GNADE distribution GNU compressed tar file
gnade-src-0.9o.zip 478991 Complete GNADE distribution as ZIP file.

Copyright, License and Authors

The GNU Public License (GPL) applies with the following extension to all software components in this release

As a special exception, if other files instantiate generics from GNADE Ada units, or you link GNADE Ada units or libraries with other files to produce an executable, these units or libraries do not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.

The documentation has been put under the Free GNU Documentation License.

The authors and copyright holders of the GNADE project are:

Jürgen Pfeifer juergen.pfeifer@gmx.net>
Michael Erdmann Michael.Erdmann@snafu.de
Sune Falck sunef@hem.passagen.se

Contact

Bug Reports http://sourcefore.net/projects/gnade M.Erdmann
GNADE Discussions http://cert.uni-stuttgart.de/mailman/listinfo/gnade-dev

gnade-dev@cert.uni-stuttgart.de

Florian Weimer
Project Page http://gnade.sourceforge.net/

http://sourcefore.net/projects/gnade

M.Erdmann
Dev. Coordination Michael.Erdmann@snafu.de M.Erdmann

Restrictions

  • The configuration procedure for Solaris has not been tested completely. If it fails please use the Makefiles in the directory ./win32. These files are known to build a working installation under Solaris.
  • The documentation is only distributed as HTML format, because the pdf files generated by docbook are faulty.
  • All corrections for ObjectAda have not been tested yet, because the compiler is not available within the GNADE team. If the -compiler aonix switch is used, the following embedded SQL constructs has to be modified as shown below:

    ... empno : CHAR( 1..15) := (others=>' ') ; ---> empno : CHAR := (1..15=>' '); ..

    This is a temporary work around, the next version will contain a solution for this issue.

Fixed Problems

Bug Ref. Fixed with Version Short Description Comments
411143 0.9g configure does not fail. The configure.in script has been updated and aborts if the library check fails or one of the GNAT components is missing
412931 0.9h Ada compiler not found On FreeBSD and Solaris the Ada compiler is not found even it is there. The configuration procedure assumes the name of the compiler based on the build OS name.
412885 0.9h Distribution not installable on Solaris A prebuilt version of the configure script was missing. If the target system does not support autoconf, the files in ./autoconf should never touched.
412884 0.9h HTML Documentation files where missing The prebuilt version of the documentation was missing. The make dist target has been changed.
413658 0.9i MyODBC 2.50.36 fails with 0.9h The offending SQL primitive has been removed.
413660 0.9i Long_String looks not nice Patch from Sune Falck has been inserted
413687 0.9j test sample generates exception Change in esql_support. Pointer not initialized.
414349 0.9k cp fails on Solaris Depending on the OS, different options are used for the cp command.
414350 0.9k Install not found on Solaris The autoconf specific fallback procedures are used which means the install-sh script will be used in case of problems.
414351 0.9k configure terminates on Solaris with error The -e parameter for the test command is not supported by Solaris. The parameter -f seems to be more commonly supported.
413687 0.9k test sample generates exception A patch has been received from Mr. Obry solving the problem in esql_support.adb.
414526 0.9k configure - make directories executed ./configure checks the result of auotconf/configure
414583 0.9k Wrong error message for errors in sql qu Patch from S. Falck added.
415224 0.9m V0.9l windows example are not build GNUmakefile from S. Falck added
416018 0.9m Misstyped online help esql updated.
421586 0.9o ODBC does not compile with ObjectAda Modules have been corrected but the test with ObjectAda are still outstanding.
421587 0.9o ObjectAda Unrstricted_Access not supported. The switch -compiler <name> has been added. Use the value "aonix" to turn of the usage of Unrestricted_Access. Tests with ObjectAda are still outstanding. This compiler switch imposes some restrictions on the embedded sql code.

Known Problems

Bug Ref. Short Description Comments
411141 Missing ";" for "EXEC SQL DECLARE DB01 D This problem may be bypassed by putting a semicolon

in the source code.

Installation

The installation of this software requires the following components:

Component Version Origin
gzip 1.2.4 GNU
unzip 5.42 Infozip
zip 2.2 Infozip
tar - GNU or native
autoconf*1 2-13-9 GNU
make 3.79.1 GNU
gnat 3.13p ALT distribution
gawk 3.0.3 GNU

The autoconf utility is only required on Linux/Unix Systems if the configuration scripts have to be changed. For window systems a special set of makefiles in the directory ./win32 is provided which are not using the autoconf facility.

Installation on Linux/Unix

Unpacking and Configuration

$ gunzip -c gnade-src-linux-gnu-<version>.tar.gz | tar xvf -
$ cd gnade-src-linux-gnu-<version>
$ ./configure <dbname>

As dbname the following values are allowed.

  • mimer - MimerSQL
  • postgres - PostgreSQL
  • MySQL - MySQL

If the value is omitted, all subsequent steps regarding the data base installation may be skipped.

Installation of the Database

Depending on the installation of the data base you have specified in the configure script command, you have to execute the following step either by using a DBA account our you may use your own user account.

$ su ..dba..
$ make createuser

After the database and the database user has been configured, the ODBC interface has to be configured. The directory ./samples/sample_db contains sample files for the unixODBC driver manager. The files odbc.ini.sample odbcinst.ini.sample have to be copied to /etc/odbc.ini and /etc/ odbcinst.ini.sample.

Compiling an testing

After the creation of the data base user, the final build may be done by:

$ make

Test code is located under ./samples. In order to test the functionality of the ODBC interface use the examples in ./odbc or ./esql.

If it does not work

If this installation procedure fails you may use the Makefile under ./win32. This makefile is known to work at least on Solaris well if the correct driver manager is installed (see section other components).

Installation on Windows NT

For window users a zip file is provided. In order to install perform the following steps:

> unzip gnade-src-linux-gnu-<version>.zip
> cd gnade-src-linux-gnu-<version>/win32
> make 
                                   
The issue regarding the installation of a data base user has to be done by hand. 
The windows makefile  uses the make.conf file which is prebuilt by the ./configure script. Any configuration
change has to be done there. Please refer to the README file in ./win32.

Other components

The following Driver Manager are known to work with the release:

Component Description Version Operating System Comments
unixODC ODBC Driver Manager 1.8.12-2 Linux www.unixodbc.org
2.0.5 Solaris 8

www.unixodbc.org

The iODBC 3.04 implementation on Solaris seems to have a problem with the handling of cursor states. It should not be used.

Contributions

Special regards to the following persons which have contributed to the project:

Florian Weimer Florian.Weimer@RUS.Uni-Stuttgart.DE
François Fabien. fr.fabien@infonie.fr
Pascal Obry p.obry@wanadoo.fr

gnade-1.6.2.orig/doc/releasenotes/note_1.1.0.html0000644000175000017500000005320607300301210021173 0ustar lbrentalbrenta No title

GNU Ada 95 Database Development Environment - (GNADE)

Version 1.1

Editor M.Erdmann

13.5.2001

Content

This is the first source code release of the GNADE project for production releases with the following features:

  • An extensive thin Ada 95 binding to the ODBC interfaces.
  • ISO/92 compliant embedded SQL translator which processes Ada 95 packages creating Ada 95 modules working on top the of the ODBC interface.
  • Installation support for some commonly known data base products (see below).
  • Documentation in html format.
  • Native Ada 95 bindings for MySQL and Postgres.
  • GNU specific include clause which allows to access the ODBC handles via embedded SQL. This allows to mix embedded SQL and low level ODBC programing in a single source (see chpter in documentation)
  • DECLARE TABLE is used to gnerate parts of the schema files (-schema option)
  • The syntax for dynmaic SQL is included, but no code is generated yet (postposed to Version 1.1).
  • The Option -compiler has been added to allow the support of spcifica of different Ada 95 compiliers which has currently no effect.

The release is intended for building with the GNU Ada Translator on the platforms Linux, Solaris and Windows NT/2000.

The GNADE source code and the documentation in HTML format is delivered in the following files:

File Size in Bytes Contents
gnade-src-1.1.tar.gz 274181 Complete GNADE distribution GNU compressed tar file
gnade-src-1.1.zip 452670 Complete GNADE distribution as ZIP file.

Supported Databases

Even the GNADE project except for the native data base bindings is expected to work with all ODBC compilent data base products. The following products are known to work with GNADE assuming, that you are using the correct driver manager (see section "Other Components").

Component Description Version OS Distribution/Source of the release
Postgres PostgreSQL Database 7.0.3
Linux - Redhat 7.0
Linux - SuSe 7.0
Solaris 7
Windows NT/2000
www.postgresql.org
Mimer Mimer SQL RDBMS 8.2
Solaris 7/8
Linux
Windows NT
www.mimer.com
MySQL MySQL Database

MyODBC
3.23.22

2.50.36-1

Linux www.mysql.com
3.23.35a

2.50.36

Windows 2000 www.mysql.com

The GNADE project installation procedure provides for theses product test data bases. If your data base is not liseted below, the GNADE project will be very likely usable but the test data base has to be installed manually.

Copyright, License and Authors

The GNU Public License (GPL) applies with the following extension to all software components in this release

As a special exception, if other files instantiate generics from GNADE Ada units, or you link GNADE Ada units or libraries with other files to produce an executable, these units or libraries do not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.

The documentation has been put under the Free GNU Documentation License.

The authors and copyright holders of the GNADE project are:

Jürgen Pfeifer juergen.pfeifer@gmx.net>
Michael Erdmann Michael.Erdmann@snafu.de
Sune Falck sunef@hem.passagen.se

Contact

Bug Reports http://sourcefore.net/projects/gnade M.Erdmann
GNADE Discussions http://cert.uni-stuttgart.de/mailman/listinfo/gnade-dev

gnade-dev@cert.uni-stuttgart.de

Florian Weimer
Project Page http://gnade.sourceforge.net/

http://sourcefore.net/projects/gnade

M.Erdmann
Dev. Coordination Michael.Erdmann@snafu.de M.Erdmann

Restrictions

  • The configuration procedure for Solaris has not been tested completely. If it fails please use the Makefiles in the directory ./win32. These files are known to build a working installation under Solaris.
  • The documentation is only distributed as HTML format, because the pdf files generated by docbook are faulty.
  • The Object Ada Compiler is known to fail compiling the odbc bindings.

Fixed Problems

Bug Ref. Fixed with Version Short Description Comments
411143 0.9g configure does not fail. The configure.in script has been updated and aborts if the library check fails or one of the GNAT components is missing
412931 0.9h Ada compiler not found On FreeBSD and Solaris the Ada compiler is not found even it is there. The configuration procedure assumes the name of the compiler based on the build OS name.
412885 0.9h Distribution not installable on Solaris A prebuilt version of the configure script was missing. If the target system does not support autoconf, the files in ./autoconf should never touched.
412884 0.9h HTML Documentation files where missing The prebuilt version of the documentation was missing. The make dist target has been changed.
413658 0.9i MyODBC 2.50.36 fails with 0.9h The offending SQL primitive has been removed.
413660 0.9i Long_String looks not nice Patch from Sune Falck has been inserted
413687 0.9j test sample generates exception Change in esql_support. Pointer not initialized.
414349 0.9k cp fails on Solaris Depending on the OS, different options are used for the cp command.
414350 0.9k Install not found on Solaris The autoconf specific fallback procedures are used which means the install-sh script will be used in case of problems.
414351 0.9k configure terminates on Solaris with error The -e parameter for the test command is not supported by Solaris. The parameter -f seems to be more commonly supported.
413687 0.9k test sample generates exception A patch has been received from Mr. Obry solving the problem in esql_support.adb.
414526 0.9k configure - make directories executed ./configure checks the result of auotconf/configure
414583 0.9k Wrong error message for errors in sql qu Patch from S. Falck added.
415224 0.9m V0.9l windows example are not build GNUmakefile from S. Falck added
416018 0.9m Misstyped online help esql updated.
421587 0.9o ObjectAda Unrstricted_Access not supported. Unrestricted access is not used any more.

Known Problems

Bug Ref. Short Description Comments
411141 Missing ";" for "EXEC SQL DECLARE DB01 D This problem may be bypassed by putting a semicolon

in the source code.

421586

ODBC does not compile with ObjectAda

This is a problem with the Object Ada compiler.

Installation

The installation of this software requires the following components:

Component Version Origin
gzip 1.2.4 GNU
unzip 5.42 Infozip
zip 2.2 Infozip
tar - GNU or native
autoconf*1 2-13-9 GNU
make 3.79.1 GNU
gnat 3.13p ALT distribution
gawk 3.0.3 GNU

The autoconf utility is only required on Linux/Unix Systems if the configuration scripts have to be changed. For window systems a special set of makefiles in the directory ./win32 is provided which are not using the autoconf facility.

Installation on Linux/Unix

Unpacking and Configuration

$ gunzip -c gnade-src-linux-gnu-<version>.tar.gz | tar xvf -
$ cd gnade-src-linux-gnu-<version>
$ ./configure <dbname>

As dbname the following values are allowed.

  • mimer - MimerSQL
  • postgres - PostgreSQL
  • MySQL - MySQL

If the value is omitted, all subsequent steps regarding the data base installation may be skipped.

Installation of the Database

Depending on the installation of the data base you have specified in the configure script command, you have to execute the following step either by using a DBA account our you may use your own user account.

$ su ..dba..
$ make createuser

After the database and the database user has been configured, the ODBC interface has to be configured. The directory ./samples/sample_db contains sample files for the unixODBC driver manager. The files odbc.ini.sample odbcinst.ini.sample have to be copied to /etc/odbc.ini and /etc/ odbcinst.ini.sample.

Compiling an testing

After the creation of the data base user, the final build may be done by:

$ make

Test code is located under ./samples. In order to test the functionality of the ODBC interface use the examples in ./odbc or ./esql.

If it does not work

If this installation procedure fails you may use the Makefile under ./win32. This makefile is known to work at least on Solaris well if the correct driver manager is installed (see section other components).

Installation on Windows NT

For window users a zip file is provided. In order to install perform the following steps:

> unzip gnade-src-linux-gnu-<version>.zip
> cd gnade-src-linux-gnu-<version>/win32
> make 
                                   
The issue regarding the installation of a data base user has to be done by hand. 
The windows makefile  uses the make.conf file which is prebuilt by the ./configure script. Any configuration
change has to be done there. Please refer to the README file in ./win32.

Other components

The following Driver Manager are known to work with the release:

Component Description Version Operating System Comments
unixODC ODBC Driver Manager 1.8.12-2 Linux www.unixodbc.org
2.0.5 Solaris 8

www.unixodbc.org

The iODBC 3.04 implementation on Solaris seems to have a problem with the handling of cursor states. It should not be used.

Contributions

Special regards to the following persons which have contributed to the project:

Florian Weimer Florian.Weimer@RUS.Uni-Stuttgart.DE
François Fabien. fr.fabien@infonie.fr
Pascal Obry p.obry@wanadoo.fr

gnade-1.6.2.orig/doc/releasenotes/note_1.1.1.html0000644000175000017500000005647707303023606021226 0ustar lbrentalbrenta No title

GNU Ada 95 Database Development Environment - (GNADE)

Version 1.1.1

Editor M.Erdmann

20.5.2001

Content

This is the first source code release of the GNADE project for production releases with the following features:

  • An extensive thin Ada 95 binding to the ODBC interfaces.
  • ISO/92 compliant embedded SQL translator which processes Ada 95 packages creating Ada 95 modules working on top the of the ODBC interface.
  • Installation support for some commonly known data base products (see below).
  • Documentation in HTML format.
  • Native Ada 95 bindings for MySQL and Postgres.
  • GNU specific include clause which allows to access the ODBC handles via embedded SQL. This allows to mix embedded SQL and low level ODBC programing in a single source (see chapter in documentation)
  • DECLARE TABLE is used to generate parts of the schema files (-schema option)
  • The syntax for dynamic SQL is included, but no code is generated yet (postponed to Version 1.1).
  • The Option -compiler has been added to allow the support of specific of different Ada 95 compilers which has currently no effect.

The release is intended for building with the GNU Ada Translator on the platforms Linux, Solaris and Windows NT/2000.

The GNADE code and the documentation in HTML, PDF and postscript format is delivered in the following files:

File Size in Bytes Contents
gnade-src-1.1.1.tar.gz 461738 Complete GNADE distribution GNU compressed tar file
gnade-src-1.1.1.zip 643597 Complete GNADE distribution as ZIP file.
gnade-1.1.1.exe 948254 Windows NT setup contains only the binaries and the libraries of the GNADE project.

RPM files are available via the Ada Linux Team for SuSe and Redhat Linux

Supported Databases

Even the GNADE project except for the native data base bindings is expected to work with all ODBC compliant data base products. The following products are known to work with GNADE assuming, that you are using the correct driver manager (see section "Other Components").

Component Description Version OS Distribution/Source of the release
Postgres PostgreSQL Database 7.0.3
Linux - Redhat 7.0
Linux - SuSe 7.0
Solaris 7
Windows NT/2000
www.postgresql.org
Mimer Mimer SQL RDBMS 8.2
Solaris 7/8
Linux
Windows NT
www.mimer.com
MySQL MySQL Database

MyODBC
3.23.22

2.50.36-1

Linux www.mysql.com
3.23.35a

2.50.36

Windows 2000 www.mysql.com

The GNADE project installation procedure provides for theses product test data bases. If your data base is not listed below, the GNADE project will be very likely usable but the test data base has to be installed manually.

Copyright, License and Authors

The GNU Public License (GPL) applies with the following extension to all software components in this release

As a special exception, if other files instantiate generics from GNADE Ada units, or you link GNADE Ada units or libraries with other files to produce an executable, these units or libraries do not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.

The documentation has been put under the Free GNU Documentation License.

The authors and copyright holders of the GNADE project are:

Jürgen Pfeifer juergen.pfeifer@gmx.net>
Michael Erdmann Michael.Erdmann@snafu.de
Sune Falck sunef@hem.passagen.se

Contact

Bug Reports http://sourcefore.net/projects/gnade M.Erdmann
GNADE Discussions http://cert.uni-stuttgart.de/mailman/listinfo/gnade-dev

gnade-dev@cert.uni-stuttgart.de

Florian Weimer
Project Page http://gnade.sourceforge.net/

http://sourcefore.net/projects/gnade

M.Erdmann
Dev. Coordination Michael.Erdmann@snafu.de M.Erdmann

Restrictions

  • The configuration procedure for Solaris has not been tested completely. If it fails please use the Makefiles in the directory ./win32. These files are known to build a working installation under Solaris.
  • The table of contents of the documentation in PDF and Postscript format does not contain any page numbers.
  • The Object Ada Compiler is known to fail compiling the ODBC bindings because of insufficient complience to the Ada 95 RM.
  • The -debugcode switch generates wrong code which does not compile (Bug 435712)

Fixed Problems

Bug Ref. Fixed with Version Short Description Comments
411143 0.9g configure does not fail. The configure.in script has been updated and aborts if the library check fails or one of the GNAT components is missing
412931 0.9h Ada compiler not found On FreeBSD and Solaris the Ada compiler is not found even it is there. The configuration procedure assumes the name of the compiler based on the build OS name.
412885 0.9h Distribution not installable on Solaris A prebuilt version of the configure script was missing. If the target system does not support autoconf, the files in ./autoconf should never touched.
412884 0.9h HTML Documentation files where missing The prebuilt version of the documentation was missing. The make dist target has been changed.
413658 0.9i MyODBC 2.50.36 fails with 0.9h The offending SQL primitive has been removed.
413660 0.9i Long_String looks not nice Patch from Sune Falck has been inserted
413687 0.9j test sample generates exception Change in esql_support. Pointer not initialized.
414349 0.9k cp fails on Solaris Depending on the OS, different options are used for the cp command.
414350 0.9k Install not found on Solaris The autoconf specific fallback procedures are used which means the install-sh script will be used in case of problems.
414351 0.9k configure terminates on Solaris with error The -e parameter for the test command is not supported by Solaris. The parameter -f seems to be more commonly supported.
413687 0.9k test sample generates exception A patch has been received from Mr. Obry solving the problem in esql_support.adb.
414526 0.9k configure - make directories executed ./configure checks the result of autoconf/configure
414583 0.9k Wrong error message for errors in sql qu Patch from S. Falck added.
415224 0.9m V0.9l windows example are not build GNUmakefile from S. Falck added
416018 0.9m Misstyped online help esql updated.
421587 0.9o ObjectAda Unrestricted_Access not supported. Unrestricted access is not used any more.
425280 1.1.1 Name of esql not changed every where GNUmakefile updated
425409 1.1.1 sql_standard prefix not handled correct gesql updated
425410 1.1.1 whenever sqlwarning faulty gesql updated
425510 1.1.1 gpl.sgml missing in distribution MANIFEST updated

Known Problems

Bug Ref. Short Description Comments
411141 Missing ";" for "EXEC SQL DECLARE DB01 D" This problem may be bypassed by putting a semicolon

in the source code.

421586

ODBC does not compile with ObjectAda

This is a problem with the Object Ada compiler which has to be fixed there.
425279 GNUmake on Windows 95 does not work S. Falck is looking for a work around
435712 Wrong debug code generated Do not use -debugcode flag. The bug will be corrected asap.

Installation

The installation of this software requires the following components:

Component Version Origin
gzip 1.2.4 GNU
unzip 5.42 Infozip
zip 2.2 Infozip
tar - GNU or native
autoconf*1 2-13-9 GNU
make 3.79.1 GNU
gnat 3.13p ALT distribution
gawk 3.0.3 GNU

The autoconf utility is only required on Linux/Unix Systems if the configuration scripts have to be changed. For window systems a special set of makefiles in the directory ./win32 is provided which are not using the autoconf facility.

Installation on Linux/Unix

Unpacking and Configuration

$ gunzip -c gnade-src-linux-gnu-<version>.tar.gz | tar xvf -
$ cd gnade-src-linux-gnu-<version>
$ ./configure <dbname>

As dbname the following values are allowed.

  • mimer - MimerSQL
  • postgres - PostgreSQL
  • MySQL - MySQL

If the value is omitted, all subsequent steps regarding the data base installation may be skipped.

Installation of the Database

Depending on the installation of the data base you have specified in the configure script command, you have to execute the following step either by using a DBA account our you may use your own user account.

$ su ..dba..
$ make createuser

After the database and the database user has been configured, the ODBC interface has to be configured. The directory ./samples/sample_db contains sample files for the unixODBC driver manager. The files odbc.ini.sample odbcinst.ini.sample have to be copied to /etc/odbc.ini and /etc/ odbcinst.ini.sample.

Compiling an testing

After the creation of the data base user, the final build may be done by:

$ make

Test code is located under ./samples. In order to test the functionality of the ODBC interface use the examples in ./odbc or ./esql.

If it does not work

If this installation procedure fails you may use the Makefile under ./win32. This makefile is known to work at least on Solaris well if the correct driver manager is installed (see section other components).

Installation on Windows NT

For window users a zip file is provided. In order to install perform the following steps:

> unzip gnade-src-linux-gnu-<version>.zip
> cd gnade-src-linux-gnu-<version>/win32
> make 
                                   
The issue regarding the installation of a data base user has to be done by hand. 
The windows makefile  uses the make.conf file which is prebuilt by the ./configure script. Any configuration
change has to be done there. Please refer to the README file in ./win32.

Other components

The following Driver Manager are known to work with the release:

Component Description Version Operating System Comments
unixODC ODBC Driver Manager 1.8.12-2 Linux www.unixodbc.org
2.0.5 Solaris 8

www.unixodbc.org

The iODBC 3.04 implementation on Solaris seems to have a problem with the handling of cursor states. It should not be used.

Contributions

Special regards to the following persons which have contributed to the project:

Florian Weimer Florian.Weimer@RUS.Uni-Stuttgart.DE
François Fabien. fr.fabien@infonie.fr
Pascal Obry p.obry@wanadoo.fr

gnade-1.6.2.orig/doc/releasenotes/note_1.1.10.html0000644000175000017500000007047607367057033021314 0ustar lbrentalbrenta No title

GNat Ada 95 Database Environment - (GNADE)

Version 1.1.10

Editor M.Erdmann

28.10.2001

Contents

This release of the GNADE project is intended for building with the GNU Ada Translator on the platforms Linux, Solaris and Windows NT/95/2000.

Features

  • An extensive thin Ada 95 binding to the ODBC interfaces.
  • ISO/92 compliant embedded SQL translator which is able to process Ada 95 packages and files containing only one procedure. The translator creates Ada 95 source files working on top the of the ODBC interface.
  • Installation support for some commonly known data base products (see below).
  • Documentation in HTML, Postscript and PDF format.
  • Native Ada 95 bindings for MySQL and Postgres.
  • GNU specific include clause which allows to access the ODBC handles via embedded SQL. This allows to mix embedded SQL and low level ODBC programing in a single source (see chapter in documentation).
  • DECLARE TABLE is used to generate parts of the schema files (-schema option).
  • Support of embedded SQL.
  • Support of Oracle Lite on MS Windows 95
  • Support of MySQL with MS ODBC Drivers on Windows 95
  • Unicode support on the ODBC interface.
  • The connection clause has been extended by the ON clause in order to intercept typical connection errors and to define a reaction on ESQL level as shown below:

    CONNECT ......

    [ ON [COMMUNICATION|AUTHORIZATION|OTHER] ERROR [RAISE|GOTO|DO] <target> ]

  • A new GNADE implemenation defined data types as VARCHAR and VARBINARY. For details please refere to the documentation and the example attachment.gpq in samples/esql.

Supported Databases

Even the GNADE project except for the native data base bindings is expected to work with all ODBC compliant data base products. The following products are known to work with GNADE assuming, that you are using the correct driver manager (see section "Other Components").

Component Description Version OS Distribution/Source of the release
Postgres PostgreSQL Database 7.0.3
Linux - Redhat 7.0
Linux - SuSe 7.0
Solaris 7
Windows NT/2000
www.postgresql.org
Mimer Mimer SQL RDBMS 8.2
Solaris 7/8
Linux
Windows NT
www.mimer.com
MySQL MySQL Database
MyODBC

3.23.22

2.50.36-1

Linux www.mysql.com
3.23.35a

2.50.36

Windows 2000 www.mysql.com
MS SQL Server 7.0 Windows 2000 Microsoft
SQL Server 2000 Windows 2000 Microsoft
Oracle Lite 8i Windows 95 Oracle

The GNADE project installation procedure provides for theses product test data bases. If your data base is not listed below, the GNADE project will be very likely usable but the test data base has to be installed manually.

Copyright, License and Authors

The GNU Public License (GPL) applies with the following extension to all software components in this release

As a special exception, if other files instantiate generics from GNADE Ada units, or you link GNADE Ada units or libraries with other files to produce an executable, these units or libraries do not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.

The documentation has been put under the Free GNU Documentation License.

The authors and copyright holders of the GNADE project are:

Jürgen Pfeifer juergen.pfeifer@gmx.net>
Michael Erdmann Michael.Erdmann@snafu.de
Sune Falck sunef@hem.passagen.se
François Fabien fr.fabien@infonie.fr

Contact

Bug Reports http://sourcefore.net/projects/gnade M.Erdmann
GNADE Discussions http://cert.uni-stuttgart.de/mailman/listinfo/gnade-dev

gnade-dev@cert.uni-stuttgart.de

Florian Weimer
Project Page http://gnade.sourceforge.net/

http://sourcefore.net/projects/gnade

M.Erdmann
Dev. Coordination Michael.Erdmann@snafu.de M.Erdmann

New Features

Feature Req, Short Description Version Comments
426744 ESQL shall be able to handle files with only one procedure in. 1.1.2 complte
473046 ESQL extended types as VARCHAR, VARBINARY 1.1.10 complte

Restrictions

  • The VARBINARY data type has only been tested with Mimer SQL.
  • The configuration procedure for Solaris has not been tested completely. If it fails please use the Makefiles in the directory ./win32. These files are known to build a working installation under Solaris.
  • The Object Ada Compiler is known to fail compiling the ODBC bindings because of insufficient compliance to the Ada 95 RM.
  • The compilation of the ODBC bindings is known to fail on a Sun SPARC using GNADE 1.13p (ACT tracking number [8925-002] Gigi abort code 411 on SPARC architectures).
  • The Option -compiler has been added to allow the support of specific of different Ada 95 compilers which has currently no effect.
  • Unicode support is only available begining with UnixODBC version 2.0
  • Oracle 8i requires the declaration of string hostvariable to be 1 character larger then the domain size, e.g. assuming the size of the domain Ename from the example simple to be 20, the host variables have to be defined as:
    Ename           :   Char (1..21); 
    Dept_Name   :   Char (1..21); 
    Location        :   Char (1..21);
    
    The automatic installation is not supported in case of Oracle 8i but the installation script is located under samples

Fixed Problems

Problems reported earlier then 0.9o are listed in the release note 1.1.2.

Bug Ref. Fixed with

Version

Short Description Comments
421587 0.9o ObjectAda Unrestricted_Access not supported. Unrestricted access is not used any more.
425280 1.1.1 Name of esql not changed every where GNUmakefile updated
425409 1.1.1 sql_standard prefix not handled correct gesql updated
425410 1.1.1 whenever sqlwarning faulty gesql updated
425510 1.1.1 gpl.sgml missing in distribution MANIFEST updated
421586 1.1.2 GNUmake on Windows 95 does not work Makefile changed
435712 1.1.2 Wrong debug code generated esql translator and esql_support updated
427531 1.1.2 gesql file corrupt but available The output file will always be deleted if some error during translation occurred.
427557 1.1.2 gesql command line not correct evaluated driver changed.
427764 1.1.3 Relastion missing error not recognized Code generation has been changed
427747 1.1.3 help message shown twice driver.adb changed
427750 1.1.3 Dynamic SQL DECLARE statement missing documentation updated
427748 1.1.3 Some_Error exception undefine code generator updated
430075 1.1.3 -noniso92 switch does not exist code generator updated
430077 1.1.3 -noiso92 switch not evaluated code generator updated
429984 1.1.4 Result evaluation done twice code generator updated
430751 1.1.4 Notfound class not correctly evaluated code generator updated
430752 1.1.4 not found exception raised twice code generator updated
430760 1.1.4 Number of affrected rows missing is SQLC code generator updated
435982 1.1.5 Wrong package name found esql parser updated
435872 1.1.5 Debug information missleading esql code generator updated
437590 1.1.5 Example simple does not work with MySQL GNU.DB.SQLCLI and esql_support.odbc

updated.

439149 1.1.5 SQLCA Not inserted correctly esql parser updated
439151 1.1.5 Handling of inner exception -noiso92 switch changed to -iso92 switch
439274 1.1.5 Mimer SQL not correctly installed Makefile updated
439274 1.1.5 MimerSQL, Tables of test db not found. Documentation updated
478056 1.1.6 Move in ESQL raises exception esql_support.adb updated
470357 1.1.6 simple.gpq does not handle conn. error simple.gqp updated
471060 1.1.7 esql_parse does not compile esql_parser.adb updated
471082 1.1.7 Useless evaluate code generated esql_parser.adb updated
473062 1.1.8 Package name in host var. decl. not eval. esql_parser.adb updated
473104 1.1.8 Query result not evaluated by gesql esql_parser.adb updated
473259 1.1.9 esql samples do not complie esql_parser.adb updated
475736 1.1.10 VARBINARY not handled correctly gnu-db-esql_support-odbc.adb
471061 1.1.10 seperator for Win 9x not handled GNUmakefile
433671 1.1.10 Win 2000 installation failes modules.adb

Known Problems

Bug Ref. Short Description Comments
411141 Missing ";" for "EXEC SQL DECLARE DB01 D" This problem may be bypassed by putting a semicolon in the source code.
421586

ODBC does not compile with ObjectAda

This is a problem with the Object Ada compiler which has to be fixed there.

Installation

The GNADE code and the documentation is distributed in the following files:

File Size in Bytes Contents
gnade-src-1.1.10.tar.gz Complete GNADE source code distribution GNU compressed tar file
gnade-src-1.1.10..zip Complete GNADE source code distribution as ZIP file.

The installation of this software requires the following components:

Component Version Origin
gzip 1.2.4 GNU
unzip 5.42 Infozip
zip 2.2 Infozip
tar - GNU or native
autoconf*1 2-13-9 GNU
make 3.79.1 GNU
gnat 3.13p

3.12

ALT distribution
gawk 3.0.3 GNU

The autoconf utility is only required on Linux/Unix Systems if the configuration scripts have to be changed. For window systems a special set of makefiles in the directory ./win32 is provided which are not using the autoconf facility.

Installation on Linux/Unix

Unpacking and Configuration

$ gunzip -c gnade-src-linux-gnu-<version>.tar.gz | tar xvf -
$ cd gnade-src-linux-gnu-<version>
$ ./configure <dbname>

As dbname the following values are allowed.

  • mimer - MimerSQL
  • postgres - PostgreSQL
  • MySQL - MySQL

If the value is omitted because your data base product is not listed,, all subsequent steps regarding the data base installation may be skipped and you have to install the test database manually.

Installation of the Database

Depending on the installation of the data base you have specified in the configure script command, you have to execute the following step either by using a DBA account our you may use your own user account.

$ su ..dba..
$ make createuser

After the database and the database user has been configured, the ODBC interface has to be configured. The directory ./samples/sample_db contains sample files for the unixODBC driver manager. The files odbc.ini.sample odbcinst.ini.sample have to be copied to /etc/odbc.ini and /etc/ odbcinst.ini.sample.

Compiling an testing

After the creation of the data base user, the final build may be done by:

$ make

Test code is located under ./samples. In order to test the functionality of the ODBC interface use the examples in ./odbc or ./esql.

If it does not work

If this installation procedure fails you may use the Makefile under ./win32. This makefile is known to work at least on Solaris well if the correct driver manager is installed (see section other components).

Installation on Windows NT

For window users a zip file is provided. In order to install perform the following steps:

> unzip gnade-src-linux-gnu-<version>.zip
> cd gnade-src-linux-gnu-<version>/win32
> make 
                                   
The issue regarding the installation of a data base user has to be done by hand. 
The windows makefile  uses the make.conf file which is prebuilt by the ./configure script. Any configuration
change has to be done there. Please refer to the README file in ./win32.

Other components

The following Driver Manager are known to work with the release:

Component Description Version Operating System Comments
unixODBC ODBC Driver Manager 1.8.12-2 Linux www.unixodbc.org
2.0.5 Solaris 8

www.unixodbc.org

ODBC Driver Manager 3.5.10 Windows 95 Microsoft

The iODBC 3.04 implementation on Solaris seems to have a problem with the handling of cursor states. It should not be used.

Contributions

Special regards to the following persons which have contributed to the project:

Florian Weimer Florian.Weimer@RUS.Uni-Stuttgart.DE
François Fabien. fr.fabien@infonie.fr
Pascal Obry p.obry@wanadoo.fr


Document Version: $Date: 2001/10/28 19:35:55 $ $Revision: 1.1 $

gnade-1.6.2.orig/doc/releasenotes/note_1.1.2.html0000644000175000017500000006055407303763553021232 0ustar lbrentalbrenta No title

GNU Ada 95 Database Development Environment - (GNADE)

Version 1.1.2

Editor M.Erdmann

26.5.2001

Content

This release of the GNADE project is intended for building with the GNU Ada Translator on the platforms Linux, Solaris and Windows NT/2000 with the following features:

  • An extensive thin Ada 95 binding to the ODBC interfaces.
  • ISO/92 compliant embedded SQL translator which processes Ada 95 packages creating Ada 95 modules working on top the of the ODBC interface.
  • Installation support for some commonly known data base products (see below).
  • Documentation in HTML format.
  • Native Ada 95 bindings for MySQL and Postgres.
  • GNU specific include clause which allows to access the ODBC handles via embedded SQL. This allows to mix embedded SQL and low level ODBC programing in a single source (see chapter in documentation)
  • DECLARE TABLE is used to generate parts of the schema files (-schema option)
  • The syntax for dynamic SQL is included, but no code is generated yet (postponed to Version 1.2).

New in this release is the capability of the esql translator to handle Ada 95 source files containing only a procedure. An additional example has been added to samples/esql.

The GNADE code and the documentation in HTML, PDF and postscript format is delivered in the following files:

File Size in Bytes Contents
gnade-src-1.1.2.tar.gz 456172 Complete GNADE distribution GNU compressed tar file
gnade-src-1.1.2.zip 642996 Complete GNADE distribution as ZIP file.
gnade-1.1.2.exe Windows NT setup contains only the binaries and the libraries of the GNADE project.

RPM files are available via the Ada Linux Team for SuSe and Redhat Linux

Supported Databases

Even the GNADE project except for the native data base bindings is expected to work with all ODBC compliant data base products. The following products are known to work with GNADE assuming, that you are using the correct driver manager (see section "Other Components").

Component Description Version OS Distribution/Source of the release
Postgres PostgreSQL Database 7.0.3
Linux - Redhat 7.0
Linux - SuSe 7.0
Solaris 7
Windows NT/2000
www.postgresql.org
Mimer Mimer SQL RDBMS 8.2
Solaris 7/8
Linux
Windows NT
www.mimer.com
MySQL MySQL Database

MyODBC
3.23.22

2.50.36-1

Linux www.mysql.com
3.23.35a

2.50.36

Windows 2000 www.mysql.com

The GNADE project installation procedure provides for theses product test data bases. If your data base is not listed below, the GNADE project will be very likely usable but the test data base has to be installed manually.

Copyright, License and Authors

The GNU Public License (GPL) applies with the following extension to all software components in this release

As a special exception, if other files instantiate generics from GNADE Ada units, or you link GNADE Ada units or libraries with other files to produce an executable, these units or libraries do not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.

The documentation has been put under the Free GNU Documentation License.

The authors and copyright holders of the GNADE project are:

Jürgen Pfeifer juergen.pfeifer@gmx.net>
Michael Erdmann Michael.Erdmann@snafu.de
Sune Falck sunef@hem.passagen.se

Contact

Bug Reports http://sourcefore.net/projects/gnade M.Erdmann
GNADE Discussions http://cert.uni-stuttgart.de/mailman/listinfo/gnade-dev

gnade-dev@cert.uni-stuttgart.de

Florian Weimer
Project Page http://gnade.sourceforge.net/

http://sourcefore.net/projects/gnade

M.Erdmann
Dev. Coordination Michael.Erdmann@snafu.de M.Erdmann

New Features

Feature Req, Short Description Version Comments
426744 ESQL shall be able to handle files with only one procedure in. 1.1.2 None

Restrictions

  • The configuration procedure for Solaris has not been tested completely. If it fails please use the Makefiles in the directory ./win32. These files are known to build a working installation under Solaris.
  • The Object Ada Compiler is known to fail compiling the ODBC bindings because of insufficient compliance to the Ada 95 RM.
  • The compilation of the ODBC bindings is known to fail on a Sun SPARC using GNADE 1.13p.
  • The Option -compiler has been added to allow the support of specific of different Ada 95 compilers which has currently no effect.

Fixed Problems

Bug Ref. Fixed with

Version

Short Description Comments
411143 0.9g configure does not fail. The configure.in script has been updated and aborts if the library check fails or one of the GNAT components is missing
412931 0.9h Ada compiler not found On FreeBSD and Solaris the Ada compiler is not found even it is there. The configuration procedure assumes the name of the compiler based on the build OS name.
412885 0.9h Distribution not installable on Solaris A prebuilt version of the configure script was missing. If the target system does not support autoconf, the files in ./autoconf should never touched.
412884 0.9h HTML Documentation files where missing The prebuilt version of the documentation was missing. The make dist target has been changed.
413658 0.9i MyODBC 2.50.36 fails with 0.9h The offending SQL primitive has been removed.
413660 0.9i Long_String looks not nice Patch from Sune Falck has been inserted
413687 0.9j test sample generates exception Change in esql_support. Pointer not initialized.
414349 0.9k cp fails on Solaris Depending on the OS, different options are used for the cp command.
414350 0.9k Install not found on Solaris The autoconf specific fallback procedures are used which means the install-sh script will be used in case of problems.
414351 0.9k configure terminates on Solaris with error The -e parameter for the test command is not supported by Solaris. The parameter -f seems to be more commonly supported.
413687 0.9k test sample generates exception A patch has been received from Mr. Obry solving the problem in esql_support.adb.
414526 0.9k configure - make directories executed ./configure checks the result of autoconf/configure
414583 0.9k Wrong error message for errors in sql qu Patch from S. Falck added.
415224 0.9m V0.9l windows example are not build GNUmakefile from S. Falck added
416018 0.9m Misstyped online help esql updated.
421587 0.9o ObjectAda Unrestricted_Access not supported. Unrestricted access is not used any more.
425280 1.1.1 Name of esql not changed every where GNUmakefile updated
425409 1.1.1 sql_standard prefix not handled correct gesql updated
425410 1.1.1 whenever sqlwarning faulty gesql updated
425510 1.1.1 gpl.sgml missing in distribution MANIFEST updated
421586 1.1.2 GNUmake on Windows 95 does not work Makefile changed
435712 1.1.2 Wrong debug code generated esql translator and esql_support updated
427531 1.1.2 gesql file corrupt but available The output file will always be deleted if some error during translation occurred.
427557 1.1.2 gesql command line not correct evaluated driver changed.

Known Problems

Bug Ref. Short Description Comments
411141 Missing ";" for "EXEC SQL DECLARE DB01 D" This problem may be bypassed by putting a semicolon

in the source code.

421586

ODBC does not compile with ObjectAda

This is a problem with the Object Ada compiler which has to be fixed there.

Installation

The installation of this software requires the following components:

Component Version Origin
gzip 1.2.4 GNU
unzip 5.42 Infozip
zip 2.2 Infozip
tar - GNU or native
autoconf*1 2-13-9 GNU
make 3.79.1 GNU
gnat 3.13p ALT distribution
gawk 3.0.3 GNU

The autoconf utility is only required on Linux/Unix Systems if the configuration scripts have to be changed. For window systems a special set of makefiles in the directory ./win32 is provided which are not using the autoconf facility.

Installation on Linux/Unix

Unpacking and Configuration

$ gunzip -c gnade-src-linux-gnu-<version>.tar.gz | tar xvf -
$ cd gnade-src-linux-gnu-<version>
$ ./configure <dbname>

As dbname the following values are allowed.

  • mimer - MimerSQL
  • postgres - PostgreSQL
  • MySQL - MySQL

If the value is omitted, all subsequent steps regarding the data base installation may be skipped.

Installation of the Database

Depending on the installation of the data base you have specified in the configure script command, you have to execute the following step either by using a DBA account our you may use your own user account.

$ su ..dba..
$ make createuser

After the database and the database user has been configured, the ODBC interface has to be configured. The directory ./samples/sample_db contains sample files for the unixODBC driver manager. The files odbc.ini.sample odbcinst.ini.sample have to be copied to /etc/odbc.ini and /etc/ odbcinst.ini.sample.

Compiling an testing

After the creation of the data base user, the final build may be done by:

$ make

Test code is located under ./samples. In order to test the functionality of the ODBC interface use the examples in ./odbc or ./esql.

If it does not work

If this installation procedure fails you may use the Makefile under ./win32. This makefile is known to work at least on Solaris well if the correct driver manager is installed (see section other components).

Installation on Windows NT

For window users a zip file is provided. In order to install perform the following steps:

> unzip gnade-src-linux-gnu-<version>.zip
> cd gnade-src-linux-gnu-<version>/win32
> make 
                                   
The issue regarding the installation of a data base user has to be done by hand. 
The windows makefile  uses the make.conf file which is prebuilt by the ./configure script. Any configuration
change has to be done there. Please refer to the README file in ./win32.

Other components

The following Driver Manager are known to work with the release:

Component Description Version Operating System Comments
unixODC ODBC Driver Manager 1.8.12-2 Linux www.unixodbc.org
2.0.5 Solaris 8

www.unixodbc.org

The iODBC 3.04 implementation on Solaris seems to have a problem with the handling of cursor states. It should not be used.

Contributions

Special regards to the following persons which have contributed to the project:

Florian Weimer Florian.Weimer@RUS.Uni-Stuttgart.DE
François Fabien. fr.fabien@infonie.fr
Pascal Obry p.obry@wanadoo.fr

gnade-1.6.2.orig/doc/releasenotes/note_1.1.3.html0000644000175000017500000005500007306756745021231 0ustar lbrentalbrenta No title

GNU Ada 95 Database Development Environment - (GNADE)

Version 1.1.3

Editor M.Erdmann

29.5.2001

Content

This release of the GNADE project is intended for building with the GNU Ada Translator on the platforms Linux, Solaris and Windows NT/2000 with the following features:

  • An extensive thin Ada 95 binding to the ODBC interfaces.
  • ISO/92 compliant embedded SQL translator which is able to process Ada 95 packages and files containing only one procedure. The translator creates Ada 95 source files working on top the of the ODBC interface.
  • Installation support for some commonly known data base products (see below).
  • Documentation in HTML, Postgres and PDF format.
  • Native Ada 95 bindings for MySQL and Postgres.
  • GNU specific include clause which allows to access the ODBC handles via embedded SQL. This allows to mix embedded SQL and low level ODBC programing in a single source (see chapter in documentation)
  • DECLARE TABLE is used to generate parts of the schema files (-schema option)

New in this release is the basis support of dynamic embedded SQL.

The GNADE code and the documentation is distributed in the following files:

File Size in Bytes Contents
gnade-src-1.1.3.tar.gz Complete GNADE distribution GNU compressed tar file
gnade-src-1.1.3.zip Complete GNADE distribution as ZIP file.
gnade-1.1.3.exe Windows NT setup contains only the binaries and the libraries of the GNADE project.

RPM files are available via the Ada Linux Team for SuSe and Redhat Linux

Supported Databases

Even the GNADE project except for the native data base bindings is expected to work with all ODBC compliant data base products. The following products are known to work with GNADE assuming, that you are using the correct driver manager (see section "Other Components").

Component Description Version OS Distribution/Source of the release
Postgres PostgreSQL Database 7.0.3
Linux - Redhat 7.0
Linux - SuSe 7.0
Solaris 7
Windows NT/2000
www.postgresql.org
Mimer Mimer SQL RDBMS 8.2
Solaris 7/8
Linux
Windows NT
www.mimer.com
MySQL MySQL Database

MyODBC
3.23.22

2.50.36-1

Linux www.mysql.com
3.23.35a

2.50.36

Windows 2000 www.mysql.com
MS SQL Server 7.0 Windows 2000 Microsoft
SQL Server 2000 Windows 2000 Microsoft

The GNADE project installation procedure provides for theses product test data bases. If your data base is not listed below, the GNADE project will be very likely usable but the test data base has to be installed manually.

Copyright, License and Authors

The GNU Public License (GPL) applies with the following extension to all software components in this release

As a special exception, if other files instantiate generics from GNADE Ada units, or you link GNADE Ada units or libraries with other files to produce an executable, these units or libraries do not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.

The documentation has been put under the Free GNU Documentation License.

The authors and copyright holders of the GNADE project are:

Jürgen Pfeifer juergen.pfeifer@gmx.net>
Michael Erdmann Michael.Erdmann@snafu.de
Sune Falck sunef@hem.passagen.se

Contact

Bug Reports http://sourcefore.net/projects/gnade M.Erdmann
GNADE Discussions http://cert.uni-stuttgart.de/mailman/listinfo/gnade-dev

gnade-dev@cert.uni-stuttgart.de

Florian Weimer
Project Page http://gnade.sourceforge.net/

http://sourcefore.net/projects/gnade

M.Erdmann
Dev. Coordination Michael.Erdmann@snafu.de M.Erdmann

New Features

Feature Req, Short Description Version Comments
426744 ESQL shall be able to handle files with only one procedure in. 1.1.2 None

Restrictions

  • The configuration procedure for Solaris has not been tested completely. If it fails please use the Makefiles in the directory ./win32. These files are known to build a working installation under Solaris.
  • The Object Ada Compiler is known to fail compiling the ODBC bindings because of insufficient compliance to the Ada 95 RM.
  • The compilation of the ODBC bindings is known to fail on a Sun SPARC using GNADE 1.13p.
  • The Option -compiler has been added to allow the support of specific of different Ada 95 compilers which has currently no effect.

Fixed Problems

Problems reported earlier then 0.9o are listed in the release note 1.1.2.

Bug Ref. Fixed with

Version

Short Description Comments
421587 0.9o ObjectAda Unrestricted_Access not supported. Unrestricted access is not used any more.
425280 1.1.1 Name of esql not changed every where GNUmakefile updated
425409 1.1.1 sql_standard prefix not handled correct gesql updated
425410 1.1.1 whenever sqlwarning faulty gesql updated
425510 1.1.1 gpl.sgml missing in distribution MANIFEST updated
421586 1.1.2 GNUmake on Windows 95 does not work Makefile changed
435712 1.1.2 Wrong debug code generated esql translator and esql_support updated
427531 1.1.2 gesql file corrupt but available The output file will always be deleted if some error during translation occurred.
427557 1.1.2 gesql command line not correct evaluated driver changed.
427764 1.1.3 Relastion missing error not recognized Code generation has been changed
427747 1.1.3 help message shown twice driver.adb changed
427750 1.1.3 Dynamic SQL DECLARE statement missing documentation updated
427748 1.1.3 Some_Error exception undefine code generator updated
430075 1.1.3 -noniso92 switch does not exist code generator updated
430077 1.1.3 -noiso92 switch not evaluated code generator updated

Known Problems

Bug Ref. Short Description Comments
411141 Missing ";" for "EXEC SQL DECLARE DB01 D" This problem may be bypassed by putting a semicolon in the source code.
421586

ODBC does not compile with ObjectAda

This is a problem with the Object Ada compiler which has to be fixed there.
429984 Result evaluation done twice Will be corrected later. It has no impact on the evaluation results

Installation

The installation of this software requires the following components:

Component Version Origin
gzip 1.2.4 GNU
unzip 5.42 Infozip
zip 2.2 Infozip
tar - GNU or native
autoconf*1 2-13-9 GNU
make 3.79.1 GNU
gnat 3.13p ALT distribution
gawk 3.0.3 GNU

The autoconf utility is only required on Linux/Unix Systems if the configuration scripts have to be changed. For window systems a special set of makefiles in the directory ./win32 is provided which are not using the autoconf facility.

Installation on Linux/Unix

Unpacking and Configuration

$ gunzip -c gnade-src-linux-gnu-<version>.tar.gz | tar xvf -
$ cd gnade-src-linux-gnu-<version>
$ ./configure <dbname>

As dbname the following values are allowed.

  • mimer - MimerSQL
  • postgres - PostgreSQL
  • MySQL - MySQL

If the value is omitted, all subsequent steps regarding the data base installation may be skipped.

Installation of the Database

Depending on the installation of the data base you have specified in the configure script command, you have to execute the following step either by using a DBA account our you may use your own user account.

$ su ..dba..
$ make createuser

After the database and the database user has been configured, the ODBC interface has to be configured. The directory ./samples/sample_db contains sample files for the unixODBC driver manager. The files odbc.ini.sample odbcinst.ini.sample have to be copied to /etc/odbc.ini and /etc/ odbcinst.ini.sample.

Compiling an testing

After the creation of the data base user, the final build may be done by:

$ make

Test code is located under ./samples. In order to test the functionality of the ODBC interface use the examples in ./odbc or ./esql.

If it does not work

If this installation procedure fails you may use the Makefile under ./win32. This makefile is known to work at least on Solaris well if the correct driver manager is installed (see section other components).

Installation on Windows NT

For window users a zip file is provided. In order to install perform the following steps:

> unzip gnade-src-linux-gnu-<version>.zip
> cd gnade-src-linux-gnu-<version>/win32
> make 
                                   
The issue regarding the installation of a data base user has to be done by hand. 
The windows makefile  uses the make.conf file which is prebuilt by the ./configure script. Any configuration
change has to be done there. Please refer to the README file in ./win32.

Other components

The following Driver Manager are known to work with the release:

Component Description Version Operating System Comments
unixODC ODBC Driver Manager 1.8.12-2 Linux www.unixodbc.org
2.0.5 Solaris 8

www.unixodbc.org

The iODBC 3.04 implementation on Solaris seems to have a problem with the handling of cursor states. It should not be used.

Contributions

Special regards to the following persons which have contributed to the project:

Florian Weimer Florian.Weimer@RUS.Uni-Stuttgart.DE
François Fabien. fr.fabien@infonie.fr
Pascal Obry p.obry@wanadoo.fr

gnade-1.6.2.orig/doc/releasenotes/note_1.1.4.html0000644000175000017500000005577407310727613021237 0ustar lbrentalbrenta No title

GNU Ada 95 Database Development Environment - (GNADE)

Version 1.1.4

Editor M.Erdmann

9.6.2001

Content

This release of the GNADE project is intended for building with the GNU Ada Translator on the platforms Linux, Solaris and Windows NT/2000 with the following features:

  • An extensive thin Ada 95 binding to the ODBC interfaces.
  • ISO/92 compliant embedded SQL translator which is able to process Ada 95 packages and files containing only one procedure. The translator creates Ada 95 source files working on top the of the ODBC interface.
  • Installation support for some commonly known data base products (see below).
  • Documentation in HTML, Postgres and PDF format.
  • Native Ada 95 bindings for MySQL and Postgres.
  • GNU specific include clause which allows to access the ODBC handles via embedded SQL. This allows to mix embedded SQL and low level ODBC programing in a single source (see chapter in documentation).
  • DECLARE TABLE is used to generate parts of the schema files (-schema option).
  • Support of embedded SQL.

The GNADE code and the documentation is distributed in the following files:

File Size in Bytes Contents
gnade-src-1.1.4.tar.gz Complete GNADE distribution GNU compressed tar file
gnade-src-1.1.4.zip Complete GNADE distribution as ZIP file.
gnade-1.1.4.exe Windows NT setup contains only the binaries and the libraries of the GNADE project.

RPM files are available via the Ada Linux Team for SuSe and Redhat Linux

Supported Databases

Even the GNADE project except for the native data base bindings is expected to work with all ODBC compliant data base products. The following products are known to work with GNADE assuming, that you are using the correct driver manager (see section "Other Components").

Component Description Version OS Distribution/Source of the release
Postgres PostgreSQL Database 7.0.3
Linux - Redhat 7.0
Linux - SuSe 7.0
Solaris 7
Windows NT/2000
www.postgresql.org
Mimer Mimer SQL RDBMS 8.2
Solaris 7/8
Linux
Windows NT
www.mimer.com
MySQL MySQL Database

MyODBC
3.23.22

2.50.36-1

Linux www.mysql.com
3.23.35a

2.50.36

Windows 2000 www.mysql.com
MS SQL Server 7.0 Windows 2000 Microsoft
SQL Server 2000 Windows 2000 Microsoft

The GNADE project installation procedure provides for theses product test data bases. If your data base is not listed below, the GNADE project will be very likely usable but the test data base has to be installed manually.

Copyright, License and Authors

The GNU Public License (GPL) applies with the following extension to all software components in this release

As a special exception, if other files instantiate generics from GNADE Ada units, or you link GNADE Ada units or libraries with other files to produce an executable, these units or libraries do not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.

The documentation has been put under the Free GNU Documentation License.

The authors and copyright holders of the GNADE project are:

Jürgen Pfeifer juergen.pfeifer@gmx.net>
Michael Erdmann Michael.Erdmann@snafu.de
Sune Falck sunef@hem.passagen.se

Contact

Bug Reports http://sourcefore.net/projects/gnade M.Erdmann
GNADE Discussions http://cert.uni-stuttgart.de/mailman/listinfo/gnade-dev

gnade-dev@cert.uni-stuttgart.de

Florian Weimer
Project Page http://gnade.sourceforge.net/

http://sourcefore.net/projects/gnade

M.Erdmann
Dev. Coordination Michael.Erdmann@snafu.de M.Erdmann

New Features

Feature Req, Short Description Version Comments
426744 ESQL shall be able to handle files with only one procedure in. 1.1.2 None

Restrictions

  • The configuration procedure for Solaris has not been tested completely. If it fails please use the Makefiles in the directory ./win32. These files are known to build a working installation under Solaris.
  • The Object Ada Compiler is known to fail compiling the ODBC bindings because of insufficient compliance to the Ada 95 RM.
  • The compilation of the ODBC bindings is known to fail on a Sun SPARC using GNADE 1.13p (ACT tracking number [8925-002] Gigi abort code 411 on SPARC architectures).
  • The Option -compiler has been added to allow the support of specific of different Ada 95 compilers which has currently no effect.

Fixed Problems

Problems reported earlier then 0.9o are listed in the release note 1.1.2.

Bug Ref. Fixed with

Version

Short Description Comments
421587 0.9o ObjectAda Unrestricted_Access not supported. Unrestricted access is not used any more.
425280 1.1.1 Name of esql not changed every where GNUmakefile updated
425409 1.1.1 sql_standard prefix not handled correct gesql updated
425410 1.1.1 whenever sqlwarning faulty gesql updated
425510 1.1.1 gpl.sgml missing in distribution MANIFEST updated
421586 1.1.2 GNUmake on Windows 95 does not work Makefile changed
435712 1.1.2 Wrong debug code generated esql translator and esql_support updated
427531 1.1.2 gesql file corrupt but available The output file will always be deleted if some error during translation occurred.
427557 1.1.2 gesql command line not correct evaluated driver changed.
427764 1.1.3 Relastion missing error not recognized Code generation has been changed
427747 1.1.3 help message shown twice driver.adb changed
427750 1.1.3 Dynamic SQL DECLARE statement missing documentation updated
427748 1.1.3 Some_Error exception undefine code generator updated
430075 1.1.3 -noniso92 switch does not exist code generator updated
430077 1.1.3 -noiso92 switch not evaluated code generator updated
429984 1.1.4 Result evaluation done twice code generator updated
430751 1.1.4 Notfound class not correctly evaluated code generator updated
430752 1.1.4 not found exception raised twice code generator updated
430760 1.1.4 Number of affrected rows missing is SQLC code generator updated

Known Problems

Bug Ref. Short Description Comments
411141 Missing ";" for "EXEC SQL DECLARE DB01 D" This problem may be bypassed by putting a semicolon in the source code.
421586

ODBC does not compile with ObjectAda

This is a problem with the Object Ada compiler which has to be fixed there.

Installation

The installation of this software requires the following components:

Component Version Origin
gzip 1.2.4 GNU
unzip 5.42 Infozip
zip 2.2 Infozip
tar - GNU or native
autoconf*1 2-13-9 GNU
make 3.79.1 GNU
gnat 3.13p ALT distribution
gawk 3.0.3 GNU

The autoconf utility is only required on Linux/Unix Systems if the configuration scripts have to be changed. For window systems a special set of makefiles in the directory ./win32 is provided which are not using the autoconf facility.

Installation on Linux/Unix

Unpacking and Configuration

$ gunzip -c gnade-src-linux-gnu-<version>.tar.gz | tar xvf -
$ cd gnade-src-linux-gnu-<version>
$ ./configure <dbname>

As dbname the following values are allowed.

  • mimer - MimerSQL
  • postgres - PostgreSQL
  • MySQL - MySQL

If the value is omitted, all subsequent steps regarding the data base installation may be skipped.

Installation of the Database

Depending on the installation of the data base you have specified in the configure script command, you have to execute the following step either by using a DBA account our you may use your own user account.

$ su ..dba..
$ make createuser

After the database and the database user has been configured, the ODBC interface has to be configured. The directory ./samples/sample_db contains sample files for the unixODBC driver manager. The files odbc.ini.sample odbcinst.ini.sample have to be copied to /etc/odbc.ini and /etc/ odbcinst.ini.sample.

Compiling an testing

After the creation of the data base user, the final build may be done by:

$ make

Test code is located under ./samples. In order to test the functionality of the ODBC interface use the examples in ./odbc or ./esql.

If it does not work

If this installation procedure fails you may use the Makefile under ./win32. This makefile is known to work at least on Solaris well if the correct driver manager is installed (see section other components).

Installation on Windows NT

For window users a zip file is provided. In order to install perform the following steps:

> unzip gnade-src-linux-gnu-<version>.zip
> cd gnade-src-linux-gnu-<version>/win32
> make 
                                   
The issue regarding the installation of a data base user has to be done by hand. 
The windows makefile  uses the make.conf file which is prebuilt by the ./configure script. Any configuration
change has to be done there. Please refer to the README file in ./win32.

Other components

The following Driver Manager are known to work with the release:

Component Description Version Operating System Comments
unixODC ODBC Driver Manager 1.8.12-2 Linux www.unixodbc.org
2.0.5 Solaris 8

www.unixodbc.org

The iODBC 3.04 implementation on Solaris seems to have a problem with the handling of cursor states. It should not be used.

Contributions

Special regards to the following persons which have contributed to the project:

Florian Weimer Florian.Weimer@RUS.Uni-Stuttgart.DE
François Fabien. fr.fabien@infonie.fr
Pascal Obry p.obry@wanadoo.fr

gnade-1.6.2.orig/doc/releasenotes/note_1.1.5.html0000644000175000017500000006525607342770274021242 0ustar lbrentalbrenta No title

GNat Ada 95 Database Environment - (GNADE)

Version 1.1.5

Editor M.Erdmann

27.8.2001

Content

This release of the GNADE project is intended for building with the GNU Ada Translator on the platforms Linux, Solaris and Windows NT/95/2000 with the following features:

  • An extensive thin Ada 95 binding to the ODBC interfaces.
  • ISO/92 compliant embedded SQL translator which is able to process Ada 95 packages and files containing only one procedure. The translator creates Ada 95 source files working on top the of the ODBC interface.
  • Installation support for some commonly known data base products (see below).
  • Documentation in HTML, Postscript and PDF format.
  • Native Ada 95 bindings for MySQL and Postgres.
  • GNU specific include clause which allows to access the ODBC handles via embedded SQL. This allows to mix embedded SQL and low level ODBC programing in a single source (see chapter in documentation).
  • DECLARE TABLE is used to generate parts of the schema files (-schema option).
  • Support of embedded SQL.

New in this release is:

  • Support of Oracle Lite on MS Windows 95
  • Support of MySQL with MS ODBC Drivers on Windows 95
  • Unicode support on the ODBC interface.
  • In the contribution section an early version of a SQL development environment completly based on the ODBC interface.

The GNADE code and the documentation is distributed in the following files:

File Size in Bytes Contents
gnade-src-1.1.5.tar.gz Complete GNADE source code distribution GNU compressed tar file
gnade-src-1.1.5.zip Complete GNADE source code distribution as ZIP file.
gnade-1.1.5.exe Windows NT setup contains only the binaries and the libraries of the GNADE project.
gnade-1.1.5-1.i386.rpm

gnade-runtime-1.1.5-1.i386.rpm

For Linux (SuSE/Redhat) tools and the libraries as installable packages. The packages are available via http://www.gnuada.org/.

Supported Databases

Even the GNADE project except for the native data base bindings is expected to work with all ODBC compliant data base products. The following products are known to work with GNADE assuming, that you are using the correct driver manager (see section "Other Components").

Component Description Version OS Distribution/Source of the release
Postgres PostgreSQL Database 7.0.3
Linux - Redhat 7.0
Linux - SuSe 7.0
Solaris 7
Windows NT/2000
www.postgresql.org
Mimer Mimer SQL RDBMS 8.2
Solaris 7/8
Linux
Windows NT
www.mimer.com
MySQL MySQL Database
MyODBC

3.23.22

2.50.36-1

Linux www.mysql.com
3.23.35a

2.50.36

Windows 2000 www.mysql.com
MS SQL Server 7.0 Windows 2000 Microsoft
SQL Server 2000 Windows 2000 Microsoft
Oracle Lite 8i Windows 95 Oracle

The GNADE project installation procedure provides for theses product test data bases. If your data base is not listed below, the GNADE project will be very likely usable but the test data base has to be installed manually.

Copyright, License and Authors

The GNU Public License (GPL) applies with the following extension to all software components in this release

As a special exception, if other files instantiate generics from GNADE Ada units, or you link GNADE Ada units or libraries with other files to produce an executable, these units or libraries do not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.

The documentation has been put under the Free GNU Documentation License.

The authors and copyright holders of the GNADE project are:

Jürgen Pfeifer juergen.pfeifer@gmx.net>
Michael Erdmann Michael.Erdmann@snafu.de
Sune Falck sunef@hem.passagen.se
François Fabien fr.fabien@infonie.fr

Contact

Bug Reports http://sourcefore.net/projects/gnade M.Erdmann
GNADE Discussions http://cert.uni-stuttgart.de/mailman/listinfo/gnade-dev

gnade-dev@cert.uni-stuttgart.de

Florian Weimer
Project Page http://gnade.sourceforge.net/

http://sourcefore.net/projects/gnade

M.Erdmann
Dev. Coordination Michael.Erdmann@snafu.de M.Erdmann

New Features

Feature Req, Short Description Version Comments
426744 ESQL shall be able to handle files with only one procedure in. 1.1.2 None

Restrictions

  • The configuration procedure for Solaris has not been tested completely. If it fails please use the Makefiles in the directory ./win32. These files are known to build a working installation under Solaris.
  • The Object Ada Compiler is known to fail compiling the ODBC bindings because of insufficient compliance to the Ada 95 RM.
  • The compilation of the ODBC bindings is known to fail on a Sun SPARC using GNADE 1.13p (ACT tracking number [8925-002] Gigi abort code 411 on SPARC architectures).
  • The Option -compiler has been added to allow the support of specific of different Ada 95 compilers which has currently no effect.
  • Unicode support is only available begining with UnixODBC version 2.0
  • Oracle 8i requires the declaration of string hostvariable to be 1 character larger then the domain size, e.g. assuming the size of the domain Ename from the example simple to be 20, the host variables have to be defined as:
    Ename           :   Char (1..21); 
    Dept_Name   :   Char (1..21); 
    Location        :   Char (1..21);
    
    
    The automatic installation is not supported in case of Oracle 8i but the installation script is located under samples.

Fixed Problems

Problems reported earlier then 0.9o are listed in the release note 1.1.2.

Bug Ref. Fixed with

Version

Short Description Comments
421587 0.9o ObjectAda Unrestricted_Access not supported. Unrestricted access is not used any more.
425280 1.1.1 Name of esql not changed every where GNUmakefile updated
425409 1.1.1 sql_standard prefix not handled correct gesql updated
425410 1.1.1 whenever sqlwarning faulty gesql updated
425510 1.1.1 gpl.sgml missing in distribution MANIFEST updated
421586 1.1.2 GNUmake on Windows 95 does not work Makefile changed
435712 1.1.2 Wrong debug code generated esql translator and esql_support updated
427531 1.1.2 gesql file corrupt but available The output file will always be deleted if some error during translation occurred.
427557 1.1.2 gesql command line not correct evaluated driver changed.
427764 1.1.3 Relastion missing error not recognized Code generation has been changed
427747 1.1.3 help message shown twice driver.adb changed
427750 1.1.3 Dynamic SQL DECLARE statement missing documentation updated
427748 1.1.3 Some_Error exception undefine code generator updated
430075 1.1.3 -noniso92 switch does not exist code generator updated
430077 1.1.3 -noiso92 switch not evaluated code generator updated
429984 1.1.4 Result evaluation done twice code generator updated
430751 1.1.4 Notfound class not correctly evaluated code generator updated
430752 1.1.4 not found exception raised twice code generator updated
430760 1.1.4 Number of affrected rows missing is SQLC code generator updated
435982 1.1.5 Wrong package name found esql parser updated
435872 1.1.5 Debug information missleading esql code generator updated
437590 1.1.5 Example simple does not work with MySQL GNU.DB.SQLCLI and esql_support.odbc

updated.

439149 1.1.5 SQLCA Not inserted correctly esql parser updated
439151 1.1.5 Handling of inner exception -noiso92 switch changed to -iso92 switch
439274 1.1.5 Mimer SQL not correctly installed Makefile updated
439274 1.1.5 MimerSQL, Tables of test db not found. Documentation updated

Known Problems

Bug Ref. Short Description Comments
411141 Missing ";" for "EXEC SQL DECLARE DB01 D" This problem may be bypassed by putting a semicolon in the source code.
421586

ODBC does not compile with ObjectAda

This is a problem with the Object Ada compiler which has to be fixed there.

Installation

The installation of this software requires the following components:

Component Version Origin
gzip 1.2.4 GNU
unzip 5.42 Infozip
zip 2.2 Infozip
tar - GNU or native
autoconf*1 2-13-9 GNU
make 3.79.1 GNU
gnat 3.13p ALT distribution
gawk 3.0.3 GNU

The autoconf utility is only required on Linux/Unix Systems if the configuration scripts have to be changed. For window systems a special set of makefiles in the directory ./win32 is provided which are not using the autoconf facility.

Installation on Linux/Unix

Unpacking and Configuration

$ gunzip -c gnade-src-linux-gnu-<version>.tar.gz | tar xvf -
$ cd gnade-src-linux-gnu-<version>
$ ./configure <dbname>

As dbname the following values are allowed.

  • mimer - MimerSQL
  • postgres - PostgreSQL
  • MySQL - MySQL

If the value is omitted because your data base product is not listed,, all subsequent steps regarding the data base installation may be skipped and you have to install the test database manually.

Installation of the Database

Depending on the installation of the data base you have specified in the configure script command, you have to execute the following step either by using a DBA account our you may use your own user account.

$ su ..dba..
$ make createuser

After the database and the database user has been configured, the ODBC interface has to be configured. The directory ./samples/sample_db contains sample files for the unixODBC driver manager. The files odbc.ini.sample odbcinst.ini.sample have to be copied to /etc/odbc.ini and /etc/ odbcinst.ini.sample.

Compiling an testing

After the creation of the data base user, the final build may be done by:

$ make

Test code is located under ./samples. In order to test the functionality of the ODBC interface use the examples in ./odbc or ./esql.

If it does not work

If this installation procedure fails you may use the Makefile under ./win32. This makefile is known to work at least on Solaris well if the correct driver manager is installed (see section other components).

Installation on Windows NT

For window users a zip file is provided. In order to install perform the following steps:

> unzip gnade-src-linux-gnu-<version>.zip
> cd gnade-src-linux-gnu-<version>/win32
> make 
                                   
The issue regarding the installation of a data base user has to be done by hand. 
The windows makefile  uses the make.conf file which is prebuilt by the ./configure script. Any configuration
change has to be done there. Please refer to the README file in ./win32.

Other components

The following Driver Manager are known to work with the release:

Component Description Version Operating System Comments
unixODBC ODBC Driver Manager 1.8.12-2 Linux www.unixodbc.org
2.0.5 Solaris 8

www.unixodbc.org

ODBC Driver Manager 3.5.10 Windows 95 Microsoft

The iODBC 3.04 implementation on Solaris seems to have a problem with the handling of cursor states. It should not be used.

Contributions

Special regards to the following persons which have contributed to the project:

Florian Weimer Florian.Weimer@RUS.Uni-Stuttgart.DE
François Fabien. fr.fabien@infonie.fr
Pascal Obry p.obry@wanadoo.fr


Document Version: $Date: 2001/08/28 19:27:56 $ $Revision: 1.8 $

gnade-1.6.2.orig/doc/releasenotes/note_1.1.6.html0000644000175000017500000006667507362076216021246 0ustar lbrentalbrenta No title

GNat Ada 95 Database Environment - (GNADE)

Version 1.1.6

Editor M.Erdmann

12.10.2001

Content

This release of the GNADE project is intended for building with the GNU Ada Translator on the platforms Linux, Solaris and Windows NT/95/2000 with the following features:

  • An extensive thin Ada 95 binding to the ODBC interfaces.
  • ISO/92 compliant embedded SQL translator which is able to process Ada 95 packages and files containing only one procedure. The translator creates Ada 95 source files working on top the of the ODBC interface.
  • Installation support for some commonly known data base products (see below).
  • Documentation in HTML, Postscript and PDF format.
  • Native Ada 95 bindings for MySQL and Postgres.
  • GNU specific include clause which allows to access the ODBC handles via embedded SQL. This allows to mix embedded SQL and low level ODBC programing in a single source (see chapter in documentation).
  • DECLARE TABLE is used to generate parts of the schema files (-schema option).
  • Support of embedded SQL.
  • Support of Oracle Lite on MS Windows 95
  • Support of MySQL with MS ODBC Drivers on Windows 95
  • Unicode support on the ODBC interface.

New in this release:

  • The connection clause has been extended by the ON clause in order to intercept typical connection errors and to define a reaction on ESQL level as shown below:

    CONNECT ...........

    [ ON [COMMUNICATION|AUTHORIZATION|OTHER] ERROR [RAISE|GOTO|DO] <target> ]

  • Error corrections.

The GNADE code and the documentation is distributed in the following files:

File Size in Bytes Contents
gnade-src-1.1.5.tar.gz Complete GNADE source code distribution GNU compressed tar file
gnade-src-1.1.5.zip Complete GNADE source code distribution as ZIP file.
gnade-1.1.5.exe Windows NT setup contains only the binaries and the libraries of the GNADE project.
gnade-1.1.5-1.i386.rpm

gnade-runtime-1.1.5-1.i386.rpm

For Linux (SuSE/Redhat) tools and the libraries as installable packages. The packages are available via http://www.gnuada.org/.

Supported Databases

Even the GNADE project except for the native data base bindings is expected to work with all ODBC compliant data base products. The following products are known to work with GNADE assuming, that you are using the correct driver manager (see section "Other Components").

Component Description Version OS Distribution/Source of the release
Postgres PostgreSQL Database 7.0.3
Linux - Redhat 7.0
Linux - SuSe 7.0
Solaris 7
Windows NT/2000
www.postgresql.org
Mimer Mimer SQL RDBMS 8.2
Solaris 7/8
Linux
Windows NT
www.mimer.com
MySQL MySQL Database
MyODBC

3.23.22

2.50.36-1

Linux www.mysql.com
3.23.35a

2.50.36

Windows 2000 www.mysql.com
MS SQL Server 7.0 Windows 2000 Microsoft
SQL Server 2000 Windows 2000 Microsoft
Oracle Lite 8i Windows 95 Oracle

The GNADE project installation procedure provides for theses product test data bases. If your data base is not listed below, the GNADE project will be very likely usable but the test data base has to be installed manually.

Copyright, License and Authors

The GNU Public License (GPL) applies with the following extension to all software components in this release

As a special exception, if other files instantiate generics from GNADE Ada units, or you link GNADE Ada units or libraries with other files to produce an executable, these units or libraries do not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.

The documentation has been put under the Free GNU Documentation License.

The authors and copyright holders of the GNADE project are:

Jürgen Pfeifer juergen.pfeifer@gmx.net>
Michael Erdmann Michael.Erdmann@snafu.de
Sune Falck sunef@hem.passagen.se
François Fabien fr.fabien@infonie.fr

Contact

Bug Reports http://sourcefore.net/projects/gnade M.Erdmann
GNADE Discussions http://cert.uni-stuttgart.de/mailman/listinfo/gnade-dev

gnade-dev@cert.uni-stuttgart.de

Florian Weimer
Project Page http://gnade.sourceforge.net/

http://sourcefore.net/projects/gnade

M.Erdmann
Dev. Coordination Michael.Erdmann@snafu.de M.Erdmann

New Features

Feature Req, Short Description Version Comments
426744 ESQL shall be able to handle files with only one procedure in. 1.1.2 None

Restrictions

  • The configuration procedure for Solaris has not been tested completely. If it fails please use the Makefiles in the directory ./win32. These files are known to build a working installation under Solaris.
  • The Object Ada Compiler is known to fail compiling the ODBC bindings because of insufficient compliance to the Ada 95 RM.
  • The compilation of the ODBC bindings is known to fail on a Sun SPARC using GNADE 1.13p (ACT tracking number [8925-002] Gigi abort code 411 on SPARC architectures).
  • The Option -compiler has been added to allow the support of specific of different Ada 95 compilers which has currently no effect.
  • Unicode support is only available begining with UnixODBC version 2.0
  • Oracle 8i requires the declaration of string hostvariable to be 1 character larger then the domain size, e.g. assuming the size of the domain Ename from the example simple to be 20, the host variables have to be defined as:
    Ename           :   Char (1..21); 
    Dept_Name   :   Char (1..21); 
    Location        :   Char (1..21);
    
    The automatic installation is not supported in case of Oracle 8i but the installation script is located under samples.

Fixed Problems

Problems reported earlier then 0.9o are listed in the release note 1.1.2.

Bug Ref. Fixed with

Version

Short Description Comments
421587 0.9o ObjectAda Unrestricted_Access not supported. Unrestricted access is not used any more.
425280 1.1.1 Name of esql not changed every where GNUmakefile updated
425409 1.1.1 sql_standard prefix not handled correct gesql updated
425410 1.1.1 whenever sqlwarning faulty gesql updated
425510 1.1.1 gpl.sgml missing in distribution MANIFEST updated
421586 1.1.2 GNUmake on Windows 95 does not work Makefile changed
435712 1.1.2 Wrong debug code generated esql translator and esql_support updated
427531 1.1.2 gesql file corrupt but available The output file will always be deleted if some error during translation occurred.
427557 1.1.2 gesql command line not correct evaluated driver changed.
427764 1.1.3 Relastion missing error not recognized Code generation has been changed
427747 1.1.3 help message shown twice driver.adb changed
427750 1.1.3 Dynamic SQL DECLARE statement missing documentation updated
427748 1.1.3 Some_Error exception undefine code generator updated
430075 1.1.3 -noniso92 switch does not exist code generator updated
430077 1.1.3 -noiso92 switch not evaluated code generator updated
429984 1.1.4 Result evaluation done twice code generator updated
430751 1.1.4 Notfound class not correctly evaluated code generator updated
430752 1.1.4 not found exception raised twice code generator updated
430760 1.1.4 Number of affrected rows missing is SQLC code generator updated
435982 1.1.5 Wrong package name found esql parser updated
435872 1.1.5 Debug information missleading esql code generator updated
437590 1.1.5 Example simple does not work with MySQL GNU.DB.SQLCLI and esql_support.odbc

updated.

439149 1.1.5 SQLCA Not inserted correctly esql parser updated
439151 1.1.5 Handling of inner exception -noiso92 switch changed to -iso92 switch
439274 1.1.5 Mimer SQL not correctly installed Makefile updated
439274 1.1.5 MimerSQL, Tables of test db not found. Documentation updated
478056 1.1.6 Move in ESQL raises exception esql_support.adb updated
470357 1.1.6 simple.gpq does not handle conn. error simple.gqp updated

Known Problems

Bug Ref. Short Description Comments
411141 Missing ";" for "EXEC SQL DECLARE DB01 D" This problem may be bypassed by putting a semicolon in the source code.
421586

ODBC does not compile with ObjectAda

This is a problem with the Object Ada compiler which has to be fixed there.

Installation

The installation of this software requires the following components:

Component Version Origin
gzip 1.2.4 GNU
unzip 5.42 Infozip
zip 2.2 Infozip
tar - GNU or native
autoconf*1 2-13-9 GNU
make 3.79.1 GNU
gnat 3.13p ALT distribution
gawk 3.0.3 GNU

The autoconf utility is only required on Linux/Unix Systems if the configuration scripts have to be changed. For window systems a special set of makefiles in the directory ./win32 is provided which are not using the autoconf facility.

Installation on Linux/Unix

Unpacking and Configuration

$ gunzip -c gnade-src-linux-gnu-<version>.tar.gz | tar xvf -
$ cd gnade-src-linux-gnu-<version>
$ ./configure <dbname>

As dbname the following values are allowed.

  • mimer - MimerSQL
  • postgres - PostgreSQL
  • MySQL - MySQL

If the value is omitted because your data base product is not listed,, all subsequent steps regarding the data base installation may be skipped and you have to install the test database manually.

Installation of the Database

Depending on the installation of the data base you have specified in the configure script command, you have to execute the following step either by using a DBA account our you may use your own user account.

$ su ..dba..
$ make createuser

After the database and the database user has been configured, the ODBC interface has to be configured. The directory ./samples/sample_db contains sample files for the unixODBC driver manager. The files odbc.ini.sample odbcinst.ini.sample have to be copied to /etc/odbc.ini and /etc/ odbcinst.ini.sample.

Compiling an testing

After the creation of the data base user, the final build may be done by:

$ make

Test code is located under ./samples. In order to test the functionality of the ODBC interface use the examples in ./odbc or ./esql.

If it does not work

If this installation procedure fails you may use the Makefile under ./win32. This makefile is known to work at least on Solaris well if the correct driver manager is installed (see section other components).

Installation on Windows NT

For window users a zip file is provided. In order to install perform the following steps:

> unzip gnade-src-linux-gnu-<version>.zip
> cd gnade-src-linux-gnu-<version>/win32
> make 
                                   
The issue regarding the installation of a data base user has to be done by hand. 
The windows makefile  uses the make.conf file which is prebuilt by the ./configure script. Any configuration
change has to be done there. Please refer to the README file in ./win32.

Other components

The following Driver Manager are known to work with the release:

Component Description Version Operating System Comments
unixODBC ODBC Driver Manager 1.8.12-2 Linux www.unixodbc.org
2.0.5 Solaris 8

www.unixodbc.org

ODBC Driver Manager 3.5.10 Windows 95 Microsoft

The iODBC 3.04 implementation on Solaris seems to have a problem with the handling of cursor states. It should not be used.

Contributions

Special regards to the following persons which have contributed to the project:

Florian Weimer Florian.Weimer@RUS.Uni-Stuttgart.DE
François Fabien. fr.fabien@infonie.fr
Pascal Obry p.obry@wanadoo.fr


Document Version: $Date: 2001/10/13 17:40:30 $ $Revision: 1.1 $

gnade-1.6.2.orig/doc/releasenotes/note_1.1.7.html0000644000175000017500000006605307363110077021230 0ustar lbrentalbrenta No title

GNat Ada 95 Database Environment - (GNADE)

Version 1.1.7

Editor M.Erdmann

16.10.2001

Contents

This release of the GNADE project is intended for building with the GNU Ada Translator on the platforms Linux, Solaris and Windows NT/95/2000 with the following features:

  • An extensive thin Ada 95 binding to the ODBC interfaces.
  • ISO/92 compliant embedded SQL translator which is able to process Ada 95 packages and files containing only one procedure. The translator creates Ada 95 source files working on top the of the ODBC interface.
  • Installation support for some commonly known data base products (see below).
  • Documentation in HTML, Postscript and PDF format.
  • Native Ada 95 bindings for MySQL and Postgres.
  • GNU specific include clause which allows to access the ODBC handles via embedded SQL. This allows to mix embedded SQL and low level ODBC programing in a single source (see chapter in documentation).
  • DECLARE TABLE is used to generate parts of the schema files (-schema option).
  • Support of embedded SQL.
  • Support of Oracle Lite on MS Windows 95
  • Support of MySQL with MS ODBC Drivers on Windows 95
  • Unicode support on the ODBC interface.

New in this release:

  • The connection clause has been extended by the ON clause in order to intercept typical connection errors and to define a reaction on ESQL level as shown below:

    CONNECT ...........

    [ ON [COMMUNICATION|AUTHORIZATION|OTHER] ERROR [RAISE|GOTO|DO] <target> ]

  • Error corrections
  • The inline comments have been changed to: --% <source-filename>

The GNADE code and the documentation is distributed in the following files:

File Size in Bytes Contents
gnade-src-1.1.7.tar.gz Complete GNADE source code distribution GNU compressed tar file
gnade-src-1.1.7.zip Complete GNADE source code distribution as ZIP file.

Supported Databases

Even the GNADE project except for the native data base bindings is expected to work with all ODBC compliant data base products. The following products are known to work with GNADE assuming, that you are using the correct driver manager (see section "Other Components").

Component Description Version OS Distribution/Source of the release
Postgres PostgreSQL Database 7.0.3
Linux - Redhat 7.0
Linux - SuSe 7.0
Solaris 7
Windows NT/2000
www.postgresql.org
Mimer Mimer SQL RDBMS 8.2
Solaris 7/8
Linux
Windows NT
www.mimer.com
MySQL MySQL Database
MyODBC

3.23.22

2.50.36-1

Linux www.mysql.com
3.23.35a

2.50.36

Windows 2000 www.mysql.com
MS SQL Server 7.0 Windows 2000 Microsoft
SQL Server 2000 Windows 2000 Microsoft
Oracle Lite 8i Windows 95 Oracle

The GNADE project installation procedure provides for theses product test data bases. If your data base is not listed below, the GNADE project will be very likely usable but the test data base has to be installed manually.

Copyright, License and Authors

The GNU Public License (GPL) applies with the following extension to all software components in this release

As a special exception, if other files instantiate generics from GNADE Ada units, or you link GNADE Ada units or libraries with other files to produce an executable, these units or libraries do not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.

The documentation has been put under the Free GNU Documentation License.

The authors and copyright holders of the GNADE project are:

Jürgen Pfeifer juergen.pfeifer@gmx.net>
Michael Erdmann Michael.Erdmann@snafu.de
Sune Falck sunef@hem.passagen.se
François Fabien fr.fabien@infonie.fr

Contact

Bug Reports http://sourcefore.net/projects/gnade M.Erdmann
GNADE Discussions http://cert.uni-stuttgart.de/mailman/listinfo/gnade-dev

gnade-dev@cert.uni-stuttgart.de

Florian Weimer
Project Page http://gnade.sourceforge.net/

http://sourcefore.net/projects/gnade

M.Erdmann
Dev. Coordination Michael.Erdmann@snafu.de M.Erdmann

New Features

Feature Req, Short Description Version Comments
426744 ESQL shall be able to handle files with only one procedure in. 1.1.2 None

Restrictions

  • The configuration procedure for Solaris has not been tested completely. If it fails please use the Makefiles in the directory ./win32. These files are known to build a working installation under Solaris.
  • The Object Ada Compiler is known to fail compiling the ODBC bindings because of insufficient compliance to the Ada 95 RM.
  • The compilation of the ODBC bindings is known to fail on a Sun SPARC using GNADE 1.13p (ACT tracking number [8925-002] Gigi abort code 411 on SPARC architectures).
  • The Option -compiler has been added to allow the support of specific of different Ada 95 compilers which has currently no effect.
  • Unicode support is only available begining with UnixODBC version 2.0
  • Oracle 8i requires the declaration of string hostvariable to be 1 character larger then the domain size, e.g. assuming the size of the domain Ename from the example simple to be 20, the host variables have to be defined as:
    Ename           :   Char (1..21); 
    Dept_Name   :   Char (1..21); 
    Location        :   Char (1..21);
    The automatic installation is not supported in case of Oracle 8i but the installation script is located under samples.

Fixed Problems

Problems reported earlier then 0.9o are listed in the release note 1.1.2.

Bug Ref. Fixed with

Version

Short Description Comments
421587 0.9o ObjectAda Unrestricted_Access not supported. Unrestricted access is not used any more.
425280 1.1.1 Name of esql not changed every where GNUmakefile updated
425409 1.1.1 sql_standard prefix not handled correct gesql updated
425410 1.1.1 whenever sqlwarning faulty gesql updated
425510 1.1.1 gpl.sgml missing in distribution MANIFEST updated
421586 1.1.2 GNUmake on Windows 95 does not work Makefile changed
435712 1.1.2 Wrong debug code generated esql translator and esql_support updated
427531 1.1.2 gesql file corrupt but available The output file will always be deleted if some error during translation occurred.
427557 1.1.2 gesql command line not correct evaluated driver changed.
427764 1.1.3 Relastion missing error not recognized Code generation has been changed
427747 1.1.3 help message shown twice driver.adb changed
427750 1.1.3 Dynamic SQL DECLARE statement missing documentation updated
427748 1.1.3 Some_Error exception undefine code generator updated
430075 1.1.3 -noniso92 switch does not exist code generator updated
430077 1.1.3 -noiso92 switch not evaluated code generator updated
429984 1.1.4 Result evaluation done twice code generator updated
430751 1.1.4 Notfound class not correctly evaluated code generator updated
430752 1.1.4 not found exception raised twice code generator updated
430760 1.1.4 Number of affrected rows missing is SQLC code generator updated
435982 1.1.5 Wrong package name found esql parser updated
435872 1.1.5 Debug information missleading esql code generator updated
437590 1.1.5 Example simple does not work with MySQL GNU.DB.SQLCLI and esql_support.odbc

updated.

439149 1.1.5 SQLCA Not inserted correctly esql parser updated
439151 1.1.5 Handling of inner exception -noiso92 switch changed to -iso92 switch
439274 1.1.5 Mimer SQL not correctly installed Makefile updated
439274 1.1.5 MimerSQL, Tables of test db not found. Documentation updated
478056 1.1.6 Move in ESQL raises exception esql_support.adb updated
470357 1.1.6 simple.gpq does not handle conn. error simple.gqp updated
471060 1.1.7 esql_parse does not compile esql_parser.adb updated
471082 1.1.7 Useless evaluate code generated esql_parser.adb updated

Known Problems

Bug Ref. Short Description Comments
411141 Missing ";" for "EXEC SQL DECLARE DB01 D" This problem may be bypassed by putting a semicolon in the source code.
421586

ODBC does not compile with ObjectAda

This is a problem with the Object Ada compiler which has to be fixed there.

Installation

The installation of this software requires the following components:

Component Version Origin
gzip 1.2.4 GNU
unzip 5.42 Infozip
zip 2.2 Infozip
tar - GNU or native
autoconf*1 2-13-9 GNU
make 3.79.1 GNU
gnat 3.13p ALT distribution
gawk 3.0.3 GNU

The autoconf utility is only required on Linux/Unix Systems if the configuration scripts have to be changed. For window systems a special set of makefiles in the directory ./win32 is provided which are not using the autoconf facility.

Installation on Linux/Unix

Unpacking and Configuration

$ gunzip -c gnade-src-linux-gnu-<version>.tar.gz | tar xvf -
$ cd gnade-src-linux-gnu-<version>
$ ./configure <dbname>

As dbname the following values are allowed.

  • mimer - MimerSQL
  • postgres - PostgreSQL
  • MySQL - MySQL

If the value is omitted because your data base product is not listed,, all subsequent steps regarding the data base installation may be skipped and you have to install the test database manually.

Installation of the Database

Depending on the installation of the data base you have specified in the configure script command, you have to execute the following step either by using a DBA account our you may use your own user account.

$ su ..dba..
$ make createuser

After the database and the database user has been configured, the ODBC interface has to be configured. The directory ./samples/sample_db contains sample files for the unixODBC driver manager. The files odbc.ini.sample odbcinst.ini.sample have to be copied to /etc/odbc.ini and /etc/ odbcinst.ini.sample.

Compiling an testing

After the creation of the data base user, the final build may be done by:

$ make

Test code is located under ./samples. In order to test the functionality of the ODBC interface use the examples in ./odbc or ./esql.

If it does not work

If this installation procedure fails you may use the Makefile under ./win32. This makefile is known to work at least on Solaris well if the correct driver manager is installed (see section other components).

Installation on Windows NT

For window users a zip file is provided. In order to install perform the following steps:

> unzip gnade-src-linux-gnu-<version>.zip
> cd gnade-src-linux-gnu-<version>/win32
> make 
                                   
The issue regarding the installation of a data base user has to be done by hand. 
The windows makefile  uses the make.conf file which is prebuilt by the ./configure script. Any configuration
change has to be done there. Please refer to the README file in ./win32.

Other components

The following Driver Manager are known to work with the release:

Component Description Version Operating System Comments
unixODBC ODBC Driver Manager 1.8.12-2 Linux www.unixodbc.org
2.0.5 Solaris 8

www.unixodbc.org

ODBC Driver Manager 3.5.10 Windows 95 Microsoft

The iODBC 3.04 implementation on Solaris seems to have a problem with the handling of cursor states. It should not be used.

Contributions

Special regards to the following persons which have contributed to the project:

Florian Weimer Florian.Weimer@RUS.Uni-Stuttgart.DE
François Fabien. fr.fabien@infonie.fr
Pascal Obry p.obry@wanadoo.fr


Document Version: $Date: 2001/10/16 19:53:35 $ $Revision: 1.1 $

gnade-1.6.2.orig/doc/releasenotes/note_1.1.8.html0000644000175000017500000007441507364264367021247 0ustar lbrentalbrenta No title

GNat Ada 95 Database Environment - (GNADE)

Version 1.1.8

Editor M.Erdmann

20.10.2001

Contents

This release of the GNADE project is intended for building with the GNU Ada Translator on the platforms Linux, Solaris and Windows NT/95/2000.

Features

  • An extensive thin Ada 95 binding to the ODBC interfaces.
  • ISO/92 compliant embedded SQL translator which is able to process Ada 95 packages and files containing only one procedure. The translator creates Ada 95 source files working on top the of the ODBC interface.
  • Installation support for some commonly known data base products (see below).
  • Documentation in HTML, Postscript and PDF format.
  • Native Ada 95 bindings for MySQL and Postgres.
  • GNU specific include clause which allows to access the ODBC handles via embedded SQL. This allows to mix embedded SQL and low level ODBC programing in a single source (see chapter in documentation).
  • DECLARE TABLE is used to generate parts of the schema files (-schema option).
  • Support of embedded SQL.
  • Support of Oracle Lite on MS Windows 95
  • Support of MySQL with MS ODBC Drivers on Windows 95
  • Unicode support on the ODBC interface.
  • The connection clause has been extended by the ON clause in order to intercept typical connection errors and to define a reaction on ESQL level as shown below:

    CONNECT ......

    [ ON [COMMUNICATION|AUTHORIZATION|OTHER] ERROR [RAISE|GOTO|DO] <target> ]

New in this release

  • A new GNADE implemenation defined data types as VARCHAR and VARBINARY.

The GNADE code and the documentation is distributed in the following files:

File Size in Bytes Contents
gnade-src-1.1.7.tar.gz Complete GNADE source code distribution GNU compressed tar file
gnade-src-1.1.7.zip Complete GNADE source code distribution as ZIP file.

Supported Databases

Even the GNADE project except for the native data base bindings is expected to work with all ODBC compliant data base products. The following products are known to work with GNADE assuming, that you are using the correct driver manager (see section "Other Components").

Component Description Version OS Distribution/Source of the release
Postgres PostgreSQL Database 7.0.3
Linux - Redhat 7.0
Linux - SuSe 7.0
Solaris 7
Windows NT/2000
www.postgresql.org
Mimer Mimer SQL RDBMS 8.2
Solaris 7/8
Linux
Windows NT
www.mimer.com
MySQL MySQL Database
MyODBC

3.23.22

2.50.36-1

Linux www.mysql.com
3.23.35a

2.50.36

Windows 2000 www.mysql.com
MS SQL Server 7.0 Windows 2000 Microsoft
SQL Server 2000 Windows 2000 Microsoft
Oracle Lite 8i Windows 95 Oracle

The GNADE project installation procedure provides for theses product test data bases. If your data base is not listed below, the GNADE project will be very likely usable but the test data base has to be installed manually.

Distribution Information

The GNADE code and the documentation is distributed in the following files:

File Size in Bytes Contents
gnade-src-1.1.7.tar.gz Complete GNADE source code distribution GNU compressed tar file
gnade-src-1.1.7.zip Complete GNADE source code distribution as ZIP file.

Copyright, License and Authors

The GNU Public License (GPL) applies with the following extension to all software components in this release

As a special exception, if other files instantiate generics from GNADE Ada units, or you link GNADE Ada units or libraries with other files to produce an executable, these units or libraries do not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.

The documentation has been put under the Free GNU Documentation License.

The authors and copyright holders of the GNADE project are:

Jürgen Pfeifer juergen.pfeifer@gmx.net>
Michael Erdmann Michael.Erdmann@snafu.de
Sune Falck sunef@hem.passagen.se
François Fabien fr.fabien@infonie.fr

Contact

Bug Reports http://sourcefore.net/projects/gnade M.Erdmann
GNADE Discussions http://cert.uni-stuttgart.de/mailman/listinfo/gnade-dev

gnade-dev@cert.uni-stuttgart.de

Florian Weimer
Project Page http://gnade.sourceforge.net/

http://sourcefore.net/projects/gnade

M.Erdmann
Dev. Coordination Michael.Erdmann@snafu.de M.Erdmann

New Features

Feature Req, Short Description Version Comments
426744 ESQL shall be able to handle files with only one procedure in. 1.1.2 None
473046 ESQL extended types as VARCHAR 1.1.8 VARCHAR only

Restrictions

  • The configuration procedure for Solaris has not been tested completely. If it fails please use the Makefiles in the directory ./win32. These files are known to build a working installation under Solaris.
  • The Object Ada Compiler is known to fail compiling the ODBC bindings because of insufficient compliance to the Ada 95 RM.
  • The compilation of the ODBC bindings is known to fail on a Sun SPARC using GNADE 1.13p (ACT tracking number [8925-002] Gigi abort code 411 on SPARC architectures).
  • The Option -compiler has been added to allow the support of specific of different Ada 95 compilers which has currently no effect.
  • Unicode support is only available begining with UnixODBC version 2.0
  • Oracle 8i requires the declaration of string hostvariable to be 1 character larger then the domain size, e.g. assuming the size of the domain Ename from the example simple to be 20, the host variables have to be defined as:
    Ename           :   Char (1..21); 
    Dept_Name   :   Char (1..21); 
    Location        :   Char (1..21);
    
    The automatic installation is not supported in case of Oracle 8i but the installation script is located under samples.

Fixed Problems

Problems reported earlier then 0.9o are listed in the release note 1.1.2.

Bug Ref. Fixed with

Version

Short Description Comments
421587 0.9o ObjectAda Unrestricted_Access not supported. Unrestricted access is not used any more.
425280 1.1.1 Name of esql not changed every where GNUmakefile updated
425409 1.1.1 sql_standard prefix not handled correct gesql updated
425410 1.1.1 whenever sqlwarning faulty gesql updated
425510 1.1.1 gpl.sgml missing in distribution MANIFEST updated
421586 1.1.2 GNUmake on Windows 95 does not work Makefile changed
435712 1.1.2 Wrong debug code generated esql translator and esql_support updated
427531 1.1.2 gesql file corrupt but available The output file will always be deleted if some error during translation occurred.
427557 1.1.2 gesql command line not correct evaluated driver changed.
427764 1.1.3 Relastion missing error not recognized Code generation has been changed
427747 1.1.3 help message shown twice driver.adb changed
427750 1.1.3 Dynamic SQL DECLARE statement missing documentation updated
427748 1.1.3 Some_Error exception undefine code generator updated
430075 1.1.3 -noniso92 switch does not exist code generator updated
430077 1.1.3 -noiso92 switch not evaluated code generator updated
429984 1.1.4 Result evaluation done twice code generator updated
430751 1.1.4 Notfound class not correctly evaluated code generator updated
430752 1.1.4 not found exception raised twice code generator updated
430760 1.1.4 Number of affrected rows missing is SQLC code generator updated
435982 1.1.5 Wrong package name found esql parser updated
435872 1.1.5 Debug information missleading esql code generator updated
437590 1.1.5 Example simple does not work with MySQL GNU.DB.SQLCLI and esql_support.odbc

updated.

439149 1.1.5 SQLCA Not inserted correctly esql parser updated
439151 1.1.5 Handling of inner exception -noiso92 switch changed to -iso92 switch
439274 1.1.5 Mimer SQL not correctly installed Makefile updated
439274 1.1.5 MimerSQL, Tables of test db not found. Documentation updated
478056 1.1.6 Move in ESQL raises exception esql_support.adb updated
470357 1.1.6 simple.gpq does not handle conn. error simple.gqp updated
471060 1.1.7 esql_parse does not compile esql_parser.adb updated
471082 1.1.7 Useless evaluate code generated esql_parser.adb updated
473062 1.1.8 Package name in host var. decl. not eval. esql_parser.adb updated
473104 1.1.8 Query result not evaluated by gesql esql_parser.adb updated

Known Problems

Bug Ref. Short Description Comments
411141 Missing ";" for "EXEC SQL DECLARE DB01 D" This problem may be bypassed by putting a semicolon in the source code.
421586

ODBC does not compile with ObjectAda

This is a problem with the Object Ada compiler which has to be fixed there.

Installation

The GNADE code and the documentation is distributed in the following files:

File Size in Bytes Contents
gnade-src-1.1.7.tar.gz Complete GNADE source code distribution GNU compressed tar file
gnade-src-1.1.7.zip Complete GNADE source code distribution as ZIP file.

The installation of this software requires the following components:

Component Version Origin
gzip 1.2.4 GNU
unzip 5.42 Infozip
zip 2.2 Infozip
tar - GNU or native
autoconf*1 2-13-9 GNU
make 3.79.1 GNU
gnat 3.13p

3.12

ALT distribution
gawk 3.0.3 GNU

The autoconf utility is only required on Linux/Unix Systems if the configuration scripts have to be changed. For window systems a special set of makefiles in the directory ./win32 is provided which are not using the autoconf facility.

Installation on Linux/Unix

Unpacking and Configuration

$ gunzip -c gnade-src-linux-gnu-<version>.tar.gz | tar xvf -
$ cd gnade-src-linux-gnu-<version>
$ ./configure <dbname>

As dbname the following values are allowed.

  • mimer - MimerSQL
  • postgres - PostgreSQL
  • MySQL - MySQL

If the value is omitted because your data base product is not listed,, all subsequent steps regarding the data base installation may be skipped and you have to install the test database manually.

Installation of the Database

Depending on the installation of the data base you have specified in the configure script command, you have to execute the following step either by using a DBA account our you may use your own user account.

$ su ..dba..
$ make createuser

After the database and the database user has been configured, the ODBC interface has to be configured. The directory ./samples/sample_db contains sample files for the unixODBC driver manager. The files odbc.ini.sample odbcinst.ini.sample have to be copied to /etc/odbc.ini and /etc/ odbcinst.ini.sample.

Compiling an testing

After the creation of the data base user, the final build may be done by:

$ make

Test code is located under ./samples. In order to test the functionality of the ODBC interface use the examples in ./odbc or ./esql.

If it does not work

If this installation procedure fails you may use the Makefile under ./win32. This makefile is known to work at least on Solaris well if the correct driver manager is installed (see section other components).

Installation on Windows NT

For window users a zip file is provided. In order to install perform the following steps:

> unzip gnade-src-linux-gnu-<version>.zip
> cd gnade-src-linux-gnu-<version>/win32
> make 
                                   
The issue regarding the installation of a data base user has to be done by hand. 
The windows makefile  uses the make.conf file which is prebuilt by the ./configure script. Any configuration
change has to be done there. Please refer to the README file in ./win32.

Other components

The following Driver Manager are known to work with the release:

Component Description Version Operating System Comments
unixODBC ODBC Driver Manager 1.8.12-2 Linux www.unixodbc.org
2.0.5 Solaris 8

www.unixodbc.org

ODBC Driver Manager 3.5.10 Windows 95 Microsoft

The iODBC 3.04 implementation on Solaris seems to have a problem with the handling of cursor states. It should not be used.

Contributions

Special regards to the following persons which have contributed to the project:

Florian Weimer Florian.Weimer@RUS.Uni-Stuttgart.DE
François Fabien. fr.fabien@infonie.fr
Pascal Obry p.obry@wanadoo.fr


Document Version: $Date: 2001/10/20 12:07:19 $ $Revision: 1.1 $

gnade-1.6.2.orig/doc/releasenotes/note_1.1.9.html0000644000175000017500000006674707365055731021253 0ustar lbrentalbrenta No title

GNat Ada 95 Database Environment - (GNADE)

Version 1.1.9

Editor M.Erdmann

22.10.2001

Contents

This release of the GNADE project is intended for building with the GNU Ada Translator on the platforms Linux, Solaris and Windows NT/95/2000.

Features

  • An extensive thin Ada 95 binding to the ODBC interfaces.
  • ISO/92 compliant embedded SQL translator which is able to process Ada 95 packages and files containing only one procedure. The translator creates Ada 95 source files working on top the of the ODBC interface.
  • Installation support for some commonly known data base products (see below).
  • Documentation in HTML, Postscript and PDF format.
  • Native Ada 95 bindings for MySQL and Postgres.
  • GNU specific include clause which allows to access the ODBC handles via embedded SQL. This allows to mix embedded SQL and low level ODBC programing in a single source (see chapter in documentation).
  • DECLARE TABLE is used to generate parts of the schema files (-schema option).
  • Support of embedded SQL.
  • Support of Oracle Lite on MS Windows 95
  • Support of MySQL with MS ODBC Drivers on Windows 95
  • Unicode support on the ODBC interface.
  • The connection clause has been extended by the ON clause in order to intercept typical connection errors and to define a reaction on ESQL level as shown below:

    CONNECT ......

    [ ON [COMMUNICATION|AUTHORIZATION|OTHER] ERROR [RAISE|GOTO|DO] <target> ]

  • A new GNADE implemenation defined data types as VARCHAR.

Supported Databases

Even the GNADE project except for the native data base bindings is expected to work with all ODBC compliant data base products. The following products are known to work with GNADE assuming, that you are using the correct driver manager (see section "Other Components").

Component Description Version OS Distribution/Source of the release
Postgres PostgreSQL Database 7.0.3
Linux - Redhat 7.0
Linux - SuSe 7.0
Solaris 7
Windows NT/2000
www.postgresql.org
Mimer Mimer SQL RDBMS 8.2
Solaris 7/8
Linux
Windows NT
www.mimer.com
MySQL MySQL Database
MyODBC

3.23.22

2.50.36-1

Linux www.mysql.com
3.23.35a

2.50.36

Windows 2000 www.mysql.com
MS SQL Server 7.0 Windows 2000 Microsoft
SQL Server 2000 Windows 2000 Microsoft
Oracle Lite 8i Windows 95 Oracle

The GNADE project installation procedure provides for theses product test data bases. If your data base is not listed below, the GNADE project will be very likely usable but the test data base has to be installed manually.

Copyright, License and Authors

The GNU Public License (GPL) applies with the following extension to all software components in this release

As a special exception, if other files instantiate generics from GNADE Ada units, or you link GNADE Ada units or libraries with other files to produce an executable, these units or libraries do not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.

The documentation has been put under the Free GNU Documentation License.

The authors and copyright holders of the GNADE project are:

Jürgen Pfeifer juergen.pfeifer@gmx.net>
Michael Erdmann Michael.Erdmann@snafu.de
Sune Falck sunef@hem.passagen.se
François Fabien fr.fabien@infonie.fr

Contact

Bug Reports http://sourcefore.net/projects/gnade M.Erdmann
GNADE Discussions http://cert.uni-stuttgart.de/mailman/listinfo/gnade-dev

gnade-dev@cert.uni-stuttgart.de

Florian Weimer
Project Page http://gnade.sourceforge.net/

http://sourcefore.net/projects/gnade

M.Erdmann
Dev. Coordination Michael.Erdmann@snafu.de M.Erdmann

New Features

Feature Req, Short Description Version Comments
426744 ESQL shall be able to handle files with only one procedure in. 1.1.2 None
473046 ESQL extended types as VARCHAR 1.1.8 VARCHAR only

Restrictions

  • The configuration procedure for Solaris has not been tested completely. If it fails please use the Makefiles in the directory ./win32. These files are known to build a working installation under Solaris.
  • The Object Ada Compiler is known to fail compiling the ODBC bindings because of insufficient compliance to the Ada 95 RM.
  • The compilation of the ODBC bindings is known to fail on a Sun SPARC using GNADE 1.13p (ACT tracking number [8925-002] Gigi abort code 411 on SPARC architectures).
  • The Option -compiler has been added to allow the support of specific of different Ada 95 compilers which has currently no effect.
  • Unicode support is only available begining with UnixODBC version 2.0
  • Oracle 8i requires the declaration of string hostvariable to be 1 character larger then the domain size, e.g. assuming the size of the domain Ename from the example simple to be 20, the host variables have to be defined as:
    Ename           :   Char (1..21); 
    Dept_Name   :   Char (1..21); 
    Location        :   Char (1..21);
    
    The automatic installation is not supported in case of Oracle 8i but the installation script is located under samples.

Fixed Problems

Problems reported earlier then 0.9o are listed in the release note 1.1.2.

Bug Ref. Fixed with

Version

Short Description Comments
421587 0.9o ObjectAda Unrestricted_Access not supported. Unrestricted access is not used any more.
425280 1.1.1 Name of esql not changed every where GNUmakefile updated
425409 1.1.1 sql_standard prefix not handled correct gesql updated
425410 1.1.1 whenever sqlwarning faulty gesql updated
425510 1.1.1 gpl.sgml missing in distribution MANIFEST updated
421586 1.1.2 GNUmake on Windows 95 does not work Makefile changed
435712 1.1.2 Wrong debug code generated esql translator and esql_support updated
427531 1.1.2 gesql file corrupt but available The output file will always be deleted if some error during translation occurred.
427557 1.1.2 gesql command line not correct evaluated driver changed.
427764 1.1.3 Relastion missing error not recognized Code generation has been changed
427747 1.1.3 help message shown twice driver.adb changed
427750 1.1.3 Dynamic SQL DECLARE statement missing documentation updated
427748 1.1.3 Some_Error exception undefine code generator updated
430075 1.1.3 -noniso92 switch does not exist code generator updated
430077 1.1.3 -noiso92 switch not evaluated code generator updated
429984 1.1.4 Result evaluation done twice code generator updated
430751 1.1.4 Notfound class not correctly evaluated code generator updated
430752 1.1.4 not found exception raised twice code generator updated
430760 1.1.4 Number of affrected rows missing is SQLC code generator updated
435982 1.1.5 Wrong package name found esql parser updated
435872 1.1.5 Debug information missleading esql code generator updated
437590 1.1.5 Example simple does not work with MySQL GNU.DB.SQLCLI and esql_support.odbc

updated.

439149 1.1.5 SQLCA Not inserted correctly esql parser updated
439151 1.1.5 Handling of inner exception -noiso92 switch changed to -iso92 switch
439274 1.1.5 Mimer SQL not correctly installed Makefile updated
439274 1.1.5 MimerSQL, Tables of test db not found. Documentation updated
478056 1.1.6 Move in ESQL raises exception esql_support.adb updated
470357 1.1.6 simple.gpq does not handle conn. error simple.gqp updated
471060 1.1.7 esql_parse does not compile esql_parser.adb updated
471082 1.1.7 Useless evaluate code generated esql_parser.adb updated
473062 1.1.8 Package name in host var. decl. not eval. esql_parser.adb updated
473104 1.1.8 Query result not evaluated by gesql esql_parser.adb updated
473259 1.1.9 esql samples do not complie esql_parser.adb updated

Known Problems

Bug Ref. Short Description Comments
411141 Missing ";" for "EXEC SQL DECLARE DB01 D" This problem may be bypassed by putting a semicolon in the source code.
421586

ODBC does not compile with ObjectAda

This is a problem with the Object Ada compiler which has to be fixed there.

Installation

The GNADE code and the documentation is distributed in the following files:

File Size in Bytes Contents
gnade-src-1.1.9.tar.gz Complete GNADE source code distribution GNU compressed tar file
gnade-src-1.1.9.zip Complete GNADE source code distribution as ZIP file.

The installation of this software requires the following components:

Component Version Origin
gzip 1.2.4 GNU
unzip 5.42 Infozip
zip 2.2 Infozip
tar - GNU or native
autoconf*1 2-13-9 GNU
make 3.79.1 GNU
gnat 3.13p

3.12

ALT distribution
gawk 3.0.3 GNU

The autoconf utility is only required on Linux/Unix Systems if the configuration scripts have to be changed. For window systems a special set of makefiles in the directory ./win32 is provided which are not using the autoconf facility.

Installation on Linux/Unix

Unpacking and Configuration

$ gunzip -c gnade-src-linux-gnu-<version>.tar.gz | tar xvf -
$ cd gnade-src-linux-gnu-<version>
$ ./configure <dbname>

As dbname the following values are allowed.

  • mimer - MimerSQL
  • postgres - PostgreSQL
  • MySQL - MySQL

If the value is omitted because your data base product is not listed,, all subsequent steps regarding the data base installation may be skipped and you have to install the test database manually.

Installation of the Database

Depending on the installation of the data base you have specified in the configure script command, you have to execute the following step either by using a DBA account our you may use your own user account.

$ su ..dba..
$ make createuser

After the database and the database user has been configured, the ODBC interface has to be configured. The directory ./samples/sample_db contains sample files for the unixODBC driver manager. The files odbc.ini.sample odbcinst.ini.sample have to be copied to /etc/odbc.ini and /etc/ odbcinst.ini.sample.

Compiling an testing

After the creation of the data base user, the final build may be done by:

$ make

Test code is located under ./samples. In order to test the functionality of the ODBC interface use the examples in ./odbc or ./esql.

If it does not work

If this installation procedure fails you may use the Makefile under ./win32. This makefile is known to work at least on Solaris well if the correct driver manager is installed (see section other components).

Installation on Windows NT

For window users a zip file is provided. In order to install perform the following steps:

> unzip gnade-src-linux-gnu-<version>.zip
> cd gnade-src-linux-gnu-<version>/win32
> make 
                                   
The issue regarding the installation of a data base user has to be done by hand. 
The windows makefile  uses the make.conf file which is prebuilt by the ./configure script. Any configuration
change has to be done there. Please refer to the README file in ./win32.

Other components

The following Driver Manager are known to work with the release:

Component Description Version Operating System Comments
unixODBC ODBC Driver Manager 1.8.12-2 Linux www.unixodbc.org
2.0.5 Solaris 8

www.unixodbc.org

ODBC Driver Manager 3.5.10 Windows 95 Microsoft

The iODBC 3.04 implementation on Solaris seems to have a problem with the handling of cursor states. It should not be used.

Contributions

Special regards to the following persons which have contributed to the project:

Florian Weimer Florian.Weimer@RUS.Uni-Stuttgart.DE
François Fabien. fr.fabien@infonie.fr
Pascal Obry p.obry@wanadoo.fr


Document Version: $Date: 2001/10/22 17:48:09 $ $Revision: 1.1 $

gnade-1.6.2.orig/doc/releasenotes/note_1.2.0.html0000644000175000017500000007043007371050241021207 0ustar lbrentalbrenta No title

GNat Ada 95 Database Environment - (GNADE)

Version 1.2.0

Editor M.Erdmann

2.11.2001

Contents

This release of the GNADE project is intended for building with the GNU Ada Translator on the platforms Linux, Solaris and Windows NT/95/2000.

  • An extensive thin Ada 95 binding to the ODBC interfaces.
  • ISO/92 compliant embedded SQL translator which is able to process Ada 95 packages and files containing only one procedure. The translator creates Ada 95 source files working on top the of the ODBC interface.
  • Installation support for some commonly known data base products (see below).
  • Documentation in HTML, Postscript and PDF format.
  • Native Ada 95 bindings for MySQL and Postgres.
  • GNU specific include clause which allows to access the ODBC handles via embedded SQL. This allows to mix embedded SQL and low level ODBC programing in a single source (see chapter in documentation).
  • DECLARE TABLE is used to generate parts of the schema files (-schema option).
  • Support of embedded SQL.
  • Support of Oracle Lite on MS Windows 95
  • Support of MySQL with MS ODBC Drivers on Windows 95
  • Unicode support on the ODBC interface.
  • The connection clause has been extended by the ON clause in order to intercept typical connection errors and to define a reaction on ESQL level as shown below:

    CONNECT ......

    [ ON [COMMUNICATION|AUTHORIZATION|OTHER] ERROR [RAISE|GOTO|DO] <target> ]

  • A new GNADE implemenation defined data types as VARCHAR and VARBINARY. For details please refere to the documentation and the example attachment.gpq in samples/esql.

Supported Databases

Even the GNADE project except for the native data base bindings is expected to work with all ODBC compliant data base products. The following products are known to work with GNADE assuming, that you are using the correct driver manager (see section "Other Components").

Component Description Version OS Distribution/Source of the release
Postgres PostgreSQL Database 7.0.3
Linux - Redhat 7.0
Linux - SuSe 7.0
Solaris 7
Windows NT/2000
www.postgresql.org
Mimer Mimer SQL RDBMS 8.2
Solaris 7/8
Linux
Windows NT
www.mimer.com
MySQL MySQL Database
MyODBC

3.23.22

2.50.36-1

Linux www.mysql.com
3.23.35a

2.50.36

Windows 2000 www.mysql.com
MS SQL Server 7.0 Windows 2000 Microsoft
SQL Server 2000 Windows 2000 Microsoft
Oracle Lite 8i Windows 95 Oracle

The GNADE project installation procedure provides for theses product test data bases. If your data base is not listed below, the GNADE project will be very likely usable but the test data base has to be installed manually.

Copyright, License and Authors

The GNU Public License (GPL) applies with the following extension to all software components in this release

As a special exception, if other files instantiate generics from GNADE Ada units, or you link GNADE Ada units or libraries with other files to produce an executable, these units or libraries do not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.

The documentation has been put under the Free GNU Documentation License.

The authors and copyright holders of the GNADE project are:

Jürgen Pfeifer juergen.pfeifer@gmx.net>
Michael Erdmann Michael.Erdmann@snafu.de
Sune Falck sunef@hem.passagen.se
François Fabien fr.fabien@infonie.fr

Contact

Bug Reports http://sourcefore.net/projects/gnade M.Erdmann
GNADE Discussions http://cert.uni-stuttgart.de/mailman/listinfo/gnade-dev

gnade-dev@cert.uni-stuttgart.de

Florian Weimer
Project Page http://gnade.sourceforge.net/

http://sourcefore.net/projects/gnade

M.Erdmann
Dev. Coordination Michael.Erdmann@snafu.de M.Erdmann

New Features

Feature Req, Short Description Version Comments
426744 ESQL shall be able to handle files with only one procedure in. 1.1.2 complte
473046 ESQL extended types as VARCHAR, VARBINARY 1.1.10 complte

Restrictions

  • The VARBINARY data type has only been tested with Mimer SQL.
  • The configuration procedure for Solaris has not been tested completely. If it fails please use the Makefiles in the directory ./win32. These files are known to build a working installation under Solaris.
  • The Object Ada Compiler is known to fail compiling the ODBC bindings because of insufficient compliance to the Ada 95 RM.
  • The compilation of the ODBC bindings is known to fail on a Sun SPARC using GNADE 1.13p (ACT tracking number [8925-002] Gigi abort code 411 on SPARC architectures).
  • The Option -compiler has been added to allow the support of specific of different Ada 95 compilers which has currently no effect.
  • Unicode support is only available begining with UnixODBC version 2.0
  • Oracle 8i requires the declaration of string hostvariable to be 1 character larger then the domain size, e.g. assuming the size of the domain Ename from the example simple to be 20, the host variables have to be defined as:
    Ename           :   Char (1..21); 
    Dept_Name   :   Char (1..21); 
    Location        :   Char (1..21);
    
    The automatic installation is not supported in case of Oracle 8i but the installation script is located under samples

Fixed Problems

Problems reported earlier then 0.9o are listed in the release note 1.1.2.

Bug Ref. Fixed with

Version

Short Description Comments
421587 0.9o ObjectAda Unrestricted_Access not supported. Unrestricted access is not used any more.
425280 1.1.1 Name of esql not changed every where GNUmakefile updated
425409 1.1.1 sql_standard prefix not handled correct gesql updated
425410 1.1.1 whenever sqlwarning faulty gesql updated
425510 1.1.1 gpl.sgml missing in distribution MANIFEST updated
421586 1.1.2 GNUmake on Windows 95 does not work Makefile changed
435712 1.1.2 Wrong debug code generated esql translator and esql_support updated
427531 1.1.2 gesql file corrupt but available The output file will always be deleted if some error during translation occurred.
427557 1.1.2 gesql command line not correct evaluated driver changed.
427764 1.1.3 Relastion missing error not recognized Code generation has been changed
427747 1.1.3 help message shown twice driver.adb changed
427750 1.1.3 Dynamic SQL DECLARE statement missing documentation updated
427748 1.1.3 Some_Error exception undefine code generator updated
430075 1.1.3 -noniso92 switch does not exist code generator updated
430077 1.1.3 -noiso92 switch not evaluated code generator updated
429984 1.1.4 Result evaluation done twice code generator updated
430751 1.1.4 Notfound class not correctly evaluated code generator updated
430752 1.1.4 not found exception raised twice code generator updated
430760 1.1.4 Number of affrected rows missing is SQLC code generator updated
435982 1.1.5 Wrong package name found esql parser updated
435872 1.1.5 Debug information missleading esql code generator updated
437590 1.1.5 Example simple does not work with MySQL GNU.DB.SQLCLI and esql_support.odbc

updated.

439149 1.1.5 SQLCA Not inserted correctly esql parser updated
439151 1.1.5 Handling of inner exception -noiso92 switch changed to -iso92 switch
439274 1.1.5 Mimer SQL not correctly installed Makefile updated
439274 1.1.5 MimerSQL, Tables of test db not found. Documentation updated
478056 1.1.6 Move in ESQL raises exception esql_support.adb updated
470357 1.1.6 simple.gpq does not handle conn. error simple.gqp updated
471060 1.1.7 esql_parse does not compile esql_parser.adb updated
471082 1.1.7 Useless evaluate code generated esql_parser.adb updated
473062 1.1.8 Package name in host var. decl. not eval. esql_parser.adb updated
473104 1.1.8 Query result not evaluated by gesql esql_parser.adb updated
473259 1.1.9 esql samples do not complie esql_parser.adb updated
475736 1.1.10 VARBINARY not handled correctly gnu-db-esql_support-odbc.adb
471061 1.1.10 seperator for Win 9x not handled GNUmakefile
433671 1.1.10 Win 2000 installation failes modules.adb
477766 1.2.0 longblob not correctly handled gnu-db-mysql.adb, gnu-db-mysql.ads

Known Problems

Bug Ref. Short Description Comments
411141 Missing ";" for "EXEC SQL DECLARE DB01 D" This problem may be bypassed by putting a semicolon in the source code.
421586

ODBC does not compile with ObjectAda

This is a problem with the Object Ada compiler which has to be fixed there.

Installation

The GNADE code and the documentation is distributed in the following files:

File Contents
gnade-src-1.2.0.tar.gz Complete GNADE source code distribution GNU compressed tar file
gnade-src-1.2.0..zip Complete GNADE source code distribution as ZIP file.

The installation of this software requires the following components:

Component Version Origin
gzip 1.2.4 GNU
unzip 5.42 Infozip
zip 2.2 Infozip
tar - GNU or native
autoconf*1 2-13-9 GNU
make 3.79.1 GNU
gnat 3.13p

3.12

ALT distribution
gawk 3.0.3 GNU

The autoconf utility is only required on Linux/Unix Systems if the configuration scripts have to be changed. For window systems a special set of makefiles in the directory ./win32 is provided which are not using the autoconf facility.

Installation on Linux/Unix

Unpacking and Configuration

$ gunzip -c gnade-src-linux-gnu-<version>.tar.gz | tar xvf -
$ cd gnade-src-linux-gnu-<version>
$ ./configure <dbname>

As dbname the following values are allowed.

  • mimer - MimerSQL
  • postgres - PostgreSQL
  • MySQL - MySQL

If the value is omitted because your data base product is not listed,, all subsequent steps regarding the data base installation may be skipped and you have to install the test database manually.

Installation of the Database

Depending on the installation of the data base you have specified in the configure script command, you have to execute the following step either by using a DBA account our you may use your own user account.

$ su ..dba..
$ make createuser

After the database and the database user has been configured, the ODBC interface has to be configured. The directory ./samples/sample_db contains sample files for the unixODBC driver manager. The files odbc.ini.sample odbcinst.ini.sample have to be copied to /etc/odbc.ini and /etc/ odbcinst.ini.sample.

Compiling an testing

After the creation of the data base user, the final build may be done by:

$ make

Test code is located under ./samples. In order to test the functionality of the ODBC interface use the examples in ./odbc or ./esql.

If it does not work

If this installation procedure fails you may use the Makefile under ./win32. This makefile is known to work at least on Solaris well if the correct driver manager is installed (see section other components).

Installation on Windows NT

For window users a zip file is provided. In order to install perform the following steps:

> unzip gnade-src-linux-gnu-<version>.zip
> cd gnade-src-linux-gnu-<version>/win32
> make 
                                   
The issue regarding the installation of a data base user has to be done by hand. 
The windows makefile  uses the make.conf file which is prebuilt by the ./configure script. Any configuration
change has to be done there. Please refer to the README file in ./win32.

Other components

The following Driver Manager are known to work with the release:

Component Description Version Operating System Comments
unixODBC ODBC Driver Manager 1.8.12-2 Linux www.unixodbc.org
2.0.5 Solaris 8

www.unixodbc.org

ODBC Driver Manager 3.5.10 Windows 95 Microsoft

The iODBC 3.04 implementation on Solaris seems to have a problem with the handling of cursor states. It should not be used.

Contributions

Special regards to the following persons which have contributed to the project:

Florian Weimer Florian.Weimer@RUS.Uni-Stuttgart.DE
François Fabien. fr.fabien@infonie.fr
Pascal Obry p.obry@wanadoo.fr


Document Version: $Date: 2001/11/03 20:16:33 $ $Revision: 1.1 $

gnade-1.6.2.orig/doc/releasenotes/note_1.2.1.html0000644000175000017500000007161207433432762021226 0ustar lbrentalbrenta No title

GNat Ada 95 Database Environment - (GNADE)

Version 1.2.1

Editor M.Erdmann

16.2.2001

Contents

This release of the GNADE project is intended for building with the GNU Ada Translator on the platforms Linux, Solaris and Windows NT/95/2000.

  • An extensive thin Ada 95 binding to the ODBC interfaces.
  • ISO/92 compliant embedded SQL translator which is able to process Ada 95 packages and files containing only one procedure. The translator creates Ada 95 source files working on top the of the ODBC interface.
  • Installation support for some commonly known data base products (see below).
  • Documentation in HTML, Postscript and PDF format.
  • Native Ada 95 bindings for MySQL and Postgres.
  • GNU specific include clause which allows to access the ODBC handles via embedded SQL. This allows to mix embedded SQL and low level ODBC programing in a single source (see chapter in documentation).
  • DECLARE TABLE is used to generate parts of the schema files (-schema option).
  • Support of embedded SQL.
  • Support of Oracle Lite on MS Windows 95
  • Support of MySQL with MS ODBC Drivers on Windows 95
  • Unicode support on the ODBC interface.
  • The connection clause has been extended by the ON clause in order to intercept typical connection errors and to define a reaction on ESQL level as shown below:

    CONNECT ......

    [ ON [COMMUNICATION|AUTHORIZATION|OTHER] ERROR [RAISE|GOTO|DO] <target> ]

  • A new GNADE implemenation defined data types as VARCHAR and VARBINARY. For details please refere to the documentation and the example attachment.gpq in samples/esql.
  • Ada 95 Binding to the Oracle call interface.
  • The experimental Ada Database Connectivity (ADBC) - API.

    The idea of this interface is to provide a binding which makes application relativly independant of the unterlying data base. The interface is not yet stable (refer to http://gnade.sourceforge.net/ado.html)

Supported Databases

Even the GNADE project except for the native data base bindings is expected to work with all ODBC compliant data base products. The following products are known to work with GNADE assuming, that you are using the correct driver manager (see section "Other Components").

Component Description Version OS Distribution/Source of the release
Postgres PostgreSQL Database 7.0.3
Linux - Redhat 7.0
Linux - SuSe 7.0
Solaris 7
Windows NT/2000
www.postgresql.org
Mimer Mimer SQL RDBMS 8.2
Solaris 7/8
Linux
Windows NT
www.mimer.com
MySQL MySQL Database
MyODBC

3.23.22

2.50.36-1

Linux www.mysql.com
3.23.35a

2.50.36

Windows 2000 www.mysql.com
MS SQL Server 7.0 Windows 2000 Microsoft
SQL Server 2000 Windows 2000 Microsoft
Oracle Lite 8i Windows 95 Oracle

The GNADE project installation procedure provides for theses product test data bases. If your data base is not listed below, the GNADE project will be very likely usable but the test data base has to be installed manually.

Copyright, License and Authors

The GNU Public License (GPL) applies with the following extension to all software components in this release

As a special exception, if other files instantiate generics from GNADE Ada units, or you link GNADE Ada units or libraries with other files to produce an executable, these units or libraries do not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.

The documentation has been put under the Free GNU Documentation License.

The authors and copyright holders of the GNADE project are:

Jürgen Pfeifer juergen.pfeifer@gmx.net>
Michael Erdmann Michael.Erdmann@snafu.de
Sune Falck sunef@hem.passagen.se
François Fabien fr.fabien@infonie.fr

Contact

Bug Reports http://sourcefore.net/projects/gnade M.Erdmann
GNADE Discussions http://cert.uni-stuttgart.de/mailman/listinfo/gnade-dev

gnade-dev@cert.uni-stuttgart.de

Florian Weimer
Project Page http://gnade.sourceforge.net/

http://sourcefore.net/projects/gnade

M.Erdmann
Dev. Coordination Michael.Erdmann@snafu.de M.Erdmann

New Features

Feature Req, Short Description Version Comments
426744 ESQL shall be able to handle files with only one procedure in. 1.1.2 complte
473046 ESQL extended types as VARCHAR, VARBINARY 1.1.10 complte

Restrictions

  • The package names of the OCI binding are not yet lined up with the GNADE package hirarchy. This allignement will be done with the next version.
  • The VARBINARY data type has only been tested with Mimer SQL.
  • The configuration procedure for Solaris has not been tested completely. If it fails please use the Makefiles in the directory ./win32. These files are known to build a working installation under Solaris.
  • The Object Ada Compiler is known to fail compiling the ODBC bindings because of insufficient compliance to the Ada 95 RM.
  • The compilation of the ODBC bindings is known to fail on a Sun SPARC using GNADE 1.13p (ACT tracking number [8925-002] Gigi abort code 411 on SPARC architectures).
  • The Option -compiler has been added to allow the support of specific of different Ada 95 compilers which has currently no effect.
  • Unicode support is only available begining with UnixODBC version 2.0
  • Oracle 8i requires the declaration of string hostvariable to be 1 character larger then the domain size, e.g. assuming the size of the domain Ename from the example simple to be 20, the host variables have to be defined as:
    Ename           :   Char (1..21); 
    Dept_Name   :   Char (1..21); 
    Location        :   Char (1..21);
    
    The automatic installation is not supported in case of Oracle 8i but the installation script is located under samples

Fixed Problems

Problems reported earlier then 0.9o are listed in the release note 1.1.2.

Bug Ref. Fixed with

Version

Short Description Comments
421587 0.9o ObjectAda Unrestricted_Access not supported. Unrestricted access is not used any more.
425280 1.1.1 Name of esql not changed every where GNUmakefile updated
425409 1.1.1 sql_standard prefix not handled correct gesql updated
425410 1.1.1 whenever sqlwarning faulty gesql updated
425510 1.1.1 gpl.sgml missing in distribution MANIFEST updated
421586 1.1.2 GNUmake on Windows 95 does not work Makefile changed
435712 1.1.2 Wrong debug code generated esql translator and esql_support updated
427531 1.1.2 gesql file corrupt but available The output file will always be deleted if some error during translation occurred.
427557 1.1.2 gesql command line not correct evaluated driver changed.
427764 1.1.3 Relastion missing error not recognized Code generation has been changed
427747 1.1.3 help message shown twice driver.adb changed
427750 1.1.3 Dynamic SQL DECLARE statement missing documentation updated
427748 1.1.3 Some_Error exception undefine code generator updated
430075 1.1.3 -noniso92 switch does not exist code generator updated
430077 1.1.3 -noiso92 switch not evaluated code generator updated
429984 1.1.4 Result evaluation done twice code generator updated
430751 1.1.4 Notfound class not correctly evaluated code generator updated
430752 1.1.4 not found exception raised twice code generator updated
430760 1.1.4 Number of affrected rows missing is SQLC code generator updated
435982 1.1.5 Wrong package name found esql parser updated
435872 1.1.5 Debug information missleading esql code generator updated
437590 1.1.5 Example simple does not work with MySQL GNU.DB.SQLCLI and esql_support.odbc

updated.

439149 1.1.5 SQLCA Not inserted correctly esql parser updated
439151 1.1.5 Handling of inner exception -noiso92 switch changed to -iso92 switch
439274 1.1.5 Mimer SQL not correctly installed Makefile updated
439274 1.1.5 MimerSQL, Tables of test db not found. Documentation updated
478056 1.1.6 Move in ESQL raises exception esql_support.adb updated
470357 1.1.6 simple.gpq does not handle conn. error simple.gqp updated
471060 1.1.7 esql_parse does not compile esql_parser.adb updated
471082 1.1.7 Useless evaluate code generated esql_parser.adb updated
473062 1.1.8 Package name in host var. decl. not eval. esql_parser.adb updated
473104 1.1.8 Query result not evaluated by gesql esql_parser.adb updated
473259 1.1.9 esql samples do not complie esql_parser.adb updated
475736 1.1.10 VARBINARY not handled correctly gnu-db-esql_support-odbc.adb
471061 1.1.10 seperator for Win 9x not handled GNUmakefile
433671 1.1.10 Win 2000 installation failes modules.adb
477766 1.2.0 longblob not correctly handled gnu-db-mysql.adb, gnu-db-mysql.ads

Known Problems

Bug Ref. Short Description Comments
411141 Missing ";" for "EXEC SQL DECLARE DB01 D" This problem may be bypassed by putting a semicolon in the source code.
421586

ODBC does not compile with ObjectAda

This is a problem with the Object Ada compiler which has to be fixed there.

Installation

The GNADE code and the documentation is distributed in the following files:

File Contents
gnade-src-1.2.1.tar.gz Complete GNADE source code distribution GNU compressed tar file
gnade-src-1.2.1..zip Complete GNADE source code distribution as ZIP file.

The installation of this software requires the following components:

Component Version Origin
gzip 1.2.4 GNU
unzip 5.42 Infozip
zip 2.2 Infozip
tar - GNU or native
autoconf*1 2-13-9 GNU
make 3.79.1 GNU
gnat 3.13p

3.12

ALT distribution
gawk 3.0.3 GNU

The autoconf utility is only required on Linux/Unix Systems if the configuration scripts have to be changed. For window systems a special set of makefiles in the directory ./win32 is provided which are not using the autoconf facility.

Installation on Linux/Unix

Unpacking and Configuration

$ gunzip -c gnade-src-linux-gnu-<version>.tar.gz | tar xvf -
$ cd gnade-src-linux-gnu-<version>
$ ./configure <dbname>

As dbname the following values are allowed.

  • mimer - MimerSQL
  • postgres - PostgreSQL
  • MySQL - MySQL

If the value is omitted because your data base product is not listed,, all subsequent steps regarding the data base installation may be skipped and you have to install the test database manually.

Installation of the Database

Depending on the installation of the data base you have specified in the configure script command, you have to execute the following step either by using a DBA account our you may use your own user account.

$ su ..dba..
$ make createuser

After the database and the database user has been configured, the ODBC interface has to be configured. The directory ./samples/sample_db contains sample files for the unixODBC driver manager. The files odbc.ini.sample odbcinst.ini.sample have to be copied to /etc/odbc.ini and /etc/ odbcinst.ini.sample.

Compiling an testing

After the creation of the data base user, the final build may be done by:

$ make

Test code is located under ./samples. In order to test the functionality of the ODBC interface use the examples in ./odbc or ./esql.

If it does not work

If this installation procedure fails you may use the Makefile under ./win32. This makefile is known to work at least on Solaris well if the correct driver manager is installed (see section other components).

Installation on Windows NT

For window users a zip file is provided. In order to install perform the following steps:

> unzip gnade-src-linux-gnu-<version>.zip
> cd gnade-src-linux-gnu-<version>/win32
> make 
                                   
The issue regarding the installation of a data base user has to be done by hand. 
The windows makefile  uses the make.conf file which is prebuilt by the ./configure script. Any configuration
change has to be done there. Please refer to the README file in ./win32.

Other components

The following Driver Manager are known to work with the release:

Component Description Version Operating System Comments
unixODBC ODBC Driver Manager 1.8.12-2 Linux www.unixodbc.org
2.0.5 Solaris 8

www.unixodbc.org

ODBC Driver Manager 3.5.10 Windows 95 Microsoft

The iODBC 3.04 implementation on Solaris seems to have a problem with the handling of cursor states. It should not be used.

Contributions

Special regards to the following persons which have contributed to the project:

Florian Weimer Florian.Weimer@RUS.Uni-Stuttgart.DE
François Fabien. fr.fabien@infonie.fr
Pascal Obry p.obry@wanadoo.fr


Document Version: $Date: 2002/02/16 10:35:30 $ $Revision: 1.1 $

gnade-1.6.2.orig/doc/releasenotes/note_1.3.0.html0000644000175000017500000007233407442460426021226 0ustar lbrentalbrenta No title

GNat Ada 95 Database Environment - (GNADE)

Version 1.3.0

Editor M.Erdmann

9.3.2001

Contents

This release of the GNADE project is intended for building with the GNU Ada Translator on the platforms Linux, Solaris and Windows NT/95/2000.

  • An extensive thin Ada 95 binding to the ODBC interfaces.
  • ISO/92 compliant embedded SQL translator which is able to process Ada 95 packages and files containing only one procedure. The translator creates Ada 95 source files working on top the of the ODBC interface.
  • Installation support for some commonly known data base products (see below).
  • Documentation in HTML, Postscript and PDF format.
  • Native Ada 95 bindings for MySQL and Postgres.
  • GNU specific include clause which allows to access the ODBC handles via embedded SQL. This allows to mix embedded SQL and low level ODBC programing in a single source (see chapter in documentation).
  • DECLARE TABLE is used to generate parts of the schema files (-schema option).
  • Support of embedded SQL.
  • Support of Oracle Lite on MS Windows 95
  • Support of MySQL with MS ODBC Drivers on Windows 95
  • Unicode support on the ODBC interface.
  • The connection clause has been extended by the ON clause in order to intercept typical connection errors and to define a reaction on ESQL level as shown below:

    CONNECT ......

    [ ON [COMMUNICATION|AUTHORIZATION|OTHER] ERROR [RAISE|GOTO|DO] <target> ]

  • A new GNADE implemenation defined data types as VARCHAR and VARBINARY. For details please refere to the documentation and the example attachment.gpq in samples/esql.
  • Ada 95 Binding to the Oracle call interface.
  • The experimental Ada Database Connectivity (ADBC) - API.

    The idea of this interface is to provide a binding which makes application relativly independant of the unterlying data base. The interface is not yet stable (refer to http://gnade.sourceforge.net/ado.html)

Supported Databases

Even the GNADE project except for the native data base bindings is expected to work with all ODBC compliant data base products. The following products are known to work with GNADE assuming, that you are using the correct driver manager (see section "Other Components").

Component Description Version OS Distribution/Source of the release
Postgres PostgreSQL Database 7.0.3
Linux - Redhat 7.0
Linux - SuSe 7.0
Solaris 7
Windows NT/2000
www.postgresql.org
Mimer Mimer SQL RDBMS 8.2
Solaris 7/8
Linux
Windows NT
www.mimer.com
MySQL MySQL Database
MyODBC

3.23.22

2.50.36-1

Linux www.mysql.com
3.23.35a

2.50.36

Windows 2000 www.mysql.com
MS SQL Server 7.0 Windows 2000 Microsoft
SQL Server 2000 Windows 2000 Microsoft
Oracle Lite 8i Windows 95 Oracle

The GNADE project installation procedure provides for theses product test data bases. If your data base is not listed below, the GNADE project will be very likely usable but the test data base has to be installed manually.

Copyright, License and Authors

The GNU Public License (GPL) applies with the following extension to all software components in this release

As a special exception, if other files instantiate generics from GNADE Ada units, or you link GNADE Ada units or libraries with other files to produce an executable, these units or libraries do not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.

The documentation has been put under the Free GNU Documentation License.

The authors and copyright holders of the GNADE project are:

Jürgen Pfeifer juergen.pfeifer@gmx.net>
Michael Erdmann Michael.Erdmann@snafu.de
Sune Falck sunef@hem.passagen.se
Julio Cano julius_bip@yahoo.com
Dimitry Anisimikov anisimkov@yahoo.com
François Fabien fr.fabien@infonie.fr

Contact

Bug Reports http://sourcefore.net/projects/gnade M.Erdmann
GNADE Discussions http://cert.uni-stuttgart.de/mailman/listinfo/gnade-dev

gnade-dev@cert.uni-stuttgart.de

Florian Weimer
Project Page http://gnade.sourceforge.net/

http://sourcefore.net/projects/gnade

M.Erdmann
Dev. Coordination Michael.Erdmann@snafu.de M.Erdmann

New Features

Feature Req, Short Description Version Comments
426744 ESQL shall be able to handle files with only one procedure in. 1.1.2 complte
473046 ESQL extended types as VARCHAR, VARBINARY 1.1.10 complte

Restrictions

  • The package names of the OCI binding are not yet lined up with the GNADE package hirarchy. This allignment will be done with the next version. The build process currently creates no test client automatically since the build scripts are only available for windows.
  • The ADBC interface is currently only a draft version and not complete
  • The VARBINARY data type has only been tested with Mimer SQL.
  • The configuration procedure for Solaris has not been tested completely. If it fails please use the Makefiles in the directory ./win32. These files are known to build a working installation under Solaris.
  • The Object Ada Compiler is known to fail compiling the ODBC bindings because of insufficient compliance to the Ada 95 RM.
  • The compilation of the ODBC bindings is known to fail on a Sun SPARC using GNADE 1.13p (ACT tracking number [8925-002] Gigi abort code 411 on SPARC architectures).
  • The Option -compiler has been added to allow the support of specific of different Ada 95 compilers which has currently no effect.
  • Unicode support is only available begining with UnixODBC version 2.0
  • Oracle 8i requires the declaration of string hostvariable to be 1 character larger then the domain size, e.g. assuming the size of the domain Ename from the example simple to be 20, the host variables have to be defined as:
    Ename           :   Char (1..21); 
    Dept_Name   :   Char (1..21); 
    Location        :   Char (1..21);
    
    The automatic installation is not supported in case of Oracle 8i but the installation script is located under samples.

Fixed Problems

Problems reported earlier then 0.9o are listed in the release note 1.1.2.

Bug Ref. Fixed with

Version

Short Description Comments
421587 0.9o ObjectAda Unrestricted_Access not supported. Unrestricted access is not used any more.
425280 1.1.1 Name of esql not changed every where GNUmakefile updated
425409 1.1.1 sql_standard prefix not handled correct gesql updated
425410 1.1.1 whenever sqlwarning faulty gesql updated
425510 1.1.1 gpl.sgml missing in distribution MANIFEST updated
421586 1.1.2 GNUmake on Windows 95 does not work Makefile changed
435712 1.1.2 Wrong debug code generated esql translator and esql_support updated
427531 1.1.2 gesql file corrupt but available The output file will always be deleted if some error during translation occurred.
427557 1.1.2 gesql command line not correct evaluated driver changed.
427764 1.1.3 Relastion missing error not recognized Code generation has been changed
427747 1.1.3 help message shown twice driver.adb changed
427750 1.1.3 Dynamic SQL DECLARE statement missing documentation updated
427748 1.1.3 Some_Error exception undefine code generator updated
430075 1.1.3 -noniso92 switch does not exist code generator updated
430077 1.1.3 -noiso92 switch not evaluated code generator updated
429984 1.1.4 Result evaluation done twice code generator updated
430751 1.1.4 Notfound class not correctly evaluated code generator updated
430752 1.1.4 not found exception raised twice code generator updated
430760 1.1.4 Number of affrected rows missing is SQLC code generator updated
435982 1.1.5 Wrong package name found esql parser updated
435872 1.1.5 Debug information missleading esql code generator updated
437590 1.1.5 Example simple does not work with MySQL GNU.DB.SQLCLI and esql_support.odbc

updated.

439149 1.1.5 SQLCA Not inserted correctly esql parser updated
439151 1.1.5 Handling of inner exception -noiso92 switch changed to -iso92 switch
439274 1.1.5 Mimer SQL not correctly installed Makefile updated
439274 1.1.5 MimerSQL, Tables of test db not found. Documentation updated
478056 1.1.6 Move in ESQL raises exception esql_support.adb updated
470357 1.1.6 simple.gpq does not handle conn. error simple.gqp updated
471060 1.1.7 esql_parse does not compile esql_parser.adb updated
471082 1.1.7 Useless evaluate code generated esql_parser.adb updated
473062 1.1.8 Package name in host var. decl. not eval. esql_parser.adb updated
473104 1.1.8 Query result not evaluated by gesql esql_parser.adb updated
473259 1.1.9 esql samples do not complie esql_parser.adb updated
475736 1.1.10 VARBINARY not handled correctly gnu-db-esql_support-odbc.adb
471061 1.1.10 seperator for Win 9x not handled GNUmakefile
433671 1.1.10 Win 2000 installation failes modules.adb
477766 1.2.0 longblob not correctly handled gnu-db-mysql.adb, gnu-db-mysql.ads

Known Problems

Bug Ref. Short Description Comments
411141 Missing ";" for "EXEC SQL DECLARE DB01 D" This problem may be bypassed by putting a semicolon in the source code.
421586

ODBC does not compile with ObjectAda

This is a problem with the Object Ada compiler which has to be fixed there.

Installation

The GNADE code and the documentation is distributed in the following files:

File Contents
gnade-src-1.2.1.tar.gz Complete GNADE source code distribution GNU compressed tar file
gnade-src-1.2.1..zip Complete GNADE source code distribution as ZIP file.

The installation of this software requires the following components:

Component Version Origin
gzip 1.2.4 GNU
unzip 5.42 Infozip
zip 2.2 Infozip
tar - GNU or native
autoconf*1 2-13-9 GNU
make 3.79.1 GNU
gnat 3.13p

3.12

ALT distribution
gawk 3.0.3 GNU

The autoconf utility is only required on Linux/Unix Systems if the configuration scripts have to be changed. For window systems a special set of makefiles in the directory ./win32 is provided which are not using the autoconf facility.

Installation on Linux/Unix

Unpacking and Configuration

$ gunzip -c gnade-src-linux-gnu-<version>.tar.gz | tar xvf -
$ cd gnade-src-linux-gnu-<version>
$ ./configure <dbname>

As dbname the following values are allowed.

  • mimer - MimerSQL
  • postgres - PostgreSQL
  • MySQL - MySQL

If the value is omitted because your data base product is not listed,, all subsequent steps regarding the data base installation may be skipped and you have to install the test database manually.

Installation of the Database

Depending on the installation of the data base you have specified in the configure script command, you have to execute the following step either by using a DBA account our you may use your own user account.

$ su ..dba..
$ make createuser

After the database and the database user has been configured, the ODBC interface has to be configured. The directory ./samples/sample_db contains sample files for the unixODBC driver manager. The files odbc.ini.sample odbcinst.ini.sample have to be copied to /etc/odbc.ini and /etc/ odbcinst.ini.sample.

Compiling an testing

After the creation of the data base user, the final build may be done by:

$ make

Test code is located under ./samples. In order to test the functionality of the ODBC interface use the examples in ./odbc or ./esql.

If it does not work

If this installation procedure fails you may use the Makefile under ./win32. This makefile is known to work at least on Solaris well if the correct driver manager is installed (see section other components).

Installation on Windows NT

For window users a zip file is provided. In order to install perform the following steps:

> unzip gnade-src-linux-gnu-<version>.zip
> cd gnade-src-linux-gnu-<version>/win32
> make 
                                   
The issue regarding the installation of a data base user has to be done by hand. 
The windows makefile  uses the make.conf file which is prebuilt by the ./configure script. Any configuration
change has to be done there. Please refer to the README file in ./win32.

Other components

The following Driver Manager are known to work with the release:

Component Description Version Operating System Comments
unixODBC ODBC Driver Manager 1.8.12-2 Linux www.unixodbc.org
2.0.5 Solaris 8

www.unixodbc.org

ODBC Driver Manager 3.5.10 Windows 95 Microsoft

The iODBC 3.04 implementation on Solaris seems to have a problem with the handling of cursor states. It should not be used.

Contributions

Special regards to the following persons which have contributed to the project:

Florian Weimer Florian.Weimer@RUS.Uni-Stuttgart.DE
Pascal Obry p.obry@wanadoo.fr


Document Version: $Date: 2002/03/09 19:23:02 $ $Revision: 1.2 $

gnade-1.6.2.orig/doc/releasenotes/note_1.3.1.html0000644000175000017500000007357307453603520021231 0ustar lbrentalbrenta No title

GNat Ada 95 Database Environment - (GNADE)

Version 1.3.1

Editor M.Erdmann

6.4.2001

Contents

This release of the GNADE project is intended for building with the GNU Ada Translator on the platforms Linux, Solaris and Windows NT/95/2000.

  • An extensive thin Ada 95 binding to the ODBC interfaces.
  • ISO/92 compliant embedded SQL translator which is able to process Ada 95 packages and files containing only one procedure. The translator creates Ada 95 source files working on top the of the ODBC interface.
  • Installation support for some commonly known data base products (see below).
  • Documentation in HTML, Postscript and PDF format.
  • Native Ada 95 bindings for MySQL and Postgres.
  • GNU specific include clause which allows to access the ODBC handles via embedded SQL. This allows to mix embedded SQL and low level ODBC programing in a single source (see chapter in documentation).
  • DECLARE TABLE is used to generate parts of the schema files (-schema option).
  • Support of embedded SQL.
  • Support of Oracle Lite on MS Windows 95
  • Support of MySQL with MS ODBC Drivers on Windows 95
  • Unicode support on the ODBC interface.
  • The connection clause has been extended by the ON clause in order to intercept typical connection errors and to define a reaction on ESQL level as shown below:

    CONNECT ......

    [ ON [COMMUNICATION|AUTHORIZATION|OTHER] ERROR [RAISE|GOTO|DO] <target> ]

  • A new GNADE implemenation defined data types as VARCHAR and VARBINARY. For details please refere to the documentation and the example attachment.gpq in samples/esql.
  • Ada 95 Binding to the Oracle call interface.
  • The experimental Ada Database Connectivity (ADBC) - API.

    The idea of this interface is to provide a binding which makes application relativly independant of the unterlying data base. The interface is not yet stable (refer to http://gnade.sourceforge.net/ado.html)

Supported Databases

Even the GNADE project except for the native data base bindings is expected to work with all ODBC compliant data base products. The following products are known to work with GNADE assuming, that you are using the correct driver manager (see section "Other Components").

Component Description Version OS Distribution/Source of the release
Postgres PostgreSQL Database 7.0.3
Linux - Redhat 7.0

Linux - SuSe 7.0

Solaris 7
Windows NT/2000
www.postgresql.org
Mimer Mimer SQL RDBMS 8.2
Solaris 7/8
Linux
Windows NT
www.mimer.com
MySQL MySQL Database
MyODBC

3.23.22

2.50.36-1

Linux www.mysql.com
3.23.35a

2.50.36

Windows 2000 www.mysql.com
MS SQL Server 7.0 Windows 2000 Microsoft
SQL Server 2000 Windows 2000 Microsoft
Oracle Lite 8i Windows 95 Oracle

The GNADE project installation procedure provides for theses product test data bases. If your data base is not listed below, the GNADE project will be very likely usable but the test data base has to be installed manually.

Copyright, License and Authors

The GNU Public License (GPL) applies with the following extension to all software components in this release

As a special exception, if other files instantiate generics from GNADE Ada units, or you link GNADE Ada units or libraries with other files to produce an executable, these units or libraries do not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.

The documentation has been put under the Free GNU Documentation License.

The authors and copyright holders of the GNADE project are:

Jürgen Pfeifer juergen.pfeifer@gmx.net>
Michael Erdmann Michael.Erdmann@snafu.de
Sune Falck sunef@hem.passagen.se
Julio Cano julius_bip@yahoo.com
Dimitry Anisimikov anisimkov@yahoo.com
François Fabien fr.fabien@infonie.fr

Contact

Bug Reports http://sourcefore.net/projects/gnade M.Erdmann
GNADE Discussions http://cert.uni-stuttgart.de/mailman/listinfo/gnade-dev

gnade-dev@cert.uni-stuttgart.de

Florian Weimer
Project Page http://gnade.sourceforge.net/

http://sourcefore.net/projects/gnade

M.Erdmann
Dev. Coordination Michael.Erdmann@snafu.de M.Erdmann

New Features

Feature Req, Short Description Version Status
540161 Excpetion in statements 1.3 complete
426744 ESQL shall be able to handle files with only one procedure in. 1.1.2 complete
473046 ESQL extended types as VARCHAR, VARBINARY 1.1.10 complete

Restrictions

  • The package names of the OCI binding are not yet lined up with the GNADE package hirarchy. This allignment will be done with the next version. The build process currently creates no test client automatically since the build scripts are only available for windows.
  • The ADBC interface is currently only a draft version and not complete
  • The VARBINARY data type has only been tested with Mimer SQL.
  • The configuration procedure for Solaris has not been tested completely. If it fails please use the Makefiles in the directory ./win32. These files are known to build a working installation under Solaris.
  • The Object Ada Compiler is known to fail compiling the ODBC bindings because of insufficient compliance to the Ada 95 RM.
  • The compilation of the ODBC bindings is known to fail on a Sun SPARC using GNADE 1.13p (ACT tracking number [8925-002] Gigi abort code 411 on SPARC architectures).
  • The Option -compiler has been added to allow the support of specific of different Ada 95 compilers which has currently no effect.
  • Unicode support is only available begining with UnixODBC version 2.0
  • Oracle 8i requires the declaration of string hostvariable to be 1 character larger then the domain size, e.g. assuming the size of the domain Ename from the example simple to be 20, the host variables have to be defined as:
    Ename           :   Char (1..21); 
    Dept_Name   :   Char (1..21); 
    Location        :   Char (1..21);
    
    The automatic installation is not supported in case of Oracle 8i but the installation script is located under samples.

    .

Fixed Problems

Problems reported earlier then 0.9o are listed in the release note 1.1.2.

Bug Ref. Fixed with

Version

Short Description Comments
421587 0.9o ObjectAda Unrestricted_Access not supported. Unrestricted access is not used any more.
425280 1.1.1 Name of esql not changed every where GNUmakefile updated
425409 1.1.1 sql_standard prefix not handled correct gesql updated
425410 1.1.1 whenever sqlwarning faulty gesql updated
425510 1.1.1 gpl.sgml missing in distribution MANIFEST updated
421586 1.1.2 GNUmake on Windows 95 does not work Makefile changed
435712 1.1.2 Wrong debug code generated esql translator and esql_support updated
427531 1.1.2 gesql file corrupt but available The output file will always be deleted if some error during translation occurred.
427557 1.1.2 gesql command line not correct evaluated driver changed.
427764 1.1.3 Relastion missing error not recognized Code generation has been changed
427747 1.1.3 help message shown twice driver.adb changed
427750 1.1.3 Dynamic SQL DECLARE statement missing documentation updated
427748 1.1.3 Some_Error exception undefine code generator updated
430075 1.1.3 -noniso92 switch does not exist code generator updated
430077 1.1.3 -noiso92 switch not evaluated code generator updated
429984 1.1.4 Result evaluation done twice code generator updated
430751 1.1.4 Notfound class not correctly evaluated code generator updated
430752 1.1.4 not found exception raised twice code generator updated
430760 1.1.4 Number of affrected rows missing is SQLC code generator updated
435982 1.1.5 Wrong package name found esql parser updated
435872 1.1.5 Debug information missleading esql code generator updated
437590 1.1.5 Example simple does not work with MySQL GNU.DB.SQLCLI and esql_support.odbc

updated.

439149 1.1.5 SQLCA Not inserted correctly esql parser updated
439151 1.1.5 Handling of inner exception -noiso92 switch changed to -iso92 switch
439274 1.1.5 Mimer SQL not correctly installed Makefile updated
439274 1.1.5 MimerSQL, Tables of test db not found. Documentation updated
478056 1.1.6 Move in ESQL raises exception esql_support.adb updated
470357 1.1.6 simple.gpq does not handle conn. error simple.gqp updated
471060 1.1.7 esql_parse does not compile esql_parser.adb updated
471082 1.1.7 Useless evaluate code generated esql_parser.adb updated
473062 1.1.8 Package name in host var. decl. not eval. esql_parser.adb updated
473104 1.1.8 Query result not evaluated by gesql esql_parser.adb updated
473259 1.1.9 esql samples do not complie esql_parser.adb updated
475736 1.1.10 VARBINARY not handled correctly gnu-db-esql_support-odbc.adb
471061 1.1.10 seperator for Win 9x not handled GNUmakefile
433671 1.1.10 Win 2000 installation failes modules.adb
477766 1.2.0 longblob not correctly handled gnu-db-mysql.adb, gnu-db-mysql.ads
538349 1.3.1 SELECT sum(valeur) incorrect translated esql_parser.adb updated
533949 1.3.1 Firsttime installation with MimerSQL failes gnade.mimer.sql
538350 1.3.1 Null value not handled correctly esql_parser.adb
540160 1.3.1 Wrong cursor state in case of failed que gnu-db-esql_support-odbc.adb
540163 1.3.1 Debug granularity esql_parser.adb

Known Problems

Bug Ref. Short Description Comments
411141 Missing ";" for "EXEC SQL DECLARE DB01 D" This problem may be bypassed by putting a semicolon in the source code.

Installation

The GNADE code and the documentation is distributed in the following files:

File Contents
gnade-src-1.3.1.tar.gz Complete GNADE source code distribution GNU compressed tar file
gnade-src-1.3.1..zip Complete GNADE source code distribution as ZIP file.

The installation of this software requires the following components:

Component Version Origin
gzip 1.2.4 GNU
unzip 5.42 Infozip
zip 2.2 Infozip
tar - GNU or native
autoconf*1 2-13-9 GNU
make 3.79.1 GNU
gnat 3.13p

3.12

ALT distribution
gawk 3.0.3 GNU

The autoconf utility is only required on Linux/Unix Systems if the configuration scripts have to be changed. For window systems a special set of makefiles in the directory ./win32 is provided which are not using the autoconf facility.

Installation on Linux/Unix

Unpacking and Configuration

$ gunzip -c gnade-src-linux-gnu-<version>.tar.gz | tar xvf -
$ cd gnade-src-linux-gnu-<version>
$ ./configure <dbname>

As dbname the following values are allowed.

  • mimer - MimerSQL
  • postgres - PostgreSQL
  • MySQL - MySQL

If the value is omitted because your data base product is not listed,, all subsequent steps regarding the data base installation may be skipped and you have to install the test database manually.

Installation of the Database

Depending on the installation of the data base you have specified in the configure script command, you have to execute the following step either by using a DBA account our you may use your own user account.

$ su ..dba..
$ make createuser

After the database and the database user has been configured, the ODBC interface has to be configured. The directory ./samples/sample_db contains sample files for the unixODBC driver manager. The files odbc.ini.sample odbcinst.ini.sample have to be copied to /etc/odbc.ini and /etc/ odbcinst.ini.sample.

Compiling an testing

After the creation of the data base user, the final build may be done by:

$ make

Test code is located under ./samples. In order to test the functionality of the ODBC interface use the examples in ./odbc or ./esql.

If it does not work

If this installation procedure fails you may use the Makefile under ./win32. This makefile is known to work at least on Solaris well if the correct driver manager is installed (see section other components).

Installation on Windows NT

For window users a zip file is provided. In order to install perform the following steps:

> unzip gnade-src-linux-gnu-<version>.zip
> cd gnade-src-linux-gnu-<version>/win32
> make 
                                   
The issue regarding the installation of a data base user has to be done by hand. 
The windows makefile  uses the make.conf file which is prebuilt by the ./configure script. Any configuration
change has to be done there. Please refer to the README file in ./win32.

Other components

The following Driver Manager are known to work with the release:

Component Description Version Operating System Comments
unixODBC ODBC Driver Manager 1.8.12-2 Linux www.unixodbc.org
2.0.5 Solaris 8

www.unixodbc.org

2.1.1-7 Linux Debian

GNADE 1.2.0

www.unixodbc.org

ODBC Driver Manager 3.5.10 Windows 95 Microsoft

The iODBC 3.04 implementation on Solaris seems to have a problem with the handling of cursor states. It should not be used.

Contributions

Special regards to the following persons which have contributed to the project:

Florian Weimer Florian.Weimer@RUS.Uni-Stuttgart.DE
Pascal Obry p.obry@wanadoo.fr


Document Version: $Date: 2002/04/06 14:33:52 $ $Revision: 1.2 $

gnade-1.6.2.orig/doc/releasenotes/note_1.3.3.html0000644000175000017500000010032207467301774021225 0ustar lbrentalbrenta No title

GNat Ada 95 Database Environment - (GNADE)

Version 1.3.3

Editor M.Erdmann

3.5.2001

Contents

This release of the GNADE project is intended for building with the GNU Ada Translator on the platforms Linux, Solaris and Windows NT/95/2000. This release covers beside bug corrections, a revised installation procedure and a CLOSE STATMENT <name> clause for dynamic SQL, the following features:

  • An extensive thin Ada 95 binding to the ODBC interfaces.
  • ISO/92 compliant embedded SQL translator which is able to process Ada 95 packages and files containing only one procedure. The translator creates Ada 95 source files working on top the of the ODBC interface.
  • Installation support for some commonly known data base products (see below).
  • Documentation in HTML, Postscript and PDF format.
  • Native Ada 95 bindings for MySQL and Postgres.
  • GNU specific include clause which allows to access the ODBC handles via embedded SQL. This allows to mix embedded SQL and low level ODBC programing in a single source (see chapter in documentation).
  • DECLARE TABLE is used to generate parts of the schema files (-schema option).
  • Support of embedded SQL.
  • Support of Oracle Lite on MS Windows 95
  • Support of MySQL with MS ODBC Drivers on Windows 95
  • Unicode support on the ODBC interface.
  • The connection clause has been extended by the ON clause in order to intercept typical connection errors and to define a reaction on ESQL level as shown below:

    CONNECT ......

    [ ON [COMMUNICATION|AUTHORIZATION|OTHER] ERROR [RAISE|GOTO|DO] <target> ]

  • A new GNADE implemenation defined data types as VARCHAR and VARBINARY. For details please refere to the documentation and the example attachment.gpq in samples/esql.
  • Ada 95 Binding to the Oracle call interface.
  • The experimental Ada Database Connectivity (ADBC) - API.

    The idea of this interface is to provide a binding which makes application relativly independant of the unterlying data base. The interface is not yet stable (refer to http://gnade.sourceforge.net/ado.html)

Supported Databases

Even the GNADE project except for the native data base bindings is expected to work with all ODBC compliant data base products. The following products are known to work with GNADE assuming, that you are using the correct driver manager (see section "Other Components").

Component Description Version OS Distribution/Source of the release
Postgres PostgreSQL Database 7.0.3
Linux - Redhat 7.0

Linux - SuSe 7.0

Solaris 7
Windows NT/2000
www.postgresql.org
Mimer Mimer SQL RDBMS 8.2
Solaris 7/8
Linux
Windows NT
www.mimer.com
MySQL MySQL Database
MyODBC
3.23.22
2.50.36-1
Linux www.mysql.com
3.23.35a
2.50.36
Windows 2000 www.mysql.com
3.23.47
3.51.02
Windows 98 www.mysql.com
MS SQL Server 7.0 Windows 2000 Microsoft
SQL Server 2000 Windows 2000 Microsoft
Oracle Lite 8i Windows 95 Oracle

The GNADE project installation procedure provides for theses product test data bases. If your data base is not listed below, the GNADE project will be very likely usable but the test data base has to be installed manually.

Supported Compilers

Compiler Version Operating System
GNAT 1.13.p Lunix

Windows

GNAT 1.14 Linux/Unix
GNAT 1.15a Win98

Copyright, License and Authors

The GNU Public License (GPL) applies with the following extension to all software components in this release

As a special exception, if other files instantiate generics from GNADE Ada units, or you link GNADE Ada units or libraries with other files to produce an executable, these units or libraries do not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.

The documentation has been put under the Free GNU Documentation License.

The authors and copyright holders of the GNADE project are:

Jürgen Pfeifer juergen.pfeifer@gmx.net>
Michael Erdmann Michael.Erdmann@snafu.de
Sune Falck sunef@hem.passagen.se
Julio Cano julius_bip@yahoo.com
Dimitry Anisimikov anisimkov@yahoo.com
François Fabien fr.fabien@infonie.fr

Contact

Bug Reports http://sourcefore.net/projects/gnade M.Erdmann
GNADE Discussions http://sourceforge.net/mailarchive/forum.php?forum_id=2843

http://lists.sourceforge.net/lists/listinfo/gnade-develop

M.Erdmann
Project Page http://gnade.sourceforge.net/

http://sourcefore.net/projects/gnade

M.Erdmann
Dev. Coordination Michael.Erdmann@snafu.de M.Erdmann

New Features

Feature Req, Short Description Version Status
540161 Excpetion in statements 1.3 complete
426744 ESQL shall be able to handle files with only one procedure in. 1.1.2 complete
473046 ESQL extended types as VARCHAR, VARBINARY 1.1.10 complete
552327 Support of gnat 1.14 1.3.3 complete

Restrictions

  • The package names of the OCI binding are not yet lined up with the GNADE package hirarchy. This allignment will be done with the next version. The build process currently creates no test client automatically since the build scripts are only available for windows.
  • The ADBC interface is currently only a draft version and not complete
  • The VARBINARY data type has only been tested with Mimer SQL.
  • The configuration procedure for Solaris has not been tested completely. If it fails please use the Makefiles in the directory ./win32. These files are known to build a working installation under Solaris.
  • The Object Ada Compiler is known to fail compiling the ODBC bindings because of insufficient compliance to the Ada 95 RM.
  • The compilation of the ODBC bindings is known to fail on a Sun SPARC using GNADE 1.13p (ACT tracking number [8925-002] Gigi abort code 411 on SPARC architectures).
  • The Option -compiler has been added to allow the support of specific of different Ada 95 compilers which has currently no effect.
  • Unicode support is only available begining with UnixODBC version 2.0
  • Oracle 8i requires the declaration of string hostvariable to be 1 character larger then the domain size, e.g. assuming the size of the domain Ename from the example simple to be 20, the host variables have to be defined as:
    Ename           :   Char (1..21); 
    Dept_Name   :   Char (1..21); 
    Location        :   Char (1..21);
    
    The automatic installation is not supported in case of Oracle 8i but the installation script is located under samples.

    .

Fixed Problems

Problems reported earlier then 0.9o are listed in the release note 1.1.2.

Bug Ref. Fixed with

Version

Short Description Comments
421587 0.9o ObjectAda Unrestricted_Access not supported. Unrestricted access is not used any more.
425280 1.1.1 Name of esql not changed every where GNUmakefile updated
425409 1.1.1 sql_standard prefix not handled correct gesql updated
425410 1.1.1 whenever sqlwarning faulty gesql updated
425510 1.1.1 gpl.sgml missing in distribution MANIFEST updated
421586 1.1.2 GNUmake on Windows 95 does not work Makefile changed
435712 1.1.2 Wrong debug code generated esql translator and esql_support updated
427531 1.1.2 gesql file corrupt but available The output file will always be deleted if some error during translation occurred.
427557 1.1.2 gesql command line not correct evaluated driver changed.
427764 1.1.3 Relastion missing error not recognized Code generation has been changed
427747 1.1.3 help message shown twice driver.adb changed
427750 1.1.3 Dynamic SQL DECLARE statement missing documentation updated
427748 1.1.3 Some_Error exception undefine code generator updated
430075 1.1.3 -noniso92 switch does not exist code generator updated
430077 1.1.3 -noiso92 switch not evaluated code generator updated
429984 1.1.4 Result evaluation done twice code generator updated
430751 1.1.4 Notfound class not correctly evaluated code generator updated
430752 1.1.4 not found exception raised twice code generator updated
430760 1.1.4 Number of affrected rows missing is SQLC code generator updated
435982 1.1.5 Wrong package name found esql parser updated
435872 1.1.5 Debug information missleading esql code generator updated
437590 1.1.5 Example simple does not work with MySQL GNU.DB.SQLCLI and esql_support.odbc

updated.

439149 1.1.5 SQLCA Not inserted correctly esql parser updated
439151 1.1.5 Handling of inner exception -noiso92 switch changed to -iso92 switch
439274 1.1.5 Mimer SQL not correctly installed Makefile updated
439274 1.1.5 MimerSQL, Tables of test db not found. Documentation updated
478056 1.1.6 Move in ESQL raises exception esql_support.adb updated
470357 1.1.6 simple.gpq does not handle conn. error simple.gqp updated
471060 1.1.7 esql_parse does not compile esql_parser.adb updated
471082 1.1.7 Useless evaluate code generated esql_parser.adb updated
473062 1.1.8 Package name in host var. decl. not eval. esql_parser.adb updated
473104 1.1.8 Query result not evaluated by gesql esql_parser.adb updated
473259 1.1.9 esql samples do not complie esql_parser.adb updated
475736 1.1.10 VARBINARY not handled correctly gnu-db-esql_support-odbc.adb
471061 1.1.10 seperator for Win 9x not handled GNUmakefile
433671 1.1.10 Win 2000 installation failes modules.adb
477766 1.2.0 longblob not correctly handled gnu-db-mysql.adb, gnu-db-mysql.ads
538349 1.3.1 SELECT sum(valeur) incorrect translated esql_parser.adb updated
533949 1.3.1 Firsttime installation with MimerSQL failes gnade.mimer.sql
538350 1.3.1 Null value not handled correctly esql_parser.adb
540160 1.3.1 Wrong cursor state in case of failed que gnu-db-esql_support-odbc.adb
540163 1.3.1 Debug granularity esql_parser.adb
543343 1.3.2 Case sensitve cursors esql_parser.adb
552325 1.3.3 configure fails on Solaris 2.8 configure.in, configure.gues
553343 1.3.3 odbc demo raises Need_Data exception demo.gpq
554383 1.3.3 odbc demo does not return any value odbc bindings
554929 1.3.3 esql moves 'pragma Source_Reference' esql-translator (driver.adb)

Known Problems

Bug Ref. Short Description Comments
411141 Missing ";" for "EXEC SQL DECLARE DB01 D" This problem may be bypassed by putting a semicolon in the source code.

Installation

The GNADE code and the documentation is distributed in the following files:

File Contents
gnade-src-1.3.1.tar.gz Complete GNADE source code distribution GNU compressed tar file
gnade-src-1.3.1..zip Complete GNADE source code distribution as ZIP file.

The installation of this software requires the following components:

Component Version Origin
gzip 1.2.4 GNU
unzip 5.42 Infozip
zip 2.2 Infozip
tar - GNU or native
autoconf*1 2-13-9 GNU
gmake 3.79.1 GNU
gnat 3.13p

3.12

ALT distribution
gawk 3.0.3 GNU

The autoconf utility is only required on Linux/Unix Systems if the configuration scripts have to be changed.

For window systems a special set of makefiles in the directory ./win32 is provided which are not using the autoconf facility. Please note, that this make file seems to work only in plan dos box mode. If they are executed via Cygnus windows, the make utility assume Unix and the build fails.

Installation on Linux/Unix

Unpacking and Configuration

$ gunzip -c gnade-src-linux-gnu-<version>.tar.gz | tar xvf -
$ cd gnade-src-linux-gnu-<version>
$ ./configure <dbname>

As dbname the following values are allowed.

  • mimer - MimerSQL
  • postgres - PostgreSQL
  • MySQL - MySQL

If the value is omitted because your data base product is not listed,, all subsequent steps regarding the data base installation may be skipped and you have to install the test database manually.

Installation of the Database

Depending on the installation of the data base you have specified in the configure script command, you have to execute the following step either by using a DBA account our you may use your own user account.

$ su ..dba..
$ gmake createuser

After the database and the database user has been configured, the ODBC interface has to be configured. The directory ./samples/sample_db contains sample files for the unixODBC driver manager. The files odbc.ini.sample odbcinst.ini.sample have to be copied to /etc/odbc.ini and /etc/ odbcinst.ini.sample.

Compiling an testing

After the creation of the data base user, the final build may be done by:

$ gmake

Test code is located under ./samples. In order to test the functionality of the ODBC interface use the examples in ./odbc or ./esql.

If it does not work

If this installation procedure fails you may use the Makefile under ./win32. This makefile is known to work at least on Solaris well if the correct driver manager is installed (see section other components).

Installation on Windows NT

For window users a zip file is provided. In order to install perform the following steps:

> unzip gnade-src-linux-gnu-<version>.zip
> cd gnade-src-linux-gnu-<version>/win32
> make 

For window systems a special set of makefiles in the directory ./win32 is provided which are not using the autoconf facility.
Please note, that this make file seems to work only in plan dos box mode. If they are executed via Cygnus windows, the
make utility assume Unix and the GNADE build fails.

The windows makefile  uses the make.conf file which is prebuilt by the ./configure script. Any configuration
change has to be done there. Please refer to the README file in ./win32.

GNAT 1.14 / Windows 95

The Windows distribution of GNAT 3.14 (free dowload) libraries are missing such as libodbc32.a which makes linking with ODBC impossible. Please install gnatwin-3.14p.exe with the windows specific components..

Other components

The following Driver Manager are known to work with the release:

Component Description Version Operating System Comments
unixODBC ODBC Driver Manager 1.8.12-2 Linux www.unixodbc.org
2.0.5 Solaris 8

www.unixodbc.org

2.1.1-7 Linux Debian

GNADE 1.2.0

www.unixodbc.org

ODBC Driver Manager 3.5.10 Windows 95

Windows 98

Microsoft

The iODBC 3.04 implementation on Solaris seems to have a problem with the handling of cursor states. It should not be used.

Contributions

Special regards to the following persons which have contributed to the project:

Pascal Obry p.obry@wanadoo.fr
Fr. Fabien fr.fabien@infonie.fr


Document Version: $Date: 2002/05/11 20:50:04 $ $Revision: 1.2 $

gnade-1.6.2.orig/doc/releasenotes/note_1.3.4.html0000644000175000017500000007362207475743447021250 0ustar lbrentalbrenta No title

GNat Ada 95 Database Environment - (GNADE)

Version 1.3.4

Editor M.Erdmann

31.5.2002

Abstract

The objective of the GNADE project is to provide various packages which are allowing Ada 95 applications to access relational data base procducts, mainly SQL RDBMS.


Contents

Overview

Legal Stuff
Copyright
Authors
Contributions

Contact

New Features

Supported ODBC / Database Products

Supported native bindings

Supported Platforms & Compilers

Other components


Problems
Fixed Problems
Known Problems
Restrictions

Installation
Installation on linux
Installation on Windows

Overview

This release of the GNADE project is intended for building with the GNU Ada Translator on the platforms Linux, Solaris and Windows NT/95/2000.

This release covers beside bug corrections, a revised installation procedure and a CLOSE STATMENT <name> clause for dynamic SQL, the following features:

  • An extensive thin Ada 95 binding to the ODBC interfaces.
  • ISO/92 compliant embedded SQL translator which is able to process Ada 95 packages and files containing only one procedure. The translator creates Ada 95 source files working on top the of the ODBC interface.
  • Installation support for some commonly known data base products (see below).
  • Documentation in HTML, Postscript and PDF format.
  • Native Ada 95 bindings for MySQL, PostgreSQL and the Oracle call interface
  • GNU specific include clause which allows to access the ODBC handles via embedded SQL. This allows to mix embedded SQL and low level ODBC programing in a single source (see chapter in documentation).
  • DECLARE TABLE construct may be used to generate parts of the schema files (-schema option).
  • Support of embedded SQL based on the ISO/92 standard.
  • Support of MySQL with MS ODBC Drivers on Windows 95
  • Unicode support on the ODBC interface.
  • The connection clause has been extended by the ON clause in order to intercept typical connection errors and to define a reaction on ESQL level as shown below: CONNECT [ ON [COMMUNICATION|AUTHORIZATION|OTHER] ERROR [RAISE|GOTO|DO] <target> ]
  • A new GNADE implemenation defined data types as VARCHAR and VARBINARY. For details please refere to the documentation and the example attachment.gpq in samples/esql.
  • The experimental Ada Database Connectivity (ADBC) - API. The idea of this interface is to provide a binding which makes application relativly independant of the unterlying data base. The interface is highly experimental (refer to http://gnade.sourceforge.net/ado.html)

Legal Stuff

License and Copyright

The GNU Public License (GPL) applies with the following extension to all components of this release

As a special exception, if other files instantiate generics from GNADE Ada units, or you link GNADE Ada units or libraries with other files to produce an executable, these units or libraries do not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.

The documentation has been put under the Free GNU Documentation License.

Authors

The authors and copyright holders of the GNADE project are:

Jürgen Pfeifer juergen.pfeifer@gmx.net
Michael Erdmann Michael.Erdmann@snafu.de
Sune Falck sunef@hem.passagen.se
Julio Cano julius_bip@yahoo.com
Dimitry Anisimikov anisimkov@yahoo.com
François Fabien fr.fabien@infonie.fr
Stephen Leake stepen_leake@acm.org

Contributions

Special regards to the following persons which have contributed to the project:

Pascal Obry p.obry@wanadoo.fr
Fr. Fabien fr.fabien@infonie.fr

Contact

Bug Reports http://sourcefore.net/projects/gnade M.Erdmann
GNADE Discussions http://lists.sourceforge.net/lists/listinfo/gnade-develop M.Erdmann
Project Page http://gnade.sourceforge.net/

http://sourcefore.net/projects/gnade

M.Erdmann
Dev. Coordination Michael.Erdmann@snafu.de Michael Erdmann

New Features

Feature Req, Short Description Version Status
540161 Excpetion in statements 1.3 complete
426744 ESQL shall be able to handle files with only one procedure in. 1.1.2 complete
473046 ESQL extended types as VARCHAR, VARBINARY 1.1.10 complete
552327 Support of gnat 1.14 1.3.3 complete

Supported ODBC and Database Products

Even the GNADE project except for the native data base bindings is expected to work with all ODBC compliant data base products. The following products are known to work with GNADE assuming, that you are using the correct driver manager.

Component Description Version OS Distribution/Source of the release
PostgreSQL PostgreSQL Database 7.0.3 Linux - Redhat 7.0 Linux - SuSe 7.0 Solaris Windows NT/2000 www.postgresql.org
Mimer Mimer SQL RDBMS 8.2 Solaris Linux Windows NT www.mimer.com
MySQL MySQL Database MyODBC 3.23.22
2.50.36-1
Linux www.mysql.com
3.23.35a
2.50.36
Windows 2000 www.mysql.com
3.23.47
3.51.02
Windows 98 www.mysql.com
MS SQL Server 7.0 Windows 2000 Microsoft
SQL Server 2000 Windows 2000 Microsoft
Oracle Lite 8i Windows 95 Oracle

The GNADE project installation procedure provides for theses product test data bases. If your data base is not listed below, the GNADE project will be very likely usable but the test data base has to be installed manually.

The following Driver Managerare known to work with this and/or previous releases:

Component Description Version Operating System Comments
unixODBC ODBC Driver Manager 1.8.12-2 Linux www.unixodbc.org
2.0.5 Solaris 8 www.unixodbc.org
2.1.1-7 Linux Debian

GNADE 1.2.0

www.unixodbc.org
ODBC Driver Manager 3.5.10 Windows 95

Windows 98

Microsoft

The iODBC 3.04 implementation on Solaris seems to have a problem with the handling of cursor states. It should not be used.

Supported native bindings

Database Product Version Comments
PostgreSQL 7.03 Thin binding
MySQL Thick binding
Oracle OCI 8i lite

Other Components

Beside of the ODBC and the native bindings, the project provides add on components as:

  • ADBC- Ada Database Connectivitiy
  • Contributed tools

ADBC

The ADBC interface is a highly experimental package which works on top of PostgreSQL and MySQL. Since the interface is completly unstable it is not recommentded to use this interface in application at the current point in time. Since the interest in the Ada community was quite low it is questionable whether the development of this interface will be continued.

Contributed Tools

Tools are not part of this release. Constributed code is released as separate packages since they do not depend on a certain version of the GNADE environment.

  • gsql - A SQL client

Supported Platforms / Compilers

Compiler Version Operating System
GNAT 1.13.p

Lunix Windows

GNAT 1.14

Linux Solaris 8

GNAT 1.15a Win98

Problems

This section contain an overview of known, fixed problems and restrictions (limitations). Please report all errors via the error report system at the source forge project page.

Fixed Problems

Problems reported earlier then 0.9o are listed in the release note 1.1.2.

Bug Ref. Fixed with

Version

Short Description Comments
421587 0.9o ObjectAda Unrestricted_Access not supported. Unrestricted access is not used any more.
425280 1.1.1 Name of esql not changed every where GNUmakefile updated
425409 1.1.1 sql_standard prefix not handled correct gesql updated
425410 1.1.1 whenever sqlwarning faulty gesql updated
425510 1.1.1 gpl.sgml missing in distribution MANIFEST updated
421586 1.1.2 GNUmake on Windows 95 does not work Makefile changed
435712 1.1.2 Wrong debug code generated esql translator and esql_support updated
427531 1.1.2 gesql file corrupt but available The output file will always be deleted if some error during translation occurred.
427557 1.1.2 gesql command line not correct evaluated driver changed.
427764 1.1.3 Relastion missing error not recognized Code generation has been changed
427747 1.1.3 help message shown twice driver.adb changed
427750 1.1.3 Dynamic SQL DECLARE statement missing documentation updated
427748 1.1.3 Some_Error exception undefine code generator updated
430075 1.1.3 -noniso92 switch does not exist code generator updated
430077 1.1.3 -noiso92 switch not evaluated code generator updated
429984 1.1.4 Result evaluation done twice code generator updated
430751 1.1.4 Notfound class not correctly evaluated code generator updated
430752 1.1.4 not found exception raised twice code generator updated
430760 1.1.4 Number of affrected rows missing is SQLC code generator updated
435982 1.1.5 Wrong package name found esql parser updated
435872 1.1.5 Debug information missleading esql code generator updated
437590 1.1.5 Example simple does not work with MySQL GNU.DB.SQLCLI and esql_support.odbc

updated.

439149 1.1.5 SQLCA Not inserted correctly esql parser updated
439151 1.1.5 Handling of inner exception -noiso92 switch changed to -iso92 switch
439274 1.1.5 Mimer SQL not correctly installed Makefile updated
439274 1.1.5 MimerSQL, Tables of test db not found. Documentation updated
478056 1.1.6 Move in ESQL raises exception esql_support.adb updated
470357 1.1.6 simple.gpq does not handle conn. error simple.gqp updated
471060 1.1.7 esql_parse does not compile esql_parser.adb updated
471082 1.1.7 Useless evaluate code generated esql_parser.adb updated
473062 1.1.8 Package name in host var. decl. not eval. esql_parser.adb updated
473104 1.1.8 Query result not evaluated by gesql esql_parser.adb updated
473259 1.1.9 esql samples do not complie esql_parser.adb updated
475736 1.1.10 VARBINARY not handled correctly gnu-db-esql_support-odbc.adb
471061 1.1.10 seperator for Win 9x not handled GNUmakefile
433671 1.1.10 Win 2000 installation failes modules.adb
477766 1.2.0 longblob not correctly handled gnu-db-mysql.adb, gnu-db-mysql.ads
538349 1.3.1 SELECT sum(valeur) incorrect translated esql_parser.adb updated
533949 1.3.1 Firsttime installation with MimerSQL failes gnade.mimer.sql
538350 1.3.1 Null value not handled correctly esql_parser.adb
540160 1.3.1 Wrong cursor state in case of failed que gnu-db-esql_support-odbc.adb
540163 1.3.1 Debug granularity esql_parser.adb
543343 1.3.2 Case sensitve cursors esql_parser.adb
552325 1.3.3 configure fails on Solaris 2.8 configure.in, configure.gues
553343 1.3.3 odbc demo raises Need_Data exception demo.gpq
554383 1.3.3 odbc demo does not return any value odbc bindings
554929 1.3.3 esql moves 'pragma Source_Reference' esql-translator (driver.adb)
557135 1.3.4 make install fails (invalid option -C) A resoable desfault will be assumed.
562994 1.3.4 Gigi Error with Solaris 8 odbc bindings changes
562998 1.3.4 Assert & Debug are not passed to ODBC sharedlib.sh.in, staticlib.sh.in changed

Known Problems

Bug Ref. Short Description Comments
411141 Missing ";" for "EXEC SQL DECLARE DB01 D" This problem may be bypassed by putting a semicolon in the source code.
555169 segmentation fault in SQLSetEnvAttr

Restrictions

  • The package names of the OCI binding are not yet lined up with the GNADE package hirarchy. This allignment will be done with the next versions. The build process currently creates no test client automatically since the build scripts are only available for windows
  • The VARBINARY data type has only been tested with Mimer SQL.
  • The configuration procedure for Solaris has not been tested completely. If it fails please use the Makefiles in the directory ./win32. These files are known to build a working installation under Solaris.
  • The Object Ada Compiler is known to fail compiling the ODBC bindings because of insufficient compliance to the Ada 95 RM.
  • The compilation of the ODBC bindings is known to fail on a Sun SPARC using GNADE 1.13p (ACT tracking number [8925-002] Gigi abort code 411 on SPARC architectures). This has been fixed mean while but all tests have been done with 1.14.
  • The Option -compiler has been added to allow the support of specific of different Ada 95 compilers which has currently no effect.
  • Unicode support is only available begining with UnixODBC version 2.0. The Uncode support does depend on GNAT specific packages
  • Oracle 8i requires the declaration of string hostvariable to be 1 character larger then the domain size, e.g. assuming the size of the domain Ename from the example simple to be 20, the host variables have to be defined as:
    Ename     :   Char (1..21); 
    Dept_Name :   Char (1..21); 
    Location  :   Char (1..21);
  • The automatic installation is not supported in case of Oracle 8i but the installation script is located under samples.

Installation

The GNADE code and the documentation is distributed in the following files:

File Contents
gnade-src-1.3.1.tar.gz Complete GNADE source code distribution GNU compressed tar file
gnade-src-1.3.1.zip Complete GNADE source code distribution as ZIP file.

The installation of this software requires the following components:

Component Version Origin
gzip 1.2.4 GNU
unzip 5.42 Infozip
zip 2.2 Infozip
tar - GNU or native
autoconf*1 2-13-9 GNU
gmake 3.79.1 GNU
gnat 3.13p

3.12

ALT distribution
gawk 3.0.3 GNU

Installation on Linux/Unix

Unpacking and Configuration

$ gunzip -c gnade-src-linux-gnu-<version>.tar.gz | tar xvf -
$ cd gnade-src-linux-gnu-<version>
$ ./configure <dbname>

As dbname the following values are allowed:

  • mimer - MimerSQL
  • postgres - PostgreSQL
  • mysql - MySQL
  • oracle - Oracle 8i lite

If the value is omitted because your data base product is not listed,, all subsequent steps regarding the data base installation may be skipped and you have to install the test database manually.

Installation of the Database

Depending on the installation of the data base you have specified in the configure script command, you have to execute the following step either by using a DBA account our you may use your own user account

$ su ..dba..
$ gmake createuser

After the database and the database user has been configured, the ODBC interface has to be configured. The directory ./samples/sample_db contains sample files for the unixODBC driver manager. The files odbc.ini.sample odbcinst.ini.sample have to be copied to /etc/odbc.ini and /etc/odbcinst.ini.sample.

Compiling an testing

After the creation of the data base user, the final build may be done by:

$ gmake

Test code is located in the directory ./samples. In order to test the functionality of the ODBC interface use the examples in ./odbc or ./esql.

If it does not work

If this installation procedure fails you may use the Makefile in the directory ./win32. This will require some manual adoptions but it is a starting point.

In any case if you encounter a problem please contact the GNADE team asap.

Installation on Windows NT

For window users a zip file is provided. In order to install perform the following steps:

> unzip gnade-src-linux-gnu-<version>.zip
> cd gnade-src-linux-gnu-<version>/win32
> make 

For window systems a special set of makefiles in the directory ./win32 is provided which are not using the autoconf facility. Please note, that this make file seems to work only in plain dos box mode. If it is executed via Cygnus windows, the make utility assume Unix and the GNADE build fails.

The windows makefile uses the make.conf file which is prebuilt by the ./configure script. Any configuration change has to be done there. Please refer to the README file in ./win32.

GNAT 1.14 / Windows 95

In the Windows distribution of GNAT 3.14 (free download) libraries are missing such as libodbc32.a which makes linking with ODBC impossible. Please install gnatwin-3.14p.exe with the windows specific components.


$Id: note_1.3.4.html,v 1.2 2002/05/31 18:55:35 merdmann Exp $
gnade-1.6.2.orig/doc/releasenotes/note_1.3.4a.html0000644000175000017500000007336107476427640021404 0ustar lbrentalbrenta No title

GNat Ada 95 Database Environment - (GNADE)

Version 1.3.4a

Editor M.Erdmann

2.6.2002

Abstract

The objective of the GNADE project is to provide various packages which are allowing Ada 95 applications to access relational data base procducts, mainly SQL RDBMS.


Contents

Overview

Legal Stuff
Copyright
Authors
Contributions

Contact

New Features

Supported ODBC / Database Products

Supported native bindings

Supported Platforms & Compilers

Other components


Problems
Fixed Problems
Known Problems
Restrictions

Installation
Installation on linux
Installation on Windows

Overview

This release of the GNADE project is intended for building with GNAT (the GNU Ada compiler) on the platforms Linux, Solaris and Windows NT/95/2000.

This release covers beside bug corrections, a revised installation procedure and a CLOSE STATMENT <name> clause for dynamic SQL, the following features:

  • An extensive thin Ada 95 binding to the ODBC interfaces.
  • ISO/92 compliant embedded SQL translator which is able to process Ada 95 packages and files containing only one procedure. The translator creates Ada 95 source files working on top the of the ODBC interface.
  • Installation support for some commonly known data base products (see below).
  • Documentation in HTML, Postscript and PDF format.
  • Native Ada 95 bindings for MySQL, PostgreSQL and the Oracle call interface
  • GNU specific include clause which allows to access the ODBC handles via embedded SQL. This allows to mix embedded SQL and low level ODBC programing in a single source (see chapter in documentation).
  • DECLARE TABLE construct may be used to generate parts of the schema files (-schema option).
  • Support of embedded SQL based on the ISO/92 standard.
  • Support of MySQL with MS ODBC Drivers on Windows 95
  • Unicode support on the ODBC interface.
  • The connection clause has been extended by the ON clause in order to intercept typical connection errors and to define a reaction on ESQL level as shown below: CONNECT [ ON [COMMUNICATION|AUTHORIZATION|OTHER] ERROR [RAISE|GOTO|DO] <target> ]
  • A new GNADE implemenation defined data types as VARCHAR and VARBINARY. For details please refere to the documentation and the example attachment.gpq in samples/esql.
  • The experimental Ada Database Connectivity (ADBC) - API. The idea of this interface is to provide a binding which makes application relativly independant of the unterlying data base. The interface is highly experimental (refer to http://gnade.sourceforge.net/ado.html)

Legal Stuff

License and Copyright

The GNU Public License (GPL) applies with the following extension to all components of this release

As a special exception, if other files instantiate generics from GNADE Ada units, or you link GNADE Ada units or libraries with other files to produce an executable, these units or libraries do not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.

The documentation has been put under the Free GNU Documentation License.

Authors

The authors and copyright holders of the GNADE project are:

Jürgen Pfeifer juergen.pfeifer@gmx.net
Michael Erdmann Michael.Erdmann@snafu.de
Sune Falck sunef@hem.passagen.se
Julio Cano julius_bip@yahoo.com
Dimitry Anisimikov anisimkov@yahoo.com
François Fabien fr.fabien@infonie.fr
Stephen Leake stephen_leake@acm.org

Contributions

Special regards to the following persons which have contributed to the project:

Pascal Obry p.obry@wanadoo.fr
Fr. Fabien fr.fabien@infonie.fr

Contact

Bug Reports http://sourceforge.net/projects/gnade M.Erdmann
GNADE Discussions http://lists.sourceforge.net/lists/listinfo/gnade-develop M.Erdmann
Project Page http://gnade.sourceforge.net/

http://sourcefore.net/projects/gnade

M.Erdmann
Dev. Coordination Michael.Erdmann@snafu.de Michael Erdmann

New Features

Feature Req, Short Description Version Status
540161 Exception in statements 1.3 complete
426744 ESQL shall be able to handle files with only one procedure in. 1.1.2 complete
473046 ESQL extended types as VARCHAR, VARBINARY 1.1.10 complete
552327 Support of gnat 3.14 1.3.3 complete

Supported ODBC and Database Products

Even the GNADE project except for the native data base bindings is expected to work with all ODBC compliant data base products. The following products are known to work with GNADE assuming, that you are using the correct driver manager.

Component Description Version OS Distribution/Source of the release
PostgreSQL PostgreSQL Database 7.0.3 Linux - Redhat 7.0 Linux - SuSe 7.0 Solaris Windows NT/2000 www.postgresql.org
Mimer Mimer SQL RDBMS 8.2 Solaris Linux Windows NT www.mimer.com
MySQL MySQL Database MyODBC 3.23.22
2.50.36-1
Linux www.mysql.com
3.23.35a
2.50.36
Windows 2000 www.mysql.com
3.23.47
3.51.02
Windows 98 www.mysql.com
MS SQL Server 7.0 Windows 2000 Microsoft
SQL Server 2000 Windows 2000 Microsoft
Oracle Lite 8i Windows 95 Oracle

The GNADE project installation procedure provides for theses product test data bases. If your data base is not listed below, the GNADE project will be very likely usable but the test data base has to be installed manually.

The following Driver Managerare known to work with this and/or previous releases:

Component Description Version Operating System Comments
unixODBC ODBC Driver Manager 1.8.12-2 Linux www.unixodbc.org
2.0.5 Solaris 8 www.unixodbc.org
2.1.1-7 Linux Debian

GNADE 1.2.0

www.unixodbc.org
ODBC Driver Manager 3.5.10 Windows 95

Windows 98

Microsoft

The iODBC 3.04 implementation on Solaris seems to have a problem with the handling of cursor states. It should not be used.

Supported native bindings

Database Product Version Comments
PostgreSQL 7.03 Thin binding
MySQL Thick binding
Oracle OCI 8i lite

Other Components

Beside of the ODBC and the native bindings, the project provides add on components as:

  • ADBC- Ada Database Connectivitiy
  • Contributed tools

ADBC

The ADBC interface is a highly experimental package which works on top of PostgreSQL and MySQL. Since the interface is completly unstable it is not recommentded to use this interface in application at the current point in time. Since the interest in the Ada community was quite low it is questionable whether the development of this interface will be continued.

Contributed Tools

Tools are not part of this release. Constributed code is released as separate packages since they do not depend on a certain version of the GNADE environment.

  • gsql - A SQL client

Supported Platforms / Compilers

Compiler Version Operating Systems
GNAT 3.13p

Linux, Windows

GNAT 3.14p

Linux, Solaris 8, Windows

GNAT 3.15a Win98

Problems

This section contain an overview of known, fixed problems and restrictions (limitations). Please report all errors via the error report system at the source forge project page.

Fixed Problems

Problems reported earlier then 0.9o are listed in the release note 1.1.2.

Bug Ref. Fixed in Short Description Comments
421587 0.9o ObjectAda Unrestricted_Access not supported. Unrestricted access is not used any more.
425280 1.1.1 Name of esql not changed every where GNUmakefile updated
425409 1.1.1 sql_standard prefix not handled correct gesql updated
425410 1.1.1 whenever sqlwarning faulty gesql updated
425510 1.1.1 gpl.sgml missing in distribution MANIFEST updated
421586 1.1.2 GNUmake on Windows 95 does not work Makefile changed
435712 1.1.2 Wrong debug code generated esql translator and esql_support updated
427531 1.1.2 gesql file corrupt but available The output file will always be deleted if some error during translation occurred.
427557 1.1.2 gesql command line not correct evaluated driver changed.
427764 1.1.3 Relastion missing error not recognized Code generation has been changed
427747 1.1.3 help message shown twice driver.adb changed
427750 1.1.3 Dynamic SQL DECLARE statement missing documentation updated
427748 1.1.3 Some_Error exception undefine code generator updated
430075 1.1.3 -noniso92 switch does not exist code generator updated
430077 1.1.3 -noiso92 switch not evaluated code generator updated
429984 1.1.4 Result evaluation done twice code generator updated
430751 1.1.4 Notfound class not correctly evaluated code generator updated
430752 1.1.4 not found exception raised twice code generator updated
430760 1.1.4 Number of affrected rows missing is SQLC code generator updated
435982 1.1.5 Wrong package name found esql parser updated
435872 1.1.5 Debug information missleading esql code generator updated
437590 1.1.5 Example simple does not work with MySQL GNU.DB.SQLCLI and esql_support.odbc

updated.

439149 1.1.5 SQLCA Not inserted correctly esql parser updated
439151 1.1.5 Handling of inner exception -noiso92 switch changed to -iso92 switch
439274 1.1.5 Mimer SQL not correctly installed Makefile updated
439274 1.1.5 MimerSQL, Tables of test db not found. Documentation updated
478056 1.1.6 Move in ESQL raises exception esql_support.adb updated
470357 1.1.6 simple.gpq does not handle conn. error simple.gqp updated
471060 1.1.7 esql_parse does not compile esql_parser.adb updated
471082 1.1.7 Useless evaluate code generated esql_parser.adb updated
473062 1.1.8 Package name in host var. decl. not eval. esql_parser.adb updated
473104 1.1.8 Query result not evaluated by gesql esql_parser.adb updated
473259 1.1.9 esql samples do not complie esql_parser.adb updated
475736 1.1.10 VARBINARY not handled correctly gnu-db-esql_support-odbc.adb
471061 1.1.10 seperator for Win 9x not handled GNUmakefile
433671 1.1.10 Win 2000 installation failes modules.adb
477766 1.2.0 longblob not correctly handled gnu-db-mysql.adb, gnu-db-mysql.ads
538349 1.3.1 SELECT sum(valeur) incorrect translated esql_parser.adb updated
533949 1.3.1 Firsttime installation with MimerSQL failes gnade.mimer.sql
538350 1.3.1 Null value not handled correctly esql_parser.adb
540160 1.3.1 Wrong cursor state in case of failed que gnu-db-esql_support-odbc.adb
540163 1.3.1 Debug granularity esql_parser.adb
543343 1.3.2 Case sensitve cursors esql_parser.adb
552325 1.3.3 configure fails on Solaris 2.8 configure.in, configure.gues
553343 1.3.3 odbc demo raises Need_Data exception demo.gpq
554383 1.3.3 odbc demo does not return any value odbc bindings
554929 1.3.3 esql moves 'pragma Source_Reference' esql-translator (driver.adb)
557135 1.3.4 make install fails (invalid option -C) A resoable desfault will be assumed.
555169 1.3.4 segmentation fault in SQLSetEnvAttr odbc bindings updated
562994 1.3.4 Gigi Error with Solaris 8 odbc bindings changes
562998 1.3.4 Assert & Debug are not passed to ODBC sharedlib.sh.in, staticlib.sh.in changed
563257 1.3.4a ODBC bindings does not compile on Win 98 gnadevars.sh changed
563259 1.3.4a ODBC shared lib always build makefile updated
563332 1.3.4a gesql insert useless spaces in query

Known Problems

Bug Ref. Short Description Comments
411141 Missing ";" for "EXEC SQL DECLARE DB01 D" This problem may be bypassed by putting a semicolon in the source code.

Restrictions

  • The package names of the OCI binding are not yet lined up with the GNADE package hirarchy. This allignment will be done with the next versions. The build process currently creates no test client automatically since the build scripts are only available for windows
  • The VARBINARY data type has only been tested with Mimer SQL.
  • The configuration procedure for Solaris has not been tested completely. If it fails please use the Makefiles in the directory ./win32. These files are known to build a working installation under Solaris.
  • The Object Ada Compiler is known to fail compiling the ODBC bindings because of insufficient compliance to the Ada 95 RM.
  • The compilation of the ODBC bindings is known to fail on a Sun SPARC using GNAT 3.13p (ACT tracking number [8925-002] Gigi abort code 411 on SPARC architectures). This has been fixed mean while but all tests have been done with GNAT 3.14p.
  • The Option -compiler has been added to allow the support of specific of different Ada 95 compilers which has currently no effect.
  • Unicode support is only available begining with UnixODBC version 2.0. The Uncode support does depend on GNAT specific packages
  • Oracle 8i requires the declaration of string hostvariable to be 1 character larger then the domain size, e.g. assuming the size of the domain Ename from the example simple to be 20, the host variables have to be defined as:
    Ename     :   Char (1..21); 
    Dept_Name :   Char (1..21); 
    Location  :   Char (1..21);
  • The automatic installation is not supported in case of Oracle 8i but the installation script is located under samples.

Installation

The GNADE code and the documentation is distributed in the following files:

File Contents
gnade-src-1.3.1.tar.gz Complete GNADE source code distribution GNU compressed tar file
gnade-src-1.3.1.zip Complete GNADE source code distribution as ZIP file.

The installation of this software requires the following components:

Component Version Origin
gzip 1.2.4 GNU
unzip 5.42 Infozip
zip 2.2 Infozip
tar - GNU or native
autoconf*1 2-13-9 GNU
gmake 3.79.1 GNU
gnat 3.14p, 3.13p ACT distribution
gawk 3.0.3 GNU

Installation on Linux/Unix

Unpacking and Configuration

$ gunzip -c gnade-src-<version>.tar.gz | tar xvf -
$ cd gnade-src-<version>
$ ./configure <dbname>

As dbname the following values are allowed:

  • mimer - MimerSQL
  • postgres - PostgreSQL
  • mysql - MySQL
  • oracle - Oracle 8i lite

If the value is omitted because your data base product is not listed,, all subsequent steps regarding the data base installation may be skipped and you have to install the test database manually.

Installation of the Database

Depending on the installation of the data base you have specified in the configure script command, you have to execute the following step either by using a DBA account our you may use your own user account

$ su ..dba..
$ gmake createuser

After the database and the database user has been configured, the ODBC interface has to be configured. The directory ./samples/sample_db contains sample files for the unixODBC driver manager. The files odbc.ini.sample odbcinst.ini.sample have to be copied to /etc/odbc.ini and /etc/odbcinst.ini.sample.

Compiling an testing

After the creation of the data base user, the final build may be done by:

$ gmake

Test code is located in the directory ./samples. In order to test the functionality of the ODBC interface use the examples in ./odbc or ./esql.

If it does not work

If this installation procedure fails you may use the Makefile in the directory ./win32. This will require some manual adoptions but it is a starting point.

In any case if you encounter a problem please contact the GNADE team asap.

Installation on Windows NT

For window users a zip file is provided. In order to install perform the following steps:

> unzip gnade-src-<version>.zip
> cd gnade-src-<version>/win32
> make 

Please note, this works with or without Cygwin installed.

Note that the Windows distribution of GNAT is in two parts; the standard GNAT tools in gnat-3.14p-nt.exe and the extra Windows tools and libraries in gnatwin-3.14p.exe. Both must be installed.


$Id: note_1.3.4a.html,v 1.3 2002/06/02 14:45:52 stephen_leake Exp $
gnade-1.6.2.orig/doc/releasenotes/note_1.3.4b.html0000644000175000017500000007325507476707507021412 0ustar lbrentalbrenta No title

GNat Ada 95 Database Environment - (GNADE)

Version 1.3.4b

Editor M.Erdmann

3.6.2002

Abstract

The objective of the GNADE project is to provide various packages which are allowing Ada 95 applications to access relational data base procducts, mainly SQL RDBMS.


Contents

Overview

Legal Stuff
Copyright
Authors
Contributions

Contact
New Features
Supported ODBC / Database Products
Supported native bindings
Supported Platforms & Compilers
Other components

Problems
Fixed Problems
Known Problems
Restrictions

Installation
Installation on linux
Installation on Windows

Overview

This release of the GNADE project is intended for building with GNAT (the GNU Ada compiler) on the platforms Linux, Solaris and Windows NT/95/2000.

This release covers beside bug corrections, a revised installation procedure and a CLOSE STATMENT <name> clause for dynamic SQL, the following features:

  • An extensive thin Ada 95 binding to the ODBC interfaces.
  • ISO/92 compliant embedded SQL translator which is able to process Ada 95 packages and files containing only one procedure. The translator creates Ada 95 source files working on top the of the ODBC interface.
  • Installation support for some commonly known data base products (see below).
  • Documentation in HTML, Postscript and PDF format.
  • Native Ada 95 bindings for MySQL, PostgreSQL and the Oracle call interface
  • GNU specific include clause which allows to access the ODBC handles via embedded SQL. This allows to mix embedded SQL and low level ODBC programing in a single source (see chapter in documentation).
  • DECLARE TABLE construct may be used to generate parts of the schema files (-schema option).
  • Support of embedded SQL based on the ISO/92 standard.
  • Support of MySQL with MS ODBC Drivers on Windows 95
  • Unicode support on the ODBC interface.
  • The connection clause has been extended by the ON clause in order to intercept typical connection errors and to define a reaction on ESQL level as shown below: CONNECT [ ON [COMMUNICATION|AUTHORIZATION|OTHER] ERROR [RAISE|GOTO|DO] <target> ]
  • A new GNADE implemenation defined data types as VARCHAR and VARBINARY. For details please refere to the documentation and the example attachment.gpq in samples/esql.
  • The experimental Ada Database Connectivity (ADBC) - API. The idea of this interface is to provide a binding which makes application relativly independant of the unterlying data base. The interface is highly experimental (refer to http://gnade.sourceforge.net/ado.html)

Legal Stuff

License and Copyright

The GNU Public License (GPL) applies with the following extension to all components of this release

As a special exception, if other files instantiate generics from GNADE Ada units, or you link GNADE Ada units or libraries with other files to produce an executable, these units or libraries do not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.

The documentation has been put under the Free GNU Documentation License.

Authors

The authors and copyright holders of the GNADE project are:

Jürgen Pfeifer juergen.pfeifer@gmx.net
Michael Erdmann Michael.Erdmann@snafu.de
Sune Falck sunef@hem.passagen.se
Julio Cano julius_bip@yahoo.com
Dimitry Anisimikov anisimkov@yahoo.com
François Fabien fr.fabien@infonie.fr
Stephen Leake stephen_leake@acm.org

Contributions

Special regards to the following persons which have contributed to the project:

Pascal Obry p.obry@wanadoo.fr

Contact

Bug Reports http://sourceforge.net/projects/gnade M.Erdmann
GNADE Discussions http://lists.sourceforge.net/lists/listinfo/gnade-develop M.Erdmann
Project Page http://gnade.sourceforge.net/
http://sourceforge.net/projects/gnade
M.Erdmann
Dev. Coordination Michael.Erdmann@snafu.de Michael Erdmann

New Features

Feature Req, Short Description Version Status
540161 Exception in statements 1.3 complete
552327 Support of gnat 3.14 1.3.3 complete
563921 Explicit Database Connection 1.3.4b complete

Supported ODBC and Database Products

Even the GNADE project except for the native data base bindings is expected to work with all ODBC compliant data base products. The following products are known to work with GNADE assuming, that you are using the correct driver manager.

Component Description Version OS Distribution/Source of the release
PostgreSQL PostgreSQL Database 7.0.3 Linux - Redhat 7.0 Linux - SuSe 7.0 Solaris Windows NT/2000 www.postgresql.org
Mimer Mimer SQL RDBMS 8.2 Solaris Linux Windows NT www.mimer.com
MySQL MySQL Database MyODBC 3.23.22
2.50.36-1
Linux www.mysql.com
3.23.35a
2.50.36
Windows 2000 www.mysql.com
3.23.47
3.51.02
Windows 98 www.mysql.com
MS SQL Server 7.0 Windows 2000 Microsoft
SQL Server 2000 Windows 2000 Microsoft
Oracle Lite 8i Windows 95 Oracle

The GNADE project installation procedure provides for theses product test data bases. If your data base is not listed below, the GNADE project will be very likely usable but the test data base has to be installed manually.

The following Driver Managerare known to work with this and/or previous releases:

Component Description Version Operating System Comments
unixODBC ODBC Driver Manager 1.8.12-2 Linux www.unixodbc.org
2.0.5 Solaris 8 www.unixodbc.org
2.1.1-7 Linux Debian

GNADE 1.2.0

www.unixodbc.org
ODBC Driver Manager 3.5.10 Windows 95

Windows 98

Microsoft

The iODBC 3.04 implementation on Solaris seems to have a problem with the handling of cursor states. It should not be used.

Supported native bindings

Database Product Version Comments
PostgreSQL 7.03 Thin binding
MySQL Thick binding
Oracle OCI 8i lite

Other Components

Beside of the ODBC and the native bindings, the project provides add on components as:

  • ADBC- Ada Database Connectivitiy
  • Contributed tools

ADBC

The ADBC interface is a highly experimental package which works on top of PostgreSQL and MySQL. Since the interface is completly unstable it is not recommentded to use this interface in application at the current point in time. Since the interest in the Ada community was quite low it is questionable whether the development of this interface will be continued.

Contributed Tools

Tools are not part of this release. Constributed code is released as separate packages since they do not depend on a certain version of the GNADE environment.

  • gsql - A SQL client

Supported Platforms / Compilers

Compiler Version Operating Systems
GNAT 3.13p

Linux, Windows

GNAT 3.14p

Linux, Solaris 8, Windows

GNAT 3.15a Win98

Problems

This section contain an overview of known, fixed problems and restrictions (limitations). Please report all errors via the error report system at the source forge project page.

Fixed Problems

Problems reported earlier then 0.9o are listed in the release note 1.1.2.

Bug Ref. Fixed in Short Description Comments
421587 0.9o ObjectAda Unrestricted_Access not supported. Unrestricted access is not used any more.
425280 1.1.1 Name of esql not changed every where GNUmakefile updated
425409 1.1.1 sql_standard prefix not handled correct gesql updated
425410 1.1.1 whenever sqlwarning faulty gesql updated
425510 1.1.1 gpl.sgml missing in distribution MANIFEST updated
421586 1.1.2 GNUmake on Windows 95 does not work Makefile changed
435712 1.1.2 Wrong debug code generated esql translator and esql_support updated
427531 1.1.2 gesql file corrupt but available The output file will always be deleted if some error during translation occurred.
427557 1.1.2 gesql command line not correct evaluated driver changed.
427764 1.1.3 Relastion missing error not recognized Code generation has been changed
427747 1.1.3 help message shown twice driver.adb changed
427750 1.1.3 Dynamic SQL DECLARE statement missing documentation updated
427748 1.1.3 Some_Error exception undefine code generator updated
430075 1.1.3 -noniso92 switch does not exist code generator updated
430077 1.1.3 -noiso92 switch not evaluated code generator updated
429984 1.1.4 Result evaluation done twice code generator updated
430751 1.1.4 Notfound class not correctly evaluated code generator updated
430752 1.1.4 not found exception raised twice code generator updated
430760 1.1.4 Number of affrected rows missing is SQLC code generator updated
435982 1.1.5 Wrong package name found esql parser updated
435872 1.1.5 Debug information missleading esql code generator updated
437590 1.1.5 Example simple does not work with MySQL GNU.DB.SQLCLI and esql_support.odbc

updated.

439149 1.1.5 SQLCA Not inserted correctly esql parser updated
439151 1.1.5 Handling of inner exception -noiso92 switch changed to -iso92 switch
439274 1.1.5 Mimer SQL not correctly installed Makefile updated
439274 1.1.5 MimerSQL, Tables of test db not found. Documentation updated
478056 1.1.6 Move in ESQL raises exception esql_support.adb updated
470357 1.1.6 simple.gpq does not handle conn. error simple.gqp updated
471060 1.1.7 esql_parse does not compile esql_parser.adb updated
471082 1.1.7 Useless evaluate code generated esql_parser.adb updated
473062 1.1.8 Package name in host var. decl. not eval. esql_parser.adb updated
473104 1.1.8 Query result not evaluated by gesql esql_parser.adb updated
473259 1.1.9 esql samples do not complie esql_parser.adb updated
475736 1.1.10 VARBINARY not handled correctly gnu-db-esql_support-odbc.adb
471061 1.1.10 seperator for Win 9x not handled GNUmakefile
433671 1.1.10 Win 2000 installation failes modules.adb
477766 1.2.0 longblob not correctly handled gnu-db-mysql.adb, gnu-db-mysql.ads
538349 1.3.1 SELECT sum(valeur) incorrect translated esql_parser.adb updated
533949 1.3.1 Firsttime installation with MimerSQL failes gnade.mimer.sql
538350 1.3.1 Null value not handled correctly esql_parser.adb
540160 1.3.1 Wrong cursor state in case of failed que gnu-db-esql_support-odbc.adb
540163 1.3.1 Debug granularity esql_parser.adb
543343 1.3.2 Case sensitve cursors esql_parser.adb
552325 1.3.3 configure fails on Solaris 2.8 configure.in, configure.gues
553343 1.3.3 odbc demo raises Need_Data exception demo.gpq
554383 1.3.3 odbc demo does not return any value odbc bindings
554929 1.3.3 esql moves 'pragma Source_Reference' esql-translator (driver.adb)
557135 1.3.4 make install fails (invalid option -C) A resoable desfault will be assumed.
555169 1.3.4 segmentation fault in SQLSetEnvAttr odbc bindings updated
562994 1.3.4 Gigi Error with Solaris 8 odbc bindings changes
562998 1.3.4 Assert & Debug are not passed to ODBC sharedlib.sh.in, staticlib.sh.in changed
563257 1.3.4a ODBC bindings does not compile on Win 98 gnadevars.sh changed
563259 1.3.4a ODBC shared lib always build makefile updated
563332 1.3.4a gesql insert useless spaces in query esql_parser updated
563769 1.3.4b Subpackages are not evaluated correctly esql_parser updated

Known Problems

Bug Ref. Short Description Comments
411141 Missing ";" for "EXEC SQL DECLARE DB01 D" This problem may be bypassed by putting a semicolon in the source code.

Restrictions

  • The package names of the OCI binding are not yet lined up with the GNADE package hirarchy. This allignment will be done with the next versions. The build process currently creates no test client automatically since the build scripts are only available for windows
  • The VARBINARY data type has only been tested with Mimer SQL.
  • The configuration procedure for Solaris has not been tested completely. If it fails please use the Makefiles in the directory ./win32. These files are known to build a working installation under Solaris.
  • The Object Ada Compiler is known to fail compiling the ODBC bindings because of insufficient compliance to the Ada 95 RM.
  • The compilation of the ODBC bindings is known to fail on a Sun SPARC using GNAT 3.13p (ACT tracking number [8925-002] Gigi abort code 411 on SPARC architectures). This has been fixed mean while but all tests have been done with GNAT 3.14p.
  • The Option -compiler has been added to allow the support of specific of different Ada 95 compilers which has currently no effect.
  • Unicode support is only available begining with UnixODBC version 2.0. The Uncode support does depend on GNAT specific packages
  • Oracle 8i requires the declaration of string hostvariable to be 1 character larger then the domain size, e.g. assuming the size of the domain Ename from the example simple to be 20, the host variables have to be defined as:
    Ename     :   Char (1..21); 
    Dept_Name :   Char (1..21); 
    Location  :   Char (1..21);
  • The automatic installation is not supported in case of Oracle 8i but the installation script is located under samples.

Installation

The GNADE code and the documentation is distributed in the following files:

File Contents
gnade-src-1.3.1.tar.gz Complete GNADE source code distribution GNU compressed tar file
gnade-src-1.3.1.zip Complete GNADE source code distribution as ZIP file.

The installation of this software requires the following components:

Component Version Origin
gzip 1.2.4 GNU
unzip 5.42 Infozip
zip 2.2 Infozip
tar - GNU or native
autoconf*1 2-13-9 GNU
gmake 3.79.1 GNU
gnat 3.14p, 3.13p ACT distribution
gawk 3.0.3 GNU

Installation on Linux/Unix

Unpacking and Configuration

$ gunzip -c gnade-src-<version>.tar.gz | tar xvf -
$ cd gnade-src-<version>
$ ./configure <dbname>

As dbname the following values are allowed:

  • mimer - MimerSQL
  • postgres - PostgreSQL
  • mysql - MySQL
  • oracle - Oracle 8i lite

If the value is omitted because your data base product is not listed,, all subsequent steps regarding the data base installation may be skipped and you have to install the test database manually.

Installation of the Database

Depending on the installation of the data base you have specified in the configure script command, you have to execute the following step either by using a DBA account our you may use your own user account

$ su ..dba..
$ gmake createuser

After the database and the database user has been configured, the ODBC interface has to be configured. The directory ./samples/sample_db contains sample files for the unixODBC driver manager. The files odbc.ini.sample odbcinst.ini.sample have to be copied to /etc/odbc.ini and /etc/odbcinst.ini.sample.

Compiling an testing

After the creation of the data base user, the final build may be done by:

$ gmake

Test code is located in the directory ./samples. In order to test the functionality of the ODBC interface use the examples in ./odbc or ./esql.

If it does not work

If this installation procedure fails you may use the Makefile in the directory ./win32. This will require some manual adoptions but it is a starting point.

In any case if you encounter a problem please contact the GNADE team asap.

Installation on Windows NT

For window users a zip file is provided. In order to install perform the following steps:

> unzip gnade-src-<version>.zip
> cd gnade-src-<version>/win32
> make 

Please note, this works with or without Cygwin installed.

Note that the Windows distribution of GNAT is in two parts; the standard GNAT tools in gnat-3.14p-nt.exe and the extra Windows tools and libraries in gnatwin-3.14p.exe. Both must be installed.


$Id: note_1.3.4b.html,v 1.2 2002/06/03 15:46:15 merdmann Exp $
gnade-1.6.2.orig/doc/releasenotes/note_1.3.5.html0000644000175000017500000007317107500431444021224 0ustar lbrentalbrenta No title

GNat Ada 95 Database Environment - (GNADE)

Version 1.3.5

Editor M.Erdmann

8.6.2002

Abstract

The objective of the GNADE project is to provide various packages which are allowing Ada 95 applications to access relational data base procducts, mainly SQL RDBMS.


Contents

Overview

Legal Stuff
Copyright
Authors
Contributions

Contact
New Features
Supported ODBC / Database Products
Supported native bindings
Supported Platforms & Compilers
Other components

Problems
Fixed Problems
Known Problems
Restrictions

Installation
Installation on linux
Installation on Windows

Overview

This release of the GNADE project is intended for building with GNAT (the GNU Ada compiler) on the platforms Linux, Solaris and Windows NT/95/2000.

This release covers beside bug corrections, a non ISO 92 esmbedded SQL extension which simplyfies the implementation libraries with the GESQL translator.

  • An extensive thin Ada 95 binding to the ODBC interfaces.
  • ISO/92 compliant embedded SQL translator which is able to process Ada 95 packages and files containing only one procedure. The translator creates Ada 95 source files working on top the of the ODBC interface.
  • Installation support for some commonly known data base products (see below).
  • Documentation in HTML, Postscript and PDF format.
  • Native Ada 95 bindings for MySQL, PostgreSQL and the Oracle call interface
  • GNU specific include clause which allows to access the ODBC handles via embedded SQL. This allows to mix embedded SQL and low level ODBC programing in a single source (see chapter in documentation).
  • DECLARE TABLE construct may be used to generate parts of the schema files (-schema option).
  • Support of embedded SQL based on the ISO/92 standard.
  • Support of MySQL with MS ODBC Drivers on Windows 95
  • Unicode support on the ODBC interface.
  • The connection clause has been extended by the ON clause in order to intercept typical connection errors and to define a reaction on ESQL level as shown below: CONNECT [ ON [COMMUNICATION|AUTHORIZATION|OTHER] ERROR [RAISE|GOTO|DO] <target> ]
  • A new GNADE implemenation defined data types as VARCHAR and VARBINARY. For details please refere to the documentation and the example attachment.gpq in samples/esql.
  • The experimental Ada Database Connectivity (ADBC) - API. The idea of this interface is to provide a binding which makes application relativly independant of the unterlying data base. The interface is highly experimental (refer to http://gnade.sourceforge.net/ado.html)

Legal Stuff

License and Copyright

The GNU Public License (GPL) applies with the following extension to all components of this release

As a special exception, if other files instantiate generics from GNADE Ada units, or you link GNADE Ada units or libraries with other files to produce an executable, these units or libraries do not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.

The documentation has been put under the Free GNU Documentation License.

Authors

The authors and copyright holders of the GNADE project are:

Jürgen Pfeifer juergen.pfeifer@gmx.net
Michael Erdmann Michael.Erdmann@snafu.de
Sune Falck sunef@hem.passagen.se
Julio Cano julius_bip@yahoo.com
Dimitry Anisimikov anisimkov@yahoo.com
François Fabien fr.fabien@infonie.fr
Stephen Leake stephen_leake@acm.org

Contributions

Special regards to the following persons which have contributed to the project:

Pascal Obry p.obry@wanadoo.fr

Contact

Bug Reports http://sourceforge.net/projects/gnade M.Erdmann
GNADE Discussions http://lists.sourceforge.net/lists/listinfo/gnade-develop M.Erdmann
Project Page http://gnade.sourceforge.net/
http://sourceforge.net/projects/gnade
M.Erdmann
Dev. Coordination Michael.Erdmann@snafu.de Michael Erdmann

New Features

Feature Req, Short Description Version Status
540161 Exception in statements 1.3 complete
552327 Support of gnat 3.14 1.3.3 complete
563921 Explicit Database Connection 1.3.4b complete

Supported ODBC and Database Products

Even the GNADE project except for the native data base bindings is expected to work with all ODBC compliant data base products. The following products are known to work with GNADE assuming, that you are using the correct driver manager.

Component Description Version OS Distribution/Source of the release
PostgreSQL PostgreSQL Database 7.0.3 Linux - Redhat 7.0 Linux - SuSe 7.0 Solaris Windows NT/2000 www.postgresql.org
Mimer Mimer SQL RDBMS 8.2 Solaris Linux Windows NT www.mimer.com
MySQL MySQL Database MyODBC 3.23.22
2.50.36-1
Linux www.mysql.com
3.23.35a
2.50.36
Windows 2000 www.mysql.com
3.23.47
3.51.02
Windows 98 www.mysql.com
MS SQL Server 7.0 Windows 2000 Microsoft
SQL Server 2000 Windows 2000 Microsoft
Oracle Lite 8i Windows 95 Oracle

The GNADE project installation procedure provides for theses product test data bases. If your data base is not listed below, the GNADE project will be very likely usable but the test data base has to be installed manually.

The following Driver Managerare known to work with this and/or previous releases:

Component Description Version Operating System Comments
unixODBC ODBC Driver Manager 1.8.12-2 Linux www.unixodbc.org
2.0.5 Solaris 8 www.unixodbc.org
2.1.1-7 Linux Debian www.unixodbc.org
ODBC Driver Manager 3.5.10 Windows 95, 98 Microsoft

The iODBC 3.04 implementation on Solaris seems to have a problem with the handling of cursor states. It should not be used.

Supported native bindings

Database Product Version Comments
PostgreSQL 7.03 Thin binding
MySQL Thick binding
Oracle OCI 8i lite Oracle Call Interface

Other Components

Beside of the ODBC and the native bindings, the project provides add on components as:

  • ADBC- Ada Database Connectivitiy
  • Contributed tools

ADBC

The ADBC interface is a highly experimental package which works on top of PostgreSQL and MySQL. Since the interface is completly unstable it is not recommentded to use this interface in application at the current point in time. Since the interest in the Ada community was quite low it is questionable whether the development of this interface will be continued.

Contributed Tools

Tools are not part of this release. Constributed code is released as separate packages since they do not depend on a certain version of the GNADE environment.

  • gsql - A SQL client

Supported Platforms / Compilers

Compiler Version Operating Systems
GNAT 3.13p Linux, Windows
GNAT 3.14p Linux, Solaris 8, Windows
GNAT 3.15a Win98

Problems

This section contain an overview of known, fixed problems and restrictions (limitations). Please report all errors via the error report system at the source forge project page.

Fixed Problems

Problems reported earlier then 0.9o are listed in the release note 1.1.2.

Bug Ref. Fixed in Short Description Comments
421587 0.9o ObjectAda Unrestricted_Access not supported. Unrestricted access is not used any more.
425280 1.1.1 Name of esql not changed every where GNUmakefile updated
425409 1.1.1 sql_standard prefix not handled correct gesql updated
425410 1.1.1 whenever sqlwarning faulty gesql updated
425510 1.1.1 gpl.sgml missing in distribution MANIFEST updated
421586 1.1.2 GNUmake on Windows 95 does not work Makefile changed
435712 1.1.2 Wrong debug code generated esql translator and esql_support updated
427531 1.1.2 gesql file corrupt but available The output file will always be deleted if some error during translation occurred.
427557 1.1.2 gesql command line not correct evaluated driver changed.
427764 1.1.3 Relastion missing error not recognized Code generation has been changed
427747 1.1.3 help message shown twice driver.adb changed
427750 1.1.3 Dynamic SQL DECLARE statement missing documentation updated
427748 1.1.3 Some_Error exception undefine code generator updated
430075 1.1.3 -noniso92 switch does not exist code generator updated
430077 1.1.3 -noiso92 switch not evaluated code generator updated
429984 1.1.4 Result evaluation done twice code generator updated
430751 1.1.4 Notfound class not correctly evaluated code generator updated
430752 1.1.4 not found exception raised twice code generator updated
430760 1.1.4 Number of affrected rows missing is SQLC code generator updated
435982 1.1.5 Wrong package name found esql parser updated
435872 1.1.5 Debug information missleading esql code generator updated
437590 1.1.5 Example simple does not work with MySQL GNU.DB.SQLCLI and esql_support.odbc

updated.

439149 1.1.5 SQLCA Not inserted correctly esql parser updated
439151 1.1.5 Handling of inner exception -noiso92 switch changed to -iso92 switch
439274 1.1.5 Mimer SQL not correctly installed Makefile updated
439274 1.1.5 MimerSQL, Tables of test db not found. Documentation updated
478056 1.1.6 Move in ESQL raises exception esql_support.adb updated
470357 1.1.6 simple.gpq does not handle conn. error simple.gqp updated
471060 1.1.7 esql_parse does not compile esql_parser.adb updated
471082 1.1.7 Useless evaluate code generated esql_parser.adb updated
473062 1.1.8 Package name in host var. decl. not eval. esql_parser.adb updated
473104 1.1.8 Query result not evaluated by gesql esql_parser.adb updated
473259 1.1.9 esql samples do not complie esql_parser.adb updated
475736 1.1.10 VARBINARY not handled correctly gnu-db-esql_support-odbc.adb
471061 1.1.10 seperator for Win 9x not handled GNUmakefile
433671 1.1.10 Win 2000 installation failes modules.adb
477766 1.2.0 longblob not correctly handled gnu-db-mysql.adb, gnu-db-mysql.ads
538349 1.3.1 SELECT sum(valeur) incorrect translated esql_parser.adb updated
533949 1.3.1 Firsttime installation with MimerSQL failes gnade.mimer.sql
538350 1.3.1 Null value not handled correctly esql_parser.adb
540160 1.3.1 Wrong cursor state in case of failed que gnu-db-esql_support-odbc.adb
540163 1.3.1 Debug granularity esql_parser.adb
543343 1.3.2 Case sensitve cursors esql_parser.adb
552325 1.3.3 configure fails on Solaris 2.8 configure.in, configure.gues
553343 1.3.3 odbc demo raises Need_Data exception demo.gpq
554383 1.3.3 odbc demo does not return any value odbc bindings
554929 1.3.3 esql moves 'pragma Source_Reference' esql-translator (driver.adb)
557135 1.3.4 make install fails (invalid option -C) A resoable desfault will be assumed.
555169 1.3.4 segmentation fault in SQLSetEnvAttr odbc bindings updated
562994 1.3.4 Gigi Error with Solaris 8 odbc bindings changes
562998 1.3.4 Assert & Debug are not passed to ODBC sharedlib.sh.in, staticlib.sh.in changed
563257 1.3.4a ODBC bindings does not compile on Win 98 gnadevars.sh changed
563259 1.3.4a ODBC shared lib always build makefile updated
563332 1.3.4a gesql insert useless spaces in query esql_parser updated
563769 1.3.4b Subpackages are not evaluated correctly esql_parser updated
565952 1.3.5 Domain Qualification not handled esql_parser updated
565951 1.3.5 QL Strings are not handled correctly esql_parser updated

Known Problems

Bug Ref. Short Description Comments
411141 Missing ";" for "EXEC SQL DECLARE DB01 D" This problem may be bypassed by putting a semicolon in the source code.

Restrictions

  • The package names of the OCI binding are not yet lined up with the GNADE package hirarchy. This allignment will be done with the next versions. The build process currently creates no test client automatically since the build scripts are only available for windows
  • The VARBINARY data type has only been tested with Mimer SQL.
  • The configuration procedure for Solaris has not been tested completely. If it fails please use the Makefiles in the directory ./win32. These files are known to build a working installation under Solaris.
  • The Object Ada Compiler is known to fail compiling the ODBC bindings because of insufficient compliance to the Ada 95 RM.
  • The compilation of the ODBC bindings is known to fail on a Sun SPARC using GNAT 3.13p (ACT tracking number [8925-002] Gigi abort code 411 on SPARC architectures). This has been fixed mean while but all tests have been done with GNAT 3.14p.
  • The Option -compiler has been added to allow the support of specific of different Ada 95 compilers which has currently no effect.
  • Unicode support is only available begining with UnixODBC version 2.0. The Uncode support does depend on GNAT specific packages
  • Oracle 8i requires the declaration of string hostvariable to be 1 character larger then the domain size, e.g. assuming the size of the domain Ename from the example simple to be 20, the host variables have to be defined as:
    Ename     :   Char (1..21); 
    Dept_Name :   Char (1..21); 
    Location  :   Char (1..21);
  • The automatic installation is not supported in case of Oracle 8i but the installation script is located under samples.

Installation

The GNADE code and the documentation is distributed in the following files:

File Contents
gnade-src-1.3.5.tar.gz Complete GNADE source code distribution GNU compressed tar file
gnade-src-1.3.5.zip Complete GNADE source code distribution as ZIP file.

The installation of this software requires the following components:

Component Version Origin
gzip 1.2.4 GNU
unzip 5.42 Infozip
zip 2.2 Infozip
tar - GNU or native
autoconf*1 2-13-9 GNU
gmake 3.79.1 GNU
gnat 3.14p, 3.13p ACT distribution
gawk 3.0.3 GNU

Installation on Linux/Unix

Unpacking and Configuration

$ gunzip -c gnade-src-<version>.tar.gz | tar xvf -
$ cd gnade-src-<version>
$ ./configure <dbname>

As dbname the following values are allowed:

  • mimer - MimerSQL
  • postgres - PostgreSQL
  • mysql - MySQL
  • oracle - Oracle 8i lite

If the value is omitted because your data base product is not listed,, all subsequent steps regarding the data base installation may be skipped and you have to install the test database manually.

Installation of the Database

Depending on the installation of the data base you have specified in the configure script command, you have to execute the following step either by using a DBA account our you may use your own user account

$ su ..dba..
$ gmake createuser

After the database and the database user has been configured, the ODBC interface has to be configured. The directory ./samples/sample_db contains sample files for the unixODBC driver manager. The files odbc.ini.sample odbcinst.ini.sample have to be copied to /etc/odbc.ini and /etc/odbcinst.ini.sample.

Compiling an testing

After the creation of the data base user, the final build may be done by:

$ gmake

Test code is located in the directory ./samples. In order to test the functionality of the ODBC interface use the examples in ./odbc or ./esql.

If it does not work

If this installation procedure fails you may use the Makefile in the directory ./win32. This will require some manual adoptions but it is a starting point.

In any case if you encounter a problem please contact the GNADE team asap.

Installation on Windows NT

For window users a zip file is provided. In order to install perform the following steps:

> unzip gnade-src-<version>.zip
> cd gnade-src-<version>/win32
> make 

Please note, this works with or without Cygwin installed.

Note that the Windows distribution of GNAT is in two parts; the standard GNAT tools in gnat-3.14p-nt.exe and the extra Windows tools and libraries in gnatwin-3.14p.exe. Both must be installed.


$Id: note_1.3.5.html,v 1.1 2002/06/08 16:39:00 merdmann Exp $
gnade-1.6.2.orig/doc/releasenotes/note_1.3.5a.html0000644000175000017500000007374007500706427021375 0ustar lbrentalbrenta No title
GNat Ada 95 Database Environment - (GNADE)
Version 1.3.5a
Editor M.Erdmann
9.6.2002


Abstract

The objective of the GNADE project is to provide various packages which are allowing Ada 95 applications to access relational data base procducts, mainly SQL RDBMS.


Contents

Overview

Legal Stuff
Copyright
Authors
Contributions

Contact
New Features
Supported ODBC / Database Products
Supported native bindings
Supported Platforms & Compilers
Other components

Problems
Fixed Problems
Known Problems
Restrictions

Installation
Installation on linux
Installation on Windows

Overview

This release contains beside of two nasty bugs of the version 1.3.5 a non ISO 92 embedded SQL extension which simplyfies the implementation libraries with the GESQL translator.

  • An extensive thin Ada 95 binding to the ODBC interfaces.
  • ISO/92 compliant embedded SQL translator which is able to process Ada 95 packages and files containing only one procedure. The translator creates Ada 95 source files working on top the of the ODBC interface.
  • Installation support for some commonly known data base products (see below).
  • Documentation in HTML, Postscript and PDF format.
  • Native Ada 95 bindings for MySQL, PostgreSQL and the Oracle call interface
  • GNU specific include clause which allows to access the ODBC handles via embedded SQL. This allows to mix embedded SQL and low level ODBC programing in a single source (see chapter in documentation).
  • DECLARE TABLE construct may be used to generate parts of the schema files (-schema option).
  • Support of embedded SQL based on the ISO/92 standard.
  • Support of MySQL with MS ODBC Drivers on Windows 95
  • Unicode support on the ODBC interface.
  • The connection clause has been extended by the ON clause in order to intercept typical connection errors and to define a reaction on ESQL level as shown below: CONNECT [ ON [COMMUNICATION|AUTHORIZATION|OTHER] ERROR [RAISE|GOTO|DO] <target> ]
  • A new GNADE implemenation defined data types as VARCHAR and VARBINARY. For details please refere to the documentation and the example attachment.gpq in samples/esql.
  • The experimental Ada Database Connectivity (ADBC) - API. The idea of this interface is to provide a binding which makes application relativly independant of the unterlying data base. The interface is highly experimental (refer to http://gnade.sourceforge.net/ado.html)

This release of the GNADE project is intended for building with GNAT (the GNU Ada compiler) on the platforms Linux, Solaris and Windows NT/95/2000.

Legal Stuff

License and Copyright

The GNU Public License (GPL) applies with the following extension to all components of this release

As a special exception, if other files instantiate generics from GNADE Ada units, or you link GNADE Ada units or libraries with other files to produce an executable, these units or libraries do not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.

The documentation has been put under the Free GNU Documentation License.

Authors

The authors and copyright holders of the GNADE project are:

Jürgen Pfeifer juergen.pfeifer@gmx.net
Michael Erdmann Michael.Erdmann@snafu.de
Sune Falck sunef@hem.passagen.se
Julio Cano julius_bip@yahoo.com
Dimitry Anisimikov anisimkov@yahoo.com
François Fabien fr.fabien@infonie.fr
Stephen Leake stephen_leake@acm.org

Contributions

Special regards to the following persons which have contributed to the project:

Pascal Obry p.obry@wanadoo.fr

Contact

Bug Reports http://sourceforge.net/projects/gnade M.Erdmann
GNADE Discussions http://lists.sourceforge.net/lists/listinfo/gnade-develop M.Erdmann
Project Page http://gnade.sourceforge.net/
http://sourceforge.net/projects/gnade
M.Erdmann
Dev. Coordination Michael.Erdmann@snafu.de Michael Erdmann

New Features

Feature Req, Short Description Version Status
540161 Exception in statements 1.3 complete
552327 Support of gnat 3.14 1.3.3 complete
563921 Explicit Database Connection 1.3.4b complete

Supported ODBC and Database Products

Even the GNADE project except for the native data base bindings is expected to work with all ODBC compliant data base products. The following products are known to work with GNADE assuming, that you are using the correct driver manager.

Component Description Version OS Distribution/Source of the release
PostgreSQL PostgreSQL Database 7.0.3 Linux - Redhat 7.0 Linux - SuSe 7.0 Solaris Windows NT/2000 www.postgresql.org
Mimer Mimer SQL RDBMS 8.2 Solaris Linux Windows NT www.mimer.com
MySQL MySQL Database MyODBC 3.23.22
2.50.36-1
Linux www.mysql.com
3.23.35a
2.50.36
Windows 2000 www.mysql.com
3.23.47
3.51.02
Windows 98 www.mysql.com
MS SQL Server 7.0 Windows 2000 Microsoft
SQL Server 2000 Windows 2000 Microsoft
Oracle Lite 8i Windows 95 Oracle

The GNADE project installation procedure provides for theses product test data bases. If your data base is not listed below, the GNADE project will be very likely usable but the test data base has to be installed manually.

The following Driver Managerare known to work with this and/or previous releases:

Component Description Version Operating System Comments
unixODBC ODBC Driver Manager 1.8.12-2 Linux www.unixodbc.org
2.0.5 Solaris 8 www.unixodbc.org
2.1.1-7 Linux Debian www.unixodbc.org
ODBC Driver Manager 3.5.10 Windows 95, 98 Microsoft

The iODBC 3.04 implementation on Solaris seems to have a problem with the handling of cursor states. It should not be used.

Supported native bindings

Database Product Version Comments
PostgreSQL 7.03 Thin binding
MySQL Thick binding
Oracle OCI 8i lite Oracle Call Interface

Other Components

Beside of the ODBC and the native bindings, the project provides add on components as:

  • ADBC- Ada Database Connectivitiy
  • Contributed tools

ADBC

The ADBC interface is a highly experimental package which works on top of PostgreSQL and MySQL. Since the interface is completly unstable it is not recommentded to use this interface in application at the current point in time. Since the interest in the Ada community was quite low it is questionable whether the development of this interface will be continued.

Contributed Tools

Tools are not part of this release. Constributed code is released as separate packages since they do not depend on a certain version of the GNADE environment.

  • gsql - A SQL client

Supported Platforms / Compilers

Compiler Version Operating Systems
GNAT 3.13p Linux, Windows
GNAT 3.14p Linux, Solaris 8, Windows
GNAT 3.15a Win98

Problems

This section contain an overview of known, fixed problems and restrictions (limitations). Please report all errors via the error report system at the source forge project page.

Fixed Problems

Problems reported earlier then 0.9o are listed in the release note 1.1.2.

Bug Ref. Fixed in Short Description Comments
421587 0.9o ObjectAda Unrestricted_Access not supported. Unrestricted access is not used any more.
425280 1.1.1 Name of esql not changed every where GNUmakefile updated
425409 1.1.1 sql_standard prefix not handled correct gesql updated
425410 1.1.1 whenever sqlwarning faulty gesql updated
425510 1.1.1 gpl.sgml missing in distribution MANIFEST updated
421586 1.1.2 GNUmake on Windows 95 does not work Makefile changed
435712 1.1.2 Wrong debug code generated esql translator and esql_support updated
427531 1.1.2 gesql file corrupt but available The output file will always be deleted if some error during translation occurred.
427557 1.1.2 gesql command line not correct evaluated driver changed.
427764 1.1.3 Relastion missing error not recognized Code generation has been changed
427747 1.1.3 help message shown twice driver.adb changed
427750 1.1.3 Dynamic SQL DECLARE statement missing documentation updated
427748 1.1.3 Some_Error exception undefine code generator updated
430075 1.1.3 -noniso92 switch does not exist code generator updated
430077 1.1.3 -noiso92 switch not evaluated code generator updated
429984 1.1.4 Result evaluation done twice code generator updated
430751 1.1.4 Notfound class not correctly evaluated code generator updated
430752 1.1.4 not found exception raised twice code generator updated
430760 1.1.4 Number of affrected rows missing is SQLC code generator updated
435982 1.1.5 Wrong package name found esql parser updated
435872 1.1.5 Debug information missleading esql code generator updated
437590 1.1.5 Example simple does not work with MySQL GNU.DB.SQLCLI and esql_support.odbc

updated.

439149 1.1.5 SQLCA Not inserted correctly esql parser updated
439151 1.1.5 Handling of inner exception -noiso92 switch changed to -iso92 switch
439274 1.1.5 Mimer SQL not correctly installed Makefile updated
439274 1.1.5 MimerSQL, Tables of test db not found. Documentation updated
478056 1.1.6 Move in ESQL raises exception esql_support.adb updated
470357 1.1.6 simple.gpq does not handle conn. error simple.gqp updated
471060 1.1.7 esql_parse does not compile esql_parser.adb updated
471082 1.1.7 Useless evaluate code generated esql_parser.adb updated
473062 1.1.8 Package name in host var. decl. not eval. esql_parser.adb updated
473104 1.1.8 Query result not evaluated by gesql esql_parser.adb updated
473259 1.1.9 esql samples do not complie esql_parser.adb updated
475736 1.1.10 VARBINARY not handled correctly gnu-db-esql_support-odbc.adb
471061 1.1.10 seperator for Win 9x not handled GNUmakefile
433671 1.1.10 Win 2000 installation failes modules.adb
477766 1.2.0 longblob not correctly handled gnu-db-mysql.adb, gnu-db-mysql.ads
538349 1.3.1 SELECT sum(valeur) incorrect translated esql_parser.adb updated
533949 1.3.1 Firsttime installation with MimerSQL failes gnade.mimer.sql
538350 1.3.1 Null value not handled correctly esql_parser.adb
540160 1.3.1 Wrong cursor state in case of failed que gnu-db-esql_support-odbc.adb
540163 1.3.1 Debug granularity esql_parser.adb
543343 1.3.2 Case sensitve cursors esql_parser.adb
552325 1.3.3 configure fails on Solaris 2.8 configure.in, configure.gues
553343 1.3.3 odbc demo raises Need_Data exception demo.gpq
554383 1.3.3 odbc demo does not return any value odbc bindings
554929 1.3.3 esql moves 'pragma Source_Reference' esql-translator (driver.adb)
557135 1.3.4 make install fails (invalid option -C) A resoable desfault will be assumed.
555169 1.3.4 segmentation fault in SQLSetEnvAttr odbc bindings updated
562994 1.3.4 Gigi Error with Solaris 8 odbc bindings changes
562998 1.3.4 Assert & Debug are not passed to ODBC sharedlib.sh.in, staticlib.sh.in changed
563257 1.3.4a ODBC bindings does not compile on Win 98 gnadevars.sh changed
563259 1.3.4a ODBC shared lib always build makefile updated
563332 1.3.4a gesql insert useless spaces in query esql_parser updated
563769 1.3.4b Subpackages are not evaluated correctly esql_parser updated
565952 1.3.5 Domain Qualification not handled esql_parser updated
565951 1.3.5 SQL Strings are not handled correctly esql_parser updated
566413 1.3.5a static libraries not build for adbc Makefile modified
566414 1.3.5a Useless printouts in gesql esql_parser updated
566429 1.3.5a esql & debugcode not compilable any more esql_parser updated

Known Problems

Bug Ref. Short Description Comments
411141 Missing ";" for "EXEC SQL DECLARE DB01 D" This problem may be bypassed by putting a semicolon in the source code.

Restrictions

  • The package names of the OCI binding are not yet lined up with the GNADE package hirarchy. This allignment will be done with the next versions. The build process currently creates no test client automatically since the build scripts are only available for windows
  • The VARBINARY data type has only been tested with Mimer SQL.
  • The configuration procedure for Solaris has not been tested completely. If it fails please use the Makefiles in the directory ./win32. These files are known to build a working installation under Solaris.
  • The Object Ada Compiler is known to fail compiling the ODBC bindings because of insufficient compliance to the Ada 95 RM.
  • The compilation of the ODBC bindings is known to fail on a Sun SPARC using GNAT 3.13p (ACT tracking number [8925-002] Gigi abort code 411 on SPARC architectures). This has been fixed mean while but all tests have been done with GNAT 3.14p.
  • The Option -compiler has been added to allow the support of specific of different Ada 95 compilers which has currently no effect.
  • Unicode support is only available begining with UnixODBC version 2.0. The Uncode support does depend on GNAT specific packages
  • Oracle 8i requires the declaration of string hostvariable to be 1 character larger then the domain size, e.g. assuming the size of the domain Ename from the example simple to be 20, the host variables have to be defined as:
    Ename     :   Char (1..21); 
    Dept_Name :   Char (1..21); 
    Location  :   Char (1..21);
  • The automatic installation is not supported in case of Oracle 8i but the installation script is located under samples.

Installation

The GNADE code and the documentation is distributed in the following files:

File Contents
gnade-src-1.3.5a.tar.gz Complete GNADE source code distribution GNU compressed tar file
gnade-src-1.3.5a.zip Complete GNADE source code distribution as ZIP file.

The installation of this software requires the following components:

Component Version Origin
gzip 1.2.4 GNU
unzip 5.42 Infozip
zip 2.2 Infozip
tar - GNU or native
autoconf*1 2-13-9 GNU
gmake 3.79.1 GNU
gnat 3.14p, 3.13p ACT distribution
gawk 3.0.3 GNU

Installation on Linux/Unix

Unpacking and Configuration

$ gunzip -c gnade-src-<version>.tar.gz | tar xvf -
$ cd gnade-src-<version>
$ ./configure <dbname>

As dbname the following values are allowed:

  • mimer - MimerSQL
  • postgres - PostgreSQL
  • mysql - MySQL
  • oracle - Oracle 8i lite

If the value is omitted because your data base product is not listed,, all subsequent steps regarding the data base installation may be skipped and you have to install the test database manually.

Installation of the Database

Depending on the installation of the data base you have specified in the configure script command, you have to execute the following step either by using a DBA account our you may use your own user account

$ su ..dba..
$ gmake createuser

After the database and the database user has been configured, the ODBC interface has to be configured. The directory ./samples/sample_db contains sample files for the unixODBC driver manager. The files odbc.ini.sample odbcinst.ini.sample have to be copied to /etc/odbc.ini and /etc/odbcinst.ini.sample.

Compiling an testing

After the creation of the data base user, the final build may be done by:

$ gmake

Test code is located in the directory ./samples. In order to test the functionality of the ODBC interface use the examples in ./odbc or ./esql.

If it does not work

If this installation procedure fails you may use the Makefile in the directory ./win32. This will require some manual adoptions but it is a starting point.

In any case if you encounter a problem please contact the GNADE team asap.

Installation on Windows NT

For window users a zip file is provided. In order to install perform the following steps:

> unzip gnade-src-<version>.zip
> cd gnade-src-<version>/win32
> make 

Please note, this works with or without Cygwin installed.

Note that the Windows distribution of GNAT is in two parts; the standard GNAT tools in gnat-3.14p-nt.exe and the extra Windows tools and libraries in gnatwin-3.14p.exe. Both must be installed.


$Id: note_1.3.5a.html,v 1.1 2002/06/09 17:15:03 merdmann Exp $
gnade-1.6.2.orig/doc/releasenotes/note_1.3.6.html0000644000175000017500000007663007500740634021234 0ustar lbrentalbrenta No title
GNat Ada 95 Database Environment - (GNADE)
Version 1.3.6
Editor M.Erdmann
9.6.2002


Abstract

The objective of the GNADE project is to provide various packages which are allowing Ada 95 applications to access relational data base procducts, mainly SQL RDBMS.


Contents

Overview

Legal Stuff
Copyright
Authors
Contributions

Contact
New Features
Supported ODBC / Database Products
Supported native bindings
Supported Platforms & Compilers
Other components

Problems
Fixed Problems
Known Problems
Restrictions

Installation
Installation on linux
Installation on Windows

Overview

This release contains updates in the installation procedure and the build environment. It is intended as a GNADE base release for the tool GSQL versions greater 0.7. The GSQL tools is not compilable or installable with previous versions of the GNADE environment.

The release features:

  • An extensive thin Ada 95 binding to the ODBC interfaces.
  • ISO/92 compliant embedded SQL translator which is able to process Ada 95 packages and files containing only one procedure. The translator creates Ada 95 source files working on top the of the ODBC interface.
  • Installation support for some commonly known data base products (see below).
  • Documentation in HTML, Postscript and PDF format.
  • Native Ada 95 bindings for MySQL, PostgreSQL and the Oracle call interface
  • GNU specific include clause which allows to access the ODBC handles via embedded SQL. This allows to mix embedded SQL and low level ODBC programing in a single source (see chapter in documentation).
  • DECLARE TABLE construct may be used to generate parts of the schema files (-schema option).
  • Support of embedded SQL based on the ISO/92 standard.
  • Support of MySQL with MS ODBC Drivers on Windows 95
  • Unicode support on the ODBC interface.
  • The connection clause has been extended by the ON clause in order to intercept typical connection errors and to define a reaction on ESQL level as shown below: CONNECT [ ON [COMMUNICATION|AUTHORIZATION|OTHER] ERROR [RAISE|GOTO|DO] <target> ]
  • A new GNADE implemenation defined data types as VARCHAR and VARBINARY. For details please refere to the documentation and the example attachment.gpq in samples/esql.
  • The experimental Ada Database Connectivity (ADBC) - API. The idea of this interface is to provide a binding which makes application relativly independant of the unterlying data base. The interface is highly experimental (refer to http://gnade.sourceforge.net/ado.html)

This release of the GNADE project is intended for building with GNAT (the GNU Ada compiler) on the platforms Linux, Solaris and Windows NT/95/2000.

Legal Stuff

License and Copyright

The GNU Public License (GPL) applies with the following extension to all components of this release

As a special exception, if other files instantiate generics from GNADE Ada units, or you link GNADE Ada units or libraries with other files to produce an executable, these units or libraries do not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.

The documentation has been put under the Free GNU Documentation License.

Authors

The authors and copyright holders of the GNADE project are:

Jürgen Pfeifer juergen.pfeifer@gmx.net
Michael Erdmann Michael.Erdmann@snafu.de
Sune Falck sunef@hem.passagen.se
Julio Cano julius_bip@yahoo.com
Dimitry Anisimikov anisimkov@yahoo.com
François Fabien fr.fabien@infonie.fr
Stephen Leake stephen_leake@acm.org

Contributions

Special regards to the following persons which have contributed to the project:

Pascal Obry p.obry@wanadoo.fr

Contact

Bug Reports http://sourceforge.net/projects/gnade M.Erdmann
GNADE Discussions http://lists.sourceforge.net/lists/listinfo/gnade-develop M.Erdmann
Project Page http://gnade.sourceforge.net/
http://sourceforge.net/projects/gnade
M.Erdmann
Dev. Coordination Michael.Erdmann@snafu.de Michael Erdmann

New Features

Feature Req, Short Description Version Status
540161 Exception in statements 1.3 complete
552327 Support of gnat 3.14 1.3.3 complete
563921 Explicit Database Connection 1.3.4b complete

Supported ODBC and Database Products

Even the GNADE project except for the native data base bindings is expected to work with all ODBC compliant data base products. The following products are known to work with GNADE assuming, that you are using the correct driver manager.

Component Description Version OS Distribution/Source of the release
PostgreSQL PostgreSQL Database 7.0.3 Linux - Redhat 7.0 Linux - SuSe 7.0 Solaris Windows NT/2000 www.postgresql.org
Mimer Mimer SQL RDBMS 8.2 Solaris Linux Windows NT www.mimer.com
MySQL MySQL Database MyODBC 3.23.22
2.50.36-1
Linux www.mysql.com
3.23.35a
2.50.36
Windows 2000 www.mysql.com
3.23.47
3.51.02
Windows 98 www.mysql.com
MS SQL Server 7.0 Windows 2000 Microsoft
SQL Server 2000 Windows 2000 Microsoft
Oracle Lite 8i Windows 95 Oracle

The GNADE project installation procedure provides for theses product test data bases. If your data base is not listed below, the GNADE project will be very likely usable but the test data base has to be installed manually.

The following Driver Managerare known to work with this and/or previous releases:

Component Description Version Operating System Comments
unixODBC ODBC Driver Manager 1.8.12-2 Linux www.unixodbc.org
2.0.5 Solaris 8 www.unixodbc.org
2.1.1-7 Linux Debian www.unixodbc.org
ODBC Driver Manager 3.5.10 Windows 95, 98 Microsoft

The iODBC 3.04 implementation on Solaris seems to have a problem with the handling of cursor states. It should not be used.

Supported native bindings

Database Product Version Comments
PostgreSQL 7.03 Thin binding
MySQL Thick binding
Oracle OCI 8i lite Oracle Call Interface

Other Components

Beside of the ODBC and the native bindings, the project provides add on components as:

  • ADBC- Ada Database Connectivitiy
  • Contributed tools

ADBC

The ADBC interface is a highly experimental package which works on top of PostgreSQL and MySQL. Since the interface is completly unstable it is not recommentded to use this interface in application at the current point in time. Since the interest in the Ada community was quite low it is questionable whether the development of this interface will be continued.

Contributed Tools

Tools are not part of this release. Constributed code is released as separate packages since they do not depend on a certain version of the GNADE environment.

  • gsql - A SQL client

Supported Platforms / Compilers

Compiler Version Operating Systems
GNAT 3.13p Linux, Windows
GNAT 3.14p Linux, Solaris 8, Windows
GNAT 3.15a Win98

Problems

This section contain an overview of known, fixed problems and restrictions (limitations). Please report all errors via the error report system at the source forge project page.

Fixed Problems

Problems reported earlier then 0.9o are listed in the release note 1.1.2.

Bug Ref. Fixed in Short Description Comments
421587 0.9o ObjectAda Unrestricted_Access not supported. Unrestricted access is not used any more.
425280 1.1.1 Name of esql not changed every where GNUmakefile updated
425409 1.1.1 sql_standard prefix not handled correct gesql updated
425410 1.1.1 whenever sqlwarning faulty gesql updated
425510 1.1.1 gpl.sgml missing in distribution MANIFEST updated
421586 1.1.2 GNUmake on Windows 95 does not work Makefile changed
435712 1.1.2 Wrong debug code generated esql translator and esql_support updated
427531 1.1.2 gesql file corrupt but available The output file will always be deleted if some error during translation occurred.
427557 1.1.2 gesql command line not correct evaluated driver changed.
427764 1.1.3 Relastion missing error not recognized Code generation has been changed
427747 1.1.3 help message shown twice driver.adb changed
427750 1.1.3 Dynamic SQL DECLARE statement missing documentation updated
427748 1.1.3 Some_Error exception undefine code generator updated
430075 1.1.3 -noniso92 switch does not exist code generator updated
430077 1.1.3 -noiso92 switch not evaluated code generator updated
429984 1.1.4 Result evaluation done twice code generator updated
430751 1.1.4 Notfound class not correctly evaluated code generator updated
430752 1.1.4 not found exception raised twice code generator updated
430760 1.1.4 Number of affrected rows missing is SQLC code generator updated
435982 1.1.5 Wrong package name found esql parser updated
435872 1.1.5 Debug information missleading esql code generator updated
437590 1.1.5 Example simple does not work with MySQL GNU.DB.SQLCLI and esql_support.odbc

updated.

439149 1.1.5 SQLCA Not inserted correctly esql parser updated
439151 1.1.5 Handling of inner exception -noiso92 switch changed to -iso92 switch
439274 1.1.5 Mimer SQL not correctly installed Makefile updated
439274 1.1.5 MimerSQL, Tables of test db not found. Documentation updated
478056 1.1.6 Move in ESQL raises exception esql_support.adb updated
470357 1.1.6 simple.gpq does not handle conn. error simple.gqp updated
471060 1.1.7 esql_parse does not compile esql_parser.adb updated
471082 1.1.7 Useless evaluate code generated esql_parser.adb updated
473062 1.1.8 Package name in host var. decl. not eval. esql_parser.adb updated
473104 1.1.8 Query result not evaluated by gesql esql_parser.adb updated
473259 1.1.9 esql samples do not complie esql_parser.adb updated
475736 1.1.10 VARBINARY not handled correctly gnu-db-esql_support-odbc.adb
471061 1.1.10 seperator for Win 9x not handled GNUmakefile
433671 1.1.10 Win 2000 installation failes modules.adb
477766 1.2.0 longblob not correctly handled gnu-db-mysql.adb, gnu-db-mysql.ads
538349 1.3.1 SELECT sum(valeur) incorrect translated esql_parser.adb updated
533949 1.3.1 Firsttime installation with MimerSQL failes gnade.mimer.sql
538350 1.3.1 Null value not handled correctly esql_parser.adb
540160 1.3.1 Wrong cursor state in case of failed que gnu-db-esql_support-odbc.adb
540163 1.3.1 Debug granularity esql_parser.adb
543343 1.3.2 Case sensitve cursors esql_parser.adb
552325 1.3.3 configure fails on Solaris 2.8 configure.in, configure.gues
553343 1.3.3 odbc demo raises Need_Data exception demo.gpq
554383 1.3.3 odbc demo does not return any value odbc bindings
554929 1.3.3 esql moves 'pragma Source_Reference' esql-translator (driver.adb)
557135 1.3.4 make install fails (invalid option -C) A resoable desfault will be assumed.
555169 1.3.4 segmentation fault in SQLSetEnvAttr odbc bindings updated
562994 1.3.4 Gigi Error with Solaris 8 odbc bindings changes
562998 1.3.4 Assert & Debug are not passed to ODBC sharedlib.sh.in, staticlib.sh.in changed
563257 1.3.4a ODBC bindings does not compile on Win 98 gnadevars.sh changed
563259 1.3.4a ODBC shared lib always build makefile updated
563332 1.3.4a gesql insert useless spaces in query esql_parser updated
563769 1.3.4b Subpackages are not evaluated correctly esql_parser updated
565952 1.3.5 Domain Qualification not handled esql_parser updated
565951 1.3.5 SQL Strings are not handled correctly esql_parser updated
566413 1.3.5a static libraries not build for adbc Makefile modified
566414 1.3.5a Useless printouts in gesql esql_parser updated
566429 1.3.5a esql & debugcode not compilable any more esql_parser updated

Known Problems

Bug Ref. Short Description Comments
411141 Missing ";" for "EXEC SQL DECLARE DB01 D" This problem may be bypassed by putting a semicolon in the source code.

Restrictions

  • The package names of the OCI binding are not yet lined up with the GNADE package hirarchy. This allignment will be done with the next versions. The build process currently creates no test client automatically since the build scripts are only available for windows
  • The VARBINARY data type has only been tested with Mimer SQL.
  • The configuration procedure for Solaris has not been tested completely. If it fails please use the Makefiles in the directory ./win32. These files are known to build a working installation under Solaris.
  • The Object Ada Compiler is known to fail compiling the ODBC bindings because of insufficient compliance to the Ada 95 RM.
  • The compilation of the ODBC bindings is known to fail on a Sun SPARC using GNAT 3.13p (ACT tracking number [8925-002] Gigi abort code 411 on SPARC architectures). This has been fixed mean while but all tests have been done with GNAT 3.14p.
  • The Option -compiler has been added to allow the support of specific of different Ada 95 compilers which has currently no effect.
  • Unicode support is only available begining with UnixODBC version 2.0. The Uncode support does depend on GNAT specific packages
  • Oracle 8i requires the declaration of string hostvariable to be 1 character larger then the domain size, e.g. assuming the size of the domain Ename from the example simple to be 20, the host variables have to be defined as:
    Ename     :   Char (1..21); 
    Dept_Name :   Char (1..21); 
    Location  :   Char (1..21);
  • The automatic installation is not supported in case of Oracle 8i but the installation script is located under samples.

Installation

The GNADE code and the documentation is distributed in the following files:

File Contents
gnade-src-1.3.6.tar.gz Complete GNADE source code distribution GNU compressed tar file
gnade-src-1.3.6.zip Complete GNADE source code distribution as ZIP file.

The installation of this software requires the following components:

Component Version Origin
gzip 1.2.4 GNU
unzip 5.42 Infozip
zip 2.2 Infozip
tar - GNU or native
autoconf*1 2-13-9 GNU
gmake 3.79.1 GNU
gnat 3.14p, 3.13p ACT distribution
gawk 3.0.3 GNU

Installation on Linux/Unix

Unpacking and Configuration

$ gunzip -c gnade-src-<version>.tar.gz | tar xvf -
$ cd gnade-src-<version>
$ ./configure <dbname>

As dbname the following values are allowed:

  • mimer - MimerSQL
  • postgres - PostgreSQL
  • mysql - MySQL
  • oracle - Oracle 8i lite

If the value is omitted because your data base product is not listed,, all subsequent steps regarding the data base installation may be skipped and you have to install the test database manually.

Installation of the Database

Depending on the installation of the data base you have specified in the configure script command, you have to execute the following step either by using a DBA account our you may use your own user account

$ su ..dba..
$ gmake createuser

After the database and the database user has been configured, the ODBC interface has to be configured. The directory ./samples/sample_db contains sample files for the unixODBC driver manager. The files odbc.ini.sample odbcinst.ini.sample have to be copied to /etc/odbc.ini and /etc/odbcinst.ini.sample.

Compiling an testing

After the creation of the data base user, the final build may be done by:

$ gmake

Test code is located in the directory ./samples. In order to test the functionality of the ODBC interface use the examples in ./odbc or ./esql.

Systemwide Installation

In order to install the build products on your system login as root and execute the following command in the installation directory of this package:

make install

The makefile will run a script which installs all components on your system that they are available to other users as well. The target directories are specified in the etc/site.config file.

Contrib Tool Installation

The GNADE project provides tools which are add on packages to the GNADE source packages. The following tools are installable with this distribution:

  • GSQL Version 0.7 or greater

For the installation please follow the procedure below after you have installed the GNADE source release.

  • change into the contrib directory
  • gunzip -c file.tar.gz | tar xvf -
  • Add the previously created directory to the file packages in the contrib directory
  • make

In order to install the tool run as root in the installation directory of GNADE the command:

make install

Since the installation procedure installs also the GNADE release ensure that the current status is usable for systemwide installation.

If it does not work

If this installation procedure fails you may use the Makefile in the directory ./win32. This will require some manual adoptions but it is a starting point.

In any case if you encounter a problem please contact the GNADE team asap.

Installation on Windows NT

For window users a zip file is provided. In order to install perform the following steps:

> unzip gnade-src-<version>.zip
> cd gnade-src-<version>/win32
> make 

Please note, this works with or without Cygwin installed.

Note that the Windows distribution of GNAT is in two parts; the standard GNAT tools in gnat-3.14p-nt.exe and the extra Windows tools and libraries in gnatwin-3.14p.exe. Both must be installed.


$Id: note_1.3.6.html,v 1.1 2002/06/09 20:59:08 merdmann Exp $
gnade-1.6.2.orig/doc/releasenotes/note_1.3.6a.html0000644000175000017500000010001707514343644021365 0ustar lbrentalbrenta No title
GNat Ada 95 Database Environment - (GNADE)
Version 1.3.6a
Editor M.Erdmann
9.6.2002


Abstract

The objective of the GNADE project is to provide various packages which are allowing Ada 95 applications to access relational data base procducts, mainly SQL RDBMS.


Contents

Overview

Legal Stuff
Copyright
Authors
Contributions

Contact
New Features
Supported ODBC / Database Products
Supported native bindings
Supported Platforms & Compilers
Other components

Problems
Fixed Problems
Known Problems
Restrictions

Installation
Installation on linux
Installation on Windows

Overview

This release contains updates in the installation procedure and the build environment. It is intended as a GNADE base release for the tool GSQL versions greater 0.7. The GSQL tools is not compilable or installable with previous versions of the GNADE environment.

The release features:

  • An extensive thin Ada 95 binding to the ODBC interfaces.
  • ISO/92 compliant embedded SQL translator which is able to process Ada 95 packages and files containing only one procedure. The translator creates Ada 95 source files working on top the of the ODBC interface.
  • Installation support for some commonly known data base products (see below).
  • Documentation in HTML, Postscript and PDF format.
  • Native Ada 95 bindings for MySQL, PostgreSQL and the Oracle call interface
  • GNU specific include clause which allows to access the ODBC handles via embedded SQL. This allows to mix embedded SQL and low level ODBC programing in a single source (see chapter in documentation).
  • DECLARE TABLE construct may be used to generate parts of the schema files (-schema option).
  • Support of embedded SQL based on the ISO/92 standard.
  • Support of MySQL with MS ODBC Drivers on Windows 95
  • Unicode support on the ODBC interface.
  • The connection clause has been extended by the ON clause in order to intercept typical connection errors and to define a reaction on ESQL level as shown below: CONNECT [ ON [COMMUNICATION|AUTHORIZATION|OTHER] ERROR [RAISE|GOTO|DO] <target> ]
  • A new GNADE implemenation defined data types as VARCHAR and VARBINARY. For details please refere to the documentation and the example attachment.gpq in samples/esql.
  • The experimental Ada Database Connectivity (ADBC) - API. The idea of this interface is to provide a binding which makes application relativly independant of the unterlying data base. The interface is highly experimental (refer to http://gnade.sourceforge.net/ado.html)

This release of the GNADE project is intended for building with GNAT (the GNU Ada compiler) on the platforms Linux, Solaris and Windows NT/95/2000.

Legal Stuff

License and Copyright

The GNU Public License (GPL) applies with the following extension to all components of this release

As a special exception, if other files instantiate generics from GNADE Ada units, or you link GNADE Ada units or libraries with other files to produce an executable, these units or libraries do not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.

The documentation has been put under the Free GNU Documentation License.

Authors

The authors and copyright holders of the GNADE project are:

Jürgen Pfeifer juergen.pfeifer@gmx.net
Michael Erdmann Michael.Erdmann@snafu.de
Sune Falck sunef@hem.passagen.se
Julio Cano julius_bip@yahoo.com
Dimitry Anisimikov anisimkov@yahoo.com
François Fabien fr.fabien@infonie.fr
Stephen Leake stephen_leake@acm.org

Contributions

Special regards to the following persons which have contributed to the project:

Pascal Obry p.obry@wanadoo.fr

Contact

Bug Reports http://sourceforge.net/projects/gnade M.Erdmann
GNADE Discussions http://lists.sourceforge.net/lists/listinfo/gnade-develop M.Erdmann
Project Page http://gnade.sourceforge.net/
http://sourceforge.net/projects/gnade
M.Erdmann
Dev. Coordination Michael.Erdmann@snafu.de Michael Erdmann

New Features

Feature Req, Short Description Version Status
540161 Exception in statements 1.3 complete
552327 Support of gnat 3.14 1.3.3 complete
563921 Explicit Database Connection 1.3.4b complete

Supported ODBC and Database Products

Even the GNADE project except for the native data base bindings is expected to work with all ODBC compliant data base products. The following products are known to work with GNADE assuming, that you are using the correct driver manager.

Component Description Version OS Distribution/Source of the release
PostgreSQL PostgreSQL Database 7.0.3 Linux - Redhat 7.0 Linux - SuSe 7.0 Solaris Windows NT/2000 www.postgresql.org
Mimer Mimer SQL RDBMS 8.2 Solaris Linux Windows NT www.mimer.com
MySQL MySQL Database MyODBC 3.23.22
2.50.36-1
Linux www.mysql.com
3.23.35a
2.50.36
Windows 2000 www.mysql.com
3.23.47
3.51.02
Windows 98 www.mysql.com
MS SQL Server 7.0 Windows 2000 Microsoft
SQL Server 2000 Windows 2000 Microsoft
Oracle Lite 8i Windows 95 Oracle

The GNADE project installation procedure provides for theses product test data bases. If your data base is not listed below, the GNADE project will be very likely usable but the test data base has to be installed manually.

The following Driver Managerare known to work with this and/or previous releases:

Component Description Version Operating System Comments
unixODBC ODBC Driver Manager 1.8.12-2 Linux www.unixodbc.org
2.0.5 Solaris 8 www.unixodbc.org
2.1.1-7 Linux Debian www.unixodbc.org
ODBC Driver Manager 3.5.10 Windows 95, 98 Microsoft

The iODBC 3.04 implementation on Solaris seems to have a problem with the handling of cursor states. It should not be used.

Supported native bindings

Database Product Version Comments
PostgreSQL 7.03 Thin binding
MySQL Thick binding
Oracle OCI 8i lite Oracle Call Interface

Other Components

Beside of the ODBC and the native bindings, the project provides add on components as:

  • ADBC- Ada Database Connectivitiy
  • Contributed tools

ADBC

The ADBC interface is a highly experimental package which works on top of PostgreSQL and MySQL. Since the interface is completly unstable it is not recommentded to use this interface in application at the current point in time. Since the interest in the Ada community was quite low it is questionable whether the development of this interface will be continued.

Contributed Tools

Tools are not part of this release. Constributed code is released as separate packages since they do not depend on a certain version of the GNADE environment.

  • gsql - A SQL client

Supported Platforms / Compilers

Compiler Version Operating Systems
GNAT 3.13p Linux, Windows
GNAT 3.14p Linux, Solaris 8, Windows
GNAT 3.15a Win98

Problems

This section contain an overview of known, fixed problems and restrictions (limitations). Please report all errors via the error report system at the source forge project page.

Fixed Problems

Problems reported earlier then 0.9o are listed in the release note 1.1.2.

Bug Ref. Fixed in Short Description Comments
421587 0.9o ObjectAda Unrestricted_Access not supported. Unrestricted access is not used any more.
425280 1.1.1 Name of esql not changed every where GNUmakefile updated
425409 1.1.1 sql_standard prefix not handled correct gesql updated
425410 1.1.1 whenever sqlwarning faulty gesql updated
425510 1.1.1 gpl.sgml missing in distribution MANIFEST updated
421586 1.1.2 GNUmake on Windows 95 does not work Makefile changed
435712 1.1.2 Wrong debug code generated esql translator and esql_support updated
427531 1.1.2 gesql file corrupt but available The output file will always be deleted if some error during translation occurred.
427557 1.1.2 gesql command line not correct evaluated driver changed.
427764 1.1.3 Relastion missing error not recognized Code generation has been changed
427747 1.1.3 help message shown twice driver.adb changed
427750 1.1.3 Dynamic SQL DECLARE statement missing documentation updated
427748 1.1.3 Some_Error exception undefine code generator updated
430075 1.1.3 -noniso92 switch does not exist code generator updated
430077 1.1.3 -noiso92 switch not evaluated code generator updated
429984 1.1.4 Result evaluation done twice code generator updated
430751 1.1.4 Notfound class not correctly evaluated code generator updated
430752 1.1.4 not found exception raised twice code generator updated
430760 1.1.4 Number of affrected rows missing is SQLC code generator updated
435982 1.1.5 Wrong package name found esql parser updated
435872 1.1.5 Debug information missleading esql code generator updated
437590 1.1.5 Example simple does not work with MySQL GNU.DB.SQLCLI and esql_support.odbc

updated.

439149 1.1.5 SQLCA Not inserted correctly esql parser updated
439151 1.1.5 Handling of inner exception -noiso92 switch changed to -iso92 switch
439274 1.1.5 Mimer SQL not correctly installed Makefile updated
439274 1.1.5 MimerSQL, Tables of test db not found. Documentation updated
478056 1.1.6 Move in ESQL raises exception esql_support.adb updated
470357 1.1.6 simple.gpq does not handle conn. error simple.gqp updated
471060 1.1.7 esql_parse does not compile esql_parser.adb updated
471082 1.1.7 Useless evaluate code generated esql_parser.adb updated
473062 1.1.8 Package name in host var. decl. not eval. esql_parser.adb updated
473104 1.1.8 Query result not evaluated by gesql esql_parser.adb updated
473259 1.1.9 esql samples do not complie esql_parser.adb updated
475736 1.1.10 VARBINARY not handled correctly gnu-db-esql_support-odbc.adb
471061 1.1.10 seperator for Win 9x not handled GNUmakefile
433671 1.1.10 Win 2000 installation failes modules.adb
477766 1.2.0 longblob not correctly handled gnu-db-mysql.adb, gnu-db-mysql.ads
538349 1.3.1 SELECT sum(valeur) incorrect translated esql_parser.adb updated
533949 1.3.1 Firsttime installation with MimerSQL failes gnade.mimer.sql
538350 1.3.1 Null value not handled correctly esql_parser.adb
540160 1.3.1 Wrong cursor state in case of failed que gnu-db-esql_support-odbc.adb
540163 1.3.1 Debug granularity esql_parser.adb
543343 1.3.2 Case sensitve cursors esql_parser.adb
552325 1.3.3 configure fails on Solaris 2.8 configure.in, configure.gues
553343 1.3.3 odbc demo raises Need_Data exception demo.gpq
554383 1.3.3 odbc demo does not return any value odbc bindings
554929 1.3.3 esql moves 'pragma Source_Reference' esql-translator (driver.adb)
557135 1.3.4 make install fails (invalid option -C) A resoable desfault will be assumed.
555169 1.3.4 segmentation fault in SQLSetEnvAttr odbc bindings updated
562994 1.3.4 Gigi Error with Solaris 8 odbc bindings changes
562998 1.3.4 Assert & Debug are not passed to ODBC sharedlib.sh.in, staticlib.sh.in changed
563257 1.3.4a ODBC bindings does not compile on Win 98 gnadevars.sh changed
563259 1.3.4a ODBC shared lib always build makefile updated
563332 1.3.4a gesql insert useless spaces in query esql_parser updated
563769 1.3.4b Subpackages are not evaluated correctly esql_parser updated
565952 1.3.5 Domain Qualification not handled esql_parser updated
565951 1.3.5 SQL Strings are not handled correctly esql_parser updated
566413 1.3.5a static libraries not build for adbc Makefile modified
566414 1.3.5a Useless printouts in gesql esql_parser updated
566429 1.3.5a esql & debugcode not compilable any more esql_parser updated
568396 1.3.6a config.gpq missing MANIFEST updated
567600 1.3.6a gesql translator includes odbc bindings esql_parser updated
567553 1.3.6a FeeBSD build chmod failes makefiles
566635 1.3.6a FreeBSD Makefile Problems (1.3.5a) Makefiles

Known Problems

Bug Ref. Short Description Comments
411141 Missing ";" for "EXEC SQL DECLARE DB01 D" This problem may be bypassed by putting a semicolon in the source code.

Restrictions

  • The package names of the OCI binding are not yet lined up with the GNADE package hirarchy. This allignment will be done with the next versions. The build process currently creates no test client automatically since the build scripts are only available for windows
  • The VARBINARY data type has only been tested with Mimer SQL.
  • The configuration procedure for Solaris has not been tested completely. If it fails please use the Makefiles in the directory ./win32. These files are known to build a working installation under Solaris.
  • The Object Ada Compiler is known to fail compiling the ODBC bindings because of insufficient compliance to the Ada 95 RM.
  • The compilation of the ODBC bindings is known to fail on a Sun SPARC using GNAT 3.13p (ACT tracking number [8925-002] Gigi abort code 411 on SPARC architectures). This has been fixed mean while but all tests have been done with GNAT 3.14p.
  • The Option -compiler has been added to allow the support of specific of different Ada 95 compilers which has currently no effect.
  • Unicode support is only available begining with UnixODBC version 2.0. The Uncode support does depend on GNAT specific packages
  • Oracle 8i requires the declaration of string hostvariable to be 1 character larger then the domain size, e.g. assuming the size of the domain Ename from the example simple to be 20, the host variables have to be defined as:
    Ename     :   Char (1..21); 
    Dept_Name :   Char (1..21); 
    Location  :   Char (1..21);
  • The automatic installation is not supported in case of Oracle 8i but the installation script is located under samples.

Installation

The GNADE code and the documentation is distributed in the following files:

File Contents
gnade-src-1.3.6.tar.gz Complete GNADE source code distribution GNU compressed tar file
gnade-src-1.3.6.zip Complete GNADE source code distribution as ZIP file.

The installation of this software requires the following components:

Component Version Origin
gzip 1.2.4 GNU
unzip 5.42 Infozip
zip 2.2 Infozip
tar - GNU or native
autoconf*1 2-13-9 GNU
gmake 3.79.1 GNU
gnat 3.14p, 3.13p ACT distribution
gawk 3.0.3 GNU

Installation on Linux/Unix

Unpacking and Configuration

$ gunzip -c gnade-src-<version>.tar.gz | tar xvf -
$ cd gnade-src-<version>
$ ./configure <dbname>

As dbname the following values are allowed:

  • mimer - MimerSQL
  • postgres - PostgreSQL
  • mysql - MySQL
  • oracle - Oracle 8i lite

If the value is omitted because your data base product is not listed,, all subsequent steps regarding the data base installation may be skipped and you have to install the test database manually.

Installation of the Database

Depending on the installation of the data base you have specified in the configure script command, you have to execute the following step either by using a DBA account our you may use your own user account

$ su ..dba..
$ gmake createuser

After the database and the database user has been configured, the ODBC interface has to be configured. The directory ./samples/sample_db contains sample files for the unixODBC driver manager. The files odbc.ini.sample odbcinst.ini.sample have to be copied to /etc/odbc.ini and /etc/odbcinst.ini.sample.

Compiling an testing

After the creation of the data base user, the final build may be done by:

$ gmake

Test code is located in the directory ./samples. In order to test the functionality of the ODBC interface use the examples in ./odbc or ./esql.

Systemwide Installation

In order to install the build products on your system login as root and execute the following command in the installation directory of this package:

make install

The makefile will run a script which installs all components on your system that they are available to other users as well. The target directories are specified in the etc/site.config file.

Contrib Tool Installation

The GNADE project provides tools which are add on packages to the GNADE source packages. The following tools are installable with this distribution:

  • GSQL Version 0.7 or greater

For the installation please follow the procedure below after you have installed the GNADE source release.

  • change into the contrib directory
  • gunzip -c file.tar.gz | tar xvf -
  • Add the previously created directory to the file packages in the contrib directory
  • make

In order to install the tool run as root in the installation directory of GNADE the command:

make install

Since the installation procedure installs also the GNADE release ensure that the current status is usable for systemwide installation.

If it does not work

If this installation procedure fails you may use the Makefile in the directory ./win32. This will require some manual adoptions but it is a starting point.

In any case if you encounter a problem please contact the GNADE team asap.

Installation on Windows NT

For window users a zip file is provided. In order to install perform the following steps:

> unzip gnade-src-<version>.zip
> cd gnade-src-<version>/win32
> make 

Please note, this works with or without Cygwin installed.

Note that the Windows distribution of GNAT is in two parts; the standard GNAT tools in gnat-3.14p-nt.exe and the extra Windows tools and libraries in gnatwin-3.14p.exe. Both must be installed.


$Id: note_1.3.6a.html,v 1.2 2002/07/14 18:49:08 merdmann Exp $
gnade-1.6.2.orig/doc/releasenotes/note_1.3.7.html0000644000175000017500000010141307524013503021213 0ustar lbrentalbrenta No title
GNat Ada 95 Database Environment - (GNADE)
Version 1.3.7
Editor M.Erdmann
5.8.2002


Abstract

The objective of the GNADE project is to provide various packages which are allowing Ada 95 applications to access relational data base procducts, mainly SQL RDBMS.


Contents

Overview

Legal Stuff
Copyright
Authors
Contributions

Contact
New Features
Supported ODBC / Database Products
Supported native bindings
Supported Platforms & Compilers
Other components

Problems
Fixed Problems
Known Problems
Restrictions

Installation
Installation on linux
Installation on Windows

Overview

This release contains updates in the installation procedure and the build environment. It is intended as a GNADE base release for the tool GSQL versions greater 0.7. The GSQL tools is not compilable or installable with previous versions of the GNADE environment.

A slight change in the ESQL translator has been done. If you are using constructs like

Print_Employee(1, EXEC SQL INCLUDE DATABASE NAMED DB01; );

change them into

Print_Employee(1, EXEC SQL INCLUDE DATABASE NAMED DB01 );

Additionally the gesql supports a simple variable substitution by means of the -D command line switch.

The release features:

  • An extensive thin Ada 95 binding to the ODBC interfaces.
  • ISO/92 compliant embedded SQL translator which is able to process Ada 95 packages and files containing only one procedure. The translator creates Ada 95 source files working on top the of the ODBC interface.
  • Installation support for some commonly known data base products (see below).
  • Documentation in HTML, Postscript and PDF format.
  • Native Ada 95 bindings for MySQL, PostgreSQL and the Oracle call interface
  • GNU specific include clause which allows to access the ODBC handles via embedded SQL. This allows to mix embedded SQL and low level ODBC programing in a single source (see chapter in documentation).
  • DECLARE TABLE construct may be used to generate parts of the schema files (-schema option).
  • Support of embedded SQL based on the ISO/92 standard.
  • Support of MySQL with MS ODBC Drivers on Windows 95
  • Unicode support on the ODBC interface.
  • The connection clause has been extended by the ON clause in order to intercept typical connection errors and to define a reaction on ESQL level as shown below: CONNECT [ ON [COMMUNICATION|AUTHORIZATION|OTHER] ERROR [RAISE|GOTO|DO] <target> ]
  • A new GNADE implemenation defined data types as VARCHAR and VARBINARY. For details please refere to the documentation and the example attachment.gpq in samples/esql.
  • The esql translator contains a small scale variable substituation which makes gnatprep not nessesary for simple substitution jobs.
  • The experimental Ada Database Connectivity (ADBC) - API. The idea of this interface is to provide a binding which makes application relativly independant of the unterlying data base. The interface is highly experimental (refer to http://gnade.sourceforge.net/ado.html)

This release of the GNADE project is intended for building with GNAT (the GNU Ada compiler) on the platforms Linux, Solaris and Windows NT/95/2000.

Legal Stuff

License and Copyright

The GNU Public License (GPL) applies with the following extension to all components of this release

As a special exception, if other files instantiate generics from GNADE Ada units, or you link GNADE Ada units or libraries with other files to produce an executable, these units or libraries do not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.

The documentation has been put under the Free GNU Documentation License.

Authors

The authors and copyright holders of the GNADE project are:

Jürgen Pfeifer juergen.pfeifer@gmx.net
Michael Erdmann Michael.Erdmann@snafu.de
Sune Falck sunef@hem.passagen.se
Julio Cano julius_bip@yahoo.com
Dimitry Anisimikov anisimkov@yahoo.com
François Fabien fr.fabien@infonie.fr
Stephen Leake stephen_leake@acm.org

Contributions

Special regards to the following persons which have contributed to the project:

Pascal Obry p.obry@wanadoo.fr

Contact

Bug Reports http://sourceforge.net/projects/gnade M.Erdmann
GNADE Discussions http://lists.sourceforge.net/lists/listinfo/gnade-develop M.Erdmann
Project Page http://gnade.sourceforge.net/
http://sourceforge.net/projects/gnade
M.Erdmann
Dev. Coordination Michael.Erdmann@snafu.de Michael Erdmann

New Features

Feature Req, Short Description Version Status
540161 Exception in statements 1.3 complete
552327 Support of gnat 3.14 1.3.3 complete
563921 Explicit Database Connection 1.3.4b complete
590779 Preprocessor invokation 1.3.7 complete

Supported ODBC and Database Products

Even the GNADE project except for the native data base bindings is expected to work with all ODBC compliant data base products. The following products are known to work with GNADE assuming, that you are using the correct driver manager.

Component Description Version OS Distribution/Source of the release
PostgreSQL PostgreSQL Database 7.0.3 Linux - Redhat 7.0 Linux - SuSe 7.0 Solaris Windows NT/2000 www.postgresql.org
Mimer Mimer SQL RDBMS 8.2 Solaris Linux Windows NT www.mimer.com
MySQL MySQL Database MyODBC 3.23.22
2.50.36-1
Linux www.mysql.com
3.23.35a
2.50.36
Windows 2000 www.mysql.com
3.23.47
3.51.02
Windows 98 www.mysql.com
MS SQL Server 7.0 Windows 2000 Microsoft
SQL Server 2000 Windows 2000 Microsoft
Oracle Lite 8i Windows 95 Oracle

The GNADE project installation procedure provides for theses product test data bases. If your data base is not listed below, the GNADE project will be very likely usable but the test data base has to be installed manually.

The following Driver Managerare known to work with this and/or previous releases:

Component Description Version Operating System Comments
unixODBC ODBC Driver Manager 1.8.12-2 Linux www.unixodbc.org
2.0.5 Solaris 8 www.unixodbc.org
2.1.1-7 Linux Debian www.unixodbc.org
ODBC Driver Manager 3.5.10 Windows 95, 98 Microsoft

The iODBC 3.04 implementation on Solaris seems to have a problem with the handling of cursor states. It should not be used.

Supported native bindings

Database Product Version Comments
PostgreSQL 7.03 Thin binding
MySQL Thick binding
Oracle OCI 8i lite Oracle Call Interface

Other Components

Beside of the ODBC and the native bindings, the project provides add on components as:

  • ADBC- Ada Database Connectivitiy
  • Contributed tools

ADBC

The ADBC interface is a highly experimental package which works on top of PostgreSQL and MySQL. Since the interface is completly unstable it is not recommentded to use this interface in application at the current point in time. Since the interest in the Ada community was quite low it is questionable whether the development of this interface will be continued.

Contributed Tools

Tools are not part of this release. Constributed code is released as separate packages since they do not depend on a certain version of the GNADE environment.

  • gsql - A SQL client

Supported Platforms / Compilers

Compiler Version Operating Systems
GNAT 3.13p Linux, Windows
GNAT 3.14p Linux, Solaris 8, Windows
GNAT 3.15a Win98

Problems

This section contain an overview of known, fixed problems and restrictions (limitations). Please report all errors via the error report system at the source forge project page.

Fixed Problems

Problems reported earlier then 0.9o are listed in the release note 1.1.2.

Bug Ref. Fixed in Short Description Comments
421587 0.9o ObjectAda Unrestricted_Access not supported. Unrestricted access is not used any more.
425280 1.1.1 Name of esql not changed every where GNUmakefile updated
425409 1.1.1 sql_standard prefix not handled correct gesql updated
425410 1.1.1 whenever sqlwarning faulty gesql updated
425510 1.1.1 gpl.sgml missing in distribution MANIFEST updated
421586 1.1.2 GNUmake on Windows 95 does not work Makefile changed
435712 1.1.2 Wrong debug code generated esql translator and esql_support updated
427531 1.1.2 gesql file corrupt but available The output file will always be deleted if some error during translation occurred.
427557 1.1.2 gesql command line not correct evaluated driver changed.
427764 1.1.3 Relastion missing error not recognized Code generation has been changed
427747 1.1.3 help message shown twice driver.adb changed
427750 1.1.3 Dynamic SQL DECLARE statement missing documentation updated
427748 1.1.3 Some_Error exception undefine code generator updated
430075 1.1.3 -noniso92 switch does not exist code generator updated
430077 1.1.3 -noiso92 switch not evaluated code generator updated
429984 1.1.4 Result evaluation done twice code generator updated
430751 1.1.4 Notfound class not correctly evaluated code generator updated
430752 1.1.4 not found exception raised twice code generator updated
430760 1.1.4 Number of affrected rows missing is SQLC code generator updated
435982 1.1.5 Wrong package name found esql parser updated
435872 1.1.5 Debug information missleading esql code generator updated
437590 1.1.5 Example simple does not work with MySQL GNU.DB.SQLCLI and esql_support.odbc

updated.

439149 1.1.5 SQLCA Not inserted correctly esql parser updated
439151 1.1.5 Handling of inner exception -noiso92 switch changed to -iso92 switch
439274 1.1.5 Mimer SQL not correctly installed Makefile updated
439274 1.1.5 MimerSQL, Tables of test db not found. Documentation updated
478056 1.1.6 Move in ESQL raises exception esql_support.adb updated
470357 1.1.6 simple.gpq does not handle conn. error simple.gqp updated
471060 1.1.7 esql_parse does not compile esql_parser.adb updated
471082 1.1.7 Useless evaluate code generated esql_parser.adb updated
473062 1.1.8 Package name in host var. decl. not eval. esql_parser.adb updated
473104 1.1.8 Query result not evaluated by gesql esql_parser.adb updated
473259 1.1.9 esql samples do not complie esql_parser.adb updated
475736 1.1.10 VARBINARY not handled correctly gnu-db-esql_support-odbc.adb
471061 1.1.10 seperator for Win 9x not handled GNUmakefile
433671 1.1.10 Win 2000 installation failes modules.adb
477766 1.2.0 longblob not correctly handled gnu-db-mysql.adb, gnu-db-mysql.ads
538349 1.3.1 SELECT sum(valeur) incorrect translated esql_parser.adb updated
533949 1.3.1 Firsttime installation with MimerSQL failes gnade.mimer.sql
538350 1.3.1 Null value not handled correctly esql_parser.adb
540160 1.3.1 Wrong cursor state in case of failed que gnu-db-esql_support-odbc.adb
540163 1.3.1 Debug granularity esql_parser.adb
543343 1.3.2 Case sensitve cursors esql_parser.adb
552325 1.3.3 configure fails on Solaris 2.8 configure.in, configure.gues
553343 1.3.3 odbc demo raises Need_Data exception demo.gpq
554383 1.3.3 odbc demo does not return any value odbc bindings
554929 1.3.3 esql moves 'pragma Source_Reference' esql-translator (driver.adb)
557135 1.3.4 make install fails (invalid option -C) A resoable desfault will be assumed.
555169 1.3.4 segmentation fault in SQLSetEnvAttr odbc bindings updated
562994 1.3.4 Gigi Error with Solaris 8 odbc bindings changes
562998 1.3.4 Assert & Debug are not passed to ODBC sharedlib.sh.in, staticlib.sh.in changed
563257 1.3.4a ODBC bindings does not compile on Win 98 gnadevars.sh changed
563259 1.3.4a ODBC shared lib always build makefile updated
563332 1.3.4a gesql insert useless spaces in query esql_parser updated
563769 1.3.4b Subpackages are not evaluated correctly esql_parser updated
565952 1.3.5 Domain Qualification not handled esql_parser updated
565951 1.3.5 SQL Strings are not handled correctly esql_parser updated
566413 1.3.5a static libraries not build for adbc Makefile modified
566414 1.3.5a Useless printouts in gesql esql_parser updated
566429 1.3.5a esql & debugcode not compilable any more esql_parser updated
568396 1.3.6a config.gpq missing MANIFEST updated
567600 1.3.6a gesql translator includes odbc bindings esql_parser updated
567553 1.3.6a FeeBSD build chmod failes makefiles
566635 1.3.6a FreeBSD Makefile Problems (1.3.5a) Makefiles
590569 1.3.7 Default cursor does not work esql_parser.adb, esql_support.odbc

Known Problems

Bug Ref. Short Description Comments
411141 Missing ";" for "EXEC SQL DECLARE DB01 D" This problem may be bypassed by putting a semicolon in the source code.

Restrictions

  • The package names of the OCI binding are not yet lined up with the GNADE package hirarchy. This allignment will be done with the next versions. The build process currently creates no test client automatically since the build scripts are only available for windows
  • The VARBINARY data type has only been tested with Mimer SQL.
  • The configuration procedure for Solaris has not been tested completely. If it fails please use the Makefiles in the directory ./win32. These files are known to build a working installation under Solaris.
  • The Object Ada Compiler is known to fail compiling the ODBC bindings because of insufficient compliance to the Ada 95 RM.
  • The compilation of the ODBC bindings is known to fail on a Sun SPARC using GNAT 3.13p (ACT tracking number [8925-002] Gigi abort code 411 on SPARC architectures). This has been fixed mean while but all tests have been done with GNAT 3.14p.
  • The Option -compiler has been added to allow the support of specific of different Ada 95 compilers which has currently no effect.
  • Unicode support is only available begining with UnixODBC version 2.0. The Uncode support does depend on GNAT specific packages
  • Oracle 8i requires the declaration of string hostvariable to be 1 character larger then the domain size, e.g. assuming the size of the domain Ename from the example simple to be 20, the host variables have to be defined as:
    Ename     :   Char (1..21); 
    Dept_Name :   Char (1..21); 
    Location  :   Char (1..21);
  • The automatic installation is not supported in case of Oracle 8i but the installation script is located under samples.

Installation

The GNADE code and the documentation is distributed in the following files:

File Contents
gnade-src-1.3.6.tar.gz Complete GNADE source code distribution GNU compressed tar file
gnade-src-1.3.6.zip Complete GNADE source code distribution as ZIP file.

The installation of this software requires the following components:

Component Version Origin
gzip 1.2.4 GNU
unzip 5.42 Infozip
zip 2.2 Infozip
tar - GNU or native
autoconf*1 2-13-9 GNU
gmake 3.79.1 GNU
gnat 3.14p, 3.13p ACT distribution
gawk 3.0.3 GNU

Installation on Linux/Unix

Unpacking and Configuration

$ gunzip -c gnade-src-<version>.tar.gz | tar xvf -
$ cd gnade-src-<version>
$ ./configure <dbname>

As dbname the following values are allowed:

  • mimer - MimerSQL
  • postgres - PostgreSQL
  • mysql - MySQL
  • oracle - Oracle 8i lite

If the value is omitted because your data base product is not listed,, all subsequent steps regarding the data base installation may be skipped and you have to install the test database manually.

Installation of the Database

Depending on the installation of the data base you have specified in the configure script command, you have to execute the following step either by using a DBA account our you may use your own user account

$ su ..dba..
$ gmake createuser

After the database and the database user has been configured, the ODBC interface has to be configured. The directory ./samples/sample_db contains sample files for the unixODBC driver manager. The files odbc.ini.sample odbcinst.ini.sample have to be copied to /etc/odbc.ini and /etc/odbcinst.ini.sample.

Compiling an testing

After the creation of the data base user, the final build may be done by:

$ gmake

Test code is located in the directory ./samples. In order to test the functionality of the ODBC interface use the examples in ./odbc or ./esql.

Systemwide Installation

In order to install the build products on your system login as root and execute the following command in the installation directory of this package:

make install

The makefile will run a script which installs all components on your system that they are available to other users as well. The target directories are specified in the etc/site.config file.

Contrib Tool Installation

The GNADE project provides tools which are add on packages to the GNADE source packages. The following tools are installable with this distribution:

  • GSQL Version 0.7 or greater

For the installation please follow the procedure below after you have installed the GNADE source release.

  • change into the contrib directory
  • gunzip -c file.tar.gz | tar xvf -
  • Add the previously created directory to the file packages in the contrib directory
  • make

In order to install the tool run as root in the installation directory of GNADE the command:

make install

Since the installation procedure installs also the GNADE release ensure that the current status is usable for systemwide installation.

If it does not work

If this installation procedure fails you may use the Makefile in the directory ./win32. This will require some manual adoptions but it is a starting point.

In any case if you encounter a problem please contact the GNADE team asap.

Installation on Windows NT

For window users a zip file is provided. In order to install perform the following steps:

> unzip gnade-src-<version>.zip
> cd gnade-src-<version>/win32
> make 

Please note, this works with or without Cygwin installed.

Note that the Windows distribution of GNAT is in two parts; the standard GNAT tools in gnat-3.14p-nt.exe and the extra Windows tools and libraries in gnatwin-3.14p.exe. Both must be installed.


$Id: note_1.3.7.html,v 1.3 2002/08/06 18:36:51 merdmann Exp $
gnade-1.6.2.orig/doc/releasenotes/note_1.3.7a.html0000644000175000017500000010415407537444607021402 0ustar lbrentalbrenta GNADE Sotware Release Note
GNat Ada 95 Database Environment - (GNADE)
Version 1.3.7a
Editor M.Erdmann
16.8.2002


Abstract

The objective of the GNADE project is to provide various packages which are allowing Ada 95 applications to access relational data base procducts, mainly SQL RDBMS.


Contents

Overview

Legal Stuff
Copyright
Authors
Contributions

Contact
New Features
Supported ODBC / Database Products
Supported native bindings
Supported Platforms & Compilers
Other components

Problems
Fixed Problems
Known Problems
Restrictions

Installation
Installation on linux
Installation on Windows

Overview

The scope of this release is a bug fix in the ./configure and build procedure in order to detect if it is possible to build the native bindings. The arguments of the configure script have been changed (see installation hints below).

A slight change in the ESQL translator has been done. If you are using constructs like

Print_Employee(1, EXEC SQL INCLUDE DATABASE NAMED DB01; );

change them into

Print_Employee(1, EXEC SQL INCLUDE DATABASE NAMED DB01 );

Additionally the gesql supports a simple variable substitution (like gnatprep) by means of the -D command line switch.

The ADBC interface will not be installed system wide any more since it is still experimental and incomplete.

The release features:

  • An extensive thin Ada 95 binding to the ODBC interfaces.
  • ISO/92 compliant embedded SQL translator which is able to process Ada 95 packages and files containing only one procedure. The translator creates Ada 95 source files working on top the of the ODBC interface.
  • Installation support for some commonly known data base products (see below).
  • Documentation in HTML, Postscript and PDF format.
  • Native Ada 95 bindings for MySQL, PostgreSQL and the Oracle call interface
  • GNU specific include clause which allows to access the ODBC handles via embedded SQL. This allows to mix embedded SQL and low level ODBC programing in a single source (see chapter in documentation).
  • DECLARE TABLE construct may be used to generate parts of the schema files (-schema option).
  • Support of embedded SQL based on the ISO/92 standard.
  • Support of MySQL with MS ODBC Drivers on Windows 95
  • Unicode support on the ODBC interface.
  • The connection clause has been extended by the ON clause in order to intercept typical connection errors and to define a reaction on ESQL level as shown below: CONNECT [ ON [COMMUNICATION|AUTHORIZATION|OTHER] ERROR [RAISE|GOTO|DO] <target> ]
  • A new GNADE implemenation defined data types as VARCHAR and VARBINARY. For details please refere to the documentation and the example attachment.gpq in samples/esql.
  • The esql translator contains a small scale variable substituation which makes gnatprep not nessesary for simple substitution jobs.
  • The experimental Ada Database Connectivity (ADBC) - API. The idea of this interface is to provide a binding which makes application relativly independant of the unterlying data base. The interface is highly experimental (refer to http://gnade.sourceforge.net/ado.html)

This release of the GNADE project is intended for building with GNAT (the GNU Ada compiler) on the platforms Linux, Solaris and Windows NT/95/2000.

Legal Stuff

License and Copyright

The GNU Public License (GPL) applies with the following extension to all components of this release

As a special exception, if other files instantiate generics from GNADE Ada units, or you link GNADE Ada units or libraries with other files to produce an executable, these units or libraries do not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.

The documentation has been put under the Free GNU Documentation License.

Authors

The authors and copyright holders of the GNADE project are:

Jürgen Pfeifer juergen.pfeifer@gmx.net
Michael Erdmann Michael.Erdmann@snafu.de
Sune Falck sunef@hem.passagen.se
Julio Cano julius_bip@yahoo.com
Dimitry Anisimikov anisimkov@yahoo.com
François Fabien fr.fabien@infonie.fr
Stephen Leake stephen_leake@acm.org

Contributions

Special regards to the following persons which have contributed to the project:

Pascal Obry p.obry@wanadoo.fr

Contact

Bug Reports http://sourceforge.net/projects/gnade M.Erdmann
GNADE Discussions http://lists.sourceforge.net/lists/listinfo/gnade-develop M.Erdmann
Project Page http://gnade.sourceforge.net/
http://sourceforge.net/projects/gnade
M.Erdmann
Dev. Coordination Michael.Erdmann@snafu.de Michael Erdmann

New Features

Feature Req, Short Description Version Status
540161 Exception in statements 1.3 complete
552327 Support of gnat 3.14 1.3.3 complete
563921 Explicit Database Connection 1.3.4b complete
590779 Preprocessor invokation 1.3.7 complete
591707 pkg-config support 1.3.7a complete (see Notes)

Note 1- If okg-config is found on a system, the systemwide installation script will install the package descriptor in the path which is given in the file etc/config.site:

site_pkgconfig_path=<your path>

If nothing is given /usr/local/lib/pkgconfig is assumed.

Supported ODBC and Database Products

Even the GNADE project except for the native data base bindings is expected to work with all ODBC compliant data base products. The following products are known to work with GNADE assuming, that you are using the correct driver manager.

Component Description Version OS Distribution/Source of the release
PostgreSQL PostgreSQL Database 7.0.3 Linux - Redhat 7.0 Linux - SuSe 7.0 Solaris Windows NT/2000 www.postgresql.org
Mimer Mimer SQL RDBMS 8.2 Solaris Linux Windows NT www.mimer.com
MySQL MySQL Database MyODBC 3.23.22
2.50.36-1
Linux www.mysql.com
3.23.35a
2.50.36
Windows 2000 www.mysql.com
3.23.47
3.51.02
Windows 98 www.mysql.com
MS SQL Server 7.0 Windows 2000 Microsoft
SQL Server 2000 Windows 2000 Microsoft
Oracle Lite 8i Windows 95 Oracle

The GNADE project installation procedure provides for theses product test data bases. If your data base is not listed below, the GNADE project will be very likely usable but the test data base has to be installed manually.

The following Driver Managerare known to work with this and/or previous releases:

Component Description Version Operating System Comments
unixODBC ODBC Driver Manager 1.8.12-2 Linux www.unixodbc.org
2.0.5 Solaris 8 www.unixodbc.org
2.1.1-7 Linux Debian www.unixodbc.org
ODBC Driver Manager 3.5.10 Windows 95, 98 Microsoft

The iODBC 3.04 implementation on Solaris seems to have a problem with the handling of cursor states. It should not be used.

Supported native bindings

Database Product Version Comments
PostgreSQL 7.03 Thin binding
MySQL Thick binding
Oracle OCI 8i lite Oracle Call Interface

Other Components

Beside of the ODBC and the native bindings, the project provides add on components as:

  • ADBC- Ada Database Connectivitiy
  • Contributed tools

ADBC

The ADBC interface is a highly experimental package which works on top of PostgreSQL and MySQL. Since the interface is completly unstable it is not recommentded to use this interface in application at the current point in time. Since the interest in the Ada community was quite low it is questionable whether the development of this interface will be continued.

Contributed Tools

Tools are not part of this release. Constributed code is released as separate packages since they do not depend on a certain version of the GNADE environment.

  • gsql - A SQL client

Supported Platforms / Compilers

Compiler Version Operating Systems
GNAT 3.13p Linux, Windows
GNAT 3.14p Linux, Solaris 8, Windows
GNAT 3.15a Win98

Problems

This section contain an overview of known, fixed problems and restrictions (limitations). Please report all errors via the error report system at the source forge project page.

Fixed Problems

Problems reported earlier then 0.9o are listed in the release note 1.1.2.

Bug Ref. Fixed in Short Description Comments
421587 0.9o ObjectAda Unrestricted_Access not supported. Unrestricted access is not used any more.
425280 1.1.1 Name of esql not changed every where GNUmakefile updated
425409 1.1.1 sql_standard prefix not handled correct gesql updated
425410 1.1.1 whenever sqlwarning faulty gesql updated
425510 1.1.1 gpl.sgml missing in distribution MANIFEST updated
421586 1.1.2 GNUmake on Windows 95 does not work Makefile changed
435712 1.1.2 Wrong debug code generated esql translator and esql_support updated
427531 1.1.2 gesql file corrupt but available The output file will always be deleted if some error during translation occurred.
427557 1.1.2 gesql command line not correct evaluated driver changed.
427764 1.1.3 Relastion missing error not recognized Code generation has been changed
427747 1.1.3 help message shown twice driver.adb changed
427750 1.1.3 Dynamic SQL DECLARE statement missing documentation updated
427748 1.1.3 Some_Error exception undefine code generator updated
430075 1.1.3 -noniso92 switch does not exist code generator updated
430077 1.1.3 -noiso92 switch not evaluated code generator updated
429984 1.1.4 Result evaluation done twice code generator updated
430751 1.1.4 Notfound class not correctly evaluated code generator updated
430752 1.1.4 not found exception raised twice code generator updated
430760 1.1.4 Number of affrected rows missing is SQLC code generator updated
435982 1.1.5 Wrong package name found esql parser updated
435872 1.1.5 Debug information missleading esql code generator updated
437590 1.1.5 Example simple does not work with MySQL GNU.DB.SQLCLI and esql_support.odbc

updated.

439149 1.1.5 SQLCA Not inserted correctly esql parser updated
439151 1.1.5 Handling of inner exception -noiso92 switch changed to -iso92 switch
439274 1.1.5 Mimer SQL not correctly installed Makefile updated
439274 1.1.5 MimerSQL, Tables of test db not found. Documentation updated
478056 1.1.6 Move in ESQL raises exception esql_support.adb updated
470357 1.1.6 simple.gpq does not handle conn. error simple.gqp updated
471060 1.1.7 esql_parse does not compile esql_parser.adb updated
471082 1.1.7 Useless evaluate code generated esql_parser.adb updated
473062 1.1.8 Package name in host var. decl. not eval. esql_parser.adb updated
473104 1.1.8 Query result not evaluated by gesql esql_parser.adb updated
473259 1.1.9 esql samples do not complie esql_parser.adb updated
475736 1.1.10 VARBINARY not handled correctly gnu-db-esql_support-odbc.adb
471061 1.1.10 seperator for Win 9x not handled GNUmakefile
433671 1.1.10 Win 2000 installation failes modules.adb
477766 1.2.0 longblob not correctly handled gnu-db-mysql.adb, gnu-db-mysql.ads
538349 1.3.1 SELECT sum(valeur) incorrect translated esql_parser.adb updated
533949 1.3.1 Firsttime installation with MimerSQL failes gnade.mimer.sql
538350 1.3.1 Null value not handled correctly esql_parser.adb
540160 1.3.1 Wrong cursor state in case of failed que gnu-db-esql_support-odbc.adb
540163 1.3.1 Debug granularity esql_parser.adb
543343 1.3.2 Case sensitve cursors esql_parser.adb
552325 1.3.3 configure fails on Solaris 2.8 configure.in, configure.gues
553343 1.3.3 odbc demo raises Need_Data exception demo.gpq
554383 1.3.3 odbc demo does not return any value odbc bindings
554929 1.3.3 esql moves 'pragma Source_Reference' esql-translator (driver.adb)
557135 1.3.4 make install fails (invalid option -C) A resoable desfault will be assumed.
555169 1.3.4 segmentation fault in SQLSetEnvAttr odbc bindings updated
562994 1.3.4 Gigi Error with Solaris 8 odbc bindings changes
562998 1.3.4 Assert & Debug are not passed to ODBC sharedlib.sh.in, staticlib.sh.in changed
563257 1.3.4a ODBC bindings does not compile on Win 98 gnadevars.sh changed
563259 1.3.4a ODBC shared lib always build makefile updated
563332 1.3.4a gesql insert useless spaces in query esql_parser updated
563769 1.3.4b Subpackages are not evaluated correctly esql_parser updated
565952 1.3.5 Domain Qualification not handled esql_parser updated
565951 1.3.5 SQL Strings are not handled correctly esql_parser updated
566413 1.3.5a static libraries not build for adbc Makefile modified
566414 1.3.5a Useless printouts in gesql esql_parser updated
566429 1.3.5a esql & debugcode not compilable any more esql_parser updated
568396 1.3.6a config.gpq missing MANIFEST updated
567600 1.3.6a gesql translator includes odbc bindings esql_parser updated
567553 1.3.6a FeeBSD build chmod failes makefiles
566635 1.3.6a FreeBSD Makefile Problems (1.3.5a) Makefiles
585539 1.3.7 mysql and prosgresql does not link Makefiles
590569 1.3.7 Default cursor does not work esql_parser.adb, esql_support.odbc
597264 1.3.7a postgreSQL sdk not installed but native Makefiles, autoconf.in, ..
602598 1.3.7a makeliv.ali should be removed from distr staticlib.sh, sharedlib.sh

Known Problems

Bug Ref. Short Description Comments
411141 Missing ";" for "EXEC SQL DECLARE DB01 D" This problem may be bypassed by putting a semicolon in the source code.

Restrictions

  • The package names of the OCI binding are not yet lined up with the GNADE package hirarchy. This allignment will be done with the next versions. The build process currently creates no test client automatically since the build scripts are only available for windows
  • The VARBINARY data type has only been tested with Mimer SQL.
  • The configuration procedure for Solaris has not been tested completely. If it fails please use the Makefiles in the directory ./win32. These files are known to build a working installation under Solaris.
  • The Object Ada Compiler is known to fail compiling the ODBC bindings because of insufficient compliance to the Ada 95 RM.
  • The compilation of the ODBC bindings is known to fail on a Sun SPARC using GNAT 3.13p (ACT tracking number [8925-002] Gigi abort code 411 on SPARC architectures). This has been fixed mean while but all tests have been done with GNAT 3.14p.
  • The Option -compiler has been added to allow the support of specific of different Ada 95 compilers which has currently no effect.
  • Unicode support is only available begining with UnixODBC version 2.0. The Uncode support does depend on GNAT specific packages
  • Oracle 8i requires the declaration of string hostvariable to be 1 character larger then the domain size, e.g. assuming the size of the domain Ename from the example simple to be 20, the host variables have to be defined as:
    Ename     :   Char (1..21); 
    Dept_Name :   Char (1..21); 
    Location  :   Char (1..21);
  • The automatic installation is not supported in case of Oracle 8i but the installation script is located under samples.

Installation

The GNADE code and the documentation is distributed in the following files:

File Contents
gnade-src-1.3.7a.tar.gz Complete GNADE source code distribution GNU compressed tar file
gnade-src-1.3.7a.zip Complete GNADE source code distribution as ZIP file.

The installation of this software requires the following components:

Component Version Origin
gzip 1.2.4 GNU
unzip 5.42 Infozip
zip 2.2 Infozip
tar - GNU or native
autoconf*1 2.52 GNU
gmake 3.79.1 GNU
gnat 3.14p, 3.13p ACT distribution
gawk 3.0.3 GNU

Installation on Linux/Unix

Unpacking and Configuration

$ gunzip -c gnade-src-<version>.tar.gz | tar xvf -
$ cd gnade-src-<version>
$ ./configure [ --sampledb=<rdbms> [ native(s) ]

This allows you to specify for which RDBMS product you wish to create a sample data bases and for which RDBMS products you wish to build native bindings. If nothing is given only the ODBC based parts will be build.

The following RDBMS prducts are supported.

  • mimer - MimerSQL
  • postgres - PostgreSQL
  • mysql - MySQL
  • oracle - Oracle 8i lite

If the value is omitted because your data base product is not listed,, all subsequent steps regarding the data base installation may be skipped and you have to install the test database manually.

Installation of the Database

Depending on the installation of the data base you have specified in the configure script command, you have to execute the following step either by using a DBA account our you may use your own user account

$ su ..dba..
$ gmake createuser

After the database and the database user has been configured, the ODBC interface has to be configured. The directory ./samples/sample_db contains sample files for the unixODBC driver manager. The files odbc.ini.sample odbcinst.ini.sample have to be copied to /etc/odbc.ini and /etc/odbcinst.ini.sample.

Compiling an testing

After the creation of the data base user, the final build may be done by:

$ gmake

Test code is located in the directory ./samples. In order to test the functionality of the ODBC interface use the examples in ./odbc or ./esql.

Systemwide Installation

In order to install the build products on your system login as root and execute the following command in the installation directory of this package:

make install

The makefile will run a script which installs all components on your system that they are available to other users as well. The target directories are specified in the etc/site.config file.

Contrib Tool Installation

The GNADE project provides tools which are add on packages to the GNADE source packages. The following tools are installable with this distribution:

  • GSQL Version 0.7 or greater

For the installation please follow the procedure below after you have installed the GNADE source release.

  • change into the contrib directory
  • gunzip -c file.tar.gz | tar xvf -
  • Add the previously created directory to the file packages in the contrib directory
  • make

In order to install the tool run as root in the installation directory of GNADE the command:

make install

Since the installation procedure installs also the GNADE release ensure that the current status is usable for systemwide installation.

If it does not work

If this installation procedure fails you may use the Makefile in the directory ./win32. This will require some manual adoptions but it is a starting point.

In any case if you encounter a problem please contact the GNADE team asap.

Installation on Windows NT

For window users a zip file is provided. In order to install perform the following steps:

> unzip gnade-src-<version>.zip
> cd gnade-src-<version>/win32
> make 

Please note, this works with or without Cygwin installed.

Note that the Windows distribution of GNAT is in two parts; the standard GNAT tools in gnat-3.14p-nt.exe and the extra Windows tools and libraries in gnatwin-3.14p.exe. Both must be installed.


$Id: note_1.3.7a.html,v 1.5 2002/09/10 19:35:35 merdmann Exp $
gnade-1.6.2.orig/doc/releasenotes/note_1.3.7b.html0000644000175000017500000010435207540572243021373 0ustar lbrentalbrenta GNADE Sotware Release Note
GNat Ada 95 Database Environment - (GNADE)
Version 1.3.7b
Editor M.Erdmann
16.8.2002


Abstract

The objective of the GNADE project is to provide various packages which are allowing Ada 95 applications to access relational data base procducts, mainly SQL RDBMS.


Contents

Overview

Legal Stuff
Copyright
Authors
Contributions

Contact
New Features
Supported ODBC / Database Products
Supported native bindings
Supported Platforms & Compilers
Other components

Problems
Fixed Problems
Known Problems
Restrictions

Installation
Installation on linux
Installation on Windows

Overview

The scope of this release is a bug fix in the ./configure and build procedure in order to detect if it is possible to build the native bindings. The arguments of the configure script have been changed (see installation hints below).

A slight change in the ESQL translator has been done. If you are using constructs like

Print_Employee(1, EXEC SQL INCLUDE DATABASE NAMED DB01; );

change them into

Print_Employee(1, EXEC SQL INCLUDE DATABASE NAMED DB01 );

Additionally the gesql supports a simple variable substitution (like gnatprep) by means of the -D command line switch.

The ADBC interface will not be installed system wide any more since it is still experimental and incomplete.

The release features:

  • An extensive thin Ada 95 binding to the ODBC interfaces.
  • ISO/92 compliant embedded SQL translator which is able to process Ada 95 packages and files containing only one procedure. The translator creates Ada 95 source files working on top the of the ODBC interface.
  • Installation support for some commonly known data base products (see below).
  • Documentation in HTML, Postscript and PDF format.
  • Native Ada 95 bindings for MySQL, PostgreSQL and the Oracle call interface
  • GNU specific include clause which allows to access the ODBC handles via embedded SQL. This allows to mix embedded SQL and low level ODBC programing in a single source (see chapter in documentation).
  • DECLARE TABLE construct may be used to generate parts of the schema files (-schema option).
  • Support of embedded SQL based on the ISO/92 standard.
  • Support of MySQL with MS ODBC Drivers on Windows 95
  • Unicode support on the ODBC interface.
  • The connection clause has been extended by the ON clause in order to intercept typical connection errors and to define a reaction on ESQL level as shown below: CONNECT [ ON [COMMUNICATION|AUTHORIZATION|OTHER] ERROR [RAISE|GOTO|DO] <target> ]
  • A new GNADE implemenation defined data types as VARCHAR and VARBINARY. For details please refere to the documentation and the example attachment.gpq in samples/esql.
  • The esql translator contains a small scale variable substituation which makes gnatprep not nessesary for simple substitution jobs.
  • The experimental Ada Database Connectivity (ADBC) - API. The idea of this interface is to provide a binding which makes application relativly independant of the unterlying data base. The interface is highly experimental (refer to http://gnade.sourceforge.net/ado.html)

This release of the GNADE project is intended for building with GNAT (the GNU Ada compiler) on the platforms Linux, Solaris and Windows NT/95/2000.

Legal Stuff

License and Copyright

The GNU Public License (GPL) applies with the following extension to all components of this release

As a special exception, if other files instantiate generics from GNADE Ada units, or you link GNADE Ada units or libraries with other files to produce an executable, these units or libraries do not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.

The documentation has been put under the Free GNU Documentation License.

Authors

The authors and copyright holders of the GNADE project are:

Jürgen Pfeifer juergen.pfeifer@gmx.net
Michael Erdmann Michael.Erdmann@snafu.de
Sune Falck sunef@hem.passagen.se
Julio Cano julius_bip@yahoo.com
Dimitry Anisimikov anisimkov@yahoo.com
François Fabien fr.fabien@infonie.fr
Stephen Leake stephen_leake@acm.org

Contributions

Special regards to the following persons which have contributed to the project:

Pascal Obry p.obry@wanadoo.fr

Contact

Bug Reports http://sourceforge.net/projects/gnade M.Erdmann
GNADE Discussions http://lists.sourceforge.net/lists/listinfo/gnade-develop M.Erdmann
Project Page http://gnade.sourceforge.net/
http://sourceforge.net/projects/gnade
M.Erdmann
Dev. Coordination Michael.Erdmann@snafu.de Michael Erdmann

New Features

Feature Req, Short Description Version Status
540161 Exception in statements 1.3 complete
552327 Support of gnat 3.14 1.3.3 complete
563921 Explicit Database Connection 1.3.4b complete
590779 Preprocessor invokation 1.3.7 complete
591707 pkg-config support 1.3.7a complete (see Notes)

Note 1- If okg-config is found on a system, the systemwide installation script will install the package descriptor in the path which is given in the file etc/config.site:

site_pkgconfig_path=<your path>

If nothing is given /usr/local/lib/pkgconfig is assumed.

Supported ODBC and Database Products

Even the GNADE project except for the native data base bindings is expected to work with all ODBC compliant data base products. The following products are known to work with GNADE assuming, that you are using the correct driver manager.

Component Description Version OS Distribution/Source of the release
PostgreSQL PostgreSQL Database 7.0.3 Linux - Redhat 7.0 Linux - SuSe 7.0 Solaris Windows NT/2000 www.postgresql.org
Mimer Mimer SQL RDBMS 8.2 Solaris Linux Windows NT www.mimer.com
MySQL MySQL Database MyODBC 3.23.22
2.50.36-1
Linux www.mysql.com
3.23.35a
2.50.36
Windows 2000 www.mysql.com
3.23.47
3.51.02
Windows 98 www.mysql.com
MS SQL Server 7.0 Windows 2000 Microsoft
SQL Server 2000 Windows 2000 Microsoft
Oracle Lite 8i Windows 95 Oracle

The GNADE project installation procedure provides for theses product test data bases. If your data base is not listed below, the GNADE project will be very likely usable but the test data base has to be installed manually.

The following Driver Managerare known to work with this and/or previous releases:

Component Description Version Operating System Comments
unixODBC ODBC Driver Manager 1.8.12-2 Linux www.unixodbc.org
2.0.5 Solaris 8 www.unixodbc.org
2.1.1-7 Linux Debian www.unixodbc.org
ODBC Driver Manager 3.5.10 Windows 95, 98 Microsoft

The iODBC 3.04 implementation on Solaris seems to have a problem with the handling of cursor states. It should not be used.

Supported native bindings

Database Product Version Comments
PostgreSQL 7.03 Thin binding
MySQL Thick binding
Oracle OCI 8i lite Oracle Call Interface

Other Components

Beside of the ODBC and the native bindings, the project provides add on components as:

  • ADBC- Ada Database Connectivitiy
  • Contributed tools

ADBC

The ADBC interface is a highly experimental package which works on top of PostgreSQL and MySQL. Since the interface is completly unstable it is not recommentded to use this interface in application at the current point in time. Since the interest in the Ada community was quite low it is questionable whether the development of this interface will be continued.

Contributed Tools

Tools are not part of this release. Constributed code is released as separate packages since they do not depend on a certain version of the GNADE environment.

  • gsql - A SQL client

Supported Platforms / Compilers

Compiler Version Operating Systems
GNAT 3.13p Linux, Windows
GNAT 3.14p Linux, Solaris 8, Windows
GNAT 3.15a Win98

Problems

This section contain an overview of known, fixed problems and restrictions (limitations). Please report all errors via the error report system at the source forge project page.

Fixed Problems

Problems reported earlier then 0.9o are listed in the release note 1.1.2.

Bug Ref. Fixed in Short Description Comments
421587 0.9o ObjectAda Unrestricted_Access not supported. Unrestricted access is not used any more.
425280 1.1.1 Name of esql not changed every where GNUmakefile updated
425409 1.1.1 sql_standard prefix not handled correct gesql updated
425410 1.1.1 whenever sqlwarning faulty gesql updated
425510 1.1.1 gpl.sgml missing in distribution MANIFEST updated
421586 1.1.2 GNUmake on Windows 95 does not work Makefile changed
435712 1.1.2 Wrong debug code generated esql translator and esql_support updated
427531 1.1.2 gesql file corrupt but available The output file will always be deleted if some error during translation occurred.
427557 1.1.2 gesql command line not correct evaluated driver changed.
427764 1.1.3 Relastion missing error not recognized Code generation has been changed
427747 1.1.3 help message shown twice driver.adb changed
427750 1.1.3 Dynamic SQL DECLARE statement missing documentation updated
427748 1.1.3 Some_Error exception undefine code generator updated
430075 1.1.3 -noniso92 switch does not exist code generator updated
430077 1.1.3 -noiso92 switch not evaluated code generator updated
429984 1.1.4 Result evaluation done twice code generator updated
430751 1.1.4 Notfound class not correctly evaluated code generator updated
430752 1.1.4 not found exception raised twice code generator updated
430760 1.1.4 Number of affrected rows missing is SQLC code generator updated
435982 1.1.5 Wrong package name found esql parser updated
435872 1.1.5 Debug information missleading esql code generator updated
437590 1.1.5 Example simple does not work with MySQL GNU.DB.SQLCLI and esql_support.odbc

updated.

439149 1.1.5 SQLCA Not inserted correctly esql parser updated
439151 1.1.5 Handling of inner exception -noiso92 switch changed to -iso92 switch
439274 1.1.5 Mimer SQL not correctly installed Makefile updated
439274 1.1.5 MimerSQL, Tables of test db not found. Documentation updated
478056 1.1.6 Move in ESQL raises exception esql_support.adb updated
470357 1.1.6 simple.gpq does not handle conn. error simple.gqp updated
471060 1.1.7 esql_parse does not compile esql_parser.adb updated
471082 1.1.7 Useless evaluate code generated esql_parser.adb updated
473062 1.1.8 Package name in host var. decl. not eval. esql_parser.adb updated
473104 1.1.8 Query result not evaluated by gesql esql_parser.adb updated
473259 1.1.9 esql samples do not complie esql_parser.adb updated
475736 1.1.10 VARBINARY not handled correctly gnu-db-esql_support-odbc.adb
471061 1.1.10 seperator for Win 9x not handled GNUmakefile
433671 1.1.10 Win 2000 installation failes modules.adb
477766 1.2.0 longblob not correctly handled gnu-db-mysql.adb, gnu-db-mysql.ads
538349 1.3.1 SELECT sum(valeur) incorrect translated esql_parser.adb updated
533949 1.3.1 Firsttime installation with MimerSQL failes gnade.mimer.sql
538350 1.3.1 Null value not handled correctly esql_parser.adb
540160 1.3.1 Wrong cursor state in case of failed que gnu-db-esql_support-odbc.adb
540163 1.3.1 Debug granularity esql_parser.adb
543343 1.3.2 Case sensitve cursors esql_parser.adb
552325 1.3.3 configure fails on Solaris 2.8 configure.in, configure.gues
553343 1.3.3 odbc demo raises Need_Data exception demo.gpq
554383 1.3.3 odbc demo does not return any value odbc bindings
554929 1.3.3 esql moves 'pragma Source_Reference' esql-translator (driver.adb)
557135 1.3.4 make install fails (invalid option -C) A resoable desfault will be assumed.
555169 1.3.4 segmentation fault in SQLSetEnvAttr odbc bindings updated
562994 1.3.4 Gigi Error with Solaris 8 odbc bindings changes
562998 1.3.4 Assert & Debug are not passed to ODBC sharedlib.sh.in, staticlib.sh.in changed
563257 1.3.4a ODBC bindings does not compile on Win 98 gnadevars.sh changed
563259 1.3.4a ODBC shared lib always build makefile updated
563332 1.3.4a gesql insert useless spaces in query esql_parser updated
563769 1.3.4b Subpackages are not evaluated correctly esql_parser updated
565952 1.3.5 Domain Qualification not handled esql_parser updated
565951 1.3.5 SQL Strings are not handled correctly esql_parser updated
566413 1.3.5a static libraries not build for adbc Makefile modified
566414 1.3.5a Useless printouts in gesql esql_parser updated
566429 1.3.5a esql & debugcode not compilable any more esql_parser updated
568396 1.3.6a config.gpq missing MANIFEST updated
567600 1.3.6a gesql translator includes odbc bindings esql_parser updated
567553 1.3.6a FeeBSD build chmod failes makefiles
566635 1.3.6a FreeBSD Makefile Problems (1.3.5a) Makefiles
585539 1.3.7 mysql and prosgresql does not link Makefiles
590569 1.3.7 Default cursor does not work esql_parser.adb, esql_support.odbc
597264 1.3.7a postgreSQL sdk not installed but native Makefiles, autoconf.in, ..
602598 1.3.7a makeliv.ali should be removed from distr staticlib.sh, sharedlib.sh
609204 1.3.7b debian: install failes install.sh

Known Problems

Bug Ref. Short Description Comments
411141 Missing ";" for "EXEC SQL DECLARE DB01 D" This problem may be bypassed by putting a semicolon in the source code.

Restrictions

  • The package names of the OCI binding are not yet lined up with the GNADE package hirarchy. This allignment will be done with the next versions. The build process currently creates no test client automatically since the build scripts are only available for windows
  • The VARBINARY data type has only been tested with Mimer SQL.
  • The configuration procedure for Solaris has not been tested completely. If it fails please use the Makefiles in the directory ./win32. These files are known to build a working installation under Solaris.
  • The Object Ada Compiler is known to fail compiling the ODBC bindings because of insufficient compliance to the Ada 95 RM.
  • The compilation of the ODBC bindings is known to fail on a Sun SPARC using GNAT 3.13p (ACT tracking number [8925-002] Gigi abort code 411 on SPARC architectures). This has been fixed mean while but all tests have been done with GNAT 3.14p.
  • The Option -compiler has been added to allow the support of specific of different Ada 95 compilers which has currently no effect.
  • Unicode support is only available begining with UnixODBC version 2.0. The Uncode support does depend on GNAT specific packages
  • Oracle 8i requires the declaration of string hostvariable to be 1 character larger then the domain size, e.g. assuming the size of the domain Ename from the example simple to be 20, the host variables have to be defined as:
    Ename     :   Char (1..21); 
    Dept_Name :   Char (1..21); 
    Location  :   Char (1..21);
  • The automatic installation is not supported in case of Oracle 8i but the installation script is located under samples.

Installation

The GNADE code and the documentation is distributed in the following files:

File Contents
gnade-src-1.3.7a.tar.gz Complete GNADE source code distribution GNU compressed tar file
gnade-src-1.3.7a.zip Complete GNADE source code distribution as ZIP file.

The installation of this software requires the following components:

Component Version Origin
gzip 1.2.4 GNU
unzip 5.42 Infozip
zip 2.2 Infozip
tar - GNU or native
autoconf*1 2.52 GNU
gmake 3.79.1 GNU
gnat 3.14p, 3.13p ACT distribution
gawk 3.0.3 GNU

Installation on Linux/Unix

Unpacking and Configuration

$ gunzip -c gnade-src-<version>.tar.gz | tar xvf -
$ cd gnade-src-<version>
$ ./configure [ --sampledb=<rdbms> [ native(s) ]

This allows you to specify for which RDBMS product you wish to create a sample data bases and for which RDBMS products you wish to build native bindings. If nothing is given only the ODBC based parts will be build.

The following RDBMS prducts are supported.

  • mimer - MimerSQL
  • postgres - PostgreSQL
  • mysql - MySQL
  • oracle - Oracle 8i lite

If the value is omitted because your data base product is not listed,, all subsequent steps regarding the data base installation may be skipped and you have to install the test database manually.

Installation of the Database

Depending on the installation of the data base you have specified in the configure script command, you have to execute the following step either by using a DBA account our you may use your own user account

$ su ..dba..
$ gmake createuser

After the database and the database user has been configured, the ODBC interface has to be configured. The directory ./samples/sample_db contains sample files for the unixODBC driver manager. The files odbc.ini.sample odbcinst.ini.sample have to be copied to /etc/odbc.ini and /etc/odbcinst.ini.sample.

Compiling an testing

After the creation of the data base user, the final build may be done by:

$ gmake

Test code is located in the directory ./samples. In order to test the functionality of the ODBC interface use the examples in ./odbc or ./esql.

Systemwide Installation

In order to install the build products on your system login as root and execute the following command in the installation directory of this package:

make install

The makefile will run a script which installs all components on your system that they are available to other users as well. The target directories are specified in the etc/site.config file.

Contrib Tool Installation

The GNADE project provides tools which are add on packages to the GNADE source packages. The following tools are installable with this distribution:

  • GSQL Version 0.7 or greater

For the installation please follow the procedure below after you have installed the GNADE source release.

  • change into the contrib directory
  • gunzip -c file.tar.gz | tar xvf -
  • Add the previously created directory to the file packages in the contrib directory
  • make

In order to install the tool run as root in the installation directory of GNADE the command:

make install

Since the installation procedure installs also the GNADE release ensure that the current status is usable for systemwide installation.

If it does not work

If this installation procedure fails you may use the Makefile in the directory ./win32. This will require some manual adoptions but it is a starting point.

In any case if you encounter a problem please contact the GNADE team asap.

Installation on Windows NT

For window users a zip file is provided. In order to install perform the following steps:

> unzip gnade-src-<version>.zip
> cd gnade-src-<version>/win32
> make 

Please note, this works with or without Cygwin installed.

Note that the Windows distribution of GNAT is in two parts; the standard GNAT tools in gnat-3.14p-nt.exe and the extra Windows tools and libraries in gnatwin-3.14p.exe. Both must be installed.


$Id: note_1.3.7b.html,v 1.1 2002/09/14 08:34:43 merdmann Exp $
gnade-1.6.2.orig/doc/releasenotes/note_1.3.7c.html0000644000175000017500000010451507541410565021374 0ustar lbrentalbrenta GNADE Sotware Release Note
GNat Ada 95 Database Environment - (GNADE)
Version 1.3.7c
Editor M.Erdmann
16.8.2002


Abstract

The objective of the GNADE project is to provide various packages which are allowing Ada 95 applications to access relational data base procducts, mainly SQL RDBMS.


Contents

Overview

Legal Stuff
Copyright
Authors
Contributions

Contact
New Features
Supported ODBC / Database Products
Supported native bindings
Supported Platforms & Compilers
Other components

Problems
Fixed Problems
Known Problems
Restrictions

Installation
Installation on linux
Installation on Windows

Overview

The scope of this release is a bug fix in the ./configure and build procedure in order to detect if it is possible to build the native bindings. The arguments of the configure script have been changed (see installation hints below).

A slight change in the ESQL translator has been done. If you are using constructs like

Print_Employee(1, EXEC SQL INCLUDE DATABASE NAMED DB01; );

change them into

Print_Employee(1, EXEC SQL INCLUDE DATABASE NAMED DB01 );

Additionally the gesql supports a simple variable substitution (like gnatprep) by means of the -D command line switch.

The ADBC interface will not be installed system wide any more since it is still experimental and incomplete.

The release features:

  • An extensive thin Ada 95 binding to the ODBC interfaces.
  • ISO/92 compliant embedded SQL translator which is able to process Ada 95 packages and files containing only one procedure. The translator creates Ada 95 source files working on top the of the ODBC interface.
  • Installation support for some commonly known data base products (see below).
  • Documentation in HTML, Postscript and PDF format.
  • Native Ada 95 bindings for MySQL, PostgreSQL and the Oracle call interface
  • GNU specific include clause which allows to access the ODBC handles via embedded SQL. This allows to mix embedded SQL and low level ODBC programing in a single source (see chapter in documentation).
  • DECLARE TABLE construct may be used to generate parts of the schema files (-schema option).
  • Support of embedded SQL based on the ISO/92 standard.
  • Support of MySQL with MS ODBC Drivers on Windows 95
  • Unicode support on the ODBC interface.
  • The connection clause has been extended by the ON clause in order to intercept typical connection errors and to define a reaction on ESQL level as shown below: CONNECT [ ON [COMMUNICATION|AUTHORIZATION|OTHER] ERROR [RAISE|GOTO|DO] <target> ]
  • A new GNADE implemenation defined data types as VARCHAR and VARBINARY. For details please refere to the documentation and the example attachment.gpq in samples/esql.
  • The esql translator contains a small scale variable substituation which makes gnatprep not nessesary for simple substitution jobs.
  • The experimental Ada Database Connectivity (ADBC) - API. The idea of this interface is to provide a binding which makes application relativly independant of the unterlying data base. The interface is highly experimental (refer to http://gnade.sourceforge.net/ado.html)

This release of the GNADE project is intended for building with GNAT (the GNU Ada compiler) on the platforms Linux, Solaris and Windows NT/95/2000.

Legal Stuff

License and Copyright

The GNU Public License (GPL) applies with the following extension to all components of this release

As a special exception, if other files instantiate generics from GNADE Ada units, or you link GNADE Ada units or libraries with other files to produce an executable, these units or libraries do not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.

The documentation has been put under the Free GNU Documentation License.

Authors

The authors and copyright holders of the GNADE project are:

Jürgen Pfeifer juergen.pfeifer@gmx.net
Michael Erdmann Michael.Erdmann@snafu.de
Sune Falck sunef@hem.passagen.se
Julio Cano julius_bip@yahoo.com
Dimitry Anisimikov anisimkov@yahoo.com
François Fabien fr.fabien@infonie.fr
Stephen Leake stephen_leake@acm.org

Contributions

Special regards to the following persons which have contributed to the project:

Pascal Obry p.obry@wanadoo.fr

Contact

Bug Reports http://sourceforge.net/projects/gnade M.Erdmann
GNADE Discussions http://lists.sourceforge.net/lists/listinfo/gnade-develop M.Erdmann
Project Page http://gnade.sourceforge.net/
http://sourceforge.net/projects/gnade
M.Erdmann
Dev. Coordination Michael.Erdmann@snafu.de Michael Erdmann

New Features

Feature Req, Short Description Version Status
540161 Exception in statements 1.3 complete
552327 Support of gnat 3.14 1.3.3 complete
563921 Explicit Database Connection 1.3.4b complete
590779 Preprocessor invokation 1.3.7 complete
591707 pkg-config support 1.3.7a complete (see Notes)

Note 1- If okg-config is found on a system, the systemwide installation script will install the package descriptor in the path which is given in the file etc/config.site:

site_pkgconfig_path=<your path>

If nothing is given /usr/local/lib/pkgconfig is assumed.

Supported ODBC and Database Products

Even the GNADE project except for the native data base bindings is expected to work with all ODBC compliant data base products. The following products are known to work with GNADE assuming, that you are using the correct driver manager.

Component Description Version OS Distribution/Source of the release
PostgreSQL PostgreSQL Database 7.0.3
7.2
Linux - Redhat 7.0
Linux - SuSe 7.0 Solaris
Linux - Debian 2.2, 3.0
Windows NT/2000
www.postgresql.org
Mimer Mimer SQL RDBMS 8.2 Solaris Linux Windows NT www.mimer.com
MySQL MySQL Database MyODBC 3.23.22
2.50.36-1
Linux www.mysql.com
3.23.35a
2.50.36
Windows 2000 www.mysql.com
3.23.47
3.51.02
Windows 98 www.mysql.com
MS SQL Server 7.0 Windows 2000 Microsoft
SQL Server 2000 Windows 2000 Microsoft
Oracle Lite 8i Windows 95 Oracle

The GNADE project installation procedure provides for theses product test data bases. If your data base is not listed below, the GNADE project will be very likely usable but the test data base has to be installed manually.

The following Driver Managerare known to work with this and/or previous releases:

Component Description Version Operating System Comments
unixODBC ODBC Driver Manager 1.8.12-2 Linux www.unixodbc.org
2.0.5 Solaris 8 www.unixodbc.org
2.1.1-7 Linux Debian www.unixodbc.org
ODBC Driver Manager 3.5.10 Windows 95, 98 Microsoft

The iODBC 3.04 implementation on Solaris seems to have a problem with the handling of cursor states. It should not be used.

Supported native bindings

Database Product Version Comments
PostgreSQL 7.03 Thin binding
MySQL Thick binding
Oracle OCI 8i lite Oracle Call Interface

Other Components

Beside of the ODBC and the native bindings, the project provides add on components as:

  • ADBC- Ada Database Connectivitiy
  • Contributed tools

ADBC

The ADBC interface is a highly experimental package which works on top of PostgreSQL and MySQL. Since the interface is completly unstable it is not recommentded to use this interface in application at the current point in time. Since the interest in the Ada community was quite low it is questionable whether the development of this interface will be continued.

Contributed Tools

Tools are not part of this release. Constributed code is released as separate packages since they do not depend on a certain version of the GNADE environment.

  • gsql - A SQL client

Supported Platforms / Compilers

Compiler Version Operating Systems
GNAT 3.13p Linux, Windows
GNAT 3.14p Linux, Solaris 8, Windows
GNAT 3.15a Win98

Problems

This section contain an overview of known, fixed problems and restrictions (limitations). Please report all errors via the error report system at the source forge project page.

Fixed Problems

Problems reported earlier then 0.9o are listed in the release note 1.1.2.

Bug Ref. Fixed in Short Description Comments
421587 0.9o ObjectAda Unrestricted_Access not supported. Unrestricted access is not used any more.
425280 1.1.1 Name of esql not changed every where GNUmakefile updated
425409 1.1.1 sql_standard prefix not handled correct gesql updated
425410 1.1.1 whenever sqlwarning faulty gesql updated
425510 1.1.1 gpl.sgml missing in distribution MANIFEST updated
421586 1.1.2 GNUmake on Windows 95 does not work Makefile changed
435712 1.1.2 Wrong debug code generated esql translator and esql_support updated
427531 1.1.2 gesql file corrupt but available The output file will always be deleted if some error during translation occurred.
427557 1.1.2 gesql command line not correct evaluated driver changed.
427764 1.1.3 Relastion missing error not recognized Code generation has been changed
427747 1.1.3 help message shown twice driver.adb changed
427750 1.1.3 Dynamic SQL DECLARE statement missing documentation updated
427748 1.1.3 Some_Error exception undefine code generator updated
430075 1.1.3 -noniso92 switch does not exist code generator updated
430077 1.1.3 -noiso92 switch not evaluated code generator updated
429984 1.1.4 Result evaluation done twice code generator updated
430751 1.1.4 Notfound class not correctly evaluated code generator updated
430752 1.1.4 not found exception raised twice code generator updated
430760 1.1.4 Number of affrected rows missing is SQLC code generator updated
435982 1.1.5 Wrong package name found esql parser updated
435872 1.1.5 Debug information missleading esql code generator updated
437590 1.1.5 Example simple does not work with MySQL GNU.DB.SQLCLI and esql_support.odbc

updated.

439149 1.1.5 SQLCA Not inserted correctly esql parser updated
439151 1.1.5 Handling of inner exception -noiso92 switch changed to -iso92 switch
439274 1.1.5 Mimer SQL not correctly installed Makefile updated
439274 1.1.5 MimerSQL, Tables of test db not found. Documentation updated
478056 1.1.6 Move in ESQL raises exception esql_support.adb updated
470357 1.1.6 simple.gpq does not handle conn. error simple.gqp updated
471060 1.1.7 esql_parse does not compile esql_parser.adb updated
471082 1.1.7 Useless evaluate code generated esql_parser.adb updated
473062 1.1.8 Package name in host var. decl. not eval. esql_parser.adb updated
473104 1.1.8 Query result not evaluated by gesql esql_parser.adb updated
473259 1.1.9 esql samples do not complie esql_parser.adb updated
475736 1.1.10 VARBINARY not handled correctly gnu-db-esql_support-odbc.adb
471061 1.1.10 seperator for Win 9x not handled GNUmakefile
433671 1.1.10 Win 2000 installation failes modules.adb
477766 1.2.0 longblob not correctly handled gnu-db-mysql.adb, gnu-db-mysql.ads
538349 1.3.1 SELECT sum(valeur) incorrect translated esql_parser.adb updated
533949 1.3.1 Firsttime installation with MimerSQL failes gnade.mimer.sql
538350 1.3.1 Null value not handled correctly esql_parser.adb
540160 1.3.1 Wrong cursor state in case of failed que gnu-db-esql_support-odbc.adb
540163 1.3.1 Debug granularity esql_parser.adb
543343 1.3.2 Case sensitve cursors esql_parser.adb
552325 1.3.3 configure fails on Solaris 2.8 configure.in, configure.gues
553343 1.3.3 odbc demo raises Need_Data exception demo.gpq
554383 1.3.3 odbc demo does not return any value odbc bindings
554929 1.3.3 esql moves 'pragma Source_Reference' esql-translator (driver.adb)
557135 1.3.4 make install fails (invalid option -C) A resoable desfault will be assumed.
555169 1.3.4 segmentation fault in SQLSetEnvAttr odbc bindings updated
562994 1.3.4 Gigi Error with Solaris 8 odbc bindings changes
562998 1.3.4 Assert & Debug are not passed to ODBC sharedlib.sh.in, staticlib.sh.in changed
563257 1.3.4a ODBC bindings does not compile on Win 98 gnadevars.sh changed
563259 1.3.4a ODBC shared lib always build makefile updated
563332 1.3.4a gesql insert useless spaces in query esql_parser updated
563769 1.3.4b Subpackages are not evaluated correctly esql_parser updated
565952 1.3.5 Domain Qualification not handled esql_parser updated
565951 1.3.5 SQL Strings are not handled correctly esql_parser updated
566413 1.3.5a static libraries not build for adbc Makefile modified
566414 1.3.5a Useless printouts in gesql esql_parser updated
566429 1.3.5a esql & debugcode not compilable any more esql_parser updated
568396 1.3.6a config.gpq missing MANIFEST updated
567600 1.3.6a gesql translator includes odbc bindings esql_parser updated
567553 1.3.6a FeeBSD build chmod failes makefiles
566635 1.3.6a FreeBSD Makefile Problems (1.3.5a) Makefiles
585539 1.3.7 mysql and prosgresql does not link Makefiles
590569 1.3.7 Default cursor does not work esql_parser.adb, esql_support.odbc
597264 1.3.7a postgreSQL sdk not installed but native Makefiles, autoconf.in, ..
602598 1.3.7a makeliv.ali should be removed from distr staticlib.sh, sharedlib.sh
609204 1.3.7b debian: install failes install.sh

Known Problems

Bug Ref. Short Description Comments
411141 Missing ";" for "EXEC SQL DECLARE DB01 D" This problem may be bypassed by putting a semicolon in the source code.

Restrictions

  • The package names of the OCI binding are not yet lined up with the GNADE package hirarchy. This allignment will be done with the next versions. The build process currently creates no test client automatically since the build scripts are only available for windows
  • The VARBINARY data type has only been tested with Mimer SQL.
  • The configuration procedure for Solaris has not been tested completely. If it fails please use the Makefiles in the directory ./win32. These files are known to build a working installation under Solaris.
  • The Object Ada Compiler is known to fail compiling the ODBC bindings because of insufficient compliance to the Ada 95 RM.
  • The compilation of the ODBC bindings is known to fail on a Sun SPARC using GNAT 3.13p (ACT tracking number [8925-002] Gigi abort code 411 on SPARC architectures). This has been fixed mean while but all tests have been done with GNAT 3.14p.
  • The Option -compiler has been added to allow the support of specific of different Ada 95 compilers which has currently no effect.
  • Unicode support is only available begining with UnixODBC version 2.0. The Uncode support does depend on GNAT specific packages
  • Oracle 8i requires the declaration of string hostvariable to be 1 character larger then the domain size, e.g. assuming the size of the domain Ename from the example simple to be 20, the host variables have to be defined as:
    Ename     :   Char (1..21); 
    Dept_Name :   Char (1..21); 
    Location  :   Char (1..21);
  • The automatic installation is not supported in case of Oracle 8i but the installation script is located under samples.

Installation

The GNADE code and the documentation is distributed in the following files:

File Contents
gnade-src-1.3.7a.tar.gz Complete GNADE source code distribution GNU compressed tar file
gnade-src-1.3.7a.zip Complete GNADE source code distribution as ZIP file.

The installation of this software requires the following components:

Component Version Origin
gzip 1.2.4 GNU
unzip 5.42 Infozip
zip 2.2 Infozip
tar - GNU or native
autoconf*1 2.52 GNU
gmake 3.79.1 GNU
gnat 3.14p, 3.13p ACT distribution
gawk 3.0.3 GNU

Installation on Linux/Unix

Unpacking and Configuration

$ gunzip -c gnade-src-<version>.tar.gz | tar xvf -
$ cd gnade-src-<version>
$ ./configure [ --sampledb=<rdbms> [ native(s) ]

This allows you to specify for which RDBMS product you wish to create a sample data bases and for which RDBMS products you wish to build native bindings. If nothing is given only the ODBC based parts will be build.

The following RDBMS prducts are supported.

  • mimer - MimerSQL
  • postgres - PostgreSQL
  • mysql - MySQL
  • oracle - Oracle 8i lite

If the value is omitted because your data base product is not listed,, all subsequent steps regarding the data base installation may be skipped and you have to install the test database manually.

Installation of the Database

Depending on the installation of the data base you have specified in the configure script command, you have to execute the following step either by using a DBA account our you may use your own user account

$ su ..dba..
$ gmake createuser

After the database and the database user has been configured, the ODBC interface has to be configured. The directory ./samples/sample_db contains sample files for the unixODBC driver manager. The files odbc.ini.sample odbcinst.ini.sample have to be copied to /etc/odbc.ini and /etc/odbcinst.ini.sample.

Compiling an testing

After the creation of the data base user, the final build may be done by:

$ gmake

Test code is located in the directory ./samples. In order to test the functionality of the ODBC interface use the examples in ./odbc or ./esql.

Systemwide Installation

In order to install the build products on your system login as root and execute the following command in the installation directory of this package:

make install

The makefile will run a script which installs all components on your system that they are available to other users as well. The target directories are specified in the etc/site.config file.

Contrib Tool Installation

The GNADE project provides tools which are add on packages to the GNADE source packages. The following tools are installable with this distribution:

  • GSQL Version 0.7 or greater

For the installation please follow the procedure below after you have installed the GNADE source release.

  • change into the contrib directory
  • gunzip -c file.tar.gz | tar xvf -
  • Add the previously created directory to the file packages in the contrib directory
  • make

In order to install the tool run as root in the installation directory of GNADE the command:

make install

Since the installation procedure installs also the GNADE release ensure that the current status is usable for systemwide installation.

If it does not work

If this installation procedure fails you may use the Makefile in the directory ./win32. This will require some manual adoptions but it is a starting point.

In any case if you encounter a problem please contact the GNADE team asap.

Installation on Windows NT

For window users a zip file is provided. In order to install perform the following steps:

> unzip gnade-src-<version>.zip
> cd gnade-src-<version>/win32
> make 

Please note, this works with or without Cygwin installed.

Note that the Windows distribution of GNAT is in two parts; the standard GNAT tools in gnat-3.14p-nt.exe and the extra Windows tools and libraries in gnatwin-3.14p.exe. Both must be installed.


$Id: note_1.3.7c.html,v 1.1 2002/09/16 17:14:29 merdmann Exp $
gnade-1.6.2.orig/doc/releasenotes/note_1.3.7d.html0000644000175000017500000010524607545270420021375 0ustar lbrentalbrenta GNADE Sotware Release Note
GNat Ada 95 Database Environment - (GNADE)
Version 1.3.7d
Editor M.Erdmann
27.9.2002


Abstract

The objective of the GNADE project is to provide various packages which are allowing Ada 95 applications to access relational data base procducts, mainly SQL RDBMS.


Contents

Overview

Legal Stuff
Copyright
Authors
Contributions

Contact
New Features
Supported ODBC / Database Products
Supported native bindings
Supported Platforms & Compilers
Other components

Problems
Fixed Problems
Known Problems
Restrictions

Installation
Installation on linux
Installation on Windows

Overview

New with Release 1.3.7

  • The build procedure will build native bindings only if the requiered RDBMS products are installed
  • The configure script has got new arguments allowing to select the native bindings explicitly. The ODBC bindngs will be build in any case.
  • A slight change in the ESQL translator syntax. Change statements like:

    Print_Employee(1, EXEC SQL INCLUDE DATABASE NAMED DB01; );

    into:

    Print_Employee(1, EXEC SQL INCLUDE DATABASE NAMED DB01 );


  • gesql supports a simple variable substitution (like gnatprep) by means of the -D command line switch. For detailes please refere to the documentation of gesql.
  • The ADBC interface will not be installed system wide any more since it is still experimental and incomplete.
  • Runs on Debian

Features of the Release:

  • An extensive thin Ada 95 binding to the ODBC interfaces.
  • ISO/92 compliant embedded SQL translator which is able to process Ada 95 packages and files containing only one procedure. The translator creates Ada 95 source files working on top the of the ODBC interface.
  • Installation support for some commonly known data base products (see below).
  • Documentation in HTML, Postscript and PDF format.
  • Native Ada 95 bindings for MySQL, PostgreSQL and the Oracle call interface
  • GNU specific include clause which allows to access the ODBC handles via embedded SQL. This allows to mix embedded SQL and low level ODBC programing in a single source (see chapter in documentation).
  • DECLARE TABLE construct may be used to generate parts of the schema files (-schema option).
  • Support of embedded SQL based on the ISO/92 standard.
  • Support of MySQL with MS ODBC Drivers on Windows 95
  • Unicode support on the ODBC interface.
  • The connection clause has been extended by the ON clause in order to intercept typical connection errors and to define a reaction on ESQL level as shown below: CONNECT [ ON [COMMUNICATION|AUTHORIZATION|OTHER] ERROR [RAISE|GOTO|DO] <target> ]
  • A new GNADE implemenation defined data types as VARCHAR and VARBINARY. For details please refere to the documentation and the example attachment.gpq in samples/esql.
  • The esql translator contains a small scale variable substituation which makes gnatprep not nessesary for simple substitution jobs.
  • The experimental Ada Database Connectivity (ADBC) - API. The idea of this interface is to provide a binding which makes application relativly independant of the unterlying data base. The interface is highly experimental (refer to http://gnade.sourceforge.net/ado.html)

This release of the GNADE project is intended for building with GNAT (the GNU Ada compiler) on the platforms Linux, Solaris and Windows NT/95/2000.

Legal Stuff

License and Copyright

The GNU Public License (GPL) applies with the following extension to all components of this release

As a special exception, if other files instantiate generics from GNADE Ada units, or you link GNADE Ada units or libraries with other files to produce an executable, these units or libraries do not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.

The documentation has been put under the Free GNU Documentation License.

Authors

The authors and copyright holders of the GNADE project are:

Jürgen Pfeifer juergen.pfeifer@gmx.net
Michael Erdmann Michael.Erdmann@snafu.de
Sune Falck sunef@hem.passagen.se
Julio Cano julius_bip@yahoo.com
Dimitry Anisimikov anisimkov@yahoo.com
François Fabien fr.fabien@infonie.fr
Stephen Leake stephen_leake@acm.org

Contributions

Special regards to the following persons which have contributed to the project:

Pascal Obry p.obry@wanadoo.fr

Contact

Bug Reports http://sourceforge.net/projects/gnade M.Erdmann
GNADE Discussions http://lists.sourceforge.net/lists/listinfo/gnade-develop M.Erdmann
Project Page http://gnade.sourceforge.net/
http://sourceforge.net/projects/gnade
M.Erdmann
Dev. Coordination Michael.Erdmann@snafu.de Michael Erdmann

New Features

Feature Req, Short Description Version Status
540161 Exception in statements 1.3 complete
552327 Support of gnat 3.14 1.3.3 complete
563921 Explicit Database Connection 1.3.4b complete
590779 Preprocessor invokation 1.3.7 complete
591707 pkg-config support 1.3.7a complete (see Notes)

Note 1- If okg-config is found on a system, the systemwide installation script will install the package descriptor in the path which is given in the file etc/config.site:

site_pkgconfig_path=<your path>

If nothing is given /usr/local/lib/pkgconfig is assumed.

Supported ODBC and Database Products

Even the GNADE project except for the native data base bindings is expected to work with all ODBC compliant data base products. The following products are known to work with GNADE assuming, that you are using the correct driver manager.

Component Description Version OS Distribution/Source of the release
PostgreSQL PostgreSQL Database 7.0.3
7.2
Linux - Redhat 7.0
Linux - SuSe 7.0 Solaris
Linux - Debian 2.2, 3.0
Windows NT/2000
www.postgresql.org
Mimer Mimer SQL RDBMS 8.2 Solaris Linux Windows NT www.mimer.com
MySQL MySQL Database MyODBC 3.23.22
2.50.36-1
Linux www.mysql.com
3.23.35a
2.50.36
Windows 2000 www.mysql.com
3.23.47
3.51.02
Windows 98 www.mysql.com
MS SQL Server 7.0 Windows 2000 Microsoft
SQL Server 2000 Windows 2000 Microsoft
Oracle Lite 8i Windows 95 Oracle

The GNADE project installation procedure provides for theses product test data bases. If your data base is not listed below, the GNADE project will be very likely usable but the test data base has to be installed manually.

The following Driver Managerare known to work with this and/or previous releases:

Component Description Version Operating System Comments
unixODBC ODBC Driver Manager 1.8.12-2 Linux www.unixodbc.org
2.0.5 Solaris 8 www.unixodbc.org
2.1.1-7 Linux Debian www.unixodbc.org
ODBC Driver Manager 3.5.10 Windows 95, 98 Microsoft

The iODBC 3.04 implementation on Solaris seems to have a problem with the handling of cursor states. It should not be used.

Supported native bindings

Database Product Version Comments
PostgreSQL 7.03 Thin binding
MySQL Thick binding
Oracle OCI 8i lite Oracle Call Interface

Other Components

Beside of the ODBC and the native bindings, the project provides add on components as:

  • ADBC- Ada Database Connectivitiy
  • Contributed tools

ADBC

The ADBC interface is a highly experimental package which works on top of PostgreSQL and MySQL. Since the interface is completly unstable it is not recommentded to use this interface in application at the current point in time. Since the interest in the Ada community was quite low it is questionable whether the development of this interface will be continued.

Contributed Tools

Tools are not part of this release. Constributed code is released as separate packages since they do not depend on a certain version of the GNADE environment.

  • gsql - A SQL client

Supported Platforms / Compilers

Compiler Version Operating Systems
GNAT 3.13p Linux, Windows
GNAT 3.14p Linux (Debian, Redhat, SuSe), Solaris 8, Windows
GNAT 3.15a Win98

Problems

This section contain an overview of known, fixed problems and restrictions (limitations). Please report all errors via the error report system at the source forge project page.

Fixed Problems

Problems reported earlier then 0.9o are listed in the release note 1.1.2.

Bug Ref. Fixed in Short Description Comments
421587 0.9o ObjectAda Unrestricted_Access not supported. Unrestricted access is not used any more.
425280 1.1.1 Name of esql not changed every where GNUmakefile updated
425409 1.1.1 sql_standard prefix not handled correct gesql updated
425410 1.1.1 whenever sqlwarning faulty gesql updated
425510 1.1.1 gpl.sgml missing in distribution MANIFEST updated
421586 1.1.2 GNUmake on Windows 95 does not work Makefile changed
435712 1.1.2 Wrong debug code generated esql translator and esql_support updated
427531 1.1.2 gesql file corrupt but available The output file will always be deleted if some error during translation occurred.
427557 1.1.2 gesql command line not correct evaluated driver changed.
427764 1.1.3 Relastion missing error not recognized Code generation has been changed
427747 1.1.3 help message shown twice driver.adb changed
427750 1.1.3 Dynamic SQL DECLARE statement missing documentation updated
427748 1.1.3 Some_Error exception undefine code generator updated
430075 1.1.3 -noniso92 switch does not exist code generator updated
430077 1.1.3 -noiso92 switch not evaluated code generator updated
429984 1.1.4 Result evaluation done twice code generator updated
430751 1.1.4 Notfound class not correctly evaluated code generator updated
430752 1.1.4 not found exception raised twice code generator updated
430760 1.1.4 Number of affrected rows missing is SQLC code generator updated
435982 1.1.5 Wrong package name found esql parser updated
435872 1.1.5 Debug information missleading esql code generator updated
437590 1.1.5 Example simple does not work with MySQL GNU.DB.SQLCLI and esql_support.odbc

updated.

439149 1.1.5 SQLCA Not inserted correctly esql parser updated
439151 1.1.5 Handling of inner exception -noiso92 switch changed to -iso92 switch
439274 1.1.5 Mimer SQL not correctly installed Makefile updated
439274 1.1.5 MimerSQL, Tables of test db not found. Documentation updated
478056 1.1.6 Move in ESQL raises exception esql_support.adb updated
470357 1.1.6 simple.gpq does not handle conn. error simple.gqp updated
471060 1.1.7 esql_parse does not compile esql_parser.adb updated
471082 1.1.7 Useless evaluate code generated esql_parser.adb updated
473062 1.1.8 Package name in host var. decl. not eval. esql_parser.adb updated
473104 1.1.8 Query result not evaluated by gesql esql_parser.adb updated
473259 1.1.9 esql samples do not complie esql_parser.adb updated
475736 1.1.10 VARBINARY not handled correctly gnu-db-esql_support-odbc.adb
471061 1.1.10 seperator for Win 9x not handled GNUmakefile
433671 1.1.10 Win 2000 installation failes modules.adb
477766 1.2.0 longblob not correctly handled gnu-db-mysql.adb, gnu-db-mysql.ads
538349 1.3.1 SELECT sum(valeur) incorrect translated esql_parser.adb updated
533949 1.3.1 Firsttime installation with MimerSQL failes gnade.mimer.sql
538350 1.3.1 Null value not handled correctly esql_parser.adb
540160 1.3.1 Wrong cursor state in case of failed que gnu-db-esql_support-odbc.adb
540163 1.3.1 Debug granularity esql_parser.adb
543343 1.3.2 Case sensitve cursors esql_parser.adb
552325 1.3.3 configure fails on Solaris 2.8 configure.in, configure.gues
553343 1.3.3 odbc demo raises Need_Data exception demo.gpq
554383 1.3.3 odbc demo does not return any value odbc bindings
554929 1.3.3 esql moves 'pragma Source_Reference' esql-translator (driver.adb)
557135 1.3.4 make install fails (invalid option -C) A resoable desfault will be assumed.
555169 1.3.4 segmentation fault in SQLSetEnvAttr odbc bindings updated
562994 1.3.4 Gigi Error with Solaris 8 odbc bindings changes
562998 1.3.4 Assert & Debug are not passed to ODBC sharedlib.sh.in, staticlib.sh.in changed
563257 1.3.4a ODBC bindings does not compile on Win 98 gnadevars.sh changed
563259 1.3.4a ODBC shared lib always build makefile updated
563332 1.3.4a gesql insert useless spaces in query esql_parser updated
563769 1.3.4b Subpackages are not evaluated correctly esql_parser updated
565952 1.3.5 Domain Qualification not handled esql_parser updated
565951 1.3.5 SQL Strings are not handled correctly esql_parser updated
566413 1.3.5a static libraries not build for adbc Makefile modified
566414 1.3.5a Useless printouts in gesql esql_parser updated
566429 1.3.5a esql & debugcode not compilable any more esql_parser updated
568396 1.3.6a config.gpq missing MANIFEST updated
567600 1.3.6a gesql translator includes odbc bindings esql_parser updated
567553 1.3.6a FeeBSD build chmod failes makefiles
566635 1.3.6a FreeBSD Makefile Problems (1.3.5a) Makefiles
585539 1.3.7 mysql and prosgresql does not link Makefiles
590569 1.3.7 Default cursor does not work esql_parser.adb, esql_support.odbc
597264 1.3.7a postgreSQL sdk not installed but native Makefiles, autoconf.in, ..
602598 1.3.7a makeliv.ali should be removed from distr staticlib.sh, sharedlib.sh
609204 1.3.7b debian: install failes install.sh
612521 1.3.7d pkg-config contains unbuild natives makefiles, configure.in

Known Problems

Bug Ref. Short Description Comments
411141 Missing ";" for "EXEC SQL DECLARE DB01 D" This problem may be bypassed by putting a semicolon in the source code.

Restrictions

  • The package names of the OCI binding are not yet lined up with the GNADE package hirarchy. This allignment will be done with the next versions. The build process currently creates no test client automatically since the build scripts are only available for windows
  • The VARBINARY data type has only been tested with Mimer SQL.
  • The configuration procedure for Solaris has not been tested completely. If it fails please use the Makefiles in the directory ./win32. These files are known to build a working installation under Solaris.
  • The Object Ada Compiler is known to fail compiling the ODBC bindings because of insufficient compliance to the Ada 95 RM.
  • The compilation of the ODBC bindings is known to fail on a Sun SPARC using GNAT 3.13p (ACT tracking number [8925-002] Gigi abort code 411 on SPARC architectures). This has been fixed mean while but all tests have been done with GNAT 3.14p.
  • The Option -compiler has been added to allow the support of specific of different Ada 95 compilers which has currently no effect.
  • Unicode support is only available begining with UnixODBC version 2.0. The Uncode support does depend on GNAT specific packages
  • Oracle 8i requires the declaration of string hostvariable to be 1 character larger then the domain size, e.g. assuming the size of the domain Ename from the example simple to be 20, the host variables have to be defined as:
    Ename     :   Char (1..21); 
    Dept_Name :   Char (1..21); 
    Location  :   Char (1..21);
  • The automatic installation is not supported in case of Oracle 8i but the installation script is located under samples.

Installation

The GNADE code and the documentation is distributed in the following files:

File Contents
gnade-src-1.3.7a.tar.gz Complete GNADE source code distribution GNU compressed tar file
gnade-src-1.3.7a.zip Complete GNADE source code distribution as ZIP file.

The installation of this software requires the following components:

Component Version Origin
gzip 1.2.4 GNU
unzip 5.42 Infozip
zip 2.2 Infozip
tar - GNU or native
autoconf*1 2.52 GNU
gmake 3.79.1 GNU
gnat 3.14p, 3.13p ACT distribution
gawk 3.0.3 GNU

Installation on Linux/Unix

Unpacking and Configuration

$ gunzip -c gnade-src-<version>.tar.gz | tar xvf -
$ cd gnade-src-<version>
$ ./configure [ --sampledb=<rdbms> [ native(s) ]

This allows you to specify for which RDBMS product you wish to create a sample data bases and for which RDBMS products you wish to build native bindings. If nothing is given only the ODBC based parts will be build.

The following RDBMS prducts are supported.

  • mimer - MimerSQL
  • postgres - PostgreSQL
  • mysql - MySQL
  • oracle - Oracle 8i lite

If the value is omitted because your data base product is not listed,, all subsequent steps regarding the data base installation may be skipped and you have to install the test database manually.

Installation of the Database

Depending on the installation of the data base you have specified in the configure script command, you have to execute the following step either by using a DBA account our you may use your own user account

$ su ..dba..
$ gmake createuser

After the database and the database user has been configured, the ODBC interface has to be configured. The directory ./samples/sample_db contains sample files for the unixODBC driver manager. The files odbc.ini.sample odbcinst.ini.sample have to be copied to /etc/odbc.ini and /etc/odbcinst.ini.sample.

Compiling an testing

After the creation of the data base user, the final build may be done by:

$ gmake

Test code is located in the directory ./samples. In order to test the functionality of the ODBC interface use the examples in ./odbc or ./esql.

Systemwide Installation

In order to install the build products on your system login as root and execute the following command in the installation directory of this package:

make install

The makefile will run a script which installs all components on your system that they are available to other users as well. The target directories are specified in the etc/site.config file.

Contrib Tool Installation

The GNADE project provides tools which are add on packages to the GNADE source packages. The following tools are installable with this distribution:

  • GSQL Version 0.7 or greater

For the installation please follow the procedure below after you have installed the GNADE source release.

  • change into the contrib directory
  • gunzip -c file.tar.gz | tar xvf -
  • Add the previously created directory to the file packages in the contrib directory
  • make

In order to install the tool run as root in the installation directory of GNADE the command:

make install

Since the installation procedure installs also the GNADE release ensure that the current status is usable for systemwide installation.

If it does not work

If this installation procedure fails you may use the Makefile in the directory ./win32. This will require some manual adoptions but it is a starting point.

In any case if you encounter a problem please contact the GNADE team asap.

Installation on Windows NT

For window users a zip file is provided. In order to install perform the following steps:

> unzip gnade-src-<version>.zip
> cd gnade-src-<version>/win32
> make 

Please note, this works with or without Cygwin installed.

Note that the Windows distribution of GNAT is in two parts; the standard GNAT tools in gnat-3.14p-nt.exe and the extra Windows tools and libraries in gnatwin-3.14p.exe. Both must be installed.


$Id: note_1.3.7d.html,v 1.1 2002/09/28 09:06:24 merdmann Exp $
gnade-1.6.2.orig/doc/releasenotes/note_1.4.0.html0000644000175000017500000010537507552075104021226 0ustar lbrentalbrenta GNADE Sotware Release Note
GNat Ada 95 Database Environment - (GNADE)
Version 1.4.0
Editor M.Erdmann
12.10.2002


Abstract

The objective of the GNADE project is to provide various packages which are allowing Ada 95 applications to access relational data base procducts, mainly SQL RDBMS.


Contents

Overview

Legal Stuff
Copyright
Authors
Contributions

Contact
New Features
Supported ODBC / Database Products
Supported native bindings
Supported Platforms & Compilers
Other components

Problems
Fixed Problems
Known Problems
Restrictions

Installation
Installation on linux
Installation on Windows

Overview

New with Release 1.4.0

  • RPM build process include in source distribution.
  • A prebuild binary distribution RPM file which contains all native packages, the odbc interface and the embedded SQL translator.

Features of the Release:

  • An extensive thin Ada 95 binding to the ODBC interfaces.
  • ISO/92 compliant embedded SQL translator which is able to process Ada 95 packages and files containing only one procedure. The translator creates Ada 95 source files working on top the of the ODBC interface.
  • Installation support for some commonly known data base products (see below).
  • Documentation in HTML, Postscript and PDF format.
  • Native Ada 95 bindings for MySQL, PostgreSQL and the Oracle call interface
  • GNU specific include clause which allows to access the ODBC handles via embedded SQL. This allows to mix embedded SQL and low level ODBC programing in a single source (see chapter in documentation).
  • DECLARE TABLE construct may be used to generate parts of the schema files (-schema option).
  • Support of embedded SQL based on the ISO/92 standard.
  • Support of MySQL with MS ODBC Drivers on Windows 95
  • Unicode support on the ODBC interface.
  • The connection clause has been extended by the ON clause in order to intercept typical connection errors and to define a reaction on ESQL level as shown below: CONNECT [ ON [COMMUNICATION|AUTHORIZATION|OTHER] ERROR [RAISE|GOTO|DO] <target> ]
  • A new GNADE implemenation defined data types as VARCHAR and VARBINARY. For details please refere to the documentation and the example attachment.gpq in samples/esql.
  • The esql translator contains a small scale variable substituation which makes gnatprep not nessesary for simple substitution jobs.
  • The experimental Ada Database Connectivity (ADBC) - API. The idea of this interface is to provide a binding which makes application relativly independant of the unterlying data base. The interface is highly experimental (refer to http://gnade.sourceforge.net/ado.html)

This release of the GNADE project is intended for building with GNAT (the GNU Ada compiler) on the platforms Linux, Solaris and Windows NT/95/2000.

Legal Stuff

License and Copyright

The GNU Public License (GPL) applies with the following extension to all components of this release

As a special exception, if other files instantiate generics from GNADE Ada units, or you link GNADE Ada units or libraries with other files to produce an executable, these units or libraries do not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.

The documentation has been put under the Free GNU Documentation License.

Authors

The authors and copyright holders of the GNADE project are:

Jürgen Pfeifer juergen.pfeifer@gmx.net
Michael Erdmann Michael.Erdmann@snafu.de
Sune Falck sunef@hem.passagen.se
Julio Cano julius_bip@yahoo.com
Dimitry Anisimikov anisimkov@yahoo.com
François Fabien fr.fabien@infonie.fr
Stephen Leake stephen_leake@acm.org

Contributions

Special regards to the following persons which have contributed to the project:

Pascal Obry p.obry@wanadoo.fr

Contact

Bug Reports http://sourceforge.net/projects/gnade M.Erdmann
GNADE Discussions http://lists.sourceforge.net/lists/listinfo/gnade-develop M.Erdmann
Project Page http://gnade.sourceforge.net/
http://sourceforge.net/projects/gnade
M.Erdmann
Dev. Coordination Michael.Erdmann@snafu.de Michael Erdmann

New Features

Feature Req, Short Description Version Status
540161 Exception in statements 1.3 complete
552327 Support of gnat 3.14 1.3.3 complete
563921 Explicit Database Connection 1.3.4b complete
590779 Preprocessor invokation 1.3.7 complete
591707 pkg-config support 1.3.7a complete (see Notes)

Note 1- If okg-config is found on a system, the systemwide installation script will install the package descriptor in the path which is given in the file etc/config.site:

site_pkgconfig_path=<your path>

If nothing is given /usr/local/lib/pkgconfig is assumed.

Supported ODBC and Database Products

Even the GNADE project except for the native data base bindings is expected to work with all ODBC compliant data base products. The following products are known to work with GNADE assuming, that you are using the correct driver manager.

Component Description Version OS Distribution/Source of the release
PostgreSQL PostgreSQL Database 7.0.3
7.2
Linux - Redhat 7.0
Linux - SuSe 7.0 Solaris
Linux - Debian 2.2, 3.0
Windows NT/2000
www.postgresql.org
Mimer Mimer SQL RDBMS 8.2 Solaris Linux Windows NT www.mimer.com
MySQL MySQL Database MyODBC 3.23.22
2.50.36-1
Linux www.mysql.com
3.23.35a
2.50.36
Windows 2000 www.mysql.com
3.23.47
3.51.02
Windows 98 www.mysql.com
MS SQL Server 7.0 Windows 2000 Microsoft
SQL Server 2000 Windows 2000 Microsoft
Oracle Lite 8i Windows 95 Oracle

The GNADE project installation procedure provides for theses product test data bases. If your data base is not listed below, the GNADE project will be very likely usable but the test data base has to be installed manually.

The following Driver Managerare known to work with this and/or previous releases:

Component Description Version Operating System Comments
unixODBC ODBC Driver Manager 1.8.12-2 Linux www.unixodbc.org
2.0.5 Solaris 8 www.unixodbc.org
2.1.1-7 Linux Debian www.unixodbc.org
ODBC Driver Manager 3.5.10 Windows 95, 98 Microsoft

The iODBC 3.04 implementation on Solaris seems to have a problem with the handling of cursor states. It should not be used.

Supported native bindings

Database Product Version Comments
PostgreSQL 7.03 Thin binding
MySQL Thick binding
Oracle OCI 8i lite Oracle Call Interface

Other Components

Beside of the ODBC and the native bindings, the project provides add on components as:

  • ADBC- Ada Database Connectivitiy
  • Contributed tools

ADBC

The ADBC interface is a highly experimental package which works on top of PostgreSQL and MySQL. Since the interface is completly unstable it is not recommentded to use this interface in application at the current point in time. Since the interest in the Ada community was quite low it is questionable whether the development of this interface will be continued.

Contributed Tools

Tools are not part of this release. Constributed code is released as separate packages since they do not depend on a certain version of the GNADE environment.

  • gsql - A SQL client

Supported Platforms / Compilers

Compiler Version Operating Systems
GNAT 3.13p Linux, Windows
GNAT 3.14p Linux (Debian, Redhat, SuSe), Solaris 8, Windows
GNAT 3.15a Win98

Problems

This section contain an overview of known, fixed problems and restrictions (limitations). Please report all errors via the error report system at the source forge project page.

Fixed Problems

Problems reported earlier then 0.9o are listed in the release note 1.1.2.

Bug Ref. Fixed in Short Description Comments
421587 0.9o ObjectAda Unrestricted_Access not supported. Unrestricted access is not used any more.
425280 1.1.1 Name of esql not changed every where GNUmakefile updated
425409 1.1.1 sql_standard prefix not handled correct gesql updated
425410 1.1.1 whenever sqlwarning faulty gesql updated
425510 1.1.1 gpl.sgml missing in distribution MANIFEST updated
421586 1.1.2 GNUmake on Windows 95 does not work Makefile changed
435712 1.1.2 Wrong debug code generated esql translator and esql_support updated
427531 1.1.2 gesql file corrupt but available The output file will always be deleted if some error during translation occurred.
427557 1.1.2 gesql command line not correct evaluated driver changed.
427764 1.1.3 Relastion missing error not recognized Code generation has been changed
427747 1.1.3 help message shown twice driver.adb changed
427750 1.1.3 Dynamic SQL DECLARE statement missing documentation updated
427748 1.1.3 Some_Error exception undefine code generator updated
430075 1.1.3 -noniso92 switch does not exist code generator updated
430077 1.1.3 -noiso92 switch not evaluated code generator updated
429984 1.1.4 Result evaluation done twice code generator updated
430751 1.1.4 Notfound class not correctly evaluated code generator updated
430752 1.1.4 not found exception raised twice code generator updated
430760 1.1.4 Number of affrected rows missing is SQLC code generator updated
435982 1.1.5 Wrong package name found esql parser updated
435872 1.1.5 Debug information missleading esql code generator updated
437590 1.1.5 Example simple does not work with MySQL GNU.DB.SQLCLI and esql_support.odbc

updated.

439149 1.1.5 SQLCA Not inserted correctly esql parser updated
439151 1.1.5 Handling of inner exception -noiso92 switch changed to -iso92 switch
439274 1.1.5 Mimer SQL not correctly installed Makefile updated
439274 1.1.5 MimerSQL, Tables of test db not found. Documentation updated
478056 1.1.6 Move in ESQL raises exception esql_support.adb updated
470357 1.1.6 simple.gpq does not handle conn. error simple.gqp updated
471060 1.1.7 esql_parse does not compile esql_parser.adb updated
471082 1.1.7 Useless evaluate code generated esql_parser.adb updated
473062 1.1.8 Package name in host var. decl. not eval. esql_parser.adb updated
473104 1.1.8 Query result not evaluated by gesql esql_parser.adb updated
473259 1.1.9 esql samples do not complie esql_parser.adb updated
475736 1.1.10 VARBINARY not handled correctly gnu-db-esql_support-odbc.adb
471061 1.1.10 seperator for Win 9x not handled GNUmakefile
433671 1.1.10 Win 2000 installation failes modules.adb
477766 1.2.0 longblob not correctly handled gnu-db-mysql.adb, gnu-db-mysql.ads
538349 1.3.1 SELECT sum(valeur) incorrect translated esql_parser.adb updated
533949 1.3.1 Firsttime installation with MimerSQL failes gnade.mimer.sql
538350 1.3.1 Null value not handled correctly esql_parser.adb
540160 1.3.1 Wrong cursor state in case of failed que gnu-db-esql_support-odbc.adb
540163 1.3.1 Debug granularity esql_parser.adb
543343 1.3.2 Case sensitve cursors esql_parser.adb
552325 1.3.3 configure fails on Solaris 2.8 configure.in, configure.gues
553343 1.3.3 odbc demo raises Need_Data exception demo.gpq
554383 1.3.3 odbc demo does not return any value odbc bindings
554929 1.3.3 esql moves 'pragma Source_Reference' esql-translator (driver.adb)
557135 1.3.4 make install fails (invalid option -C) A resoable desfault will be assumed.
555169 1.3.4 segmentation fault in SQLSetEnvAttr odbc bindings updated
562994 1.3.4 Gigi Error with Solaris 8 odbc bindings changes
562998 1.3.4 Assert & Debug are not passed to ODBC sharedlib.sh.in, staticlib.sh.in changed
563257 1.3.4a ODBC bindings does not compile on Win 98 gnadevars.sh changed
563259 1.3.4a ODBC shared lib always build makefile updated
563332 1.3.4a gesql insert useless spaces in query esql_parser updated
563769 1.3.4b Subpackages are not evaluated correctly esql_parser updated
565952 1.3.5 Domain Qualification not handled esql_parser updated
565951 1.3.5 SQL Strings are not handled correctly esql_parser updated
566413 1.3.5a static libraries not build for adbc Makefile modified
566414 1.3.5a Useless printouts in gesql esql_parser updated
566429 1.3.5a esql & debugcode not compilable any more esql_parser updated
568396 1.3.6a config.gpq missing MANIFEST updated
567600 1.3.6a gesql translator includes odbc bindings esql_parser updated
567553 1.3.6a FeeBSD build chmod failes makefiles
566635 1.3.6a FreeBSD Makefile Problems (1.3.5a) Makefiles
585539 1.3.7 mysql and prosgresql does not link Makefiles
590569 1.3.7 Default cursor does not work esql_parser.adb, esql_support.odbc
597264 1.3.7a postgreSQL sdk not installed but native Makefiles, autoconf.in, ..
602598 1.3.7a makeliv.ali should be removed from distr staticlib.sh, sharedlib.sh
609204 1.3.7b debian: install failes install.sh
612521 1.3.7d pkg-config contains unbuild natives makefiles, configure.in

Known Problems

Bug Ref. Short Description Comments
411141 Missing ";" for "EXEC SQL DECLARE DB01 D" This problem may be bypassed by putting a semicolon in the source code.

Restrictions

  • The package names of the OCI binding are not yet lined up with the GNADE package hirarchy. This allignment will be done with the next versions. The build process currently creates no test client automatically since the build scripts are only available for windows
  • The VARBINARY data type has only been tested with Mimer SQL.
  • The configuration procedure for Solaris has not been tested completely. If it fails please use the Makefiles in the directory ./win32. These files are known to build a working installation under Solaris.
  • The Object Ada Compiler is known to fail compiling the ODBC bindings because of insufficient compliance to the Ada 95 RM.
  • The compilation of the ODBC bindings is known to fail on a Sun SPARC using GNAT 3.13p (ACT tracking number [8925-002] Gigi abort code 411 on SPARC architectures). This has been fixed mean while but all tests have been done with GNAT 3.14p.
  • The Option -compiler has been added to allow the support of specific of different Ada 95 compilers which has currently no effect.
  • Unicode support is only available begining with UnixODBC version 2.0. The Uncode support does depend on GNAT specific packages
  • Oracle 8i requires the declaration of string hostvariable to be 1 character larger then the domain size, e.g. assuming the size of the domain Ename from the example simple to be 20, the host variables have to be defined as:
    Ename     :   Char (1..21); 
    Dept_Name :   Char (1..21); 
    Location  :   Char (1..21);
  • The automatic installation is not supported in case of Oracle 8i but the installation script is located under samples.

Installation

The GNADE code and the documentation is distributed in the following files:

File Contents
gnade-src-1.4.0.tar.gz Complete GNADE source code distribution GNU compressed tar file
gnade-src-1.4.0.zip Complete GNADE source code distribution as ZIP file.
gnade-1.4.0-4.src.rpm Source rpm used to build.
gnade-1.4.0-4.i686.rpm Linux binaries and executables in RPM format.

The installation of this software requires the following components:

Component Version Origin
gzip 1.2.4 GNU
unzip 5.42 Infozip
zip 2.2 Infozip
tar - GNU or native
autoconf 2.52 GNU
gmake 3.79.1 GNU
gnat 3.14p, 3.13p ACT distribution (ftp://cs.ny.edu/)
gawk 3.0.3 GNU
rpm www.rpm.org (only if rpm is to be installed)

Installation on Linux/Unix

Unpacking and Configuration

$ gunzip -c gnade-src-<version>.tar.gz | tar xvf -
$ cd gnade-src-<version>
$ ./configure [ --sampledb=<rdbms> [ native(s) ]

This allows you to specify for which RDBMS product you wish to create a sample data bases and for which RDBMS products you wish to build native bindings. If nothing is given only the ODBC based parts will be build.

The following RDBMS prducts are supported.

  • mimer - MimerSQL
  • postgres - PostgreSQL
  • mysql - MySQL
  • oracle - Oracle 8i lite

If the value is omitted because your data base product is not listed,, all subsequent steps regarding the data base installation may be skipped and you have to install the test database manually.

Installation of the Database

Depending on the installation of the data base you have specified in the configure script command, you have to execute the following step either by using a DBA account our you may use your own user account

$ su ..dba..
$ gmake createuser

After the database and the database user has been configured, the ODBC interface has to be configured. The directory ./samples/sample_db contains sample files for the unixODBC driver manager. The files odbc.ini.sample odbcinst.ini.sample have to be copied to /etc/odbc.ini and /etc/odbcinst.ini.sample.

Compiling an testing

After the creation of the data base user, the final build may be done by:

$ gmake

Test code is located in the directory ./samples. In order to test the functionality of the ODBC interface use the examples in ./odbc or ./esql.

Systemwide Installation

In order to install the build products on your system login as root and execute the following command in the installation directory of this package:

make install

The makefile will run a script which installs all components on your system that they are available to other users as well. The target directories are specified in the etc/site.config file.

Installation of the RPM packages

The installation of the executable package done by executing the following command:

rpm -ivh gnade-1.4.0-4.i686.rpm.

This will install the production results at the following places in the filesystem:

libraries - /usr/lib/libgnade*
documentation - /usr/share/doc/gnade-1.4.0
binaries - /usr/bin

Since this is the first rpm release no deinstallation has to be done.

Contrib Tool Installation

The GNADE project provides tools which are add on packages to the GNADE source packages. The following tools are installable with this distribution:

  • GSQL Version 0.7 or greater

For the installation please follow the procedure below after you have installed the GNADE source release.

  • change into the contrib directory
  • gunzip -c file.tar.gz | tar xvf -
  • Add the previously created directory to the file packages in the contrib directory
  • make

In order to install the tool run as root in the installation directory of GNADE the command:

make install

Since the installation procedure installs also the GNADE release ensure that the current status is usable for systemwide installation.

If it does not work

If this installation procedure fails you may use the Makefile in the directory ./win32. This will require some manual adoptions but it is a starting point.

In any case if you encounter a problem please contact the GNADE team asap.

Installation on Windows NT

For window users a zip file is provided. In order to install perform the following steps:

> unzip gnade-src-<version>.zip
> cd gnade-src-<version>/win32
> make 

Please note, this works with or without Cygwin installed.

Note that the Windows distribution of GNAT is in two parts; the standard GNAT tools in gnat-3.14p-nt.exe and the extra Windows tools and libraries in gnatwin-3.14p.exe. Both must be installed.


$Id: note_1.4.0.html,v 1.2 2002/10/12 19:38:44 merdmann Exp $
gnade-1.6.2.orig/doc/releasenotes/note_1.4.1.html0000644000175000017500000007536707603533042021233 0ustar lbrentalbrenta GNADE Sotware Release Note
GNat Ada 95 Database Environment - (GNADE)
Version 1.4.1
Editor M.Erdmann
27.12.2002


Abstract

The objective of the GNADE project is to provide various packages which are allowing Ada 95 applications to access relational data base procducts, mainly SQL RDBMS.


Contents

Overview

Legal Stuff
Copyright
Authors
Contributions

Contact
New Features
Supported ODBC / Database Products
Supported native bindings
Supported Platforms & Compilers
Other components

Problems
Fixed Problems
Known Problems
Restrictions

Installation
Installation on linux
Installation on Windows

Overview

New with this Release (1.4.1)

  • Support of SuSe 8.x platform
  • Bugfixes
  • RPM packages for Linux
  • Support of GNAT 3.15p

Features of the Release:

  • An extensive thin Ada 95 binding to the ODBC interfaces.
  • ISO/92 compliant embedded SQL translator which is able to process Ada 95 packages and files containing only one procedure. The translator creates Ada 95 source files working on top the of the ODBC interface.
  • Installation support for some commonly known data base products (see below).
  • Documentation in HTML, Postscript and PDF format.
  • Native Ada 95 bindings for MySQL, PostgreSQL and the Oracle call interface
  • GNU specific include clause which allows to access the ODBC handles via embedded SQL. This allows to mix embedded SQL and low level ODBC programing in a single source (see chapter in documentation).
  • DECLARE TABLE construct may be used to generate parts of the schema files (-schema option).
  • Support of embedded SQL based on the ISO/92 standard.
  • Support of MySQL with MS ODBC Drivers on Windows 95
  • Unicode support on the ODBC interface.
  • The connection clause has been extended by the ON clause in order to intercept typical connection errors and to define a reaction on ESQL level as shown below: CONNECT [ ON [COMMUNICATION|AUTHORIZATION|OTHER] ERROR [RAISE|GOTO|DO] <target> ]
  • A new GNADE implemenation defined data types as VARCHAR and VARBINARY. For details please refere to the documentation and the example attachment.gpq in samples/esql.
  • The esql translator contains a small scale variable substituation which makes gnatprep not nessesary for simple substitution jobs.
  • The experimental Ada Database Connectivity (ADBC) - API. The idea of this interface is to provide a binding which makes application relativly independant of the unterlying data base. The interface is highly experimental (refer to http://gnade.sourceforge.net/ado.html)

This release of the GNADE project is intended for building with GNAT (the GNU Ada compiler) on the platforms Linux, Solaris and Windows NT/95/2000.

Legal Stuff

License and Copyright

The GNU Public License (GPL) applies with the following extension to all components of this release

As a special exception, if other files instantiate generics from GNADE Ada units, or you link GNADE Ada units or libraries with other files to produce an executable, these units or libraries do not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.

The documentation has been put under the Free GNU Documentation License.

Authors

The authors and copyright holders of the GNADE project are:

Jürgen Pfeifer juergen.pfeifer@gmx.net
Michael Erdmann Michael.Erdmann@snafu.de
Sune Falck sunef@hem.passagen.se
Julio Cano julius_bip@yahoo.com
Dimitry Anisimikov anisimkov@yahoo.com
François Fabien fr.fabien@infonie.fr
Stephen Leake stephen_leake@acm.org

Contributions

Special regards to the following persons which have contributed to the project:

Pascal Obry p.obry@wanadoo.fr

Contact

Bug Reports http://sourceforge.net/projects/gnade M.Erdmann
GNADE Discussions http://lists.sourceforge.net/lists/listinfo/gnade-develop M.Erdmann
Project Page http://gnade.sourceforge.net/
http://sourceforge.net/projects/gnade
M.Erdmann
Dev. Coordination Michael.Erdmann@snafu.de Michael Erdmann

New Features

Feature Req, Short Description Version Status
540161 Exception in statements 1.3 complete
552327 Support of gnat 3.14 1.3.3 complete
563921 Explicit Database Connection 1.3.4b complete
590779 Preprocessor invokation 1.3.7 complete
591707 pkg-config support 1.3.7a complete (see Notes)

Note 1- If okg-config is found on a system, the systemwide installation script will install the package descriptor in the path which is given in the file etc/config.site:

site_pkgconfig_path=<your path>

If nothing is given /usr/local/lib/pkgconfig is assumed.

Supported ODBC and Database Products

Even the GNADE project except for the native data base bindings is expected to work with all ODBC compliant data base products. The following products are known to work with GNADE assuming, that you are using the correct driver manager.

Component Description Version OS Distribution/Source of the release
PostgreSQL PostgreSQL Database 7.0.3
7.2
Linux - Redhat 7.0
Linux - SuSe 7.0 Solaris
Linux - Debian 2.2, 3.0
Windows NT/2000
www.postgresql.org
Mimer Mimer SQL RDBMS 8.2(.4G) Solaris Linux Windows NT www.mimer.com
MySQL MySQL Database MyODBC 3.23.22
2.50.36-1
Linux www.mysql.com
3.23.35a
2.50.36
Windows 2000 www.mysql.com
3.23.47
3.51.02
Windows 98 www.mysql.com
MS SQL Server 7.0 Windows 2000 Microsoft
SQL Server 2000 Windows 2000 Microsoft
Oracle Lite 8i Windows 95 Oracle

The GNADE project installation procedure provides for theses product test data bases. If your data base is not listed below, the GNADE project will be very likely usable but the test data base has to be installed manually.

The following Driver Managerare known to work with this and/or previous releases:

Component Description Version Operating System Comments
unixODBC ODBC Driver Manager 1.8.12-2 Linux www.unixodbc.org
2.0.5 Solaris 8 www.unixodbc.org
2.1.1-7 Linux Debian www.unixodbc.org
ODBC Driver Manager 3.5.10 Windows 95, 98 Microsoft

The iODBC 3.04 implementation on Solaris seems to have a problem with the handling of cursor states. It should not be used.

Supported native bindings

Database Product Version Comments
PostgreSQL 7.03 Thin binding
MySQL Thick binding
Oracle OCI 8i lite Oracle Call Interface

Other Components

Beside of the ODBC and the native bindings, the project provides add on components as:

  • ADBC- Ada Database Connectivitiy
  • Contributed tools

ADBC

The ADBC interface is a highly experimental package which works on top of PostgreSQL and MySQL. Since the interface is completly unstable it is not recommentded to use this interface in application at the current point in time. Since the interest in the Ada community was quite low it is questionable whether the development of this interface will be continued.

Contributed Tools

Tools are not part of this release. Constributed code is released as separate packages since they do not depend on a certain version of the GNADE environment.

  • gsql - A SQL client

Supported Platforms / Compilers

Compiler Version Operating Systems
GNAT 3.13p Linux, Windows
GNAT 3.14p Linux (Debian, Redhat, SuSe), Solaris 8, Windows
GNAT 3.15p
GNAT 3.15a Win98

Problems

This section contain an overview of known, fixed problems and restrictions (limitations). Please report all errors via the error report system at the source forge project page.

Fixed Problems

Problems reported earlier then 1.2.0 are listed in the release note 1.4.0

Bug Ref. Fixed in Short Description Comments
477766 1.2.0 longblob not correctly handled gnu-db-mysql.adb, gnu-db-mysql.ads
538349 1.3.1 SELECT sum(valeur) incorrect translated esql_parser.adb updated
533949 1.3.1 Firsttime installation with MimerSQL failes gnade.mimer.sql
538350 1.3.1 Null value not handled correctly esql_parser.adb
540160 1.3.1 Wrong cursor state in case of failed que gnu-db-esql_support-odbc.adb
540163 1.3.1 Debug granularity esql_parser.adb
543343 1.3.2 Case sensitve cursors esql_parser.adb
552325 1.3.3 configure fails on Solaris 2.8 configure.in, configure.gues
553343 1.3.3 odbc demo raises Need_Data exception demo.gpq
554383 1.3.3 odbc demo does not return any value odbc bindings
554929 1.3.3 esql moves 'pragma Source_Reference' esql-translator (driver.adb)
557135 1.3.4 make install fails (invalid option -C) A resoable desfault will be assumed.
555169 1.3.4 segmentation fault in SQLSetEnvAttr odbc bindings updated
562994 1.3.4 Gigi Error with Solaris 8 odbc bindings changes
562998 1.3.4 Assert & Debug are not passed to ODBC sharedlib.sh.in, staticlib.sh.in changed
563257 1.3.4a ODBC bindings does not compile on Win 98 gnadevars.sh changed
563259 1.3.4a ODBC shared lib always build makefile updated
563332 1.3.4a gesql insert useless spaces in query esql_parser updated
563769 1.3.4b Subpackages are not evaluated correctly esql_parser updated
565952 1.3.5 Domain Qualification not handled esql_parser updated
565951 1.3.5 SQL Strings are not handled correctly esql_parser updated
566413 1.3.5a static libraries not build for adbc Makefile modified
566414 1.3.5a Useless printouts in gesql esql_parser updated
566429 1.3.5a esql & debugcode not compilable any more esql_parser updated
568396 1.3.6a config.gpq missing MANIFEST updated
567600 1.3.6a gesql translator includes odbc bindings esql_parser updated
567553 1.3.6a FeeBSD build chmod failes makefiles
566635 1.3.6a FreeBSD Makefile Problems (1.3.5a) Makefiles
585539 1.3.7 mysql and prosgresql does not link Makefiles
590569 1.3.7 Default cursor does not work esql_parser.adb, esql_support.odbc
597264 1.3.7a postgreSQL sdk not installed but native Makefiles, autoconf.in, ..
602598 1.3.7a makeliv.ali should be removed from distr staticlib.sh, sharedlib.sh
609204 1.3.7b debian: install failes install.sh
612521 1.3.7d pkg-config contains unbuild natives makefiles, configure.in
640172 1.4.1 odbc example failes to link makefile, configure.in
640171 1.4.1 make clean failes in mysql sample makefiles
637947 1.4.1 sql_standard package missing rpm spec.
637949 1.4.1 SuSe 8.1 installation failes Makefile(s)
637951 1.4.1 rpm build failes on SuSe 8.1 Makefile
637952 1.4.1 Sample database with MimerSQL 8.2.4G mimer.sql
659298 1.4.1 rpm does not contain the *.o and *.ali gnade.spec, rpmfiles.sh
659301 1.4.1 rpm samples are not compilable gnade-config, Makefile
659418 1.4.1 standalone example does not work gnade-config, Makefile

Known Problems

Bug Ref. Short Description Comments
411141 Missing ";" for "EXEC SQL DECLARE DB01 D" This problem may be bypassed by putting a semicolon in the source code.

Restrictions

  • The package names of the OCI binding are not yet lined up with the GNADE package hirarchy. This allignment will be done with the next versions. The build process currently creates no test client automatically since the build scripts are only available for windows
  • The VARBINARY data type has only been tested with Mimer SQL.
  • The configuration procedure for Solaris has not been tested completely. If it fails please use the Makefiles in the directory ./win32. These files are known to build a working installation under Solaris.
  • The Object Ada Compiler is known to fail compiling the ODBC bindings because of insufficient compliance to the Ada 95 RM.
  • The compilation of the ODBC bindings is known to fail on a Sun SPARC using GNAT 3.13p (ACT tracking number [8925-002] Gigi abort code 411 on SPARC architectures). This has been fixed mean while but all tests have been done with GNAT 3.14p.
  • The Option -compiler has been added to allow the support of specific of different Ada 95 compilers which has currently no effect.
  • Unicode support is only available begining with UnixODBC version 2.0. The Uncode support does depend on GNAT specific packages
  • Oracle 8i requires the declaration of string hostvariable to be 1 character larger then the domain size, e.g. assuming the size of the domain Ename from the example simple to be 20, the host variables have to be defined as:
    Ename     :   Char (1..21); 
    Dept_Name :   Char (1..21); 
    Location  :   Char (1..21);
  • The automatic installation is not supported in case of Oracle 8i but the installation script is located under samples.

Installation

The GNADE code and the documentation is distributed in the following files:

File Contents
gnade-src-1.4.1.tar.gz Complete GNADE source code distribution GNU compressed tar file
gnade-src-1.4.1.zip Complete GNADE source code distribution as ZIP file.
gnade-1.4.1-xx.src.rpm Source rpm used to build.
gnade-1.4.1-xx.i686.rpm Linux binaries and executables in RPM format.

The installation of this software requires the following components:

Component Version Origin
gzip 1.2.4 GNU
unzip 5.42 Infozip
zip 2.2 Infozip
tar - GNU or native
autoconf 2.52 GNU
gmake 3.79.1 GNU
gnat 3.14p, 3.13p ACT distribution (ftp://cs.ny.edu/)
gawk 3.0.3 GNU
rpm www.rpm.org (only if rpm is to be installed)

Installation on Linux/Unix

Unpacking and Configuration

$ gunzip -c gnade-src-<version>.tar.gz | tar xvf -
$ cd gnade-src-<version>
$ ./configure [ --sampledb=<rdbms> [ native(s) ]

This allows you to specify for which RDBMS product you wish to create a sample data bases and for which RDBMS products you wish to build native bindings. If nothing is given only the ODBC based parts will be build.

The following RDBMS prducts are supported.

  • mimer - MimerSQL
  • postgres - PostgreSQL
  • mysql - MySQL
  • oracle - Oracle 8i lite

If the value is omitted because your data base product is not listed,, all subsequent steps regarding the data base installation may be skipped and you have to install the test database manually.

Installation of the Database

Depending on the installation of the data base you have specified in the configure script command, you have to execute the following step either by using a DBA account our you may use your own user account

$ su ..dba..
$ gmake createuser

After the database and the database user has been configured, the ODBC interface has to be configured. The directory ./samples/sample_db contains sample files for the unixODBC driver manager. The files odbc.ini.sample odbcinst.ini.sample have to be copied to /etc/odbc.ini and /etc/odbcinst.ini.sample.

Compiling an testing

After the creation of the data base user, the final build may be done by:

$ gmake

Test code is located in the directory ./samples. In order to test the functionality of the ODBC interface use the examples in ./odbc or ./esql.

Systemwide Installation

In order to install the build products on your system login as root and execute the following command in the installation directory of this package:

make install

The makefile will run a script which installs all components on your system that they are available to other users as well. The target directories are specified in the etc/site.config file.

Installation of the RPM packages

The installation of the executable package done by executing the following command:

rpm -ivh gnade-1.4.0-4.i686.rpm.

This will install the production results at the following places in the filesystem:

libraries - /usr/lib/libgnade*
documentation - /usr/share/doc/gnade-1.4.0
binaries - /usr/bin

Since this is the first rpm release no deinstallation has to be done.

Contrib Tool Installation

The GNADE project provides tools which are add on packages to the GNADE source packages. The following tools are installable with this distribution:

  • GSQL Version 0.7 or greater

For the installation please follow the procedure below after you have installed the GNADE source release.

  • change into the contrib directory
  • gunzip -c file.tar.gz | tar xvf -
  • Add the previously created directory to the file packages in the contrib directory
  • make

In order to install the tool run as root in the installation directory of GNADE the command:

make install

Since the installation procedure installs also the GNADE release ensure that the current status is usable for systemwide installation.

If it does not work

If this installation procedure fails you may use the Makefile in the directory ./win32. This will require some manual adoptions but it is a starting point.

In any case if you encounter a problem please contact the GNADE team asap.

Installation on Windows NT

For window users a zip file is provided. In order to install perform the following steps:

> unzip gnade-src-<version>.zip
> cd gnade-src-<version>/win32
> make 

Please note, this works with or without Cygwin installed.

Note that the Windows distribution of GNAT is in two parts; the standard GNAT tools in gnat-3.14p-nt.exe and the extra Windows tools and libraries in gnatwin-3.14p.exe. Both must be installed.


$Id: note_1.4.1.html,v 1.2 2002/12/29 08:45:22 merdmann Exp $
gnade-1.6.2.orig/doc/releasenotes/note_1.4.2.html0000644000175000017500000010022707646316101021216 0ustar lbrentalbrenta GNADE Sotware Release Note
GNat Ada 95 Database Environment - (GNADE)
Version 1.4.2
Editor M.Erdmann
13.4.2003


Abstract

The objective of the GNADE project is to provide various packages which are allowing Ada 95 applications to access relational data base procducts, mainly SQL RDBMS.


Contents

Overview

Legal Stuff
Copyright
Authors
Contributions

Contact
New Features
Supported ODBC / Database Products
Supported native bindings
Supported Platforms & Compilers
Other components

Problems
Fixed Problems
Known Problems
Restrictions

Installation
Installation on linux
Installation on Windows

Overview

New with this Release (1.4.2)

  • Support of the Apple Macintosh OS-X Platform.
  • Bug fixes.
  • ESQL provides a way to redirect the diagnostic outputs
  • A new set of command line tools including import/export tools (see documentation).
  • The location of the GNADE software has been moved to /usr/local/gnade.

Features of the Release:

  • An extensive thin Ada 95 binding to the ODBC interfaces.
  • ISO/92 compliant embedded SQL translator which is able to process Ada 95 packages and files containing only one procedure. The translator creates Ada 95 source files working on top the of the ODBC interface.
  • Installation support for some commonly known data base products (see below).
  • Documentation in HTML, Postscript and PDF format.
  • Native Ada 95 bindings for MySQL, PostgreSQL and the Oracle call interface
  • GNU specific include clause which allows to access the ODBC handles via embedded SQL. This allows to mix embedded SQL and low level ODBC programing in a single source (see chapter in documentation).
  • DECLARE TABLE construct may be used to generate parts of the schema files (-schema option).
  • Support of embedded SQL based on the ISO/92 standard.
  • Support of MySQL with MS ODBC Drivers on Windows 95
  • Unicode support on the ODBC interface.
  • The connection clause has been extended by the ON clause in order to intercept typical connection errors and to define a reaction on ESQL level as shown below: CONNECT [ ON [COMMUNICATION|AUTHORIZATION|OTHER] ERROR [RAISE|GOTO|DO] <target> ]
  • A new GNADE implemenation defined data types as VARCHAR and VARBINARY. For details please refere to the documentation and the example attachment.gpq in samples/esql.
  • The esql translator contains a small scale variable substituation which makes gnatprep not nessesary for simple substitution jobs.
  • The experimental Ada Database Connectivity (ADBC) - API. The idea of this interface is to provide a binding which makes application relativly independant of the unterlying data base. The interface is highly experimental (refer to http://gnade.sourceforge.net/ado.html)

This release of the GNADE project is intended for building with GNAT (the GNU Ada compiler) on the platforms Linux, Solaris and Windows NT/95/2000.

Legal Stuff

License and Copyright

The GNU Public License (GPL) applies with the following extension to all components of this release

As a special exception, if other files instantiate generics from GNADE Ada units, or you link GNADE Ada units or libraries with other files to produce an executable, these units or libraries do not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.

The documentation has been put under the Free GNU Documentation License.

Authors

The authors and copyright holders of the GNADE project are:

Jürgen Pfeifer juergen.pfeifer@gmx.net
Michael Erdmann Michael.Erdmann@snafu.de
Sune Falck sunef@hem.passagen.se
Julio Cano julius_bip@yahoo.com
Dimitry Anisimikov anisimkov@yahoo.com
François Fabien fr.fabien@infonie.fr
Stephen Leake stephen_leake@acm.org

Contributions

Special regards to the following persons which have contributed to the project:

Pascal Obry p.obry@wanadoo.fr
James Hopper jhopper@woh.rr.com
Vasile V. Alaiba alaiba@ozland.ro

Contact

Bug Reports http://sourceforge.net/projects/gnade M.Erdmann
GNADE Discussions http://lists.sourceforge.net/lists/listinfo/gnade-develop M.Erdmann
Project Page http://gnade.sourceforge.net/
http://sourceforge.net/projects/gnade
M.Erdmann
Dev. Coordination Michael.Erdmann@snafu.de Michael Erdmann

New Features

Feature Req, Short Description Version Status
540161 Exception in statements 1.3 complete
552327 Support of gnat 3.14 1.3.3 complete
563921 Explicit Database Connection 1.3.4b complete
590779 Preprocessor invokation 1.3.7 complete
591707 pkg-config support 1.3.7a complete (see Notes)
688243 Support of OS/X 1.4.2 complete

Note 1- If okg-config is found on a system, the systemwide installation script will install the package descriptor in the path which is given in the file etc/config.site:

site_pkgconfig_path=<your path>

If nothing is given /usr/local/lib/pkgconfig is assumed.

Supported ODBC and Database Products

Even the GNADE project except for the native data base bindings is expected to work with all ODBC compliant data base products. The following products are known to work with GNADE assuming, that you are using the correct driver manager.

Component Description Version OS Distribution/Source of the release
PostgreSQL PostgreSQL Database 7.0.3
7.2
Linux - Redhat 7.0
Linux - SuSe 7.0 Solaris
Linux - Debian 2.2, 3.0
Windows NT/2000
www.postgresql.org
Mimer Mimer SQL RDBMS 8.2(.4G) Solaris Linux Windows NT www.mimer.com
MySQL MySQL Database MyODBC 3.23.22
2.50.36-1
Linux www.mysql.com
3.23.35a
2.50.36
Windows 2000 www.mysql.com
3.23.47
3.51.02
Windows 98 www.mysql.com
MS SQL Server 7.0 Windows 2000 Microsoft
SQL Server 2000 Windows 2000 Microsoft
Oracle Lite 8i Windows 95 Oracle

The GNADE project installation procedure provides for theses product test data bases. If your data base is not listed below, the GNADE project will be very likely usable but the test data base has to be installed manually.

The following Driver Managerare known to work with this and/or previous releases:

Component Description Version Operating System Comments
unixODBC ODBC Driver Manager 2.2.3 Linux www.unixodbc.org
2.0.5 Solaris 8 www.unixodbc.org
2.1.1-7 Linux Debian www.unixodbc.org
MS ODBC ODBC Driver Manager 3.5.10 Windows 95, 98 Microsoft

The iODBC 3.04 implementation on Solaris seems to have a problem with the handling of cursor states. It should not be used.

Supported native bindings

Database Product Version Comments
PostgreSQL 7.03 Thin binding
MySQL Thick binding
Oracle OCI 8i lite Oracle Call Interface

Other Components

Beside of the ODBC and the native bindings, the project provides add on components as:

  • ADBC- Ada Database Connectivitiy
  • Contributed tools

ADBC

The ADBC interface is a highly experimental package which works on top of PostgreSQL and MySQL. Since the interface is completly unstable it is not recommentded to use this interface in application at the current point in time. Since the interest in the Ada community was quite low it is questionable whether the development of this interface will be continued.

Contributed Tools

Tools are not part of this release. Constributed code is released as separate packages since they do not depend on a certain version of the GNADE environment.

  • gsql - A SQL client

Supported Platforms / Compilers

Compiler Version Operating Systems
GNAT 3.13p Linux, Windows
GNAT 3.14p Linux (Debian, Redhat, SuSe), Solaris 8, Windows
GNAT 3.15p
GNAT 3.15a Win98

Problems

This section contain an overview of known, fixed problems and restrictions (limitations). Please report all errors via the error report system at the source forge project page.

Fixed Problems

Problems reported earlier then 1.2.0 are listed in the release note 1.4.0

Bug Ref. Fixed in Short Description Comments
477766 1.2.0 longblob not correctly handled gnu-db-mysql.adb, gnu-db-mysql.ads
538349 1.3.1 SELECT sum(valeur) incorrect translated esql_parser.adb updated
533949 1.3.1 Firsttime installation with MimerSQL failes gnade.mimer.sql
538350 1.3.1 Null value not handled correctly esql_parser.adb
540160 1.3.1 Wrong cursor state in case of failed que gnu-db-esql_support-odbc.adb
540163 1.3.1 Debug granularity esql_parser.adb
543343 1.3.2 Case sensitve cursors esql_parser.adb
552325 1.3.3 configure fails on Solaris 2.8 configure.in, configure.gues
553343 1.3.3 odbc demo raises Need_Data exception demo.gpq
554383 1.3.3 odbc demo does not return any value odbc bindings
554929 1.3.3 esql moves 'pragma Source_Reference' esql-translator (driver.adb)
557135 1.3.4 make install fails (invalid option -C) A resoable desfault will be assumed.
555169 1.3.4 segmentation fault in SQLSetEnvAttr odbc bindings updated
562994 1.3.4 Gigi Error with Solaris 8 odbc bindings changes
562998 1.3.4 Assert & Debug are not passed to ODBC sharedlib.sh.in, staticlib.sh.in changed
563257 1.3.4a ODBC bindings does not compile on Win 98 gnadevars.sh changed
563259 1.3.4a ODBC shared lib always build makefile updated
563332 1.3.4a gesql insert useless spaces in query esql_parser updated
563769 1.3.4b Subpackages are not evaluated correctly esql_parser updated
565952 1.3.5 Domain Qualification not handled esql_parser updated
565951 1.3.5 SQL Strings are not handled correctly esql_parser updated
566413 1.3.5a static libraries not build for adbc Makefile modified
566414 1.3.5a Useless printouts in gesql esql_parser updated
566429 1.3.5a esql & debugcode not compilable any more esql_parser updated
568396 1.3.6a config.gpq missing MANIFEST updated
567600 1.3.6a gesql translator includes odbc bindings esql_parser updated
567553 1.3.6a FeeBSD build chmod failes makefiles
566635 1.3.6a FreeBSD Makefile Problems (1.3.5a) Makefiles
585539 1.3.7 mysql and prosgresql does not link Makefiles
590569 1.3.7 Default cursor does not work esql_parser.adb, esql_support.odbc
597264 1.3.7a postgreSQL sdk not installed but native Makefiles, autoconf.in, ..
602598 1.3.7a makeliv.ali should be removed from distr staticlib.sh, sharedlib.sh
609204 1.3.7b debian: install failes install.sh
612521 1.3.7d pkg-config contains unbuild natives makefiles, configure.in
640172 1.4.1 odbc example failes to link makefile, configure.in
640171 1.4.1 make clean failes in mysql sample makefiles
637947 1.4.1 sql_standard package missing rpm spec.
637949 1.4.1 SuSe 8.1 installation failes Makefile(s)
637951 1.4.1 rpm build failes on SuSe 8.1 Makefile
637952 1.4.1 Sample database with MimerSQL 8.2.4G mimer.sql
659298 1.4.1 rpm does not contain the *.o and *.ali gnade.spec, rpmfiles.sh
659301 1.4.1 rpm samples are not compilable gnade-config, Makefile
659418 1.4.1 standalone example does not work gnade-config, Makefile
700087 1.4.2 odbc example failes with mimer dynamic.gpq
700088 1.4.2 unixODBC is not preferenced configure.in

Known Problems

Bug Ref. Short Description Comments
411141 Missing ";" for "EXEC SQL DECLARE DB01 D" This problem may be bypassed by putting a semicolon in the source code.

Restrictions

  • The package names of the OCI binding are not yet lined up with the GNADE package hirarchy. This allignment will be done with the next versions. The build process currently creates no test client automatically since the build scripts are only available for windows
  • The VARBINARY data type has only been tested with Mimer SQL.
  • The configuration procedure for Solaris has not been tested completely. If it fails please use the Makefiles in the directory ./win32. These files are known to build a working installation under Solaris.
  • The Object Ada Compiler is known to fail compiling the ODBC bindings because of insufficient compliance to the Ada 95 RM.
  • The compilation of the ODBC bindings is known to fail on a Sun SPARC using GNAT 3.13p (ACT tracking number [8925-002] Gigi abort code 411 on SPARC architectures). This has been fixed mean while but all tests have been done with GNAT 3.14p.
  • The Option -compiler has been added to allow the support of specific of different Ada 95 compilers which has currently no effect.
  • Unicode support is only available begining with UnixODBC version 2.0. The Uncode support does depend on GNAT specific packages
  • Oracle 8i requires the declaration of string hostvariable to be 1 character larger then the domain size, e.g. assuming the size of the domain Ename from the example simple to be 20, the host variables have to be defined as:
    Ename     :   Char (1..21); 
    Dept_Name :   Char (1..21); 
    Location  :   Char (1..21);
  • The automatic installation is not supported in case of Oracle 8i but the installation script is located under samples.

Installation

The GNADE code and the documentation is distributed in the following files:

File Contents
gnade-src-1.4.2.tar.gz Complete GNADE source code distribution GNU compressed tar file
gnade-src-1.4.2.zip Complete GNADE source code distribution as ZIP file.
gnade-1.4.2-xx.src.rpm Source rpm used to build the binary packages
gnade-1.4.2-xx.i686.rpm Linux binaries and executables in RPM format.

The installation of this software requires the following components:

Component Version Origin
gzip 1.2.4 GNU
unzip 5.42 Infozip
zip 2.2 Infozip
tar - GNU or native
autoconf 2.52 GNU
gmake 3.79.1 GNU
gnat 3.14p, 3.13p ACT distribution (ftp://cs.ny.edu/)
gawk 3.0.3 GNU
rpm www.rpm.org (only if rpm is to be installed)

Installation on Linux/Unix

Unpacking and Configuration

$ gunzip -c gnade-src-<version>.tar.gz | tar xvf -
$ cd gnade-src-<version>
$ ./configure [ --sampledb=<rdbms> [ native(s) ]

This allows you to specify for which RDBMS product you wish to create a sample data bases and for which RDBMS products you wish to build native bindings. If nothing is given only the ODBC based parts will be build.

The following RDBMS prducts are supported.

  • mimer - MimerSQL
  • postgres - PostgreSQL
  • mysql - MySQL
  • oracle - Oracle 8i lite

If the value is omitted because your data base product is not listed,, all subsequent steps regarding the data base installation may be skipped and you have to install the test database manually.

Installation of the Database

Depending on the installation of the data base you have specified in the configure script command, you have to execute the following step either by using a DBA account our you may use your own user account

$ su ..dba..
$ gmake createuser

After the database and the database user has been configured, the ODBC interface has to be configured. The directory ./samples/sample_db contains sample files for the unixODBC driver manager. The files odbc.ini.sample odbcinst.ini.sample have to be copied to /etc/odbc.ini and /etc/odbcinst.ini.sample.

Compiling an testing

After the creation of the data base user, the final build may be done by:

$ gmake

Test code is located in the directory ./samples. In order to test the functionality of the ODBC interface use the examples in ./odbc or ./esql.

Systemwide Installation

In order to install the build products on your system login as root and execute the following command in the installation directory of this package:

make install

The makefile will run a script which installs all components on your system that they are available to other users as well. The target directories are specified in the etc/site.config file.

In case of upgrading from 1.4.1 to a higer version please perform the following steps prio to the installation of the package:

cd /usr/lib ; rm libgnade*

cd /usr/bin; rm gesql gnade-config

cd /usr/lib/ada; rm -rf gnade

or if you have installed the rpm package, simply run:

rpm -e <gnade-package>

Include the new location of the GNADE environment both in the PATH variable and in the loader configuration:

In /etc/profile.local add

PATH=$PATH:/usr/local/gnade/bin ; export PATH

In /etc/ld.so.conf add the line /usr/local/gnade/lib and execute

ldconfig -v

Installation of the RPM packages

The installation of the executable package done by executing the following command:

rpm -ivh gnade-1.4.0-4.i686.rpm.

This will install the production results at the following places in the filesystem:

libraries - /usr/lib/libgnade*
documentation - /usr/share/doc/gnade-1.4.0
binaries - /usr/bin

Since this is the first rpm release no deinstallation has to be done.

Contrib Tool Installation

The GNADE project provides tools which are add on packages to the GNADE source packages. The following tools are installable with this distribution:

  • GSQL Version 0.7 or greater

For the installation please follow the procedure below after you have installed the GNADE source release.

  • change into the contrib directory
  • gunzip -c file.tar.gz | tar xvf -
  • Add the previously created directory to the file packages in the contrib directory
  • make

In order to install the tool run as root in the installation directory of GNADE the command:

make install

Since the installation procedure installs also the GNADE release ensure that the current status is usable for systemwide installation.

If it does not work

If this installation procedure fails you may use the Makefile in the directory ./win32. This will require some manual adoptions but it is a starting point.

In any case if you encounter a problem please contact the GNADE team asap.

Installation on Windows NT

For window users a zip file is provided. In order to install perform the following steps:

> unzip gnade-src-<version>.zip
> cd gnade-src-<version>/win32
> make 

Please note, this works with or without Cygwin installed.

Note that the Windows distribution of GNAT is in two parts; the standard GNAT tools in gnat-3.14p-nt.exe and the extra Windows tools and libraries in gnatwin-3.14p.exe. Both must be installed.


$Id: note_1.4.2.html,v 1.3 2003/04/13 17:20:01 merdmann Exp $
gnade-1.6.2.orig/doc/releasenotes/note_1.5.0.html0000644000175000017500000010410607735360034021220 0ustar lbrentalbrenta GNADE Sotware Release Note
GNat Ada 95 Database Environment - (GNADE)
Version 1.5.0
Editor M.Erdmann
27.07.2003


Abstract

The objective of the GNADE project is to provide various packages which are allowing Ada 95 applications to access relational data base procducts, mainly SQL RDBMS.


Contents

Overview

Legal Stuff
Copyright
Authors
Contributions

Contact
New Features
Supported ODBC / Database Products
Supported native bindings
Supported Platforms & Compilers
Other components

Problems
Fixed Problems
Known Problems
Restrictions

Installation
Installation on linux
Installation on Windows

Overview

New with this Release (1.5.0) in adittion to some bug fixes:

  • SQLite bindings added (prerelease)

Features of the Release:

  • An extensive thin Ada 95 binding to the ODBC interfaces.
  • ISO/92 compliant embedded SQL translator which is able to process Ada 95 packages and files containing only one procedure. The translator creates Ada 95 source files working on top the of the ODBC interface.
  • Installation support for some commonly known data base products (see below).
  • Documentation in HTML, Postscript and PDF format.
  • Native Ada 95 bindings for MySQL, PostgreSQL and the Oracle call interface
  • GNU specific include clause which allows to access the ODBC handles via embedded SQL. This allows to mix embedded SQL and low level ODBC programing in a single source (see chapter in documentation).
  • DECLARE TABLE construct may be used to generate parts of the schema files (-schema option).
  • Support of embedded SQL based on the ISO/92 standard.
  • Support of MySQL with MS ODBC Drivers on Windows 95
  • Unicode support on the ODBC interface.
  • The connection clause has been extended by the ON clause in order to intercept typical connection errors and to define a reaction on ESQL level as shown below: CONNECT [ ON [COMMUNICATION|AUTHORIZATION|OTHER] ERROR [RAISE|GOTO|DO] <target> ]
  • A new GNADE implemenation defined data types as VARCHAR and VARBINARY. For details please refere to the documentation and the example attachment.gpq in samples/esql.
  • The esql translator contains a small scale variable substituation which makes gnatprep not nessesary for simple substitution jobs.
  • The experimental Ada Database Connectivity (ADBC) - API. The idea of this interface is to provide a binding which makes application relativly independant of the unterlying data base. The interface is highly experimental (refer to http://gnade.sourceforge.net/ado.html)
  • A set of command line tools including import/export tools (see documentation).

This release of the GNADE project is intended for building with GNAT (the GNU Ada compiler) on the platforms Linux, Solaris and Windows NT/95/2000.

Legal Stuff

License and Copyright

The GNU Public License (GPL) applies with the following extension to all components of this release

As a special exception, if other files instantiate generics from GNADE Ada units, or you link GNADE Ada units or libraries with other files to produce an executable, these units or libraries do not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.

The documentation has been put under the Free GNU Documentation License.

Authors

The authors and copyright holders of the GNADE project are:

Jürgen Pfeifer juergen.pfeifer@gmx.net
Michael Erdmann Michael.Erdmann@snafu.de
Sune Falck sunef@hem.passagen.se
Julio Cano julius_bip@yahoo.com
Dimitry Anisimikov anisimkov@yahoo.com
François Fabien fr.fabien@infonie.fr
Stephen Leake stephen_leake@acm.org
Denis Chalon denis.chalon@itris.fr
Bon Lam c.lam@student.utwente.nl

Contributions

Special regards to the following persons which have contributed to the project:

Pascal Obry p.obry@wanadoo.fr
James Hopper jhopper@woh.rr.com
Vasile V. Alaiba alaiba@ozland.ro
Andreas Almroth andreas@almroth.com

Contact

Bug Reports http://sourceforge.net/projects/gnade M.Erdmann
GNADE Discussions http://lists.sourceforge.net/lists/listinfo/gnade-develop M.Erdmann
Project Page http://gnade.sourceforge.net/
http://sourceforge.net/projects/gnade
M.Erdmann
Dev. Coordination Michael.Erdmann@snafu.de Michael Erdmann

New Features

Feature Req, Short Description Version Status
540161 Exception in statements 1.3 complete
552327 Support of gnat 3.14 1.3.3 complete
563921 Explicit Database Connection 1.3.4b complete
590779 Preprocessor invokation 1.3.7 complete
591707 pkg-config support 1.3.7a complete (see Notes)
688243 Support of OS/X 1.4.2 complete

Note 1- If okg-config is found on a system, the systemwide installation script will install the package descriptor in the path which is given in the file etc/config.site:

site_pkgconfig_path=<your path>

If nothing is given /usr/local/lib/pkgconfig is assumed.

Supported ODBC and Database Products

Even the GNADE project except for the native data base bindings is expected to work with all ODBC compliant data base products. The following products are known to work with GNADE assuming, that you are using the correct driver manager.

Component Description Version OS Distribution/Source of the release
PostgreSQL PostgreSQL Database 7.0.3
7.2
Linux - Redhat 7.0
Linux - SuSe 7.0 Solaris
Linux - Debian 2.2, 3.0
Windows NT/2000
www.postgresql.org
Mimer Mimer SQL RDBMS 8.2(.4G) Solaris Linux Windows NT www.mimer.com
MySQL MySQL Database MyODBC 3.23.22
2.50.36-1
Linux www.mysql.com
3.23.35a
2.50.36
Windows 2000 www.mysql.com
3.23.47
3.51.02
Windows 98 www.mysql.com
MS SQL Server 7.0 Windows 2000 Microsoft
SQL Server 2000 Windows 2000 Microsoft
Oracle Lite 8i Windows 95 Oracle
SQLite SQLite emb. Database 2.8.2-1 Linux www.sqlite.org

The GNADE project installation procedure provides for theses product test data bases. If your data base is not listed below, the GNADE project will be very likely usable but the test data base has to be installed manually.

The following Driver Managerare known to work with this and/or previous releases:

Component Description Version Operating System Comments
unixODBC ODBC Driver Manager 2.2.3 Linux www.unixodbc.org
2.0.5 Solaris 8 www.unixodbc.org
2.1.1-7 Linux Debian www.unixodbc.org
MS ODBC ODBC Driver Manager 3.5.10 Windows 95, 98 Microsoft

The iODBC 3.04 implementation on Solaris seems to have a problem with the handling of cursor states. It should not be used.

Supported native bindings

Database Product Version Comments
PostgreSQL 7.03 Thin binding
MySQL Thick binding
Oracle OCI 8i lite Oracle Call Interface

Other Components

Beside of the ODBC and the native bindings, the project provides add on components as:

  • ADBC- Ada Database Connectivitiy
  • Contributed tools

ADBC

The ADBC interface is a highly experimental package which works on top of PostgreSQL and MySQL. Since the interface is completly unstable it is not recommentded to use this interface in application at the current point in time. Since the interest in the Ada community was quite low it is questionable whether the development of this interface will be continued.

Contributed Tools

Tools are not part of this release. Constributed code is released as separate packages since they do not depend on a certain version of the GNADE environment.

  • gsql - A SQL client

Supported Platforms / Compilers

Compiler Version Operating Systems
GNAT 3.13p Linux, Windows
GNAT 3.14p Linux (Debian, Redhat, SuSe), Solaris 8, Windows
GNAT 3.15p
GNAT 3.15a Win98

Problems

This section contain an overview of known, fixed problems and restrictions (limitations). Please report all errors via the error report system at the source forge project page.

Fixed Problems

Problems reported earlier then 1.2.0 are listed in the release note 1.4.0

Bug Ref. Fixed in Short Description Comments
477766 1.2.0 longblob not correctly handled gnu-db-mysql.adb, gnu-db-mysql.ads
538349 1.3.1 SELECT sum(valeur) incorrect translated esql_parser.adb updated
533949 1.3.1 Firsttime installation with MimerSQL failes gnade.mimer.sql
538350 1.3.1 Null value not handled correctly esql_parser.adb
540160 1.3.1 Wrong cursor state in case of failed que gnu-db-esql_support-odbc.adb
540163 1.3.1 Debug granularity esql_parser.adb
543343 1.3.2 Case sensitve cursors esql_parser.adb
552325 1.3.3 configure fails on Solaris 2.8 configure.in, configure.gues
553343 1.3.3 odbc demo raises Need_Data exception demo.gpq
554383 1.3.3 odbc demo does not return any value odbc bindings
554929 1.3.3 esql moves 'pragma Source_Reference' esql-translator (driver.adb)
557135 1.3.4 make install fails (invalid option -C) A resoable desfault will be assumed.
555169 1.3.4 segmentation fault in SQLSetEnvAttr odbc bindings updated
562994 1.3.4 Gigi Error with Solaris 8 odbc bindings changes
562998 1.3.4 Assert & Debug are not passed to ODBC sharedlib.sh.in, staticlib.sh.in changed
563257 1.3.4a ODBC bindings does not compile on Win 98 gnadevars.sh changed
563259 1.3.4a ODBC shared lib always build makefile updated
563332 1.3.4a gesql insert useless spaces in query esql_parser updated
563769 1.3.4b Subpackages are not evaluated correctly esql_parser updated
565952 1.3.5 Domain Qualification not handled esql_parser updated
565951 1.3.5 SQL Strings are not handled correctly esql_parser updated
566413 1.3.5a static libraries not build for adbc Makefile modified
566414 1.3.5a Useless printouts in gesql esql_parser updated
566429 1.3.5a esql & debugcode not compilable any more esql_parser updated
568396 1.3.6a config.gpq missing MANIFEST updated
567600 1.3.6a gesql translator includes odbc bindings esql_parser updated
567553 1.3.6a FeeBSD build chmod failes makefiles
566635 1.3.6a FreeBSD Makefile Problems (1.3.5a) Makefiles
585539 1.3.7 mysql and prosgresql does not link Makefiles
590569 1.3.7 Default cursor does not work esql_parser.adb, esql_support.odbc
597264 1.3.7a postgreSQL sdk not installed but native Makefiles, autoconf.in, ..
602598 1.3.7a makeliv.ali should be removed from distr staticlib.sh, sharedlib.sh
609204 1.3.7b debian: install failes install.sh
612521 1.3.7d pkg-config contains unbuild natives makefiles, configure.in
640172 1.4.1 odbc example failes to link makefile, configure.in
640171 1.4.1 make clean failes in mysql sample makefiles
637947 1.4.1 sql_standard package missing rpm spec.
637949 1.4.1 SuSe 8.1 installation failes Makefile(s)
637951 1.4.1 rpm build failes on SuSe 8.1 Makefile
637952 1.4.1 Sample database with MimerSQL 8.2.4G mimer.sql
659298 1.4.1 rpm does not contain the *.o and *.ali gnade.spec, rpmfiles.sh
659301 1.4.1 rpm samples are not compilable gnade-config, Makefile
659418 1.4.1 standalone example does not work gnade-config, Makefile
700087 1.4.2 odbc example failes with mimer dynamic.gpq
700088 1.4.2 unixODBC is not preferenced configure.in
724091 1.4.3 Memory leak in MySQL bindings mysql bindings
730626 1.4.3 Cursros not correctly closed esql_support
733462 1.4.3 Close cursor failes in case of insert esql_support
758450 1.4.3a rpm not build MANIFEST file
758452 1.4.3a postgres samples not compilable Makeifle of psotgres sample
758462 1.4.3a rpm failes if oracle bindings are included ./configure script
805896 1.5.0 gnade config creates useless -l gnade-config
813238 1.5.0 odbc.ini and odbcinist.ini nor correctly placed Makefile
813239 1.5.0 make of the adbc sample failes Makefile
813243 1.5.0 snadalone example does not compile Makefile
813615 1.5.0 sqlite sample does not compile correctly Makefile
813617 1.5.0 distribution build for sqlite does not work MANIFEST

Known Problems

Bug Ref. Short Description Comments
411141 Missing ";" for "EXEC SQL DECLARE DB01 D" This problem may be bypassed by putting a semicolon in the source code.

Restrictions

  • The package names of the OCI binding are not yet lined up with the GNADE package hirarchy. This allignment will be done with the next versions. The build process currently creates no test client automatically since the build scripts are only available for windows
  • The VARBINARY data type has only been tested with Mimer SQL.
  • The configuration procedure for Solaris has not been tested completely. If it fails please use the Makefiles in the directory ./win32. These files are known to build a working installation under Solaris.
  • The Object Ada Compiler is known to fail compiling the ODBC bindings because of insufficient compliance to the Ada 95 RM.
  • The compilation of the ODBC bindings is known to fail on a Sun SPARC using GNAT 3.13p (ACT tracking number [8925-002] Gigi abort code 411 on SPARC architectures). This has been fixed mean while but all tests have been done with GNAT 3.14p.
  • The Option -compiler has been added to allow the support of specific of different Ada 95 compilers which has currently no effect.
  • Unicode support is only available begining with UnixODBC version 2.0. The Uncode support does depend on GNAT specific packages
  • Oracle 8i requires the declaration of string hostvariable to be 1 character larger then the domain size, e.g. assuming the size of the domain Ename from the example simple to be 20, the host variables have to be defined as:
    Ename     :   Char (1..21); 
    Dept_Name :   Char (1..21); 
    Location  :   Char (1..21);
  • The automatic installation is not supported in case of Oracle 8i but the installation script is located under samples.

Installation

The GNADE code and the documentation is distributed in the following files:

File Contents
gnade-src-1.4.2.tar.gz Complete GNADE source code distribution GNU compressed tar file
gnade-src-1.4.2.zip Complete GNADE source code distribution as ZIP file.
gnade-1.4.2-xx.src.rpm Source rpm used to build the binary packages
gnade-1.4.2-xx.i686.rpm Linux binaries and executables in RPM format.

The installation of this software requires the following components:

Component Version Origin
gzip 1.2.4 GNU
unzip 5.42 Infozip
zip 2.2 Infozip
tar - GNU or native
autoconf 2.52 GNU
gmake 3.79.1 GNU
gnat 3.14p, 3.13p ACT distribution (ftp://cs.ny.edu/)
gawk 3.0.3 GNU
rpm www.rpm.org (only if rpm is to be installed)

Installation on Linux/Unix

Unpacking and Configuration

$ gunzip -c gnade-src-<version>.tar.gz | tar xvf -
$ cd gnade-src-<version>
$ ./configure [ --sampledb=<rdbms> [ native(s) ]

This allows you to specify for which RDBMS product you wish to create a sample data bases and for which RDBMS products you wish to build native bindings. If nothing is given only the ODBC based parts will be build.

The following RDBMS prducts are supported.

  • mimer - MimerSQL
  • postgres - PostgreSQL
  • mysql - MySQL
  • oracle - Oracle 8i lite

If the value is omitted because your data base product is not listed,, all subsequent steps regarding the data base installation may be skipped and you have to install the test database manually.

Installation of the Database

Depending on the installation of the data base you have specified in the configure script command, you have to execute the following step either by using a DBA account our you may use your own user account

$ su ..dba..
$ gmake createuser

After the database and the database user has been configured, the ODBC interface has to be configured. The directory ./samples/sample_db contains sample files for the unixODBC driver manager. The files odbc.ini.sample odbcinst.ini.sample have to be copied to /etc/odbc.ini and /etc/odbcinst.ini.sample.

Compiling an testing

After the creation of the data base user, the final build may be done by:

$ gmake

Test code is located in the directory ./samples. In order to test the functionality of the ODBC interface use the examples in ./odbc or ./esql.

Systemwide Installation

In order to install the build products on your system login as root and execute the following command in the installation directory of this package:

make install

The makefile will run a script which installs all components on your system that they are available to other users as well. The target directories are specified in the etc/site.config file.

In case of upgrading from 1.4.1 to a higer version please perform the following steps prio to the installation of the package:

cd /usr/lib ; rm libgnade*

cd /usr/bin; rm gesql gnade-config

cd /usr/lib/ada; rm -rf gnade

or if you have installed the rpm package, simply run:

rpm -e <gnade-package>

Include the new location of the GNADE environment both in the PATH variable and in the loader configuration:

In /etc/profile.local add

PATH=$PATH:/usr/local/gnade/bin ; export PATH

In/etc/ld.so.confadd the line /usr/local/gnade/lib and execute

ldconfig -v

Installation of the RPM packages

The installation of the executable package done by executing the following command:

rpm -ivh gnade-1.4.0-4.i686.rpm.

This will install the production results at the following places in the filesystem:

libraries - /usr/lib/libgnade*
documentation - /usr/share/doc/gnade-1.4.0
binaries - /usr/bin

Since this is the first rpm release no deinstallation has to be done.

Contrib Tool Installation

The GNADE project provides tools which are add on packages to the GNADE source packages. The following tools are installable with this distribution:

  • GSQL Version 0.7 or greater

For the installation please follow the procedure below after you have installed the GNADE source release.

  • change into the contrib directory
  • gunzip -c file.tar.gz | tar xvf -
  • Add the previously created directory to the file packages in the contrib directory
  • make

In order to install the tool run as root in the installation directory of GNADE the command:

make install

Since the installation procedure installs also the GNADE release ensure that the current status is usable for systemwide installation.

If it does not work

If this installation procedure fails you may use the Makefile in the directory ./win32. This will require some manual adoptions but it is a starting point.

In any case if you encounter a problem please contact the GNADE team asap.

Installation on Windows NT

For window users a zip file is provided. In order to install perform the following steps:

> unzip gnade-src-<version>.zip
> cd gnade-src-<version>/win32
> make 

Please note, this works with or without Cygwin installed.

Note that the Windows distribution of GNAT is in two parts; the standard GNAT tools in gnat-3.14p-nt.exe and the extra Windows tools and libraries in gnatwin-3.14p.exe. Both must be installed.


$Id: note_1.5.0.html,v 1.2 2003/09/27 19:08:12 merdmann Exp $
gnade-1.6.2.orig/doc/releasenotes/note_1.5.1.html0000644000175000017500000010657610023337645021232 0ustar lbrentalbrenta GNADE Sotware Release Note
GNat Ada 95 Database Environment - (GNADE)
Version 1.5.1
Editor M.Erdmann
9.3.2004


Abstract

The objective of the GNADE project is to provide various packages which are allowing Ada 95 applications to access relational data base procducts, mainly SQL RDBMS.


Contents

Overview

Legal Stuff
Copyright
Authors
Contributions

Contact
New Features
Supported ODBC / Database Products
Supported native bindings
Supported Platforms & Compilers
Other components

Problems
Fixed Problems
Known Problems
Restrictions

Installation
Installation on linux
Installation on Windows

Overview

This release provides the first time a common build procedure for windows and *unix systems. Additionaly the use of the GPS system of ACT.com has been taken into account, which means for each component a gps project files has been created.

Features of the Release:

  • An extensive thin Ada 95 binding to the ODBC interfaces.
  • ISO/92 compliant embedded SQL translator which is able to process Ada 95 packages and files containing only one procedure. The translator creates Ada 95 source files working on top the of the ODBC interface.
  • Installation support for some commonly known data base products (see below).
  • Documentation in HTML, Postscript and PDF format.
  • Native Ada 95 bindings for MySQL, PostgreSQL and the Oracle call interface
  • GNU specific include clause which allows to access the ODBC handles via embedded SQL. This allows to mix embedded SQL and low level ODBC programing in a single source (see chapter in documentation).
  • DECLARE TABLE construct may be used to generate parts of the schema files (-schema option).
  • Support of embedded SQL based on the ISO/92 standard.
  • Support of MySQL with MS ODBC Drivers on Windows 95
  • Unicode support on the ODBC interface.
  • The connection clause has been extended by the ON clause in order to intercept typical connection errors and to define a reaction on ESQL level as shown below: CONNECT [ ON [COMMUNICATION|AUTHORIZATION|OTHER] ERROR [RAISE|GOTO|DO] <target> ]
  • A new GNADE implemenation defined data types as VARCHAR and VARBINARY. For details please refere to the documentation and the example attachment.gpq in samples/esql.
  • The esql translator contains a small scale variable substituation which makes gnatprep not nessesary for simple substitution jobs.
  • The experimental Ada Database Connectivity (ADBC) - API. The idea of this interface is to provide a binding which makes application relativly independant of the unterlying data base. The interface is highly experimental (refer to http://gnade.sourceforge.net/ado.html)
  • A set of command line tools including import/export tools (see documentation).
  • Experimental SQLite Bindings

This release of the GNADE project is intended for building with GNAT (the GNU Ada compiler) on the platforms Linux, Solaris and Windows NT/95/2000.

Legal Stuff

License and Copyright

The GNU Public License (GPL) applies with the following extension to all components of this release

As a special exception, if other files instantiate generics from GNADE Ada units, or you link GNADE Ada units or libraries with other files to produce an executable, these units or libraries do not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.

The documentation has been put under the Free GNU Documentation License.

Authors

The authors and copyright holders of the GNADE project are:

Jürgen Pfeifer juergen.pfeifer@gmx.net
Michael Erdmann Michael.Erdmann@snafu.de
Sune Falck sunef@hem.passagen.se
Julio Cano julius_bip@yahoo.com
Dimitry Anisimikov anisimkov@yahoo.com
François Fabien fr.fabien@infonie.fr
Stephen Leake stephen_leake@acm.org
Denis Chalon denis.chalon@itris.fr
Bon Lam c.lam@student.utwente.nl

Contributions

Special regards to the following persons which have contributed to the project:

Pascal Obry p.obry@wanadoo.fr
James Hopper jhopper@woh.rr.com
Vasile V. Alaiba alaiba@ozland.ro
Andreas Almroth andreas@almroth.com

Contact

Bug Reports http://sourceforge.net/projects/gnade M.Erdmann
GNADE Discussions http://lists.sourceforge.net/lists/listinfo/gnade-develop M.Erdmann
Project Page http://gnade.sourceforge.net/
http://sourceforge.net/projects/gnade
M.Erdmann
Dev. Coordination Michael.Erdmann@snafu.de Michael Erdmann

New Features

Feature Req, Short Description Version Status
540161 Exception in statements 1.3 complete
552327 Support of gnat 3.14 1.3.3 complete
563921 Explicit Database Connection 1.3.4b complete
590779 Preprocessor invokation 1.3.7 complete
591707 pkg-config support 1.3.7a complete (see Notes)
688243 Support of OS/X 1.4.2 complete

Note 1- If okg-config is found on a system, the systemwide installation script will install the package descriptor in the path which is given in the file etc/config.site:

site_pkgconfig_path=<your path>

If nothing is given /usr/local/lib/pkgconfig is assumed.

Supported ODBC and Database Products

Even the GNADE project except for the native data base bindings is expected to work with all ODBC compliant data base products. The following products are known to work with GNADE assuming, that you are using the correct driver manager.

Component Description Version OS Distribution/Source of the release
PostgreSQL PostgreSQL Database 7.0.3
7.2
Linux - Redhat 7.0
Linux - SuSe 7.0 Solaris
Linux - Debian 2.2, 3.0
Windows NT/2000
www.postgresql.org
Mimer Mimer SQL RDBMS 8.2(.4G) Solaris Linux Windows NT www.mimer.com
MySQL MySQL Database MyODBC 3.23.22
2.50.36-1
Linux www.mysql.com
3.23.35a
2.50.36
Windows 2000 www.mysql.com
3.23.47
3.51.02
Windows 98 www.mysql.com
MS SQL Server 7.0 Windows 2000 Microsoft
SQL Server 2000 Windows 2000 Microsoft
Oracle Lite 8i Windows 95 Oracle
SQLite SQLite emb. Database 2.8.2-1 Linux www.sqlite.org

The GNADE project installation procedure provides for theses product test data bases. If your data base is not listed below, the GNADE project will be very likely usable but the test data base has to be installed manually.

The following Driver Managerare known to work with this and/or previous releases:

Component Description Version Operating System Comments
unixODBC ODBC Driver Manager 2.2.3 Linux www.unixodbc.org
2.0.5 Solaris 8 www.unixodbc.org
2.1.1-7 Linux Debian www.unixodbc.org
MS ODBC ODBC Driver Manager 3.5.10 Windows 95, 98 Microsoft

The iODBC 3.04 implementation on Solaris seems to have a problem with the handling of cursor states. It should not be used.

Supported native bindings

Database Product Version Comments
PostgreSQL 7.03 Thin binding
MySQL Thick binding
Oracle OCI 8i lite Oracle Call Interface
SQLite 2.8.2 and higher

Other Components

Beside of the ODBC and the native bindings, the project provides add on components as:

  • ADBC- Ada Database Connectivitiy
  • Contributed tools

ADBC

The ADBC interface is a highly experimental package which works on top of PostgreSQL and MySQL. Since the interface is completly unstable it is not recommentded to use this interface in application at the current point in time. Since the interest in the Ada community was quite low it is questionable whether the development of this interface will be continued.

Contributed Tools

Tools are not part of this release. Constributed code is released as separate packages since they do not depend on a certain version of the GNADE environment.

  • gsql - A SQL client

Supported Platforms / Compilers

Compiler Version Operating Systems
GNAT 3.13p Linux, Windows
GNAT 3.14p Linux (Debian, Redhat, SuSe), Solaris 8, Windows
GNAT 3.15p
GNAT 3.15a Win98

Problems

This section contain an overview of known, fixed problems and restrictions (limitations). Please report all errors via the error report system at the source forge project page.

Fixed Problems

Problems reported earlier then 1.2.0 are listed in the release note 1.4.0

Bug Ref. Fixed in Short Description Comments
477766 1.2.0 longblob not correctly handled gnu-db-mysql.adb, gnu-db-mysql.ads
538349 1.3.1 SELECT sum(valeur) incorrect translated esql_parser.adb updated
533949 1.3.1 Firsttime installation with MimerSQL failes gnade.mimer.sql
538350 1.3.1 Null value not handled correctly esql_parser.adb
540160 1.3.1 Wrong cursor state in case of failed que gnu-db-esql_support-odbc.adb
540163 1.3.1 Debug granularity esql_parser.adb
543343 1.3.2 Case sensitve cursors esql_parser.adb
552325 1.3.3 configure fails on Solaris 2.8 configure.in, configure.gues
553343 1.3.3 odbc demo raises Need_Data exception demo.gpq
554383 1.3.3 odbc demo does not return any value odbc bindings
554929 1.3.3 esql moves 'pragma Source_Reference' esql-translator (driver.adb)
557135 1.3.4 make install fails (invalid option -C) A resoable desfault will be assumed.
555169 1.3.4 segmentation fault in SQLSetEnvAttr odbc bindings updated
562994 1.3.4 Gigi Error with Solaris 8 odbc bindings changes
562998 1.3.4 Assert & Debug are not passed to ODBC sharedlib.sh.in, staticlib.sh.in changed
563257 1.3.4a ODBC bindings does not compile on Win 98 gnadevars.sh changed
563259 1.3.4a ODBC shared lib always build makefile updated
563332 1.3.4a gesql insert useless spaces in query esql_parser updated
563769 1.3.4b Subpackages are not evaluated correctly esql_parser updated
565952 1.3.5 Domain Qualification not handled esql_parser updated
565951 1.3.5 SQL Strings are not handled correctly esql_parser updated
566413 1.3.5a static libraries not build for adbc Makefile modified
566414 1.3.5a Useless printouts in gesql esql_parser updated
566429 1.3.5a esql & debugcode not compilable any more esql_parser updated
568396 1.3.6a config.gpq missing MANIFEST updated
567600 1.3.6a gesql translator includes odbc bindings esql_parser updated
567553 1.3.6a FeeBSD build chmod failes makefiles
566635 1.3.6a FreeBSD Makefile Problems (1.3.5a) Makefiles
585539 1.3.7 mysql and prosgresql does not link Makefiles
590569 1.3.7 Default cursor does not work esql_parser.adb, esql_support.odbc
597264 1.3.7a postgreSQL sdk not installed but native Makefiles, autoconf.in, ..
602598 1.3.7a makeliv.ali should be removed from distr staticlib.sh, sharedlib.sh
609204 1.3.7b debian: install failes install.sh
612521 1.3.7d pkg-config contains unbuild natives makefiles, configure.in
640172 1.4.1 odbc example failes to link makefile, configure.in
640171 1.4.1 make clean failes in mysql sample makefiles
637947 1.4.1 sql_standard package missing rpm spec.
637949 1.4.1 SuSe 8.1 installation failes Makefile(s)
637951 1.4.1 rpm build failes on SuSe 8.1 Makefile
637952 1.4.1 Sample database with MimerSQL 8.2.4G mimer.sql
659298 1.4.1 rpm does not contain the *.o and *.ali gnade.spec, rpmfiles.sh
659301 1.4.1 rpm samples are not compilable gnade-config, Makefile
659418 1.4.1 standalone example does not work gnade-config, Makefile
700087 1.4.2 odbc example failes with mimer dynamic.gpq
700088 1.4.2 unixODBC is not preferenced configure.in
724091 1.4.3 Memory leak in MySQL bindings mysql bindings
730626 1.4.3 Cursros not correctly closed esql_support
733462 1.4.3 Close cursor failes in case of insert esql_support
758450 1.4.3a rpm not build MANIFEST file
758452 1.4.3a postgres samples not compilable Makeifle of psotgres sample
758462 1.4.3a rpm failes if oracle bindings are included ./configure script
805896 1.5.0 gnade config creates useless -l gnade-config
813238 1.5.0 odbc.ini and odbcinist.ini nor correctly placed Makefile
813239 1.5.0 make of the adbc sample failes Makefile
813243 1.5.0 snadalone example does not compile Makefile
813615 1.5.0 sqlite sample does not compile correctly Makefile
813617 1.5.0 distribution build for sqlite does not work MANIFEST
805896 1.5.1 gnade config creates useless -l configure
813238 1.5.1 odbc.ini and odbcinist.ini nor correctly placed install
813239 1.5.1 make of the adbc sample failes Makefile
813243 1.5.1 snadalone example does not compile Makefile
813615 1.5.1 sqlite sample does not compile correctly Makefile
813617 1.5.1 distribution build for sqlite does not work MANIFEST
865741 1.5.1 Useless debug inserted esql_parser
865742 1.5.1 Excpetion message not shown esql_parser

Known Problems

Bug Ref. Short Description Comments
411141 Missing ";" for "EXEC SQL DECLARE DB01 D" This problem may be bypassed by putting a semicolon in the source code.

Restrictions

  • The package names of the OCI binding are not yet lined up with the GNADE package hirarchy. This allignment will be done with the next versions. The build process currently creates no test client automatically since the build scripts are only available for windows
  • The VARBINARY data type has only been tested with Mimer SQL.
  • The configuration procedure for Solaris has not been tested completely. If it fails please use the Makefiles in the directory ./win32. These files are known to build a working installation under Solaris.
  • The Object Ada Compiler is known to fail compiling the ODBC bindings because of insufficient compliance to the Ada 95 RM.
  • The compilation of the ODBC bindings is known to fail on a Sun SPARC using GNAT 3.13p (ACT tracking number [8925-002] Gigi abort code 411 on SPARC architectures). This has been fixed mean while but all tests have been done with GNAT 3.14p.
  • The Option -compiler has been added to allow the support of specific of different Ada 95 compilers which has currently no effect.
  • Unicode support is only available begining with UnixODBC version 2.0. The Uncode support does depend on GNAT specific packages
  • Oracle 8i requires the declaration of string hostvariable to be 1 character larger then the domain size, e.g. assuming the size of the domain Ename from the example simple to be 20, the host variables have to be defined as:
    Ename     :   Char (1..21); 
    Dept_Name :   Char (1..21); 
    Location  :   Char (1..21);
  • The automatic installation is not supported in case of Oracle 8i but the installation script is located under samples.

Installation

The GNADE code and the documentation is distributed in the following files:

File Contents
gnade-src-X.Y.Z.tar.gz Complete GNADE source code distribution GNU compressed tar file
gnade-src-X.Y:Z.zip Complete GNADE source code distribution as ZIP file.
gnade-X.Y.Z-xx.src.rpm Source rpm used to build the binary packages
gnade-X.Y.Z-xx.i686.rpm Linux binaries and executables in RPM format.

The installation of this software requires the following components:

Component Version Origin
gzip 1.2.4 GNU
unzip 5.42 Infozip
zip 2.2 Infozip
tar - GNU or native
autoconf 2.52 GNU
gmake 3.79.1 GNU
gnat 3.14p, 3.13p ACT distribution (ftp://cs.ny.edu/)
gawk 3.0.3 GNU
rpm www.rpm.org (only if rpm is to be installed)

Installation on Linux/Unix

Unpacking and Configuration

$ gunzip -c gnade-src-<version>.tar.gz | tar xvf -
$ cd gnade-src-<version>
$ ./configure [ --sampledb=<rdbms> [ native(s) ]

This allows you to specify for which RDBMS product you wish to create a sample data bases and for which RDBMS products you wish to build native bindings. If nothing is given only the ODBC based parts will be build.

The following RDBMS prducts are supported.

  • mimer - MimerSQL
  • postgres - PostgreSQL
  • mysql - MySQL
  • oracle - Oracle 8i lite

If the value is omitted because your data base product is not listed,, all subsequent steps regarding the data base installation may be skipped and you have to install the test database manually.

Installation of the Database

Depending on the installation of the data base you have specified in the configure script command, you have to execute the following step either by using a DBA account our you may use your own user account

$ su ..dba..
$ gmake createuser

After the database and the database user has been configured, the ODBC interface has to be configured. The directory ./samples/sample_db contains sample files for the unixODBC driver manager. The files odbc.ini.sample odbcinst.ini.sample have to be copied to /etc/odbc.ini and /etc/odbcinst.ini.sample.

Compiling an testing

After the creation of the data base user, the final build may be done by:

$ gmake

Test code is located in the directory ./samples. In order to test the functionality of the ODBC interface use the examples in ./odbc or ./esql.

Systemwide Installation

In order to install the build products on your system login as root and execute the following command in the installation directory of this package:

make install

The makefile will run a script which installs all components on your system that they are available to other users as well. The target directories are specified in the etc/site.config file.

In case of upgrading from 1.4.1 to a higer version please perform the following steps prio to the installation of the package:

cd /usr/lib ; rm libgnade*

cd /usr/bin; rm gesql gnade-config

cd /usr/lib/ada; rm -rf gnade

or if you have installed the rpm package, simply run:

rpm -e <gnade-package>

Include the new location of the GNADE environment both in the PATH variable and in the loader configuration:

In /etc/profile.local add

PATH=$PATH:/usr/local/gnade/bin ; export PATH

In/etc/ld.so.confadd the line /usr/local/gnade/lib and execute

ldconfig -v

Installation of the RPM packages

The installation of the executable package done by executing the following command:

rpm -ivh gnade-1.4.0-4.i686.rpm.

This will install the production results at the following places in the filesystem:

libraries - /usr/lib/libgnade*
documentation - /usr/share/doc/gnade-1.4.0
binaries - /usr/bin

Since this is the first rpm release no deinstallation has to be done.

Contrib Tool Installation

The GNADE project provides tools which are add on packages to the GNADE source packages. The following tools are installable with this distribution:

  • GSQL Version 0.7 or greater

For the installation please follow the procedure below after you have installed the GNADE source release.

  • change into the contrib directory
  • gunzip -c file.tar.gz | tar xvf -
  • Add the previously created directory to the file packages in the contrib directory
  • make

In order to install the tool run as root in the installation directory of GNADE the command:

make install

Since the installation procedure installs also the GNADE release ensure that the current status is usable for systemwide installation.

If it does not work

If this installation procedure fails you may use the Makefile in the directory ./win32. This will require some manual adoptions but it is a starting point.

In any case if you encounter a problem please contact the GNADE team asap.

Installation on Windows NT

For window users a zip file is provided. In order to install perform the following steps:

> unzip gnade-src-<version>.zip
> cd gnade-src-<version>/win32
> make 

Please note, this works with or without Cygwin installed.

Note that the Windows distribution of GNAT is in two parts; the standard GNAT tools in gnat-3.14p-nt.exe and the extra Windows tools and libraries in gnatwin-3.14p.exe. Both must be installed.


$Id: note_1.5.1.html,v 1.3 2004/03/09 12:59:17 merdmann Exp $
gnade-1.6.2.orig/doc/releasenotes/note_1.5.2.html0000644000175000017500000011337010025624475021223 0ustar lbrentalbrenta GNADE Sotware Release Note
GNat Ada 95 Database Environment - (GNADE)
Version 1.5.2
Editor M.Erdmann
15.3.2004


Abstract

The objective of the GNADE project is to provide various packages which are allowing Ada 95 applications to access relational data base procducts, mainly SQL RDBMS.


Contents

Overview

Legal Stuff
Copyright
Authors
Contributions

Contact
New Features
Supported ODBC / Database Products
Supported native bindings
Supported Platforms & Compilers
Other components

Problems
Fixed Problems
Known Problems
Restrictions

Installation
Installation on linux
Installation on Windows

Overview

This release provides the first time a common build procedure for windows and *unix systems. Additionaly the use of the GPS system of ACT.com has been taken into account, which means for each component a gps project files has been created.

Features of the Release:

  • An extensive thin Ada 95 binding to the ODBC interfaces.
  • ISO/92 compliant embedded SQL translator which is able to process Ada 95 packages and files containing only one procedure. The translator creates Ada 95 source files working on top the of the ODBC interface.
  • Installation support for some commonly known data base products (see below).
  • Documentation in HTML, Postscript and PDF format.
  • Native Ada 95 bindings for MySQL, PostgreSQL and the Oracle call interface
  • GNU specific include clause which allows to access the ODBC handles via embedded SQL. This allows to mix embedded SQL and low level ODBC programing in a single source (see chapter in documentation).
  • DECLARE TABLE construct may be used to generate parts of the schema files (-schema option).
  • Support of embedded SQL based on the ISO/92 standard.
  • Support of MySQL with MS ODBC Drivers on Windows 95
  • Unicode support on the ODBC interface.
  • The connection clause has been extended by the ON clause in order to intercept typical connection errors and to define a reaction on ESQL level as shown below: CONNECT [ ON [COMMUNICATION|AUTHORIZATION|OTHER] ERROR [RAISE|GOTO|DO] <target> ]
  • A new GNADE implemenation defined data types as VARCHAR and VARBINARY. For details please refere to the documentation and the example attachment.gpq in samples/esql.
  • The esql translator contains a small scale variable substituation which makes gnatprep not nessesary for simple substitution jobs.
  • The experimental Ada Database Connectivity (ADBC) - API. The idea of this interface is to provide a binding which makes application relativly independant of the unterlying data base. The interface is highly experimental (refer to http://gnade.sourceforge.net/ado.html)
  • A set of command line tools including import/export tools (see documentation).
  • Experimental SQLite Bindings

This release of the GNADE project is intended for building with GNAT (the GNU Ada compiler) on the platforms Linux, Solaris and Windows NT/95/2000.

Legal Stuff

License and Copyright

The GNU Public License (GPL) applies with the following extension to all components of this release

As a special exception, if other files instantiate generics from GNADE Ada units, or you link GNADE Ada units or libraries with other files to produce an executable, these units or libraries do not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.

The documentation has been put under the Free GNU Documentation License.

Authors

The authors and copyright holders of the GNADE project are:

Jürgen Pfeifer juergen.pfeifer@gmx.net
Michael Erdmann Michael.Erdmann@snafu.de
Sune Falck sunef@hem.passagen.se
Julio Cano julius_bip@yahoo.com
Dimitry Anisimikov anisimkov@yahoo.com
François Fabien fr.fabien@infonie.fr
Stephen Leake stephen_leake@acm.org
Denis Chalon denis.chalon@itris.fr
Bon Lam c.lam@student.utwente.nl

Contributions

Special regards to the following persons which have contributed to the project:

Pascal Obry p.obry@wanadoo.fr
James Hopper jhopper@woh.rr.com
Vasile V. Alaiba alaiba@ozland.ro
Andreas Almroth andreas@almroth.com

Contact

Bug Reports http://sourceforge.net/projects/gnade M.Erdmann
GNADE Discussions http://lists.sourceforge.net/lists/listinfo/gnade-develop M.Erdmann
Project Page http://gnade.sourceforge.net/
http://sourceforge.net/projects/gnade
M.Erdmann
Dev. Coordination Michael.Erdmann@snafu.de Michael Erdmann

New Features

Feature Req, Short Description Version Status
540161 Exception in statements 1.3 complete
552327 Support of gnat 3.14 1.3.3 complete
563921 Explicit Database Connection 1.3.4b complete
590779 Preprocessor invokation 1.3.7 complete
591707 pkg-config support 1.3.7a complete (see Notes)
688243 Support of OS/X 1.4.2 complete

Note 1- If okg-config is found on a system, the systemwide installation script will install the package descriptor in the path which is given in the file etc/config.site:

site_pkgconfig_path=<your path>

If nothing is given /usr/local/lib/pkgconfig is assumed.

Supported ODBC and Database Products

Even the GNADE project except for the native data base bindings is expected to work with all ODBC compliant data base products. The following products are known to work with GNADE assuming, that you are using the correct driver manager.

Component Description Version OS Distribution/Source of the release
PostgreSQL PostgreSQL Database 7.0.3
7.2
Linux - Redhat 7.0
Linux - SuSe 7.0 Solaris
Linux - Debian 2.2, 3.0
Windows NT/2000
www.postgresql.org
Mimer Mimer SQL RDBMS 8.2(.4G) Solaris Linux Windows NT www.mimer.com
9.2
Linux Windows XP www.mysql.com
MySQL MySQL Database MyODBC 3.23.22
2.50.36-1
Linux www.mysql.com
3.23.35a
2.50.36
Windows 2000 www.mysql.com
3.23.47
3.51.02
Windows 98 www.mysql.com
MS SQL Server 7.0 Windows 2000 Microsoft
SQL Server 2000 Windows 2000 Microsoft
Oracle Lite 8i Windows 95 Oracle
SQLite SQLite emb. Database 2.8.2-1 Linux www.sqlite.org

The GNADE project installation procedure provides for theses product test data bases. If your data base is not listed below, the GNADE project will be very likely usable but the test data base has to be installed manually.

The following Driver Managerare known to work with this and/or previous releases:

Component Description Version Operating System Comments
unixODBC ODBC Driver Manager 2.2.3 Linux www.unixodbc.org
2.0.5 Solaris 8 www.unixodbc.org
2.1.1-7 Linux Debian www.unixodbc.org
MS ODBC ODBC Driver Manager 3.5.10 Windows 95, 98 Microsoft

The iODBC 3.04 implementation on Solaris seems to have a problem with the handling of cursor states. It should not be used.

Supported native bindings

Database Product Version Comments
PostgreSQL 7.03 Thin binding
MySQL 4 Thick binding
Oracle OCI 8i lite Oracle Call Interface
SQLite 2.8.2 and higher

Other Components

Beside of the ODBC and the native bindings, the project provides add on components as:

  • ADBC- Ada Database Connectivitiy
  • Contributed tools

ADBC

The ADBC interface is a highly experimental package which works on top of PostgreSQL and MySQL. Since the interface is completly unstable it is not recommentded to use this interface in application at the current point in time. Since the interest in the Ada community was quite low it is questionable whether the development of this interface will be continued.

Contributed Tools

Tools are not part of this release. Constributed code is released as separate packages since they do not depend on a certain version of the GNADE environment.

  • gsql - A SQL client

Supported Platforms / Compilers

Compiler Version Operating Systems
GNAT 3.13p Linux, Windows
GNAT 3.14p Linux (Debian, Redhat, SuSe), Solaris 8, Windows
GNAT 3.15p
GNAT 3.15a Win98

Problems

This section contain an overview of known, fixed problems and restrictions (limitations). Please report all errors via the error report system at the source forge project page.

Fixed Problems

Problems reported earlier then 1.2.0 are listed in the release note 1.4.0

Bug Ref. Fixed in Short Description Comments
477766 1.2.0 longblob not correctly handled gnu-db-mysql.adb, gnu-db-mysql.ads
538349 1.3.1 SELECT sum(valeur) incorrect translated esql_parser.adb updated
533949 1.3.1 Firsttime installation with MimerSQL failes gnade.mimer.sql
538350 1.3.1 Null value not handled correctly esql_parser.adb
540160 1.3.1 Wrong cursor state in case of failed que gnu-db-esql_support-odbc.adb
540163 1.3.1 Debug granularity esql_parser.adb
543343 1.3.2 Case sensitve cursors esql_parser.adb
552325 1.3.3 configure fails on Solaris 2.8 configure.in, configure.gues
553343 1.3.3 odbc demo raises Need_Data exception demo.gpq
554383 1.3.3 odbc demo does not return any value odbc bindings
554929 1.3.3 esql moves 'pragma Source_Reference' esql-translator (driver.adb)
557135 1.3.4 make install fails (invalid option -C) A resoable desfault will be assumed.
555169 1.3.4 segmentation fault in SQLSetEnvAttr odbc bindings updated
562994 1.3.4 Gigi Error with Solaris 8 odbc bindings changes
562998 1.3.4 Assert & Debug are not passed to ODBC sharedlib.sh.in, staticlib.sh.in changed
563257 1.3.4a ODBC bindings does not compile on Win 98 gnadevars.sh changed
563259 1.3.4a ODBC shared lib always build makefile updated
563332 1.3.4a gesql insert useless spaces in query esql_parser updated
563769 1.3.4b Subpackages are not evaluated correctly esql_parser updated
565952 1.3.5 Domain Qualification not handled esql_parser updated
565951 1.3.5 SQL Strings are not handled correctly esql_parser updated
566413 1.3.5a static libraries not build for adbc Makefile modified
566414 1.3.5a Useless printouts in gesql esql_parser updated
566429 1.3.5a esql & debugcode not compilable any more esql_parser updated
568396 1.3.6a config.gpq missing MANIFEST updated
567600 1.3.6a gesql translator includes odbc bindings esql_parser updated
567553 1.3.6a FeeBSD build chmod failes makefiles
566635 1.3.6a FreeBSD Makefile Problems (1.3.5a) Makefiles
585539 1.3.7 mysql and prosgresql does not link Makefiles
590569 1.3.7 Default cursor does not work esql_parser.adb, esql_support.odbc
597264 1.3.7a postgreSQL sdk not installed but native Makefiles, autoconf.in, ..
602598 1.3.7a makeliv.ali should be removed from distr staticlib.sh, sharedlib.sh
609204 1.3.7b debian: install failes install.sh
612521 1.3.7d pkg-config contains unbuild natives makefiles, configure.in
640172 1.4.1 odbc example failes to link makefile, configure.in
640171 1.4.1 make clean failes in mysql sample makefiles
637947 1.4.1 sql_standard package missing rpm spec.
637949 1.4.1 SuSe 8.1 installation failes Makefile(s)
637951 1.4.1 rpm build failes on SuSe 8.1 Makefile
637952 1.4.1 Sample database with MimerSQL 8.2.4G mimer.sql
659298 1.4.1 rpm does not contain the *.o and *.ali gnade.spec, rpmfiles.sh
659301 1.4.1 rpm samples are not compilable gnade-config, Makefile
659418 1.4.1 standalone example does not work gnade-config, Makefile
700087 1.4.2 odbc example failes with mimer dynamic.gpq
700088 1.4.2 unixODBC is not preferenced configure.in
724091 1.4.3 Memory leak in MySQL bindings mysql bindings
730626 1.4.3 Cursros not correctly closed esql_support
733462 1.4.3 Close cursor failes in case of insert esql_support
758450 1.4.3a rpm not build MANIFEST file
758452 1.4.3a postgres samples not compilable Makeifle of psotgres sample
758462 1.4.3a rpm failes if oracle bindings are included ./configure script
805896 1.5.0 gnade config creates useless -l gnade-config
813238 1.5.0 odbc.ini and odbcinist.ini nor correctly placed Makefile
813239 1.5.0 make of the adbc sample failes Makefile
813243 1.5.0 snadalone example does not compile Makefile
813615 1.5.0 sqlite sample does not compile correctly Makefile
813617 1.5.0 distribution build for sqlite does not work MANIFEST
805896 1.5.1 gnade config creates useless -l configure
813238 1.5.1 odbc.ini and odbcinist.ini nor correctly placed install
813239 1.5.1 make of the adbc sample failes Makefile
813243 1.5.1 snadalone example does not compile Makefile
813615 1.5.1 sqlite sample does not compile correctly Makefile
813617 1.5.1 distribution build for sqlite does not work MANIFEST
865741 1.5.1 Useless debug inserted esql_parser
865742 1.5.1 Excpetion message not shown esql_parser
917392 1.5.2 Version switch for gnade-config does not work gnade-config
917382 1.5.2 gnade-config in rpm provides wrong path gnade-config
916707 1.5.2 Architecture code wring on windows platform Makefile
916689 1.5.2 win32 was missing in windows installer gnade.iss
914050 1.5.2 MySQL package does not compile Makefile

Known Problems

Bug Ref. Short Description Comments
411141 Missing ";" for "EXEC SQL DECLARE DB01 D" This problem may be bypassed by putting a semicolon in the source code.

Restrictions

  • The package names of the OCI binding are not yet lined up with the GNADE package hirarchy. The build process currently creates no test client automatically since the build scripts are only available for windows
  • The VARBINARY data type has only been tested with Mimer SQL.
  • The configuration procedure for Solaris has not been tested completely. If it fails please use the Makefiles in the directory ./win32. These files are known to build a working installation under Solaris.
  • The Object Ada Compiler is known to fail compiling the ODBC bindings because of insufficient compliance to the Ada 95 RM.
  • The compilation of the ODBC bindings is known to fail on a Sun SPARC using GNAT 3.13p (ACT tracking number [8925-002] Gigi abort code 411 on SPARC architectures). This has been fixed mean while but all tests have been done with GNAT 3.14p.
  • The Option -compiler has been added to allow the support of specific of different Ada 95 compilers which has currently no effect.
  • Unicode support is only available begining with UnixODBC version 2.0. The Uncode support does depend on GNAT specific packages
  • Oracle 8i requires the declaration of string hostvariable to be 1 character larger then the domain size, e.g. assuming the size of the domain Ename from the example simple to be 20, the host variables have to be defined as:
    Ename     :   Char (1..21); 
    Dept_Name :   Char (1..21); 
    Location  :   Char (1..21);
  • The automatic installation is not supported in case of Oracle 8i but the installation script is located under samples.
  • The windows setup does not provide any documentation yet.
  • The windows setup contains the sample files for all native bindings but the selection of the applicable samples and the installation of the data base needs to be done manually.

Installation

The GNADE code and the documentation is distributed in the following files:

File Contents
gnade-src-X.Y.Z.tar.gz Complete GNADE source code distribution GNU compressed tar file
gnade-src-X.Y:Z.zip Complete GNADE source code distribution as ZIP file.
gnade-X.Y.Z-xx.src.rpm Source rpm used to build the binary packages
gnade-X.Y.Z-xx.i686.rpm Linux binaries and executables in RPM format.
setup.exe Setup for Windows with executables and source code.

The installation of this software requires the following components:

Component Version Origin
gzip 1.2.4 GNU
unzip 5.42 Infozip
zip 2.2 Infozip
tar - GNU or native
autoconf 2.52 GNU
gmake 3.79.1 GNU
gnat 3.14p, 3.13p ACT distribution (ftp://cs.ny.edu/)
gawk 3.0.3 GNU
rpm www.rpm.org (only if rpm is to be installed)
innosetup 4.1.5.1 www.innosetup.org (windows)

Installation on Linux/Unix

Unpacking and Configuration

$ gunzip -c gnade-src-<version>.tar.gz | tar xvf -
$ cd gnade-src-<version>
$ ./configure [ --sampledb=<rdbms> [ native(s) ]

This allows you to specify for which RDBMS product you wish to create a sample data bases and for which RDBMS products you wish to build native bindings. If nothing is given only the ODBC based parts will be build.

The following RDBMS prducts are supported.

  • mimer - MimerSQL
  • postgres - PostgreSQL
  • mysql - MySQL
  • oracle - Oracle 8i lite

If the value is omitted because your data base product is not listed,, all subsequent steps regarding the data base installation may be skipped and you have to install the test database manually.

Installation of the Database

Depending on the installation of the data base you have specified in the configure script command, you have to execute the following step either by using a DBA account our you may use your own user account

$ su ..dba..
$ gmake createuser

After the database and the database user has been configured, the ODBC interface has to be configured. The directory ./samples/sample_db contains sample files for the unixODBC driver manager. The files odbc.ini.sample odbcinst.ini.sample have to be copied to /etc/odbc.ini and /etc/odbcinst.ini.sample.

Compiling an testing

After the creation of the data base user, the final build may be done by:

$ gmake

Test code is located in the directory ./samples. In order to test the functionality of the ODBC interface use the examples in ./odbc or ./esql.

Systemwide Installation

In order to install the build products on your system login as root and execute the following command in the installation directory of this package:

make install

The makefile will run a script which installs all components on your system that they are available to other users as well. The target directories are specified in the etc/site.config file.

In case of upgrading from 1.4.1 to a higer version please perform the following steps prio to the installation of the package:

cd /usr/lib ; rm libgnade*

cd /usr/bin; rm gesql gnade-config

cd /usr/lib/ada; rm -rf gnade

or if you have installed the rpm package, simply run:

rpm -e <gnade-package>

Include the new location of the GNADE environment both in the PATH variable and in the loader configuration:

In /etc/profile.local add

PATH=$PATH/usr/local/gnade/bin ; export PATH

In/etc/ld.so.confadd the line /usr/local/gnade/lib and execute

ldconfig -v

Installation of the RPM packages

The installation of the executable package done by executing the following command:

rpm -ivh gnade-1.4.0-4.i686.rpm.

This will install the production results at the following places in the filesystem:

libraries - /usr/lib/libgnade*
documentation - /usr/share/doc/gnade-1.4.0
binaries - /usr/bin

Since this is the first rpm release no deinstallation has to be done.

Contrib Tool Installation

The GNADE project provides tools which are add on packages to the GNADE source packages. The following tools are installable with this distribution:

  • GSQL Version 0.7 or greater

For the installation please follow the procedure below after you have installed the GNADE source release.

  • change into the contrib directory
  • gunzip -c file.tar.gz | tar xvf -
  • Add the previously created directory to the file packages in the contrib directory
  • make

In order to install the tool run as root in the installation directory of GNADE the command:

make install

Since the installation procedure installs also the GNADE release ensure that the current status is usable for systemwide installation.

If it does not work

If this installation procedure fails you may use the Makefile in the directory ./win32. This will require some manual adoptions but it is a starting point.

In any case if you encounter a problem please contact the GNADE team asap.

Installation on Windows

Download the setup.exe of Version 1.5.2 into any directory and exetute it. Per default the GNADE will be installed on C:\GNADE. After installing you need to add the binary directory to the PATH variable of you system.

The installation provides the following components:

Software Development Kit

The SDK contains all libraries and package files in order to develop odbc based applications by writing Ada 95 code using odbc or by means of the embedded SQL preprocessor gesql.

ODBC Database tools

This is a set of tools which should work with any RDBMS product providing an ODBC interface. It allowes to export/import tables and to execute queries.

GNADE source code
This is the source code of the GNADE distributtion. In order to recompile GNADE change into the directory c:\gnade\source and execute the configure.bat command. Afterwards simply exectue make.

In difference to the Linux implementation all native bindings are build and no automatic database setup is done. In order to build the samples figure out which database products are available and install the apropriate samples from source/samples. In order to do so you need to modify the following configuration variable in make.conf.win32 by removing the not applicable products.

NATIVE_BINDINGS=odbc mysql sqlite postgres oci

After you have changed this files you need to run the configure.bat script.


$Id note_1.5.1.html,v 1.3 2004/03/09 12:59:17 merdmann Exp $
gnade-1.6.2.orig/doc/releasenotes/note_1.5.3.html0000644000175000017500000011033610054072235021214 0ustar lbrentalbrenta GNADE Sotware Release Note
GNat Ada 95 Database Environment - (GNADE)
Version 1.5.3
Editor M.Erdmann
20.5.2004


Abstract

The objective of the GNADE project is to provide various packages which are allowing Ada 95 applications to access relational data base procducts, mainly SQL RDBMS.


Contents

Overview

Legal Stuff
Copyright
Authors
Contributions

Contact
New Features
Supported ODBC / Database Products
Supported native bindings
Supported Platforms & Compilers
Other components

Problems
Fixed Problems
Known Problems
Restrictions

Installation
Installation on linux
Installation on Windows (dos and cygwin)

Overview

This release provides correction fixes for the common build procedure for windows (dos based) and cygwin based and other *nix systems. Additionaly the use of the GPS system of ACT.com has been taken into account, which means for each component a centralized gps project files has been created (see documentation).The blob handling for the mysql bindings has been changed.

Features of the Release:

  • An extensive thin Ada 95 binding to the ODBC interfaces.
  • ISO/92 compliant embedded SQL translator which is able to process Ada 95 packages and files containing only one procedure. The translator creates Ada 95 source files working on top the of the ODBC interface.
  • Installation support for some commonly known data base products (see below).
  • Documentation in HTML, Postscript and PDF format.
  • Native Ada 95 bindings for MySQL, PostgreSQL and the Oracle call interface
  • GNU specific include clause which allows to access the ODBC handles via embedded SQL. This allows to mix embedded SQL and low level ODBC programing in a single source (see chapter in documentation).
  • DECLARE TABLE construct may be used to generate parts of the schema files (-schema option).
  • Support of embedded SQL based on the ISO/92 standard.
  • Support of MySQL with MS ODBC Drivers on Windows 95
  • Unicode support on the ODBC interface.
  • The connection clause has been extended by the ON clause in order to intercept typical connection errors and to define a reaction on ESQL level as shown below: CONNECT [ ON [COMMUNICATION|AUTHORIZATION|OTHER] ERROR [RAISE|GOTO|DO] <target> ]
  • A new GNADE implemenation defined data types as VARCHAR and VARBINARY. For details please refere to the documentation and the example attachment.gpq in samples/esql.
  • The esql translator contains a small scale variable substituation which makes gnatprep not nessesary for simple substitution jobs.
  • The experimental Ada Database Connectivity (ADBC) - API. The idea of this interface is to provide a binding which makes application relativly independant of the unterlying data base. The interface is highly experimental (refer to http://gnade.sourceforge.net/ado.html)
  • A set of command line tools including import/export tools (see documentation).
  • Experimental SQLite Bindings

This release of the GNADE project is intended for building with GNAT (the GNU Ada compiler) on the platforms Linux, Solaris and Windows NT/95/2000.

Legal Stuff

License and Copyright

The GNU Public License (GPL) applies with the following extension to all components of this release

As a special exception, if other files instantiate generics from GNADE Ada units, or you link GNADE Ada units or libraries with other files to produce an executable, these units or libraries do not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.

The documentation has been put under the Free GNU Documentation License.

Authors

The authors and copyright holders of the GNADE project are:

Jürgen Pfeifer juergen.pfeifer@gmx.net
Michael Erdmann Michael.Erdmann@snafu.de
Sune Falck sunef@hem.passagen.se
Julio Cano julius_bip@yahoo.com
Dimitry Anisimikov anisimkov@yahoo.com
François Fabien fr.fabien@infonie.fr
Stephen Leake stephen_leake@acm.org
Denis Chalon denis.chalon@itris.fr
Bon Lam c.lam@student.utwente.nl

Contributions

Special regards to the following persons which have contributed to the project:

Pascal Obry p.obry@wanadoo.fr
James Hopper jhopper@woh.rr.com
Vasile V. Alaiba alaiba@ozland.ro
Andreas Almroth andreas@almroth.com
Patrice Freydiere frett27@free.fr

Contact

Bug Reports http://sourceforge.net/projects/gnade M.Erdmann
GNADE Discussions http://lists.sourceforge.net/lists/listinfo/gnade-develop M.Erdmann
Project Page http://gnade.sourceforge.net/
http://sourceforge.net/projects/gnade
M.Erdmann
Dev. Coordination Michael.Erdmann@snafu.de Michael Erdmann

New Features

Feature Req, Short Description Version Status
540161 Exception in statements 1.3 complete
552327 Support of gnat 3.14 1.3.3 complete
563921 Explicit Database Connection 1.3.4b complete
590779 Preprocessor invokation 1.3.7 complete
591707 pkg-config support 1.3.7a complete (see Notes)
688243 Support of OS/X 1.4.2 complete

Note 1- If pkg-config is found on a system, the systemwide installation script will install the package descriptor in the path which is given in the file etc/config.site:

site_pkgconfig_path=<your path>

If nothing is given /usr/local/lib/pkgconfig is assumed.

Supported ODBC and Database Products

Even the GNADE project except for the native data base bindings is expected to work with all ODBC compliant data base products. The following products are known to work with GNADE assuming, that you are using the correct driver manager.

Component Description Version OS Distribution/Source of the release
PostgreSQL PostgreSQL Database 7.0.3
7.2
Linux - Redhat 7.0
Linux - SuSe 7.0 Solaris
Linux - Debian 2.2, 3.0
Windows NT/2000
www.postgresql.org
Mimer Mimer SQL RDBMS 8.2(.4G) Solaris Linux Windows NT www.mimer.com
9.2
Linux - Suse 9.1
Windows XP
www.mysql.com
MySQL MySQL Database MyODBC 3.23.22
2.50.36-1
Linux www.mysql.com
3.23.35a
2.50.36
Windows 2000 www.mysql.com
3.23.47
3.51.02
Windows 98 www.mysql.com
MS SQL Server 7.0 Windows 2000 Microsoft
SQL Server 2000 Windows 2000 Microsoft
Oracle Lite 8i Windows 95 Oracle
SQLite SQLite emb. Database 2.8.2-1 Linux www.sqlite.org

The GNADE project installation procedure provides for theses product test data bases. If your data base is not listed below, the GNADE project will be very likely usable but the test data base has to be installed manually.

The following Driver Managerare known to work with this and/or previous releases:

Component Description Version Operating System Comments
unixODBC ODBC Driver Manager 2.2.3 Linux www.unixodbc.org
2.0.5 Solaris 8 www.unixodbc.org
2.1.1-7 Linux Debian www.unixodbc.org
MS ODBC ODBC Driver Manager 3.5.10 Windows 95, 98 Microsoft

The iODBC 3.04 implementation on Solaris seems to have a problem with the handling of cursor states. It should not be used.

Supported native bindings

Database Product Version Comments
PostgreSQL 7.03 Thin binding
MySQL 4 Thick binding
Oracle OCI 8i lite Oracle Call Interface
SQLite 2.8.2 and higher

Other Components

Beside of the ODBC and the native bindings, the project provides add on components as:

  • ADBC- Ada Database Connectivitiy
  • Contributed tools

ADBC

The ADBC interface is a highly experimental package which works on top of PostgreSQL and MySQL. Since the interface is completly unstable it is not recommentded to use this interface in application at the current point in time. Since the interest in the Ada community was quite low it is questionable whether the development of this interface will be continued.

Contributed Tools

Tools are not part of this release. Constributed code is released as separate packages since they do not depend on a certain version of the GNADE environment.

  • gsql - A SQL client

Supported Platforms / Compilers

Compiler Version Operating Systems
GNAT 3.13p Linux, Windows
GNAT 3.14p Linux (Debian, Redhat, SuSe), Solaris 8, Windows
GNAT 3.15p
GNAT 3.15a Win98, Windows XP, Linux

Problems

This section contain an overview of known, fixed problems and restrictions (limitations). Please report all errors via the error report system at the source forge project page.

Fixed Problems

Problems reported earlier then 1.5.0 are listed in the release note 1.5.2.

Bug Ref. Fixed in Short Description Comments
805896 1.5.0 gnade config creates useless -l gnade-config
813238 1.5.0 odbc.ini and odbcinist.ini nor correctly placed Makefile
813239 1.5.0 make of the adbc sample failes Makefile
813243 1.5.0 snadalone example does not compile Makefile
813615 1.5.0 sqlite sample does not compile correctly Makefile
813617 1.5.0 distribution build for sqlite does not work MANIFEST
805896 1.5.1 gnade config creates useless -l configure
813238 1.5.1 odbc.ini and odbcinist.ini nor correctly placed install
813239 1.5.1 make of the adbc sample failes Makefile
813243 1.5.1 snadalone example does not compile Makefile
813615 1.5.1 sqlite sample does not compile correctly Makefile
813617 1.5.1 distribution build for sqlite does not work MANIFEST
865741 1.5.1 Useless debug inserted esql_parser
865742 1.5.1 Excpetion message not shown esql_parser
917392 1.5.2 Version switch for gnade-config does not work gnade-config
917382 1.5.2 gnade-config in rpm provides wrong path gnade-config
916707 1.5.2 Architecture code wring on windows platform Makefile
916689 1.5.2 win32 was missing in windows installer gnade.iss
914050 1.5.2 MySQL package does not compile Makefile
916689 1.5.3 win32 was missing in windows installer gnade.iss
916691 1.5.3 Architecture code wring on windows platform configure.bat
917382 1.5.3 gnade-config in rpm provides wrong path gnade-config
917392 1.5.3 Version switch for gnade-config does not work gnade-config
920461 1.5.3 Patch: Native Mysql blob enhancement mysql bindings
914918 1.5.3 Patch: GNADE 1.5.1: All native bindings laways build Makefiles
758949 1.5.3 Patch: GNAT -gnaty Fixes for OCI Binding OCI bindings
920081 1.5.3 standalone project not at the correct place
920080 1.5.3 Standalon project file contains wronmg path
920061 1.5.3 esql error messages do not comply to the standards scanner.adb
919476 1.5.3 SQL tool online help is wrong sql.adb
958852 1.5.3 make dist does not build from dist. file Makefile

Known Problems

Bug Short Description Comments
411141 Missing ";" for "EXEC SQL DECLARE DB01 D" This problem may be bypassed by putting a semicolon in the source code.
958153 gnatlink fails A partial solution has been provided for testing which is already included.
958841 MySQL:Blob handling looses memory A free procedure has been added to the mysql bindings, but this is still not a save way of doing it.

Restrictions

  • The package names of the OCI binding are not yet lined up with the GNADE package hirarchy. The build process currently creates no test client automatically since the build scripts are only available for windows
  • The VARBINARY data type has only been tested with Mimer SQL.
  • The configuration procedure for Solaris has not been tested completely. If it fails please use the Makefiles in the directory ./win32. These files are known to build a working installation under Solaris.
  • The Object Ada Compiler is known to fail compiling the ODBC bindings because of insufficient compliance to the Ada 95 RM.
  • The compilation of the ODBC bindings is known to fail on a Sun SPARC using GNAT 3.13p (ACT tracking number [8925-002] Gigi abort code 411 on SPARC architectures). This has been fixed mean while but all tests have been done with GNAT 3.14p.
  • The Option -compiler has been added to allow the support of specific of different Ada 95 compilers which has currently no effect.
  • Unicode support is only available begining with UnixODBC version 2.0. The Uncode support does depend on GNAT specific packages
  • Oracle 8i requires the declaration of string hostvariable to be 1 character larger then the domain size, e.g. assuming the size of the domain Ename from the example simple to be 20, the host variables have to be defined as:
    Ename     :   Char (1..21); 
    Dept_Name :   Char (1..21); 
    Location  :   Char (1..21);
  • The automatic installation is not supported in case of Oracle 8i but the installation script is located under samples.
  • The windows setup does not provide any documentation yet. Refere to the windows README.
  • The windows setup contains the sample files for all native bindings but the selection of the applicable samples and the installation of the data base needs to be done manually.

Software

The GNADE code and the documentation is distributed in the following archive/package files:

File Contents
gnade-src-X.Y.Z.tar.gz Complete GNADE source code distribution GNU compressed tar file
gnade-src-X.Y:Z.zip Complete GNADE source code distribution as ZIP file.
gnade-X.Y.Z-xx.src.rpm Source rpm used to build the binary packages
gnade-X.Y.Z-xx.i686.rpm Linux binaries and executables in RPM format.
setup-gnade-X.Y.Z.exe Setup for Windows with executables, libraries and source code requiered to clone the windows installment. Please note, that not all components of the source tree are available in this installment.

The software may be obtained from the CVS (pls. refere to the details at the project page) using the tag GNADE_1_5_3.

Installation

The installation of this software requires the following components:

Component Version Origin
gzip 1.2.4 GNU
unzip 5.42 Infozip
zip 2.2 Infozip
tar - GNU or native
autoconf 2.52 GNU
gmake 3.79.1 GNU
gnat 3.14p, 3.13p ACT distribution (ftp://cs.ny.edu/)
gawk 3.0.3 GNU
rpm www.rpm.org (only if rpm is to be installed)
innosetup 4.1.5.1 www.innosetup.org (windows)

Installation on Linux/Unix

Unpacking and Configuration

$ gunzip -c gnade-src-<version>.tar.gz | tar xvf -
$ cd gnade-src-<version>
$ ./configure [ --sampledb=<rdbms> [ native(s) ]

This allows you to specify for which RDBMS product you wish to create a sample data bases and for which RDBMS products you wish to build native bindings. If nothing is given only the ODBC based parts will be build.

The following RDBMS prducts are supported.

  • mimer - MimerSQL
  • postgres - PostgreSQL
  • mysql - MySQL
  • oracle - Oracle 8i lite

If the value is omitted because your data base product is not listed,, all subsequent steps regarding the data base installation may be skipped and you have to install the test database manually.

Installation of the Database

Depending on the installation of the data base you have specified in the configure script command, you have to execute the following step either by using a DBA account our you may use your own user account

$ su ..dba..
$ gmake createuser

After the database and the database user has been configured, the ODBC interface has to be configured. The directory ./samples/sample_db contains sample files for the unixODBC driver manager. The files odbc.ini.sample odbcinst.ini.sample have to be copied to /etc/odbc.ini and /etc/odbcinst.ini.sample.

Compiling an testing

After the creation of the data base user, the final build may be done by:

$ gmake

Test code is located in the directory ./samples. In order to test the functionality of the ODBC interface use the examples in ./odbc or ./esql.

Systemwide Installation

In order to install the build products on your system login as root and execute the following command in the installation directory of this package:

make install

The makefile will run a script which installs all components on your system that they are available to other users as well. The target directories are specified in the etc/site.config file.

In case of upgrading from 1.4.1 to a higer version please perform the following steps prio to the installation of the package:

cd /usr/lib ; rm libgnade*

cd /usr/bin; rm gesql gnade-config

cd /usr/lib/ada; rm -rf gnade

or if you have installed the rpm package, simply run:

rpm -e <gnade-package>

Include the new location of the GNADE environment both in the PATH variable and in the loader configuration:

In /etc/profile.local add

PATH=$PATH/usr/local/gnade/bin ; export PATH

In/etc/ld.so.confadd the line /usr/local/gnade/lib and execute

ldconfig -v

Installation of the RPM packages

The installation of the executable package done by executing the following command:

rpm -ivh gnade-1.4.0-4.i686.rpm.

This will install the production results at the following places in the filesystem:

libraries - /usr/lib/libgnade*
documentation - /usr/share/doc/gnade-1.4.0
binaries - /usr/bin

Since this is the first rpm release no deinstallation has to be done.

Contrib Tool Installation

The GNADE project provides tools which are add on packages to the GNADE source packages. The following tools are installable with this distribution:

  • GSQL Version 0.7 or greater

For the installation please follow the procedure below after you have installed the GNADE source release.

  • change into the contrib directory
  • gunzip -c file.tar.gz | tar xvf -
  • Add the previously created directory to the file packages in the contrib directory
  • make

In order to install the tool run as root in the installation directory of GNADE the command:

make install

Since the installation procedure installs also the GNADE release ensure that the current status is usable for systemwide installation.

Local Development Environment

Generally speeking, the GNADE source code tree is not intended for application development. The applications should always be developed in the user space of the developer or the development team. A sample is provided under samples/standalone.

If it does not work

If this installation procedure fails you may use the Makefile in the directory ./win32. This will require some manual adoptions but it is a starting point.

In any case if you encounter a problem please contact the GNADE team asap.

Installation on Windows (DOS based installation)

Unpacking and configuration

Not applicable, see systemwide installation.

Installation of the Database

The package does not support the automatic installation of a test data base. This needs to be done manually.

Compiling and testing

This is not explicitly requiered. The windows installer provides all libraries, include files and binaries for application development. The sources are part of the installation, but they need not to be compiled.

Systemwide Installation

Download the gnade-setup-X.Y.Z.exe of Version 1.5.3 into any directory and exetute it. Per default the GNADE will be installed on C:\GNADE. After installing the variable GNADE_BASE will be added to your environment. In order to access the executables of GNADE add the following string to your path:

PATH=.....;%GNADE_BASEPATH%/win32-bin;..

The installation provides the following components:

Software Development Kit

The SDK contains all libraries and package files in order to develop odbc based applications by writing Ada 95 code using odbc or by means of the embedded SQL preprocessor gesql.

ODBC Database tools

This is a set of tools which should work with any RDBMS product providing an ODBC interface. It allowes to export/import tables and to execute queries.

GNADE source code
This is the source code of the GNADE distributtion. In order to recompile GNADE change into the directory c:\gnade\source and execute the configure.bat command. Afterwards simply exectue make.

In difference to the Linux implementation all native bindings are build and no automatic database setup is done. In order to build the samples figure out which database products are available and install the apropriate samples from source/samples. In order to do so you need to modify the following configuration variable in make.conf.win32 by removing the not applicable products.

NATIVE_BINDINGS=odbc mysql sqlite postgres oci

After you have changed this files you need to run the configure.bat script.

Projectfiles and GPS

If you intend to use GPS or to include the centralized gnade project file into your project set in you loca environment the following variables:

ADA_PROJECT_PATH=%ADA_PROJECT_PATH%;%GNADE_BASEPATH%

This allows GNAT and GPS to access the GNADE specific project file.

Installation on Windows using Cygwin

The cygwin environment is understood as an GNU build environment, which mean, the same procedures are applicable as in case of the *nix based installations, except for the following limitations:

  • The samples will not be included in the build
  • No automatic installation of the example data base
  • This system wide installation is done are main user of your windows box

Unpacking and Configuration

$ gunzip -c gnade-src-<version>.tar.gz | tar xvf -
$ cd gnade-src-<version>
$ ./configure 

Installation of the Database

Not applicable

Compiling an testing

After the creation of the data base user, the final build may be done by:

$ make

Systemwide Installation

In order to install the build products on your system login as root and execute the following command in the installation directory of this package:

make install

The makefile will run a script which installs all components on your system that they are available to other users as well. The target directories are specified in the etc/site.config file.

During installation a startup script will be installed at /etc/profile.d which adjusts the path in such a way that the executable will be available in the default login environment.

Installation of cygwin packages

This is a todo.

Contrib Tool Installation

Not applicable.

Local Development Environment

The example development environment ist located under examples/standalone.


$Id: note_1.5.3.html,v 1.6 2004/05/23 09:53:33 merdmann Exp $
gnade-1.6.2.orig/doc/releasenotes/note_1.5.3a.html0000644000175000017500000011265410056647212021367 0ustar lbrentalbrenta GNADE Sotware Release Note
GNat Ada 95 Database Environment - (GNADE)
Version 1.5.3a

Editor M.Erdmann
31.5.2004


Abstract

The objective of the GNADE project is to provide various packages which are allowing Ada 95 applications to access relational data base procducts, mainly SQL RDBMS.


Contents

Overview

Legal Stuff
Copyright
Authors
Contributions

Contact
New Features
Supported ODBC / Database Products
Supported native bindings
Supported Platforms & Compilers
Other components

Problems
Fixed Problems
Known Problems
Restrictions

Installation
Installation on linux
Installation on Windows (dos and cygwin)

Overview

This release provides correction fixes for the common build procedure for windows (dos based), cygwin based and other *nix systems and a new version of the mysql bindings.

Additionaly the use of the GPS system of ACT.com has been taken into account, which means for each component a centralized gps project files has been created (see documentation).The blob handling for the mysql bindings has been changed.

Features of the Release:

  • An extensive thin Ada 95 binding to the ODBC interfaces.
  • ISO/92 compliant embedded SQL translator which is able to process Ada 95 packages and files containing only one procedure. The translator creates Ada 95 source files working on top the of the ODBC interface.
  • Installation support for some commonly known data base products (see below).
  • Documentation in HTML, Postscript and PDF format.
  • Native Ada 95 bindings for MySQL, PostgreSQL and the Oracle call interface
  • GNU specific include clause which allows to access the ODBC handles via embedded SQL. This allows to mix embedded SQL and low level ODBC programing in a single source (see chapter in documentation).
  • DECLARE TABLE construct may be used to generate parts of the schema files (-schema option).
  • Support of embedded SQL based on the ISO/92 standard.
  • Support of MySQL with MS ODBC Drivers on Windows 95
  • Unicode support on the ODBC interface.
  • The connection clause has been extended by the ON clause in order to intercept typical connection errors and to define a reaction on ESQL level as shown below: CONNECT [ ON [COMMUNICATION|AUTHORIZATION|OTHER] ERROR [RAISE|GOTO|DO] <target> ]
  • A new GNADE implemenation defined data types as VARCHAR and VARBINARY. For details please refere to the documentation and the example attachment.gpq in samples/esql.
  • The esql translator contains a small scale variable substituation which makes gnatprep not nessesary for simple substitution jobs.
  • The experimental Ada Database Connectivity (ADBC) - API. The idea of this interface is to provide a binding which makes application relativly independant of the unterlying data base. The interface is highly experimental (refer to http://gnade.sourceforge.net/ado.html)
  • A set of command line tools including import/export tools (see documentation).
  • Experimental SQLite Bindings

This release of the GNADE project is intended for building with GNAT (the GNU Ada compiler) on the platforms Linux, Solaris and Windows NT/95/2000.

Legal Stuff

License and Copyright

The GNU Public License (GPL) applies with the following extension to all components of this release

As a special exception, if other files instantiate generics from GNADE Ada units, or you link GNADE Ada units or libraries with other files to produce an executable, these units or libraries do not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.

The documentation has been put under the Free GNU Documentation License.

Authors

The authors and copyright holders of the GNADE project are:

Jürgen Pfeifer juergen.pfeifer@gmx.net
Michael Erdmann Michael.Erdmann@snafu.de
Sune Falck sunef@hem.passagen.se
Julio Cano julius_bip@yahoo.com
Dimitry Anisimikov anisimkov@yahoo.com
François Fabien fr.fabien@infonie.fr
Stephen Leake stephen_leake@acm.org
Denis Chalon denis.chalon@itris.fr
Bon Lam c.lam@student.utwente.nl

Contributions

Special regards to the following persons which have contributed to the project:

Pascal Obry p.obry@wanadoo.fr
James Hopper jhopper@woh.rr.com
Vasile V. Alaiba alaiba@ozland.ro
Andreas Almroth andreas@almroth.com
Patrice Freydiere frett27@free.fr

Contact

Bug Reports http://sourceforge.net/projects/gnade M.Erdmann
GNADE Discussions http://lists.sourceforge.net/lists/listinfo/gnade-develop M.Erdmann
Project Page http://gnade.sourceforge.net/
http://sourceforge.net/projects/gnade
M.Erdmann
Dev. Coordination Michael.Erdmann@snafu.de Michael Erdmann

New Features

Feature Req, Short Description Version Status
540161 Exception in statements 1.3 complete
552327 Support of gnat 3.14 1.3.3 complete
563921 Explicit Database Connection 1.3.4b complete
590779 Preprocessor invokation 1.3.7 complete
591707 pkg-config support 1.3.7a complete (see Notes)
688243 Support of OS/X 1.4.2 complete

Note 1- If pkg-config is found on a system, the systemwide installation script will install the package descriptor in the path which is given in the file etc/config.site:

site_pkgconfig_path=<your path>

If nothing is given /usr/local/lib/pkgconfig is assumed.

Supported ODBC and Database Products

Even the GNADE project except for the native data base bindings is expected to work with all ODBC compliant data base products. The following products are known to work with GNADE assuming, that you are using the correct driver manager.

Component Description Version OS Distribution/Source of the release
PostgreSQL PostgreSQL Database 7.0.3
7.2
Linux - Redhat 7.0
Linux - SuSe 7.0 Solaris
Linux - Debian 2.2, 3.0
Windows NT/2000
www.postgresql.org
Mimer Mimer SQL RDBMS 8.2(.4G) Solaris Linux Windows NT www.mimer.com
9.2
Linux - Suse 9.1
Windows XP
www.mysql.com
MySQL MySQL Database MyODBC 3.23.22
2.50.36-1
Linux www.mysql.com
3.23.35a
2.50.36
Windows 2000 www.mysql.com
3.23.47
3.51.02
Windows 98 www.mysql.com
MS SQL Server 7.0 Windows 2000 Microsoft
SQL Server 2000 Windows 2000 Microsoft
Oracle Lite 8i Windows 95 Oracle
SQLite SQLite emb. Database 2.8.2-1 Linux www.sqlite.org

The GNADE project installation procedure provides for theses product test data bases. If your data base is not listed below, the GNADE project will be very likely usable but the test data base has to be installed manually.

The following Driver Managerare known to work with this and/or previous releases:

Component Description Version Operating System Comments
unixODBC ODBC Driver Manager 2.2.3 Linux www.unixodbc.org
2.0.5 Solaris 8 www.unixodbc.org
2.1.1-7 Linux Debian www.unixodbc.org
MS ODBC ODBC Driver Manager 3.5.10 Windows 95, 98 Microsoft

The iODBC 3.04 implementation on Solaris seems to have a problem with the handling of cursor states. It should not be used.

Supported native bindings

Database Product Version Comments
PostgreSQL 7.03 Thin binding
MySQL 4 Thick binding
Oracle OCI 8i lite Oracle Call Interface
SQLite 2.8.2 and higher

Other Components

Beside of the ODBC and the native bindings, the project provides add on components as:

  • ADBC- Ada Database Connectivitiy
  • Contributed tools

ADBC

The ADBC interface is a highly experimental package which works on top of PostgreSQL and MySQL. Since the interface is completly unstable it is not recommentded to use this interface in application at the current point in time. Since the interest in the Ada community was quite low it is questionable whether the development of this interface will be continued.

Contributed Tools

Tools are not part of this release. Constributed code is released as separate packages since they do not depend on a certain version of the GNADE environment.

  • gsql - A SQL client

Supported Platforms / Compilers

Compiler Version Operating Systems
GNAT 3.13p Linux, Windows
GNAT 3.14p Linux (Debian, Redhat, SuSe), Solaris 8, Windows
GNAT 3.15p
GNAT 3.15a Win98, Windows XP, Linux

Problems

This section contain an overview of known, fixed problems and restrictions (limitations). Please report all errors via the error report system at the source forge project page.

Fixed Problems

Problems reported earlier then 1.5.0 are listed in the release note 1.5.2.

Bug Ref. Fixed in Short Description Comments
805896 1.5.0 gnade config creates useless -l gnade-config
813238 1.5.0 odbc.ini and odbcinist.ini nor correctly placed Makefile
813239 1.5.0 make of the adbc sample failes Makefile
813243 1.5.0 snadalone example does not compile Makefile
813615 1.5.0 sqlite sample does not compile correctly Makefile
813617 1.5.0 distribution build for sqlite does not work MANIFEST
805896 1.5.1 gnade config creates useless -l configure
813238 1.5.1 odbc.ini and odbcinist.ini nor correctly placed install
813239 1.5.1 make of the adbc sample failes Makefile
813243 1.5.1 snadalone example does not compile Makefile
813615 1.5.1 sqlite sample does not compile correctly Makefile
813617 1.5.1 distribution build for sqlite does not work MANIFEST
865741 1.5.1 Useless debug inserted esql_parser
865742 1.5.1 Excpetion message not shown esql_parser
917392 1.5.2 Version switch for gnade-config does not work gnade-config
917382 1.5.2 gnade-config in rpm provides wrong path gnade-config
916707 1.5.2 Architecture code wring on windows platform Makefile
916689 1.5.2 win32 was missing in windows installer gnade.iss
914050 1.5.2 MySQL package does not compile Makefile
916689 1.5.3 win32 was missing in windows installer gnade.iss
916691 1.5.3 Architecture code wring on windows platform configure.bat
917382 1.5.3 gnade-config in rpm provides wrong path gnade-config
917392 1.5.3 Version switch for gnade-config does not work gnade-config
920461 1.5.3 Patch: Native Mysql blob enhancement mysql bindings
914918 1.5.3 Patch: GNADE 1.5.1: All native bindings laways build Makefiles
758949 1.5.3 Patch: GNAT -gnaty Fixes for OCI Binding OCI bindings
920081 1.5.3 standalone project not at the correct place
920080 1.5.3 Standalon project file contains wronmg path
920061 1.5.3 esql error messages do not comply to the standards scanner.adb
919476 1.5.3 SQL tool online help is wrong sql.adb
958153 1.5.3a gnatlink fails refere to fix: 962705
958841 1.5.3a MySQL:Blob handling looses memory Free added
958852 1.5.3a make dist does not build from dist. file Makefile
962705 1.5.3a --no-odbc switch does not work any more configure.in
962706 1.5.3a Samples of not build bindings are created Makefile
962709 1.5.3a procompiled documentation is missing 1.5.3 Makefile
963456 1.5.3a documentation is missing in 1.5.3 tar ball duplicate 962709
963467 1.5.3a clean does not work on linux srcuinst.sh.in
963615 1.5.3a dcumentation is build even openjade it not available configure.in

Known Problems

Bug Short Description Comments
411141 Missing ";" for "EXEC SQL DECLARE DB01 D" This problem may be bypassed by putting a semicolon in the source code.
958153 gnatlink fails A partial solution has been provided for testing which is already included.
958841 MySQL:Blob handling looses memory A free procedure has been added to the mysql bindings, but this is still not a save way of doing it.

Restrictions

  • The package names of the OCI binding are not yet lined up with the GNADE package hirarchy. The build process currently creates no test client automatically since the build scripts are only available for windows
  • The VARBINARY data type has only been tested with Mimer SQL.
  • The configuration procedure for Solaris has not been tested completely. If it fails please use the Makefiles in the directory ./win32. These files are known to build a working installation under Solaris.
  • The Object Ada Compiler is known to fail compiling the ODBC bindings because of insufficient compliance to the Ada 95 RM.
  • The compilation of the ODBC bindings is known to fail on a Sun SPARC using GNAT 3.13p (ACT tracking number [8925-002] Gigi abort code 411 on SPARC architectures). This has been fixed mean while but all tests have been done with GNAT 3.14p.
  • The Option -compiler has been added to allow the support of specific of different Ada 95 compilers which has currently no effect.
  • Unicode support is only available begining with UnixODBC version 2.0. The Uncode support does depend on GNAT specific packages
  • Oracle 8i requires the declaration of string hostvariable to be 1 character larger then the domain size, e.g. assuming the size of the domain Ename from the example simple to be 20, the host variables have to be defined as:
    Ename     :   Char (1..21); 
    Dept_Name :   Char (1..21); 
    Location  :   Char (1..21);
  • The automatic installation is not supported in case of Oracle 8i but the installation script is located under samples.
  • The windows setup does not provide any documentation yet. Refere to the windows README.
  • The windows setup contains the sample files for all native bindings but the selection of the applicable samples and the installation of the data base needs to be done manually.

Software

The GNADE code and the documentation is distributed in the following archive/package files:

File Contents
gnade-src-X.Y.Z.tar.gz Complete GNADE source code distribution GNU compressed tar file
gnade-src-X.Y:Z.zip Complete GNADE source code distribution as ZIP file.
gnade-X.Y.Z-xx.src.rpm Source rpm used to build the binary packages
gnade-X.Y.Z-xx.i686.rpm Linux binaries and executables in RPM format.
setup-gnade-X.Y.Z.exe Setup for Windows with executables, libraries and source code requiered to clone the windows installment. Please note, that not all components of the source tree are available in this installment.

The software may be obtained from the CVS (pls. refere to the details at the project page) using the tag GNADE_1_5_3a.

Installation

The installation of this software requires the following components:

Component Version Origin
gzip 1.2.4 GNU
unzip 5.42 Infozip
zip 2.2 Infozip
tar - GNU or native
autoconf 2.52 GNU
gmake 3.79.1 GNU
gnat 3.14p, 3.13p ACT distribution (ftp://cs.ny.edu/)
gawk 3.0.3 GNU
rpm www.rpm.org (only if rpm is to be installed)
innosetup 4.1.5.1 www.innosetup.org (windows)

Installation on Linux/Unix

Unpacking and Configuration

$ gunzip -c gnade-src-<version>.tar.gz | tar xvf -
$ cd gnade-src-<version>
$ ./configure [ --sampledb=<rdbms> [ native(s) ]

This allows you to specify for which RDBMS product you wish to create a sample data bases and for which RDBMS products you wish to build native bindings. If nothing is given only the ODBC based parts will be build.

The following RDBMS prducts are supported.

  • mimer - MimerSQL
  • postgres - PostgreSQL
  • mysql - MySQL
  • oracle - Oracle 8i lite

If the value is omitted because your data base product is not listed,, all subsequent steps regarding the data base installation may be skipped and you have to install the test database manually.

Installation of the Database

Depending on the installation of the data base you have specified in the configure script command, you have to execute the following step either by using a DBA account our you may use your own user account

$ su ..dba..
$ gmake createuser

After the database and the database user has been configured, the ODBC interface has to be configured. The directory ./samples/sample_db contains sample files for the unixODBC driver manager. The files odbc.ini.sample odbcinst.ini.sample have to be copied to /etc/odbc.ini and /etc/odbcinst.ini.sample.

Compiling an testing

After the creation of the data base user, the final build may be done by:

$ gmake

Test code is located in the directory ./samples. In order to test the functionality of the ODBC interface use the examples in ./odbc or ./esql.

Systemwide Installation

In order to install the build products on your system login as root and execute the following command in the installation directory of this package:

make install

The makefile will run a script which installs all components on your system that they are available to other users as well. The target directories are specified in the etc/site.config file.

In case of upgrading from 1.4.1 to a higer version please perform the following steps prio to the installation of the package:

cd /usr/lib ; rm libgnade*

cd /usr/bin; rm gesql gnade-config

cd /usr/lib/ada; rm -rf gnade

or if you have installed the rpm package, simply run:

rpm -e <gnade-package>

Include the new location of the GNADE environment both in the PATH variable and in the loader configuration:

In /etc/profile.local add

PATH=$PATH/usr/local/gnade/bin ; export PATH

In/etc/ld.so.confadd the line /usr/local/gnade/lib and execute

ldconfig -v

Installation of the RPM packages

The installation of the executable package done by executing the following command:

rpm -ivh gnade-1.4.0-4.i686.rpm.

This will install the production results at the following places in the filesystem:

libraries - /usr/lib/libgnade*
documentation - /usr/share/doc/gnade-1.4.0
binaries - /usr/bin

Since this is the first rpm release no deinstallation has to be done.

Contrib Tool Installation

The GNADE project provides tools which are add on packages to the GNADE source packages. The following tools are installable with this distribution:

  • GSQL Version 0.7 or greater

For the installation please follow the procedure below after you have installed the GNADE source release.

  • change into the contrib directory
  • gunzip -c file.tar.gz | tar xvf -
  • Add the previously created directory to the file packages in the contrib directory
  • make

In order to install the tool run as root in the installation directory of GNADE the command:

make install

Since the installation procedure installs also the GNADE release ensure that the current status is usable for systemwide installation.

Local Development Environment

Generally speeking, the GNADE source code tree is not intended for application development. The applications should always be developed in the user space of the developer or the development team. A sample is provided under samples/standalone.

If it does not work

If this installation procedure fails you may use the Makefile in the directory ./win32. This will require some manual adoptions but it is a starting point.

In any case if you encounter a problem please contact the GNADE team asap.

Installation on Windows (DOS based installation)

Unpacking and configuration

Not applicable, see systemwide installation.

Installation of the Database

The package does not support the automatic installation of a test data base. This needs to be done manually.

Compiling and testing

This is not explicitly requiered. The windows installer provides all libraries, include files and binaries for application development. The sources are part of the installation, but they need not to be compiled.

Systemwide Installation

Download the gnade-setup-X.Y.Z.exe of Version 1.5.3 into any directory and exetute it. Per default the GNADE will be installed on C:\GNADE. After installing the variable GNADE_BASE will be added to your environment. In order to access the executables of GNADE add the following string to your path:

PATH=.....;%GNADE_BASEPATH%/win32-bin;..

The installation provides the following components:

Software Development Kit

The SDK contains all libraries and package files in order to develop odbc based applications by writing Ada 95 code using odbc or by means of the embedded SQL preprocessor gesql.

ODBC Database tools

This is a set of tools which should work with any RDBMS product providing an ODBC interface. It allowes to export/import tables and to execute queries.

GNADE source code
This is the source code of the GNADE distributtion. In order to recompile GNADE change into the directory c:\gnade\source and execute the configure.bat command. Afterwards simply exectue make.

In difference to the Linux implementation all native bindings are build and no automatic database setup is done. In order to build the samples figure out which database products are available and install the apropriate samples from source/samples. In order to do so you need to modify the following configuration variable in make.conf.win32 by removing the not applicable products.

NATIVE_BINDINGS=odbc mysql sqlite postgres oci

After you have changed this files you need to run the configure.bat script.

Projectfiles and GPS

If you intend to use GPS or to include the centralized gnade project file into your project set in you loca environment the following variables:

ADA_PROJECT_PATH=%ADA_PROJECT_PATH%;%GNADE_BASEPATH%

This allows GNAT and GPS to access the GNADE specific project file.

Installation on Windows using Cygwin

The cygwin environment is understood as an GNU build environment, which mean, the same procedures are applicable as in case of the *nix based installations, except for the following limitations:

  • The samples will not be included in the build
  • No automatic installation of the example data base
  • This system wide installation is done are main user of your windows box

Unpacking and Configuration

$ gunzip -c gnade-src-<version>.tar.gz | tar xvf -
$ cd gnade-src-<version>
$ ./configure 

Installation of the Database

Not applicable

Compiling an testing

After the creation of the data base user, the final build may be done by:

$ make

Systemwide Installation

In order to install the build products on your system login as root and execute the following command in the installation directory of this package:

make install

The makefile will run a script which installs all components on your system that they are available to other users as well. The target directories are specified in the etc/site.config file.

During installation a startup script will be installed at /etc/profile.d which adjusts the path in such a way that the executable will be available in the default login environment.

Installation of cygwin packages

This is a todo.

Contrib Tool Installation

Not applicable.

Local Development Environment

The example development environment ist located under examples/standalone.


$Id: note_1.5.3a.html,v 1.3 2004/05/31 15:26:02 merdmann Exp $
gnade-1.6.2.orig/doc/releasenotes/note_1.5.3b.html0000644000175000017500000011364310176727672021403 0ustar lbrentalbrenta GNADE Sotware Release Note
GNat Ada 95 Database Environment - (GNADE)
Version 1.5.3b

Editor M.Erdmann
29.1.2005


Abstract

The objective of the GNADE project is to provide various packages which are allowing Ada 95 applications to access relational data base procducts, mainly SQL RDBMS.


Contents

Overview

Legal Stuff
Copyright
Authors
Contributions

Contact
New Features
Supported ODBC / Database Products
Supported native bindings
Supported Platforms & Compilers
Other components

Problems
Fixed Problems
Known Problems
Restrictions

Installation
Installation on linux
Installation on Windows (dos and cygwin)

Overview

This release provides correction fixes for the common build procedure for windows (dos based), cygwin based and other *nix systems and a new version of the mysql bindings.

Additionaly the use of the GPS system of ACT.com has been taken into account, which means for each component a centralized gps project files has been created (see documentation).The blob handling for the mysql bindings has been changed.

Features of the Release:

  • An extensive thin Ada 95 binding to the ODBC interfaces.
  • ISO/92 compliant embedded SQL translator which is able to process Ada 95 packages and files containing only one procedure. The translator creates Ada 95 source files working on top the of the ODBC interface.
  • Installation support for some commonly known data base products (see below).
  • Documentation in HTML, Postscript and PDF format.
  • Native Ada 95 bindings for MySQL, PostgreSQL and the Oracle call interface
  • GNU specific include clause which allows to access the ODBC handles via embedded SQL. This allows to mix embedded SQL and low level ODBC programing in a single source (see chapter in documentation).
  • DECLARE TABLE construct may be used to generate parts of the schema files (-schema option).
  • Support of embedded SQL based on the ISO/92 standard.
  • Support of MySQL with MS ODBC Drivers on Windows 95
  • Unicode support on the ODBC interface.
  • The connection clause has been extended by the ON clause in order to intercept typical connection errors and to define a reaction on ESQL level as shown below: CONNECT [ ON [COMMUNICATION|AUTHORIZATION|OTHER] ERROR [RAISE|GOTO|DO] <target> ]
  • A new GNADE implemenation defined data types as VARCHAR and VARBINARY. For details please refere to the documentation and the example attachment.gpq in samples/esql.
  • The esql translator contains a small scale variable substituation which makes gnatprep not nessesary for simple substitution jobs.
  • The experimental Ada Database Connectivity (ADBC) - API. The idea of this interface is to provide a binding which makes application relativly independant of the unterlying data base. The interface is highly experimental (refer to http://gnade.sourceforge.net/ado.html)
  • A set of command line tools including import/export tools (see documentation).
  • SQLite bindings. Please note, that there are two versions (sqlite, sqlite3). The authour recommends to use sqlite3. This releases contains both.

This release of the GNADE project is intended for building with GNAT (the GNU Ada compiler) on the platforms Linux, Solaris and Windows NT/95/2000.

Legal Stuff

License and Copyright

The GNU Public License (GPL) applies with the following extension to all components of this release

As a special exception, if other files instantiate generics from GNADE Ada units, or you link GNADE Ada units or libraries with other files to produce an executable, these units or libraries do not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.

The documentation has been put under the Free GNU Documentation License.

Authors

The authors and copyright holders of the GNADE project are:

Jürgen Pfeifer juergen.pfeifer@gmx.net
Michael Erdmann Michael.Erdmann@snafu.de
Sune Falck sunef@hem.passagen.se
Julio Cano julius_bip@yahoo.com
Dimitry Anisimikov anisimkov@yahoo.com
François Fabien fr.fabien@infonie.fr
Stephen Leake stephen_leake@acm.org
Denis Chalon denis.chalon@itris.fr
Bon Lam c.lam@student.utwente.nl

Contributions

Special regards to the following persons which have contributed to the project:

Pascal Obry p.obry@wanadoo.fr
James Hopper jhopper@woh.rr.com
Vasile V. Alaiba alaiba@ozland.ro
Andreas Almroth andreas@almroth.com
Patrice Freydiere frett27@free.fr

Contact

Bug Reports http://sourceforge.net/projects/gnade M.Erdmann
GNADE Discussions http://lists.sourceforge.net/lists/listinfo/gnade-develop M.Erdmann
Project Page http://gnade.sourceforge.net/
http://sourceforge.net/projects/gnade
M.Erdmann
Dev. Coordination Michael.Erdmann@snafu.de Michael Erdmann

New Features

Feature Req, Short Description Version Status
540161 Exception in statements 1.3 complete
552327 Support of gnat 3.14 1.3.3 complete
563921 Explicit Database Connection 1.3.4b complete
590779 Preprocessor invokation 1.3.7 complete
591707 pkg-config support 1.3.7a complete (see Notes)
688243 Support of OS/X 1.4.2 complete

Note 1- If pkg-config is found on a system, the systemwide installation script will install the package descriptor in the path which is given in the file etc/config.site:

site_pkgconfig_path=<your path>

If nothing is given /usr/local/lib/pkgconfig is assumed.

Supported ODBC and Database Products

Even the GNADE project except for the native data base bindings is expected to work with all ODBC compliant data base products. The following products are known to work with GNADE assuming, that you are using the correct driver manager.

Component Description Version OS Distribution/Source of the release
PostgreSQL PostgreSQL Database 7.0.3
7.2
Linux - Redhat 7.0
Linux - SuSe 7.0 Solaris
Linux - Debian 2.2, 3.0
Windows NT/2000
www.postgresql.org
Mimer Mimer SQL RDBMS 8.2(.4G) Solaris Linux Windows NT www.mimer.com
9.2
Linux - Suse 9.1
Windows XP
www.mysql.com
MySQL MySQL Database MyODBC 3.23.22
2.50.36-1
Linux www.mysql.com
3.23.35a
2.50.36
Windows 2000 www.mysql.com
3.23.47
3.51.02
Windows 98 www.mysql.com
MS SQL Server 7.0 Windows 2000 Microsoft
SQL Server 2000 Windows 2000 Microsoft
Oracle Lite 8i Windows 95 Oracle
SQLite SQLite emb. Database 2.8.2-1 Linux www.sqlite.org

The GNADE project installation procedure provides for theses product test data bases. If your data base is not listed below, the GNADE project will be very likely usable but the test data base has to be installed manually.

The following Driver Managerare known to work with this and/or previous releases:

Component Description Version Operating System Comments
unixODBC ODBC Driver Manager 2.2.3 Linux www.unixodbc.org
2.0.5 Solaris 8 www.unixodbc.org
2.1.1-7 Linux Debian www.unixodbc.org
MS ODBC ODBC Driver Manager 3.5.10 Windows 95, 98 Microsoft

The iODBC 3.04 implementation on Solaris seems to have a problem with the handling of cursor states. It should not be used.

Supported native bindings

Database Product Version Comments
PostgreSQL 7.03 Thin binding
MySQL 4 Thick binding
Oracle OCI 8i lite Oracle Call Interface
SQLite 2.8.2 and higher

Other Components

Beside of the ODBC and the native bindings, the project provides add on components as:

  • ADBC- Ada Database Connectivitiy
  • Contributed tools

ADBC

The ADBC interface is a highly experimental package which works on top of PostgreSQL and MySQL. Since the interface is completly unstable it is not recommentded to use this interface in application at the current point in time. Since the interest in the Ada community was quite low it is questionable whether the development of this interface will be continued.

Contributed Tools

Tools are not part of this release. Constributed code is released as separate packages since they do not depend on a certain version of the GNADE environment.

  • gsql - A SQL client

Supported Platforms / Compilers

Compiler Version Operating Systems
GNAT 3.13p Linux, Windows
GNAT 3.14p Linux (Debian, Redhat, SuSe), Solaris 8, Windows
GNAT 3.15p
GNAT 3.15a Win98, Windows XP, Linux

Problems

This section contain an overview of known, fixed problems and restrictions (limitations). Please report all errors via the error report system at the source forge project page.

Fixed Problems

Problems reported earlier then 1.5.0 are listed in the release note 1.5.2.

Bug Ref. Fixed in Short Description Comments
805896 1.5.0 gnade config creates useless -l gnade-config
813238 1.5.0 odbc.ini and odbcinist.ini nor correctly placed Makefile
813239 1.5.0 make of the adbc sample failes Makefile
813243 1.5.0 snadalone example does not compile Makefile
813615 1.5.0 sqlite sample does not compile correctly Makefile
813617 1.5.0 distribution build for sqlite does not work MANIFEST
805896 1.5.1 gnade config creates useless -l configure
813238 1.5.1 odbc.ini and odbcinist.ini nor correctly placed install
813239 1.5.1 make of the adbc sample failes Makefile
813243 1.5.1 snadalone example does not compile Makefile
813615 1.5.1 sqlite sample does not compile correctly Makefile
813617 1.5.1 distribution build for sqlite does not work MANIFEST
865741 1.5.1 Useless debug inserted esql_parser
865742 1.5.1 Excpetion message not shown esql_parser
917392 1.5.2 Version switch for gnade-config does not work gnade-config
917382 1.5.2 gnade-config in rpm provides wrong path gnade-config
916707 1.5.2 Architecture code wring on windows platform Makefile
916689 1.5.2 win32 was missing in windows installer gnade.iss
914050 1.5.2 MySQL package does not compile Makefile
916689 1.5.3 win32 was missing in windows installer gnade.iss
916691 1.5.3 Architecture code wring on windows platform configure.bat
917382 1.5.3 gnade-config in rpm provides wrong path gnade-config
917392 1.5.3 Version switch for gnade-config does not work gnade-config
920461 1.5.3 Patch: Native Mysql blob enhancement mysql bindings
914918 1.5.3 Patch: GNADE 1.5.1: All native bindings laways build Makefiles
758949 1.5.3 Patch: GNAT -gnaty Fixes for OCI Binding OCI bindings
920081 1.5.3 standalone project not at the correct place
920080 1.5.3 Standalon project file contains wronmg path
920061 1.5.3 esql error messages do not comply to the standards scanner.adb
919476 1.5.3 SQL tool online help is wrong sql.adb
958153 1.5.3a gnatlink fails refere to fix: 962705
958841 1.5.3a MySQL:Blob handling looses memory Free added
958852 1.5.3a make dist does not build from dist. file Makefile
962705 1.5.3a --no-odbc switch does not work any more configure.in
962706 1.5.3a Samples of not build bindings are created Makefile
962709 1.5.3a procompiled documentation is missing 1.5.3 Makefile
963456 1.5.3a documentation is missing in 1.5.3 tar ball duplicate 962709
963467 1.5.3a clean does not work on linux srcuinst.sh.in
963615 1.5.3a dcumentation is build even openjade it not available configure.in
958841 1.5.3b MySQL:Blob handling looses memory gnu-db-mysql.ads
1022959 1.5.3b Memory leak in Gnu.Db.Postgresql.Database postgres bindings
1089954 1.5.3b PROGRAM error in Finalize procedure gnu.db.sqlite

Known Problems

Bug Short Description Comments
1009569 Constraint_Error in samples/odbc/demo con_attr Currently unclear, may be the debian release is based on old sources?.

Restrictions

  • The package names of the OCI binding are not yet lined up with the GNADE package hirarchy. The build process currently creates no test client automatically since the build scripts are only available for windows
  • The VARBINARY data type has only been tested with Mimer SQL.
  • The configuration procedure for Solaris has not been tested completely. If it fails please use the Makefiles in the directory ./win32. These files are known to build a working installation under Solaris.
  • The Object Ada Compiler is known to fail compiling the ODBC bindings because of insufficient compliance to the Ada 95 RM.
  • The compilation of the ODBC bindings is known to fail on a Sun SPARC using GNAT 3.13p (ACT tracking number [8925-002] Gigi abort code 411 on SPARC architectures). This has been fixed mean while but all tests have been done with GNAT 3.14p.
  • The Option -compiler has been added to allow the support of specific of different Ada 95 compilers which has currently no effect.
  • Unicode support is only available begining with UnixODBC version 2.0. The Uncode support does depend on GNAT specific packages
  • Oracle 8i requires the declaration of string hostvariable to be 1 character larger then the domain size, e.g. assuming the size of the domain Ename from the example simple to be 20, the host variables have to be defined as:
    Ename     :   Char (1..21); 
    Dept_Name :   Char (1..21); 
    Location  :   Char (1..21);
  • The automatic installation is not supported in case of Oracle 8i but the installation script is located under samples.
  • The windows setup does not provide any documentation yet. Refere to the windows README.
  • The windows setup contains the sample files for all native bindings but the selection of the applicable samples and the installation of the data base needs to be done manually.
  • The sqlite and sqlite3 package are included in the distribution. sqlite3 requires the Ada.Containers extension. This version has not been tested. The configure process will check if the Ada.Containers package is available. If not only the sqlite binding will be included.

Software

The GNADE code and the documentation is distributed in the following archive/package files:

File Contents
gnade-src-X.Y.Z.tar.gz Complete GNADE source code distribution GNU compressed tar file
gnade-src-X.Y:Z.zip Complete GNADE source code distribution as ZIP file.
gnade-X.Y.Z-xx.src.rpm Source rpm used to build the binary packages
gnade-X.Y.Z-xx.i686.rpm Linux binaries and executables in RPM format.
setup-gnade-X.Y.Z.exe Setup for Windows with executables, libraries and source code requiered to clone the windows installment. Please note, that not all components of the source tree are available in this installment.

The software may be obtained from the CVS (pls. refere to the details at the project page) using the tag GNADE_1_5_3a.

Installation

The installation of this software requires the following components:

Component Version Origin
gzip 1.2.4 GNU
unzip 5.42 Infozip
zip 2.2 Infozip
tar - GNU or native
autoconf 2.52 GNU
gmake 3.79.1 GNU
gnat 3.14p, 3.13p ACT distribution (ftp://cs.ny.edu/)
gawk 3.0.3 GNU
rpm www.rpm.org (only if rpm is to be installed)
innosetup 4.1.5.1 www.innosetup.org (windows)

Installation on Linux/Unix

Unpacking and Configuration

$ gunzip -c gnade-src-<version>.tar.gz | tar xvf -
$ cd gnade-src-<version>
$ ./configure [ --sampledb=<rdbms> [ native(s) ]

This allows you to specify for which RDBMS product you wish to create a sample data bases and for which RDBMS products you wish to build native bindings. If nothing is given only the ODBC based parts will be build.

The following RDBMS prducts are supported.

  • mimer - MimerSQL
  • postgres - PostgreSQL
  • mysql - MySQL
  • oracle - Oracle 8i lite

If the value is omitted because your data base product is not listed,, all subsequent steps regarding the data base installation may be skipped and you have to install the test database manually.

Installation of the Database

Depending on the installation of the data base you have specified in the configure script command, you have to execute the following step either by using a DBA account our you may use your own user account

$ su ..dba..
$ gmake createuser

After the database and the database user has been configured, the ODBC interface has to be configured. The directory ./samples/sample_db contains sample files for the unixODBC driver manager. The files odbc.ini.sample odbcinst.ini.sample have to be copied to /etc/odbc.ini and /etc/odbcinst.ini.sample.

Compiling an testing

After the creation of the data base user, the final build may be done by:

$ gmake

Test code is located in the directory ./samples. In order to test the functionality of the ODBC interface use the examples in ./odbc or ./esql.

Systemwide Installation

In order to install the build products on your system login as root and execute the following command in the installation directory of this package:

make install

The makefile will run a script which installs all components on your system that they are available to other users as well. The target directories are specified in the etc/site.config file.

In case of upgrading from 1.4.1 to a higer version please perform the following steps prio to the installation of the package:

cd /usr/lib ; rm libgnade*

cd /usr/bin; rm gesql gnade-config

cd /usr/lib/ada; rm -rf gnade

or if you have installed the rpm package, simply run:

rpm -e <gnade-package>

Include the new location of the GNADE environment both in the PATH variable and in the loader configuration:

In /etc/profile.local add

PATH=$PATH/usr/local/gnade/bin ; export PATH

In/etc/ld.so.confadd the line /usr/local/gnade/lib and execute

ldconfig -v

Installation of the RPM packages

The installation of the executable package done by executing the following command:

rpm -ivh gnade-1.4.0-4.i686.rpm.

This will install the production results at the following places in the filesystem:

libraries - /usr/lib/libgnade*
documentation - /usr/share/doc/gnade-1.4.0
binaries - /usr/bin

Since this is the first rpm release no deinstallation has to be done.

Contrib Tool Installation

The GNADE project provides tools which are add on packages to the GNADE source packages. The following tools are installable with this distribution:

  • GSQL Version 0.7 or greater

For the installation please follow the procedure below after you have installed the GNADE source release.

  • change into the contrib directory
  • gunzip -c file.tar.gz | tar xvf -
  • Add the previously created directory to the file packages in the contrib directory
  • make

In order to install the tool run as root in the installation directory of GNADE the command:

make install

Since the installation procedure installs also the GNADE release ensure that the current status is usable for systemwide installation.

Local Development Environment

Generally speeking, the GNADE source code tree is not intended for application development. The applications should always be developed in the user space of the developer or the development team. A sample is provided under samples/standalone.

If it does not work

If this installation procedure fails you may use the Makefile in the directory ./win32. This will require some manual adoptions but it is a starting point.

In any case if you encounter a problem please contact the GNADE team asap.

Installation on Windows (DOS based installation)

Unpacking and configuration

Not applicable, see systemwide installation.

Installation of the Database

The package does not support the automatic installation of a test data base. This needs to be done manually.

Compiling and testing

This is not explicitly requiered. The windows installer provides all libraries, include files and binaries for application development. The sources are part of the installation, but they need not to be compiled.

Systemwide Installation

Download the gnade-setup-X.Y.Z.exe of Version 1.5.3 into any directory and exetute it. Per default the GNADE will be installed on C:\GNADE. After installing the variable GNADE_BASE will be added to your environment. In order to access the executables of GNADE add the following string to your path:

PATH=.....;%GNADE_BASEPATH%/win32-bin;..

The installation provides the following components:

Software Development Kit

The SDK contains all libraries and package files in order to develop odbc based applications by writing Ada 95 code using odbc or by means of the embedded SQL preprocessor gesql.

ODBC Database tools

This is a set of tools which should work with any RDBMS product providing an ODBC interface. It allowes to export/import tables and to execute queries.

GNADE source code
This is the source code of the GNADE distributtion. In order to recompile GNADE change into the directory c:\gnade\source and execute the configure.bat command. Afterwards simply exectue make.

In difference to the Linux implementation all native bindings are build and no automatic database setup is done. In order to build the samples figure out which database products are available and install the apropriate samples from source/samples. In order to do so you need to modify the following configuration variable in make.conf.win32 by removing the not applicable products.

NATIVE_BINDINGS=odbc mysql sqlite postgres oci

After you have changed this files you need to run the configure.bat script.

Projectfiles and GPS

If you intend to use GPS or to include the centralized gnade project file into your project set in you loca environment the following variables:

ADA_PROJECT_PATH=%ADA_PROJECT_PATH%;%GNADE_BASEPATH%

This allows GNAT and GPS to access the GNADE specific project file.

Installation on Windows using Cygwin

The cygwin environment is understood as an GNU build environment, which mean, the same procedures are applicable as in case of the *nix based installations, except for the following limitations:

  • The samples will not be included in the build
  • No automatic installation of the example data base
  • This system wide installation is done are main user of your windows box

Unpacking and Configuration

$ gunzip -c gnade-src-<version>.tar.gz | tar xvf -
$ cd gnade-src-<version>
$ ./configure 

Installation of the Database

Not applicable

Compiling an testing

After the creation of the data base user, the final build may be done by:

$ make

Systemwide Installation

In order to install the build products on your system login as root and execute the following command in the installation directory of this package:

make install

The makefile will run a script which installs all components on your system that they are available to other users as well. The target directories are specified in the etc/site.config file.

During installation a startup script will be installed at /etc/profile.d which adjusts the path in such a way that the executable will be available in the default login environment.

Installation of cygwin packages

This is a todo.

Contrib Tool Installation

Not applicable.

Local Development Environment

The example development environment ist located under examples/standalone.


$Id: note_1.5.3b.html,v 1.4 2005/01/29 15:46:02 merdmann Exp $
gnade-1.6.2.orig/doc/releasenotes/note_1.5.3c.html0000644000175000017500000011375310212602405021357 0ustar lbrentalbrenta GNADE Sotware Release Note
GNat Ada 95 Database Environment - (GNADE)
Version 1.5.3c

Editor M.Erdmann
6.3.2005


Abstract

The objective of the GNADE project is to provide various packages which are allowing Ada 95 applications to access relational data base procducts, mainly SQL RDBMS.


Contents

Overview

Legal Stuff
Copyright
Authors
Contributions

Contact
New Features
Supported ODBC / Database Products
Supported native bindings
Supported Platforms & Compilers
Other components

Problems
Fixed Problems
Known Problems
Restrictions

Installation
Installation on linux
Installation on Windows (dos and cygwin)

Overview

This release provides correction fixes related to the configuration and installation topics

Features of the Release:

  • An extensive thin Ada 95 binding to the ODBC interfaces.
  • ISO/92 compliant embedded SQL translator which is able to process Ada 95 packages and files containing only one procedure. The translator creates Ada 95 source files working on top the of the ODBC interface.
  • Installation support for some commonly known data base products (see below).
  • Documentation in HTML, Postscript and PDF format.
  • Native Ada 95 bindings for MySQL, PostgreSQL and the Oracle call interface
  • GNU specific include clause which allows to access the ODBC handles via embedded SQL. This allows to mix embedded SQL and low level ODBC programing in a single source (see chapter in documentation).
  • DECLARE TABLE construct may be used to generate parts of the schema files (-schema option).
  • Support of embedded SQL based on the ISO/92 standard.
  • Support of MySQL with MS ODBC Drivers on Windows 95
  • Unicode support on the ODBC interface.
  • The connection clause has been extended by the ON clause in order to intercept typical connection errors and to define a reaction on ESQL level as shown below: CONNECT [ ON [COMMUNICATION|AUTHORIZATION|OTHER] ERROR [RAISE|GOTO|DO] <target> ]
  • A new GNADE implemenation defined data types as VARCHAR and VARBINARY. For details please refere to the documentation and the example attachment.gpq in samples/esql.
  • The esql translator contains a small scale variable substituation which makes gnatprep not nessesary for simple substitution jobs.
  • The experimental Ada Database Connectivity (ADBC) - API. The idea of this interface is to provide a binding which makes application relativly independant of the unterlying data base. The interface is highly experimental (refer to http://gnade.sourceforge.net/ado.html)
  • A set of command line tools including import/export tools (see documentation).
  • SQLite bindings. Please note, that there are two versions (sqlite, sqlite3). The authour recommends to use sqlite3. This releases contains both.

This release of the GNADE project is intended for building with GNAT (the GNU Ada compiler) on the platforms Linux, Solaris and Windows NT/95/2000.

Legal Stuff

License and Copyright

The GNU Public License (GPL) applies with the following extension to all components of this release

As a special exception, if other files instantiate generics from GNADE Ada units, or you link GNADE Ada units or libraries with other files to produce an executable, these units or libraries do not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.

The documentation has been put under the Free GNU Documentation License.

Authors

The authors and copyright holders of the GNADE project are:

Jürgen Pfeifer juergen.pfeifer@gmx.net
Michael Erdmann Michael.Erdmann@snafu.de
Sune Falck sunef@hem.passagen.se
Julio Cano julius_bip@yahoo.com
Dimitry Anisimikov anisimkov@yahoo.com
François Fabien fr.fabien@infonie.fr
Stephen Leake stephen_leake@acm.org
Denis Chalon denis.chalon@itris.fr
Bon Lam c.lam@student.utwente.nl

Contributions

Special regards to the following persons which have contributed to the project:

Pascal Obry p.obry@wanadoo.fr
James Hopper jhopper@woh.rr.com
Vasile V. Alaiba alaiba@ozland.ro
Andreas Almroth andreas@almroth.com
Patrice Freydiere frett27@free.fr

Contact

Bug Reports http://sourceforge.net/projects/gnade M.Erdmann
GNADE Discussions http://lists.sourceforge.net/lists/listinfo/gnade-develop M.Erdmann
Project Page http://gnade.sourceforge.net/
http://sourceforge.net/projects/gnade
M.Erdmann
Dev. Coordination Michael.Erdmann@snafu.de Michael Erdmann

New Features

Feature Req, Short Description Version Status
540161 Exception in statements 1.3 complete
552327 Support of gnat 3.14 1.3.3 complete
563921 Explicit Database Connection 1.3.4b complete
590779 Preprocessor invokation 1.3.7 complete
591707 pkg-config support 1.3.7a complete (see Notes)
688243 Support of OS/X 1.4.2 complete
1153008 install should not require root 1.5.3c complete

Note 1- If pkg-config is found on a system, the systemwide installation script will install the package descriptor in the path which is given in the file etc/config.site:

site_pkgconfig_path=<your path>

If nothing is given /usr/local/lib/pkgconfig is assumed.

Supported ODBC and Database Products

Even the GNADE project except for the native data base bindings is expected to work with all ODBC compliant data base products. The following products are known to work with GNADE assuming, that you are using the correct driver manager.

Component Description Version OS Distribution/Source of the release
PostgreSQL PostgreSQL Database 7.0.3
7.2
Linux - Redhat 7.0
Linux - SuSe 7.0 Solaris
Linux - Debian 2.2, 3.0
Windows NT/2000
www.postgresql.org
Mimer Mimer SQL RDBMS 8.2(.4G) Solaris Linux Windows NT www.mimer.com
9.2
Linux - Suse 9.1
Windows XP
www.mysql.com
MySQL MySQL Database MyODBC 3.23.22
2.50.36-1
Linux www.mysql.com
3.23.35a
2.50.36
Windows 2000 www.mysql.com
3.23.47
3.51.02
Windows 98 www.mysql.com
MS SQL Server 7.0 Windows 2000 Microsoft
SQL Server 2000 Windows 2000 Microsoft
Oracle Lite 8i Windows 95 Oracle
SQLite SQLite emb. Database 2.8.2-1 Linux www.sqlite.org

The GNADE project installation procedure provides for theses product test data bases. If your data base is not listed below, the GNADE project will be very likely usable but the test data base has to be installed manually.

The following Driver Managerare known to work with this and/or previous releases:

Component Description Version Operating System Comments
unixODBC ODBC Driver Manager 2.2.3 Linux www.unixodbc.org
2.0.5 Solaris 8 www.unixodbc.org
2.1.1-7 Linux Debian www.unixodbc.org
MS ODBC ODBC Driver Manager 3.5.10 Windows 95, 98 Microsoft

The iODBC 3.04 implementation on Solaris seems to have a problem with the handling of cursor states. It should not be used.

Supported native bindings

Database Product Version Comments
PostgreSQL 7.03 Thin binding
MySQL 4 Thick binding
Oracle OCI 8i lite Oracle Call Interface
SQLite 2.8.2 and higher

Other Components

Beside of the ODBC and the native bindings, the project provides add on components as:

  • ADBC- Ada Database Connectivitiy
  • Contributed tools

ADBC

The ADBC interface is a highly experimental package which works on top of PostgreSQL and MySQL. Since the interface is completly unstable it is not recommentded to use this interface in application at the current point in time. Since the interest in the Ada community was quite low it is questionable whether the development of this interface will be continued.

Contributed Tools

Tools are not part of this release. Constributed code is released as separate packages since they do not depend on a certain version of the GNADE environment.

  • gsql - A SQL client

Supported Platforms / Compilers

Compiler Version Operating Systems
GNAT 3.13p Linux, Windows
GNAT 3.14p Linux (Debian, Redhat, SuSe), Solaris 8, Windows
GNAT 3.15p
GNAT 3.15a Win98, Windows XP, Linux

Problems

This section contain an overview of known, fixed problems and restrictions (limitations). Please report all errors via the error report system at the source forge project page.

Fixed Problems

Problems reported earlier then 1.5.0 are listed in the release note 1.5.2.

Bug Ref. Fixed in Short Description Comments
805896 1.5.0 gnade config creates useless -l gnade-config
813238 1.5.0 odbc.ini and odbcinist.ini nor correctly placed Makefile
813239 1.5.0 make of the adbc sample failes Makefile
813243 1.5.0 snadalone example does not compile Makefile
813615 1.5.0 sqlite sample does not compile correctly Makefile
813617 1.5.0 distribution build for sqlite does not work MANIFEST
805896 1.5.1 gnade config creates useless -l configure
813238 1.5.1 odbc.ini and odbcinist.ini nor correctly placed install
813239 1.5.1 make of the adbc sample failes Makefile
813243 1.5.1 snadalone example does not compile Makefile
813615 1.5.1 sqlite sample does not compile correctly Makefile
813617 1.5.1 distribution build for sqlite does not work MANIFEST
865741 1.5.1 Useless debug inserted esql_parser
865742 1.5.1 Excpetion message not shown esql_parser
917392 1.5.2 Version switch for gnade-config does not work gnade-config
917382 1.5.2 gnade-config in rpm provides wrong path gnade-config
916707 1.5.2 Architecture code wring on windows platform Makefile
916689 1.5.2 win32 was missing in windows installer gnade.iss
914050 1.5.2 MySQL package does not compile Makefile
916689 1.5.3 win32 was missing in windows installer gnade.iss
916691 1.5.3 Architecture code wring on windows platform configure.bat
917382 1.5.3 gnade-config in rpm provides wrong path gnade-config
917392 1.5.3 Version switch for gnade-config does not work gnade-config
920461 1.5.3 Patch: Native Mysql blob enhancement mysql bindings
914918 1.5.3 Patch: GNADE 1.5.1: All native bindings laways build Makefiles
758949 1.5.3 Patch: GNAT -gnaty Fixes for OCI Binding OCI bindings
920081 1.5.3 standalone project not at the correct place
920080 1.5.3 Standalon project file contains wronmg path
920061 1.5.3 esql error messages do not comply to the standards scanner.adb
919476 1.5.3 SQL tool online help is wrong sql.adb
958153 1.5.3a gnatlink fails refere to fix: 962705
958841 1.5.3a MySQL:Blob handling looses memory Free added
958852 1.5.3a make dist does not build from dist. file Makefile
962705 1.5.3a --no-odbc switch does not work any more configure.in
962706 1.5.3a Samples of not build bindings are created Makefile
962709 1.5.3a procompiled documentation is missing 1.5.3 Makefile
963456 1.5.3a documentation is missing in 1.5.3 tar ball duplicate 962709
963467 1.5.3a clean does not work on linux srcuinst.sh.in
963615 1.5.3a dcumentation is build even openjade it not available configure.in
958841 1.5.3b MySQL:Blob handling looses memory gnu-db-mysql.ads
1022959 1.5.3b Memory leak in Gnu.Db.Postgresql.Database postgres bindings
1089954 1.5.3b PROGRAM error in Finalize procedure gnu.db.sqlite
1152844 1.5.3c configure --no-odbc yield faulty gnade-config gnade-config.sh.in
1112042 <1.5.3c Typo in makefile for sample db Makefile

Known Problems

Bug Short Description Comments
1009569 Constraint_Error in samples/odbc/demo con_attr Currently unclear, may be the debian release is based on old sources?.

Restrictions

  • The package names of the OCI binding are not yet lined up with the GNADE package hirarchy. The build process currently creates no test client automatically since the build scripts are only available for windows
  • The VARBINARY data type has only been tested with Mimer SQL.
  • The configuration procedure for Solaris has not been tested completely. If it fails please use the Makefiles in the directory ./win32. These files are known to build a working installation under Solaris.
  • The Object Ada Compiler is known to fail compiling the ODBC bindings because of insufficient compliance to the Ada 95 RM.
  • The compilation of the ODBC bindings is known to fail on a Sun SPARC using GNAT 3.13p (ACT tracking number [8925-002] Gigi abort code 411 on SPARC architectures). This has been fixed mean while but all tests have been done with GNAT 3.14p.
  • The Option -compiler has been added to allow the support of specific of different Ada 95 compilers which has currently no effect.
  • Unicode support is only available begining with UnixODBC version 2.0. The Uncode support does depend on GNAT specific packages
  • Oracle 8i requires the declaration of string hostvariable to be 1 character larger then the domain size, e.g. assuming the size of the domain Ename from the example simple to be 20, the host variables have to be defined as:
    Ename     :   Char (1..21); 
    Dept_Name :   Char (1..21); 
    Location  :   Char (1..21);
  • The automatic installation is not supported in case of Oracle 8i but the installation script is located under samples.
  • The windows setup does not provide any documentation yet. Refere to the windows README.
  • The windows setup contains the sample files for all native bindings but the selection of the applicable samples and the installation of the data base needs to be done manually.
  • The sqlite and sqlite3 package are included in the distribution. sqlite3 requires the Ada.Containers extension. This version has not been tested. The configure process will check if the Ada.Containers package is available. If not only the sqlite binding will be included.

Software

The GNADE code and the documentation is distributed in the following archive/package files:

File Contents
gnade-src-X.Y.Z.tar.gz Complete GNADE source code distribution GNU compressed tar file
gnade-src-X.Y:Z.zip Complete GNADE source code distribution as ZIP file.
gnade-X.Y.Z-xx.src.rpm Source rpm used to build the binary packages
gnade-X.Y.Z-xx.i686.rpm Linux binaries and executables in RPM format.
setup-gnade-X.Y.Z.exe Setup for Windows with executables, libraries and source code requiered to clone the windows installment. Please note, that not all components of the source tree are available in this installment.

The software may be obtained from the CVS (pls. refere to the details at the project page) using the tag GNADE_1_5_3a.

Installation

The installation of this software requires the following components:

Component Version Origin
gzip 1.2.4 GNU
unzip 5.42 Infozip
zip 2.2 Infozip
tar - GNU or native
autoconf 2.52 GNU
gmake 3.79.1 GNU
gnat 3.14p, 3.13p ACT distribution (ftp://cs.ny.edu/)
gawk 3.0.3 GNU
rpm www.rpm.org (only if rpm is to be installed)
innosetup 4.1.5.1 www.innosetup.org (windows)

Installation on Linux/Unix

Unpacking and Configuration

$ gunzip -c gnade-src-<version>.tar.gz | tar xvf -
$ cd gnade-src-<version>
$ ./configure [ --sampledb=<rdbms> [ native(s) ]

This allows you to specify for which RDBMS product you wish to create a sample data bases and for which RDBMS products you wish to build native bindings. If nothing is given only the ODBC based parts will be build.

The following RDBMS prducts are supported.

  • mimer - MimerSQL
  • postgres - PostgreSQL
  • mysql - MySQL
  • oracle - Oracle 8i lite

If the value is omitted because your data base product is not listed,, all subsequent steps regarding the data base installation may be skipped and you have to install the test database manually.

Installation of the Database

Depending on the installation of the data base you have specified in the configure script command, you have to execute the following step either by using a DBA account our you may use your own user account

$ su ..dba..
$ gmake createuser

After the database and the database user has been configured, the ODBC interface has to be configured. The directory ./samples/sample_db contains sample files for the unixODBC driver manager. The files odbc.ini.sample odbcinst.ini.sample have to be copied to /etc/odbc.ini and /etc/odbcinst.ini.sample.

Compiling an testing

After the creation of the data base user, the final build may be done by:

$ gmake

Test code is located in the directory ./samples. In order to test the functionality of the ODBC interface use the examples in ./odbc or ./esql.

Systemwide Installation

In order to install the build products on your system login as root and execute the following command in the installation directory of this package:

make install

The makefile will run a script which installs all components on your system that they are available to other users as well. The target directories are specified in the etc/site.config file.

In case of upgrading from 1.4.1 to a higer version please perform the following steps prio to the installation of the package:

cd /usr/lib ; rm libgnade*

cd /usr/bin; rm gesql gnade-config

cd /usr/lib/ada; rm -rf gnade

or if you have installed the rpm package, simply run:

rpm -e <gnade-package>

Include the new location of the GNADE environment both in the PATH variable and in the loader configuration:

In /etc/profile.local add

PATH=$PATH/usr/local/gnade/bin ; export PATH

In/etc/ld.so.confadd the line /usr/local/gnade/lib and execute

ldconfig -v

Installation of the RPM packages

The installation of the executable package done by executing the following command:

rpm -ivh gnade-1.4.0-4.i686.rpm.

This will install the production results at the following places in the filesystem:

libraries - /usr/lib/libgnade*
documentation - /usr/share/doc/gnade-1.4.0
binaries - /usr/bin

Since this is the first rpm release no deinstallation has to be done.

Contrib Tool Installation

The GNADE project provides tools which are add on packages to the GNADE source packages. The following tools are installable with this distribution:

  • GSQL Version 0.7 or greater

For the installation please follow the procedure below after you have installed the GNADE source release.

  • change into the contrib directory
  • gunzip -c file.tar.gz | tar xvf -
  • Add the previously created directory to the file packages in the contrib directory
  • make

In order to install the tool run as root in the installation directory of GNADE the command:

make install

Since the installation procedure installs also the GNADE release ensure that the current status is usable for systemwide installation.

Local Development Environment

Generally speeking, the GNADE source code tree is not intended for application development. The applications should always be developed in the user space of the developer or the development team. A sample is provided under samples/standalone.

If it does not work

If this installation procedure fails you may use the Makefile in the directory ./win32. This will require some manual adoptions but it is a starting point.

In any case if you encounter a problem please contact the GNADE team asap.

Installation on Windows (DOS based installation)

Unpacking and configuration

Not applicable, see systemwide installation.

Installation of the Database

The package does not support the automatic installation of a test data base. This needs to be done manually.

Compiling and testing

This is not explicitly requiered. The windows installer provides all libraries, include files and binaries for application development. The sources are part of the installation, but they need not to be compiled.

Systemwide Installation

Download the gnade-setup-X.Y.Z.exe of Version 1.5.3 into any directory and exetute it. Per default the GNADE will be installed on C:\GNADE. After installing the variable GNADE_BASE will be added to your environment. In order to access the executables of GNADE add the following string to your path:

PATH=.....;%GNADE_BASEPATH%/win32-bin;..

The installation provides the following components:

Software Development Kit

The SDK contains all libraries and package files in order to develop odbc based applications by writing Ada 95 code using odbc or by means of the embedded SQL preprocessor gesql.

ODBC Database tools

This is a set of tools which should work with any RDBMS product providing an ODBC interface. It allowes to export/import tables and to execute queries.

GNADE source code
This is the source code of the GNADE distributtion. In order to recompile GNADE change into the directory c:\gnade\source and execute the configure.bat command. Afterwards simply exectue make.

In difference to the Linux implementation all native bindings are build and no automatic database setup is done. In order to build the samples figure out which database products are available and install the apropriate samples from source/samples. In order to do so you need to modify the following configuration variable in make.conf.win32 by removing the not applicable products.

NATIVE_BINDINGS=odbc mysql sqlite postgres oci

After you have changed this files you need to run the configure.bat script.

Projectfiles and GPS

If you intend to use GPS or to include the centralized gnade project file into your project set in you loca environment the following variables:

ADA_PROJECT_PATH=%ADA_PROJECT_PATH%;%GNADE_BASEPATH%

This allows GNAT and GPS to access the GNADE specific project file.

Installation on Windows using Cygwin

The cygwin environment is understood as an GNU build environment, which mean, the same procedures are applicable as in case of the *nix based installations, except for the following limitations:

  • The samples will not be included in the build
  • No automatic installation of the example data base
  • This system wide installation is done are main user of your windows box

Unpacking and Configuration

$ gunzip -c gnade-src-<version>.tar.gz | tar xvf -
$ cd gnade-src-<version>
$ ./configure 

Installation of the Database

Not applicable

Compiling an testing

After the creation of the data base user, the final build may be done by:

$ make

Systemwide Installation

In order to install the build products on your system login as root and execute the following command in the installation directory of this package:

make install

The makefile will run a script which installs all components on your system that they are available to other users as well. The target directories are specified in the etc/site.config file.

During installation a startup script will be installed at /etc/profile.d which adjusts the path in such a way that the executable will be available in the default login environment.

Installation of cygwin packages

This is a todo.

Contrib Tool Installation

Not applicable.

Local Development Environment

The example development environment ist located under examples/standalone.


$Id: note_1.5.3c.html,v 1.1 2005/03/06 13:26:29 merdmann Exp $
gnade-1.6.2.orig/esql/0000755000175000017500000000000011040716276014345 5ustar lbrentalbrentagnade-1.6.2.orig/esql/Changes0000644000175000017500000002331507243570454015652 0ustar lbrentalbrentaSun Feb.17 22:45:03 2001 gnade * The following cursor features have been added: DECLARE LOCAL CURSOR FOR Declares a cursor in the local scope. This works only on scopes, where a decalre section has been put in. (see examples nobel.adq) CLOSE FINAL Deallocates the handle an delete the cursor. Should not be used for reopeanble cursors. Thr Feb.15 20:05:00 2001 gnade * -nodebug changed to -debugcode. By default no debug code is generated. * The leading blank of the query has been removed * Complete revision of the cursor handling incl. of reopenable cursors. * If a string with blanks is split, the trim function did remove the blanks from the next piece of the long string. Mon Feb.11 19:50:00 2001 gnade * The result evaluation is now based upon the SQLSTATE which has a higer granularity. SQLCODE is still supported and may be used by the user. Sun Feb.10 22:45:00 2001 gnade * Bug 1002.1 NTS Fix has been removed from the code. The procedures To_String are containing the fix for the NTS problem. The code fragments for To_String have been contributed by Sune Falk. Fri Feb. 9 22:20:22 2001 gnade * Bug 0802.1 ....WHERE NAME = 'Erdmann W' ; gets translated to ... NAME = 'Erdmann W'", * Bug 0802.2 If the variable is named empno in the declare section and :Empno in a sql statement one gets this error Wed Feb. 7 19:30:25 2001 gnade * 0702.1 Sune Falk Vers. 0.1l package body P_Test is .... package IO is new Ada.Text_IO.Integer_IO (Integer); Generic packages causing big trouble!!! * 0702.2 Sune Falk Vers. 0.1l DECLARE CURSOR xyz FOR SELECT ... OPEN xyz FETCH xyz CLOSE xyz OPEN should create the resultset, not the declare clause. For a first step, the open command is isgnored, but this is no real solution. Rework of the cursor concept is expected to take place. Tue Feb. 5 19:40:00 2001 gnade * 0502.1 Sune Falck Vers. 0.1l If the -nodebugcode switch is ommited, the generated code for the esql smaples does not compile any more. * 0502.2 Sune Falk A query like "EXEC SQL SELECT NAME FROM TOWNS WHERE NAME = 'LONDON' becomes after parsing ... NAME = ' LONDON '. * 0502.3 Sune Falk The problem with esql that the last text line in the input file is not copied to the output if there is any blank lines at the end of the input file is still existing for Windows NT. * 0502.4 Sune Falk ".....warninig : table in declare clause ignored" was generated even the pedatic switch was off. Sat Feb. 4 19:09:00 2001 gnade * esql_support has been reworked because the handling of the statement handle was completly screwed up. Due to this problem, the wisconsin benchmakr did not execute after compilation. Sun Feb. 3 17:00:00 2001 gnade * Added AT and PORT clause in connect. * In case of an raise exception, the line number of the query in the original source is places in the info part of the exception. * Bug 0502.1 esql complains SQLWARNING even only SQLERROR is used in a when ever clause. Tue Jan 30 21:05:30 2001 gnade * Long queries are broken up into small strings in order to fool the gnat. * Buildvers.sh is part of the makefile Sat Jan 28 11:25:01 2001 gnade * Fully qualified SQL types where not recognized any more due to a change in the Is_ISO92_Type function. * If a string is not closed and an EOF is found in string esql loops endless. Sun Jan 27 11:02:00 2001 gnade * The Makefile has been changed in such a way, that the target dist rebuild the main program with the current Version number of the package. * Bug 2701.1 An & at the end of a line is not copied into the output stream. The complete MUMPS style invokation has been deleted. Wed Jan 24 21:10:00 2001 gnade * Bug 2401.1 Reported by Falk Sune If a comment is found at the end of a file and there is not end of line (LF) in this line, esql goes into an endless loop. The scanner has been corrected. This part of the scanner is potential candicate the for rework because it seems to be error prone. * Bug 2401.2 Reported by Falk Sune Misstypo of warning corrected. * Bug 2401.3 Reported by Falk Sune Under Windows NT the last line is not copied if followed by an empty line. This problem is still open. Tue Jan 23 18:45:00 2001 gnade * Bug 2301.01 Reported by Falk Sune The handling of the last line is not correct. The compilation of test.adq failes because the blanks at the end of the file have been removed. * Bug 2301.01 Reported by Falk Sune SQLWARNING missspelled. Sun Jan 20 14:30:00 2001 gnade * The connect syntax has been changed. Thze declare DB inserts the connection handle and the connect simply connects to the named data base: procedure x ( EXEX SQL DECLARE DB01 DATABASE ; ) is begin EXEC SQL AT DB01 SELECT ....... ; end; This allows to write libraries containig procedures for different connections. EXEC SQL CONNECT ... BY DB01 ... ; will generate a connect to DB01. X( EXEC SQL INCLUDE DATABASE NAMED DB01 ); This statement will insert the data base reference into the procedure call. Wed Jan 17 19:30:00 2001 gnade * Bug 1701.1 The terminaing Null hat to be removed. THis will be sone the simple by means of the NTSFix procedure in the ESQL_Support package. As a consequnece the type tables have been added. Tue Jan 16 13:40:01 2001 gnade * Bug 1601.4 The nobel.adq did not coplie because the host variables deptno have been reused again. An exception was raised. * BUG 1601.3 In case of an exception, the location in the code was not shown. * BUG 1601.2 The automtic code intend was causing a contraint error because loop if and case where not handled correctly * Bug 1601.1 The INCLUDE SQLCA clause was consuming following statements till the next semicolon. Tue Jan 16 9:45:00 2001 gnade * The SQLCA may now be defined localy and named. * The SQLCA is now used by esql_support * INCLUDE SQLCA [ NAMED [BY] ] allows to control the name of the SCLA. But you need the RESET SQLCA to reset it the given value or the default value! Sat Jan 14 13:01:00 2001 gnade * The ESQL translator supports now both syntax constructs: SELECT .. INTO FROM ..... ; FETCH ... INTO ; * Bug 1401.1 The esql_support source is copied into the adalib directory before is is complied. * Connect clause lined up with the commonly used syntax plus gnu extension. * Include clause added. This will simply generate a warning if pedantic mode is set. Sun Jan 13 21:50:00 2001 gnade * VAR clause from PRO*Ada supported. There will be no action just a simple warning if it is used. In case of pedantic a sytax error will be raised. Tue Jan 9 19:34:00 2001 gnade * Package GNADE renamed to GNU.DB.ESQL_SUPPORT * SELECT INTO TEMP syntax added Mon Jan 8 21:35:09 2001 gnade * Bug 0801.2 test.adb - print_employee doe work only once. * Bug 0801.1 gnade.adb was not copie into adalib Sat Jan 7 10:35:09 2001 gnade * Bug 0701.5 Exception Handling was inserted for internal functions as well. * Bug 0701.4 Fetch operation was not generated for a SELECT which is not associated with a cursor operation. * Bug 0701.3 Cursor handling was screwed up. changes all over the source. * Bug 0701.1 The next statement after CLOSE CURSOR was processed as query. * Bug 0701.2 If a simple select was given, a useless comma was generated. Sun Jan 6 17:00:05 2001 gnade * -limit switch added, but no function behind it. * Symboltable package tables.adb introduced * DECLARE DATABASE added and checks in case of the AT clause included. * Exit code handling cleaned up, which means make will terminate with error code 1 if an syntax error happens. * Removed the $log$ sections in some of the files. Fri Jan 5 16:03:28 2001 gnade * -noniso92 in order to collect all non iso features into this flag. 1* Source of ESQL checked into gnade cvs Tue Jan 2 08:04:41 2001 gnade * Version 0.1d announced. * Indicator concept added. GNADE contains meanwhile the Is_Null function which might be used later on. * DO action in whenever clause added. * SQLWARNING in whenever clause added but ignored * Editoral changes in all modules Mon Jan 1 18:06:18 2001 gnade * Connection viariable is automaticaly generated as GNADE_DB_DEFAULT. Some other package may initialize it by means of GNADE.CONNECT. * WHENEVER handling regarding continue reworked. * Cursor handling is now a part of the GNADE package. Each cursor is implemented as an OSNC statement handle. The DECLARE CURSOR, OPEN and CLOSE operation are now intercepted and not sent to the DBCS. Sun Dec 31 11:26:35 2000 gnade * debugging code option -nodebugcode added to esql * test_db added as test for the gnade package. * GNADE runtime package upgraded with BindCol and BindParameter gnade-1.6.2.orig/esql/Makefile0000644000175000017500000000742010664457436016023 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## ## Filename : $Source: /cvsroot/gnade/gnade/esql/Makefile,v $ ## Description : Makefile for the ESQL Translator ## Author : Michael Erdmann ## Created On : 22-Dec-2000 ## Last Modified By: $Author: persan $ ## Last Modified On: $Date: 2007/08/27 05:20:30 $ ## Status : $State: Exp $ ## ## Copyright (C) 2000-2002, 2004 ## ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## This makefile builds the esql translator and exports the support components ## for the esql translator. ## ## Restrictions ## ============ ## None ## ## References ## ========== ## None ## sinclude ../make.conf ADAFLAGS = $(DEBUGFLAGS) -gnatf targetdir=$(subst /,$(PATHSEP),$(bindir)) gesql=gesql$(bin) binaries=$(gesql) all dist build: support $(binaries) ifneq ($(EXPORT),) $(MAKE) install endif ## ## GESQL - GNU EMBEDDED SQL ## gesql$(bin) :: gesql.adb esql.gpr \ scanner.adb scanner.ads \ driver.adb driver.ads \ esql_parser.ads esql_parser.adb \ esql_variables.ads esql_variables.adb \ options.ads \ gnu-db-esql_iso92_types.ads gnatmake $(ADAFLAGS) -Pesql.gpr ## ## Build the embedded SQL translator ## gesql.adb: gesql.gpb ../VERSION $(ADAPREP) -DVersion=\"$(VERSION)\" gesql.gpb gesql.adb ## ## Support Library ## libname=libgnadeesql support :: $(ADAMAKE) $(ADAFLAGS) -p -d -Pgnade-esql.gpr ## ## Install with the GNADE package the translator and its support packages ## install: $(ADAINSTALL) $(includedir) $(wildcard sql_standard.* gnu-*.ali gnu-*.ad* ) $(MKSTATIC) $(libdir) $(libname).a $(MKSHARED) $(libdir) $(MINOR) $(MAJOR) $(libname).so $(CP) $(gesql) $(targetdir) ## ## distclean ## clean :: ifeq ($(EXPORT),) $(ADAUINSTALL) $(includedir) $(wildcard sql_standard.* gnu-*.ali gnu-*.ad* gnu-*.o ) endif $(RM) *.o *.ali core esql gesql.adb $(binaries) *~ *.bak b~* gnade-1.6.2.orig/esql/Makefile.esql0000644000175000017500000000542310027047041016743 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## ## Filename : $Source: /cvsroot/gnade/gnade/esql/Makefile.esql,v $ ## Description : Makefile for the ESQL Translator ## Author : Michael Erdmann ## Created On : 22-Dec-2000 ## Last Modified By: $Author: merdmann $ ## Last Modified On: $Date: 2004/03/20 13:58:57 $ ## Status : $State: Exp $ ## ## Copyright (C) 2000-2002 ## ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## This makefile builds the esql translator and exports the support components ## for the esql translator. ## ## make - build all ## make label - rebuild only the main pro. with the current release ## string. ## ## Restrictions ## ============ ## None ## ## References ## ========== ## None ## all build: $(MAKE) -C./ $@ gnade-1.6.2.orig/esql/README0000644000175000017500000000213107234762666015240 0ustar lbrentalbrentaContents ======== This is the embedded SQL Translator. The translator consitsts of the the following components: driver.adb - Top level program, decoding command line driver.ads switches and handing the command line esql_parser.adb - Parser for ESQL. It contains the code esql_parser.ads generation as well. gnu-db-esql_support.adb - This is a support package which is used gnu-db-esql_support.ads by the code generated by the ESQL translator. It contains the interface to the ODBC interface. main.adb - Main prcoedure. This procedure is generated from main_template.adb main_template.adb - Template for the main procedure options.ads - This package contains all option flags. The option falgs are set by the driver. scanner.adb - Lexical scanner for the embedded SQL scanner.ads translator. sql_standard.ads - This package is required by the ISO/92 stabdard. tables.adb - Index tree template. It is used to maintain symbol tables. tables.ads gnade-1.6.2.orig/esql/driver.adb0000644000175000017500000003671010637241242016314 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/esql/driver.adb,v $ -- Description : Main driver for the embedded SQL translator -- Author : Michael Erdmann -- -- Created : 18.12.2000 -- -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2007/06/23 15:56:18 $ -- Status : $State: Exp $ -- -- -- Copyright (C) 2002 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- This software is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- This package contains the main driver of the translator, which means -- -- the command line is processed and for each file, the esql translator -- -- is invoked. -- -- If an error happens in the ESQL translator, the processed file is -- -- closed and the next file is invoked for processing. -- -- -- -- Contact -- -- ======= -- -- Error reports shall be handled via http://gnade.sourceforge.net -- -- Features and ideas via: gnade-develop@lists.sourceforge.net -- -- -- -- Author contact: -- -- purl:/net/michael.erdmann -- -- -- ------------------------------------------------------------------------------- --* Ada with Ada.Exceptions; use Ada.Exceptions; with Ada.Strings; use Ada.Strings; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Strings.Fixed; use Ada.Strings.Fixed; with Ada.Calendar; use Ada.Calendar; with Ada.Unchecked_Conversion; with Ada.Text_IO; use Ada.Text_IO; with Ada.Command_Line; use Ada.Command_Line; --* Translator packages with Scanner; use Scanner; with ESQL_Parser; use ESQL_Parser; with ESQL_Variables; use ESQL_Variables; with Options; use Options; package body Driver is Version : constant String := "$Id: driver.adb,v 1.41 2007/06/23 15:56:18 merdmann Exp $"; Supported_Compilers : array( Target_Compiler_Type ) of Unbounded_String := ( GNU_Ada => To_Unbounded_String("gnat"), Aonix => To_Unbounded_String("aonix"), Unknown => To_Unbounded_String("unknown") ); Copyright_Shown : Boolean := False; Show_Help_Info : Boolean := False; Nbr_Of_Errors : Natural := 0; Nbr_Of_Warnings : Natural := 0; Nbr_Of_Files : Natural := 0; Nbr_Of_Files_Success : Natural := 0; ------------------ -- Process_File -- ------------------ procedure Process_File( F : in out Scanner.File_Reader; Result : out Exit_Status ) is -- -- Process a file by reading in the source file and -- checking for ISO/92 invocation key words. -- P : ESQL_Reader := New_ESQL_Parser(f); begin loop Embedded_SQL_Statement( P ); -- ISO/92 Section 19.1 end loop; exception when End_of_File_Exception => Nbr_Of_Errors := Nbr_Of_Errors + Number_Of_Errors( P ); Nbr_Of_Warnings := Nbr_Of_Warnings + Number_Of_Warnings( P ); if Number_Of_Errors( P ) > 0 then Result := Failure; else Result := Success; end if; when The_Error : Others => Message( f, "Fatal error, uncatched exception " & Exception_Name( The_Error ) & " occured" ); Message( f, "*** Processing of file aborted ***" ); Result := Failure; end Process_File; ----------- -- Error -- ----------- procedure Error( s : String ) is -- print out an error message begin Put_Line( Standard_Error, "Error : " & s ); end Error; ---------------- -- Assginment -- ---------------- procedure Handle_Variable_Definition( S : in String) is N : Unbounded_String := Null_Unbounded_String; V : Unbounded_String := Null_Unbounded_String; -- Breakup assginments like '=' by storing -- the name into N and the value into V I : Natural := S'First; begin while I in S'Range loop exit when S(I) = '=' ; N := N & S(I); I := I + 1; end loop; if S(I) = '=' then I := I + 1; while I in S'Range loop exit when S(I) <= ' '; V := V & S(I); I := I + 1; end loop; end if; ESQL_Variables.Add( To_String(N), To_String(V) ); end Handle_Variable_Definition; ------------------ -- Option_Flags -- ------------------ procedure Handle_Option_Flag( S : in String; Current : in out Natural ) is -- Handle the option flags of the esql translator begin Current := Current + 1; if S = "-pedantic" then Option_Pedantic := True; elsif s = "-v" then Option_Verbose := True; elsif s = "-debugcode" then Option_Debug_Code := True; elsif S = "-iso92" then Option_ISO92_Exception := True; elsif S = "-nosqlstate" then Option_No_SQLSTATE := True; elsif S = "-debug" then Option_DEBUG := True; elsif S = "-odbc" then Option_DBCS := To_Unbounded_String("ODBC"); elsif S = "-s" then Option_Silent := True; elsif S = "-connectpkg" then Option_Connect_Pkg := To_Unbounded_String(Argument(Current)); Current := Current + 1; elsif S = "-schema" then Create( Schema_File, Mode => Out_File, Name => Argument(Current) ); Option_SCHEMA := True; Current := Current + 1; elsif S = "-compiler" then Target_Compiler := Unknown; for I in Target_Compiler_Type loop if Argument(Current) = Supported_Compilers(I) then Target_Compiler := I; exit; end if; end loop; if Target_Compiler = Unknown then Put_Line("Warning: compiler set to unknown"); end if; Current := Current + 1; elsif S = "-limit" then Option_Error_Limit := Integer'Value(Argument(Current)); Current := Current + 1; elsif S = "-gnatnosref" then Option_GNAT_Sref := False; elsif S = "-h" or S = "-help" or S = "--help" then Show_Help_Info := True; else if S'Length > 2 and then S(1..2) = "-D" then Handle_Variable_Definition( S(3..S'Length) ); else Error("unknown switch " & S & " ignored "); end if; end if; -- turn of compiler specific flags for each supported compiler. case Target_Compiler is when GNU_Ada => null; when others => Option_GNAT_SREF := False; end case; end Handle_Option_Flag; ---------- -- Name -- ---------- function Name( s : String ) return String is -- -- Return the part for the name after the extentsion has been -- removed from the name, e.g. test.help.esql returns test.help. -- pos : Integer; begin pos := Index( s, ".", Backward ); if pos = 0 then return s; else return s(1..pos-1); end if; end Name; --------------- -- Copyright -- --------------- procedure Copyright( Version : in String ) is -- the copyright will be shown only once begin if not Option_SILENT and not Copyright_Shown then Put_Line(""); Put_Line("GNADE Embedded SQL (GESQL) Ada 95 Translator Version " & Version); Put_Line("Copyright (C) 2000-2007 Michael Erdmann"); Put_Line(""); Copyright_Shown := True; end if; end Copyright; ------------- -- Summary -- ------------- procedure Summary is begin Put_Line(""); if Nbr_Of_Files_Success /= Nbr_Of_Files then Put( "Processed" & Natural'Image(Nbr_Of_Files-Nbr_Of_Files_Success) & " of" & Natural'Image(Nbr_Of_Files) & " file(s) not successfully" ); Put("," & Natural'Image( Nbr_Of_Errors ) & " error(s)"); else Put( "Processed" & Natural'Image(Nbr_Of_Files) & " file(s) successfully" ); end if; if Nbr_Of_Warnings > 0 then Put( "," & Natural'Image( Nbr_Of_Warnings ) & " warning(s)"); end if; Put_Line( "" ); Put_Line( "" ); end Summary; --------------- -- Help_Text -- --------------- procedure Help_Text is begin Put_Line( "" ); Put_Line( "Usage: gesql [] file(s) "); Put_Line("" ); Put_Line( "options : " ); Put_Line( " -pedantic Pedantic checking against ISO/92 SQL"); Put_Line( " -debugcode Generate inline debug code" ); Put_Line( " -v Print out processing information" ); Put_Line( " -s Do not print the copyright notice" ); Put_Line( " -iso92 Conditions will sustain till next condition"); Put_Line( " -limit Max. number of errors" ); Put_Line( " -nosqlstate Don't insert automatically SQLSTATE"); -- Put_Line( " -odbc Generate code for the ODBC interface"); Put_Line( " -schema Generate the schema into a file"); Put_Line( " -compiler Define the target compiler as listed below:"); Put_Line( " -gnatnosref Add no Source_Reference Pragma"); Put_Line( " -D= Define a substitution variable"); Put ( " " ); -- for I in Target_Compiler_Type loop -- Put( " " & To_String( Supported_Compilers(I)) ); -- end loop; Put_Line( "" ); Put_Line( "" ); Put_Line( " -h, --help This message "); Put_Line( "" ); Put_Line( "file(s) is any Ada 95 source file contining embedded SQL code. "); Put_Line( "" ); end Help_Text; ---------- -- Main -- ---------- procedure Main( Version : in String ) is -- Process the command line. Files and options are -- processed in the same order as they are specified. -- In case of fatal error in a file, the next files -- will be invoked for translation. Arg : Natural := 1; Result : Exit_Status := Success; -- begin if Argument_Count = 0 then Copyright( Version ); Help_Text; Set_Exit_Status( Failure ); end if; while Arg in 1..Argument_Count loop if Argument(Arg)(1) = '-' then Handle_Option_Flag(Argument(Arg), Arg); if Show_Help_Info then Copyright( Version ); Help_Text; exit; end if; else declare F : File_Reader; begin Copyright( Version ); if Option_Verbose then Put_Line("Processing file " & Argument(Arg) & " : " ); end if; if ( Index( Argument(Arg), ".adb" ) > 0 ) or ( Index( Argument(Arg), ".ads" ) > 0 ) then Error( "Ada 95 specifications or body files are no input of gesql" ); Nbr_Of_Files := 1; exit; end if; F := Open( Argument(Arg), Name(Argument(Arg)) & ".adb" ); Nbr_Of_Files := Nbr_Of_Files + 1; Mark_Source_Line( F ); Process_File( F, Result ); Comment(F, "***************************************************"); Comment(F, " !!! D O N O T E D I T !!! "); Comment(F, " This file is gnerated by GNADE ESQL translator "); Comment(F, "" ); Comment(F, " ESQL VERSION : " & Version ); Comment(F, " SOURCE FILE : " & Argument(Arg)); Comment(F, " OPTIONS : " ); for I in 1..Argument_Count loop Comment( F, " " & Argument(I)); end loop; Comment(F, "***************************************************"); if Result /= Success then Delete( F ); else Nbr_Of_Files_Success := Nbr_Of_Files_Success + 1; Close(F); end if; Option_SILENT := True; exception when NAME_ERROR => Error("can't open input file : " & Argument(Arg)); Nbr_Of_Errors := Nbr_Of_Errors + 1; end; Arg := Arg + 1; end if; end loop; if Option_Schema then Close( Schema_File ); end if; if Nbr_Of_Files > 0 then Summary; else if Nbr_Of_Errors = 0 and Argument_Count > 0 then Help_Text; end if; end if; if Nbr_Of_Errors > 0 then Result := Failure; end if; Set_Exit_Status( Result ); end Main; end Driver; gnade-1.6.2.orig/esql/driver.ads0000644000175000017500000000743407523237653016351 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/esql/driver.ads,v $ -- Description : Main driver for the embedded SQL translator -- Author : Michael Erdmann -- -- Created : 18.12.2000 -- -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2002/08/04 14:52:27 $ -- Status : $State: Exp $ -- -- -- Copyright (C) 2002 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- This software is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- This package contains the main driver of the translator, which means -- -- the command line is processed and for each file, the esql translator -- -- is invoked. -- -- If an error happens in the ESQL translator, the processed file is -- -- closed and the next file is invoked for processing. -- -- -- -- Contact -- -- ======= -- -- Error reports shall be handled via http://gnade.sourceforge.net -- -- Features and ideas via: gnade-develop@lists.sourceforge.net -- -- -- -- Author contact: -- -- purl:/net/michael.erdmann -- -- -- ------------------------------------------------------------------------------- package Driver is procedure Main( Version : in String); end Driver; gnade-1.6.2.orig/esql/esql.gpr0000644000175000017500000000122110027125042016004 0ustar lbrentalbrenta-- $Id: esql.gpr,v 1.5 2004/03/20 20:31:30 merdmann Exp $ with "../gnade" ; project ESQL is for Languages use ("Ada"); for Source_Dirs use (".", "../support" ); for Object_Dir use "."; for Exec_Dir use "." ; for Main use ("gesql.adb"); package Compiler is for Default_Switches ("Ada") use ("-g" ); end Compiler; package Builder is for Default_Switches ("Ada") use ("-g", "-gnatQ"); end Builder; package Binder is for Default_Switches ("Ada") use ("-static"); end Binder; package Linker is for Default_Switches ("Ada") use ("-g"); end Linker; end ESQL; gnade-1.6.2.orig/esql/esql_parser.adb0000644000175000017500000037313410637241242017345 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNat Ada Database Environment -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/esql/esql_parser.adb,v $ -- Description : ESQL Parser -- -- Author : Michael Erdmann -- -- Created On : 22-Dec-2000 -- -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2007/06/23 15:56:18 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2000-2007 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- This package contains the esql parser. The result of the -- -- parse process is stored in the ESQL_Reader data. As a consequence -- -- the code generation is a part of this package as well. -- -- -- -- The Syntax of Embedded SQL is based upon the //1// plus some -- -- extensions. -- -- -- -- For more details on the implemented syntax please refere to the -- -- statements of complience. -- -- -- -- ESQL - Syntax -- -- ============= -- -- For the syntax diagram please check the documentation of the gnade -- -- project. -- -- -- -- Restrictions -- -- ============ -- -- R.1 - Character clause not implementend. -- -- R.2 - Host variable constraints not implemented. -- -- -- -- References -- -- ========== -- -- //1// - (Second Informal Review Draft) ISO/IEC 9075:1992, Database -- -- Language SQL- July 30, 1992 -- -- -- ------------------------------------------------------------------------------- --* Ada with Ada.Exceptions; use Ada.Exceptions; with Ada.Strings; use Ada.Strings; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Unchecked_Conversion; with Ada.Text_IO; use Ada.Text_IO; with Ada.Characters.Handling; use Ada.Characters.Handling; with Ada.Characters.Latin_1; use Ada.Characters; with Ada.Strings.Fixed; use Ada.Strings.Fixed; --* Translator packages with Esql_Variables; use ESQL_Variables; with Scanner; use Scanner; with Options; use Options; with GNU.DB.ESQL_ISO92_Types; use GNU.DB.ESQL_ISO92_Types; with GNU.DB.Support.Tables; use GNU.DB.Support; pragma Elaborate_All( GNU.DB.Support.Tables ); package body ESQL_Parser is Version : constant String := "$Id: esql_parser.adb,v 1.96 2007/06/23 15:56:18 merdmann Exp $"; -- This is the list of keyword. The list is larger then realy -- needed. type ESQL_Reserved_Words is ( ESQL_Declare, ESQL_Select, ESQL_Fetch, ESQL_Cursor, ESQL_For, ESQL_Open, ESQL_Close, ESQL_Into, ESQL_Delete, ESQL_From, ESQL_Update, ESQL_Set, ESQL_Where, ESQL_Current, ESQL_Of, ESQL_SQL, ESQL_Identifier, ESQL_End_Of_File, ESQL_Colon, ESQL_Semicolon, ESQL_Comma, ESQL_Range, ESQL_Equal, ESQL_Open_Bracket, ESQL_Close_Bracket, ESQL_AT, ESQL_Begin, ESQL_End, ESQL_EXEC, ESQL_Section, ESQL_STAR, ESQL_Ampersand, ESQL_Whenever, ESQL_GO, ESQL_TO, ESQL_GOTO, ESQL_Continue, ESQL_STOP, ESQL_SQL_Error, ESQL_SQL_Warning, ESQL_Not, ESQL_Found, ESQL_Dash, ESQL_Character, ESQL_Names, ESQL_ARE, ESQL_Connect, ESQL_Connection, ESQL_Disconnect, ESQL_As, ESQL_Database, ESQL_Table, ESQL_Indicator, ESQL_Temporary, ESQL_Temp, ESQL_VAR, ESQL_Identified, ESQL_Include, ESQL_By, ESQL_Named, ESQL_Reset, ESQL_DEFAULT, ESQL_SQLCA, ESQL_Port, ESQL_NULL, ESQL_Reopenable, ESQL_Final, ESQL_Local, ESQL_ALL, ESQL_Commit, ESQL_On, ESQL_Error, -- dynamic sql support ESQL_Statement, ESQL_Prepare, ESQL_Execute, ESQL_Immediate, ESQL_Using, ESQL_Dot, ESQL_String, -- odbc / esql interface ESQL_Handle, ADA_PACKAGE, -- used Ada keywords ADA_BODY, ADA_IS, ADA_RAISE, ADA_BEGIN, ADA_IF, ADA_CASE, ADA_RECORD, ADA_LOOP, ADA_DO, ADA_PROCEDURE, ADA_FUNCTION, ADA_NEW, ADA_RETURN ); type Keyword_List is array( ESQL_Reserved_Words ) of String(1..10); Keywords : constant Keyword_List := ( ESQL_Declare => "DECLARE ", ESQL_Select => "SELECT ", ESQL_Fetch => "FETCH ", ESQL_Cursor => "CURSOR ", ESQL_For => "FOR ", ESQL_Open => "OPEN ", ESQL_Close => "CLOSE ", ESQL_Into => "INTO ", ESQL_Delete => "DELETE ", ESQL_From => "FROM ", ESQL_Update => "UPDATE ", ESQL_Set => "SET ", ESQL_Where => "WHERE ", ESQL_Current => "CURRENT ", ESQL_SQL => "SQL ", ESQL_Of => "OF ", ESQL_Begin => "BEGIN ", ESQL_END => "END ", ESQL_Section => "SECTION ", ESQL_EXEC => "EXEC ", ESQL_AT => "AT ", ESQL_Whenever => "WHENEVER ", ESQL_GO => "GO ", ESQL_TO => "TO ", ESQL_GOTO => "GOTO ", ESQL_Continue => "CONTINUE ", ESQL_STOP => "STOP ", ESQL_NOT => "NOT ", ESQL_Found => "FOUND ", ESQL_SQL_Error => "SQLERROR ", ESQL_SQL_Warning => "SQLWARNING", ESQL_Character => "CHARACTER ", ESQL_Names => "NAMES ", ESQL_Are => "ARE ", ESQL_CONNECT => "CONNECT ", ESQL_CONNECTION => "CONNECTION", ESQL_DISCONNECT => "DISCONNECT", ESQL_IDENTIFIED => "IDENTIFIED", ESQL_BY => "BY ", ESQL_AS => "AS ", ESQL_DATABASE => "DATABASE ", ESQL_TABLE => "TABLE ", ESQL_Indicator => "INDICATOR ", ESQL_Temporary => "TEMPORARY ", ESQL_Temp => "TEMP ", ESQL_VAR => "VAR ", ESQL_Include => "INCLUDE ", ESQL_Named => "NAMED ", ESQL_Reset => "RESET ", ESQL_SQLCA => "SQLCA ", ESQL_Port => "PORT ", ESQL_Default => "DEFAULT ", ESQL_Reopenable => "REOPENABLE", ESQL_Final => "FINAL ", ESQL_Local => "LOCAL ", ESQL_ALL => "ALL ", ESQL_Commit => "COMMIT ", ESQL_On => "ON ", ESQL_Error => "ERROR ", ESQL_Statement => "STATEMENT ", ESQL_Prepare => "PREPARE ", ESQL_Execute => "EXECUTE ", ESQL_Using => "USING ", ESQL_Immediate => "IMMEDIATE ", ESQL_Handle => "HANDLE ", ADA_PACKAGE => "PACKAGE ", ADA_BODY => "BODY ", ADA_IS => "IS ", ADA_RAISE => "RAISE ", ADA_BEGIN => "BEGIN ", ADA_IF => "IF ", ADA_RECORD => "RECORD ", ADA_CASE => "CASE ", ADA_LOOP => "LOOP ", ADA_DO => "DO ", ADA_Procedure => "PROCEDURE ", ADA_Function => "FUNCTION ", ADA_New => "NEW ", ADA_Return => "RETURN ", ESQL_STAR => "* ", ESQL_Colon => ": ", ESQL_String => """ ", ESQL_Identifier => " ", ESQL_End_Of_File => " ", ESQL_Semicolon => "; ", ESQL_Comma => ", ", ESQL_Equal => "= ", ESQL_Dash => "- ", ESQL_Open_Bracket => "( ", ESQL_Close_Bracket=> ") ", ESQL_Ampersand => "& ", ESQL_Range => ".. ", ESQL_Dot => ". ", ESQL_NULL => " " ); type Identifier_Array is array( Natural Range <> ) of Identifier_String; Default_SQLCA_Name : constant Identifier_String := "SQLCA "; -- constants for the connection error handling; type Connection_Error_Type is ( Connection_Failure, Authorization_Failure, Other_Fault ); type Connection_Error_Record is record Target : Identifier_String := Blank_Identifier; Action : ESQL_Reserved_Words := ESQL_Continue; end record; Null_Connection_Error : constant Connection_Error_Record := ( Target => Blank_Identifier, Action => ESQL_Continue ); type Connection_Error_Array is array( Connection_Error_Type ) of Connection_Error_Record; --| --| This is the main data structure where the parser leaves --| his data and the code generator takes his data from. --| type ESQL_Reader_Type is record --- Data of the parser Current : Identifier_String := Blank_Identifier; ESQL_Terminator : ESQL_Reserved_Words := ESQL_Semicolon; -- currently processed tokens Current_Token : Token_Type; Current_Keyword : ESQL_Reserved_Words; -- push back storage Push_Back : Token_Type; Push_Back_Keyword : ESQL_Reserved_Words; --- Data created by the parser Connection : Identifier_String := Blank_Identifier; DB_Name : Identifier_String := Blank_Identifier; Host : Identifier_String := Blank_Identifier; Port : Identifier_String := Blank_Identifier; Login_Name : Identifier_String := Blank_Identifier; Password : Identifier_String := Blank_Identifier; Connection_Errors : Connection_Error_Array := ( others => Null_Connection_Error ); Package_Name : Unbounded_String := Null_Unbounded_String; Max_Count : Natural := 0; Columns : Identifier_Array( 1..50 ); Nbr_Of_Columns : Natural := 0; Indicators : Identifier_Array( 1..50 ); Parameters : Identifier_Array( 1..50 ); Nbr_Of_Parameters : Natural := 0; Parameter_Ind : Identifier_Array( 1..50 ); Query_String : Unbounded_String := Null_Unbounded_String; Query_Variable : Unbounded_String := Null_Unbounded_String; Query_Line_Number : Natural := 0; Cursor_Is_Reopenable : Boolean := False; Current_Cursor : Identifier_String := Blank_Identifier; Cursor_To_Declare : Identifier_String := Blank_Identifier; Cursor_To_Close : Identifier_String := Blank_Identifier; Cursor_Dynamic_SQL : Identifier_String := Blank_Identifier; Finalize_Cursor : Boolean := False; Cursor_To_Open : Identifier_String := Blank_Identifier; Cursor_Is_Local : Boolean := False; Current_Statement : Identifier_String := Blank_Identifier; Perform_Commit : Boolean := False; Connection_To_Close : Identifier_String := Blank_Identifier; Statement_Name : Identifier_String := Blank_Identifier; Ada_Declare : Boolean := False; Packages_Inserted : Boolean := False; Global_SQL_Env_Set : Boolean := False; Inject_Fetch : Boolean := False; SQL_Context_At_IS : Boolean := True; Eval_Result : Boolean := False; --- Persistent data Reader : Scanner.File_Reader ; Nesting_Level : Integer := 0; Nbr_Of_Syntax_Errors : Natural := 0; Nbr_Of_Warnings : Natural := 0; SQLCA_Name : Identifier_String := DEFAULT_SQLCA_Name; --- Exception handling data Not_Found_Action : ESQL_Reserved_Words := ESQL_Continue; SQL_Error_Action : ESQL_Reserved_Words := ESQL_Continue; SQL_Warning_Action : ESQL_Reserved_Words := ESQL_Continue; Not_Found_Target : Identifier_String := Blank_Identifier; SQL_Error_Target : Identifier_String := Blank_Identifier; SQL_Warning_Target : Identifier_String := Blank_Identifier; end record; Default_Connection : constant Identifier_String := "DEFAULT "; -- control the scanner type Get_Mode is ( Suppress_Token, -- dont copy into output file Accept_Token, -- copy into output file Defere_Copy -- keep the token in the output buffer, until -- either a Accept or a Discard Symbol is -- executed. ); -- ******************** HOST VARIABLE TABLE **************************** -- Symbol table for all host variables. there is only one global -- table for all variables. type Host_Variable_Record is record Name : Identifier_String := Blank_Identifier; Base_Type : Identifier_String := Blank_Identifier; end record; package Host_Var_Table is new Tables( Host_Variable_Record ); use Host_Var_Table; Host_Vars : Host_Var_Table.Tree_Node_Access := Create_Tree; type Type_Identifier_Array is array(ISO92_Host_Var_Type) of Identifier_String; Ada_SQL92_Types : constant Type_Identifier_Array := ( ISO92_CHAR_TYPE => "CHAR ", ISO92_BIT_TYPE => "BIT ", ISO92_SMALLINT_TYPE => "SMALLINT ", ISO92_INT_TYPE => "INT ", ISO92_REAL_TYPE => "REAL ", ISO92_DOUBLE_PRECISION_TYPE => "DOUBLE_PRECISION ", ISO92_SQLCODE_TYPE => "SQLCODE_TYPE ", ISO92_SQLSTATE_TYPE => "SQLSTATE_TYPE ", ISO92_INDICATOR_TYPE => "INDICATOR_TYPE ", GNADE_VARCHAR_TYPE => "GNADE.VARCHAR ", GNADE_BINARY_TYPE => "GNADE.BINARY ", GNADE_VARBINARY_TYPE => "GNADE.VARBINARY ", ISO92_Unknown_Type => Blank_Identifier ); type SQL_Type_Mapping_Array is array( ISO92_Host_Var_Type ) of Identifier_String; SQL_Type_Mapping : constant SQL_Type_Mapping_Array := ( ISO92_CHAR_TYPE => "CHARACTER ", ISO92_BIT_TYPE => "BIT ", ISO92_SMALLINT_TYPE => "INTEGER ", ISO92_INT_TYPE => "INTEGER ", ISO92_REAL_TYPE => "DECIMAL ", ISO92_DOUBLE_PRECISION_TYPE => "DECIMAL ", ISO92_SQLCODE_TYPE => Blank_Identifier , ISO92_SQLSTATE_TYPE => Blank_Identifier , ISO92_INDICATOR_TYPE => Blank_Identifier , ISO92_Unknown_Type => Blank_Identifier , GNADE_VARCHAR_TYPE => "GNADE.VARCHAR ", GNADE_BINARY_TYPE => "GNADE.BINARY ", GNADE_VARBINARY_TYPE => "GNADE.VARBINARY " ); -- ********************** DATA BASE TABLE ******************************* type Database_Table_Record is record Name : Identifier_String := Blank_Identifier; end record; package DB_Table is new Tables( Database_Table_Record ); Databases : DB_Table.Tree_Node_Access := DB_Table.Create_Tree; -- ********************** STATEMENT TABLE ******************************* type Statement_Table_Record is record Name : Identifier_String := Blank_Identifier; end record; package Statement_Table is new Tables( Statement_Table_Record ); Statements : Statement_Table.Tree_Node_Access := Statement_Table.Create_Tree; ---========================================================================--- ---=== S U P P O R T F U N C T I O N S ===--- ---========================================================================--- ------------------ -- Syntax_Error -- ------------------ procedure Syntax_Error( E : in ESQL_Reader; Text : in String ) is -- Indicate a syntax error begin E.Nbr_Of_Syntax_Errors := E.Nbr_Of_Syntax_Errors + 1; Message( e.Reader, " error : " & text ); raise Syntax_Exception; end Syntax_Error; ------------- -- Warning -- ------------- procedure Warning( e : ESQL_Reader; text : in String ) is -- Indicate a warining to the user. begin E.Nbr_Of_Warnings := E.Nbr_Of_Warnings + 1; Message( e.Reader, " warning : " & text ); end Warning; -------------- -- Pedantic -- -------------- procedure Pedantic( e : ESQL_Reader; text : in String ) is -- indicate a pedantic warning to the user begin if Option_Pedantic then Warning( E, Text ); end if; end Pedantic; ---------------- -- Add_Column -- ---------------- procedure Add_Column( e : in ESQL_reader; name : in Identifier_String ) is -- Add an affected columns to the list of affected columns. Nbr_Of_Columns : Natural renames e.Nbr_Of_Columns; begin Nbr_Of_Columns := Nbr_Of_Columns + 1; e.Columns( Nbr_Of_Columns ) := name; end Add_Column; ------------------- -- Add_Parameter -- ------------------- procedure Add_Parameter( e : in ESQL_reader; name : in Identifier_String; Ind_Name : in Identifier_String := Blank_Identifier ) is -- Add an affected columns to the list of affected columns. Nbr_Of_Parameters : Natural renames e.Nbr_Of_Parameters; begin Nbr_Of_Parameters := Nbr_Of_Parameters + 1; E.Parameters( Nbr_Of_Parameters ) := Name; E.Parameter_Ind( Nbr_Of_Parameters ) := Ind_Name; end Add_Parameter; ---------------- -- Upper_Case -- ---------------- function Upper_Case( s : in Identifier_String ) return Identifier_String is --- Result : Identifier_String; --- begin for i in Identifier_String'Range loop if Is_Lower(s(I)) then Result(I) := To_Upper(s(I)); else Result(I) := S(I); end if; end loop; return Result; end Upper_Case; ----------- -- Quote -- ----------- function Quote ( ID : String) return String is --- QT : constant Character := Character'Val (34); --- begin return QT & ID & QT; end Quote; ---------- -- Name -- ---------- function Name( s : in String ) return String is -- Return the name part by trimming of the blanks begin return Trim( s, Right ); end Name; ------------------- -- To_Identifier -- ------------------- function To_Identifier( s : String ) return Identifier_String is -- Convert to identifier Result : Identifier_String := Blank_Identifier; begin for i in Identifier_String'Range loop exit when i > s'Length; Result(i) := s(i); end loop; return Result; end To_Identifier; ------------ -- Append -- ------------ function Append( A : in String; B : in String ) return Identifier_String is begin return To_Identifier( Name(A) & Name(B) ); end Append; ----------------- -- Next_Symbol -- ----------------- function Next_Symbol( e : ESQL_Reader; mode : Get_Mode := Suppress_Token ) return ESQL_Reserved_Words is -- Read in the next symbol. It is checked against the -- list of reserved words. If it is not a reserved word -- we assume an identifier. T : Token_Type renames e.Current_Token; Temp : Identifier_String; begin if E.Push_Back /= Null_Token then T := E.Push_Back; E.Current_Keyword := E.Push_Back_Keyword; E.Push_Back := Null_Token; else -- read from file and strip of any comment token. Get_Token( E.Reader, T ); while T.Lexical_Unit = Comment_Lex and T.Lexical_Unit /= End_Of_File_Lex loop Get_Token( e.Reader, T ); end loop; end if; case mode is when Suppress_Token => Ignore_Input( E.Reader ); when Accept_Token => Accept_Input( E.Reader ); when Others => null; end case; if T.Lexical_Unit = End_Of_File_Lex then if Option_Debug then Put_Line("Next_Symbol: end of file"); end if; raise End_of_File_Exception; end if; -- match keywords in uper cases only Temp := Upper_Case( T.Lexicon ); E.Current := T.Lexicon; E.Current_Keyword := ESQL_Identifier; for i in ESQL_Reserved_Words loop if Name( Keywords(I) ) = Name( Temp ) then E.Current := Temp; E.Current_Keyword := I; exit; end if; end loop; pragma Debug( Put_Line( "Next_Symbol: " & E.Current) ); return E.Current_Keyword; exception when ESQL_Variables.Not_Existing => Syntax_Error( E, "Substituation variable '" & To_String( Scanner.Last_Variable_Name) & "' not defined" ); raise; end Next_Symbol; ----------------------------- -- Push_Back_Current_Token -- ----------------------------- procedure Push_Back_Current_Token( -- This allows to push back one token which will -- read in again upon invoktion of the Next_Symbol -- procedure. E : in ESQL_Reader ) is begin E.Push_Back := E.Current_Token; E.Push_Back_Keyword := E.Current_Keyword; end Push_Back_Current_Token; ------------------- -- Accept_Symbol -- ------------------- procedure Accept_Symbol( E : in ESQL_Reader ) is -- Accept the symbol for copying into the processing result. begin pragma Debug( Put_Line( "Accept_Symbol" ) ); Accept_Input( E.Reader ); end Accept_Symbol; -------------------- -- Discard_Symbol -- -------------------- procedure Discard_Symbol( E : in ESQL_Reader ) is begin pragma Debug( Put_Line( "Discard_Symbol" ) ); Ignore_Input( E.Reader ); end Discard_Symbol; ------------ -- Expect -- ------------ procedure Expect( e : ESQL_Reader; what : ESQL_Reserved_Words; where : String := ""; mode : Get_Mode := Suppress_Token ) is -- Check for the expected token type. If the item is not found, -- an error message will be generated. Current : ESQL_Reserved_Words; -- begin Current := Next_Symbol(e, mode); if Current /= what then if where = "" then Syntax_Error( e, " unexpected token " & ESQL_Reserved_Words'Image(Current) & " found, expected " & ESQL_Reserved_Words'Image(what)); else Syntax_Error( e, " unexpected token " & ESQL_Reserved_Words'Image(Current) & " found in " & where & ", expected " & ESQL_Reserved_Words'Image(what)); end if; end if; end Expect; ----------------- -- Is_Terminal -- ----------------- function Is_Terminal( S : in ESQL_Reserved_Words ) return Boolean is -- this returns true for those keyword which are terminals, where -- no need is to insert blanks afterwards. begin -- Put_Line( ESQL_Reserved_Words'Image(S) ); return S = ESQL_Open_Bracket or S = ESQL_Close_Bracket or S = ESQL_Equal or S = ESQL_Dot or S = ESQL_Comma or S = ESQL_String ; end Is_Terminal; --------------- -- Skip_Till -- --------------- procedure Skip_Till( e : ESQL_Reader; what : ESQL_Reserved_Words; mode : Get_Mode := Suppress_Token ) is -- Read all tokens till the given token is found. Current : ESQL_Reserved_Words; --- begin Current := Next_Symbol(e, mode); while Current /= what loop Current := Next_Symbol(e, mode); if Current = ESQL_End_Of_File then Syntax_Error( e, "missing " & ESQL_Reserved_Words'Image(what) ); exit; end if; end loop; end Skip_Till; --------------------- -- Identifier_List -- --------------------- procedure Identifier_List( e : in ESQL_Reader; ids : out Identifier_Array; length : out Natural; sep : in ESQL_Reserved_Words := ESQL_Comma; mode : in Get_Mode := Suppress_Token ) is -- copy a list of identifiers into the array. Current : ESQL_Reserved_Words; -- begin length := 0; for i in ids'Range loop Current := Next_Symbol( e, mode ); if Current = ESQL_Colon then -- host variable Current := Next_Symbol( e, mode ); end if; if Current /= ESQL_identifier then Syntax_Error( e, "exptected identifier in list" ); end if; ids(i) := e.Current; length := length + 1; Current := Next_Symbol( e, mode ); exit when Current /= ESQL_Comma; end loop; Push_Back_Current_Token(e); end Identifier_List; -------------------- -- SQL_Terminator -- -------------------- procedure SQL_Terminator( E : ESQL_Reader ) is -- scan the SQL terminator if there. If it is -- not there, then copy all tokens into the result file. -- In all other cases donot copy. Current : ESQL_Reserved_Words; Query : Unbounded_String := Null_Unbounded_String; -- begin Current := Next_Symbol(e, mode => Defere_Copy ); case Current is when ESQL_Semicolon => Discard_Symbol(e); when ESQL_END => Current := Next_Symbol(e, mode => Defere_Copy ); if Current /= ESQL_Dash then Accept_Symbol(e); else -- END - is no valid ada Expect( e, ESQL_Exec ); end if; when Others => Accept_Symbol(e); -- write out the unknown token Push_Back_Current_Token(e); -- push back for later processing end case; end SQL_Terminator; ---------------- -- Identifier -- ---------------- function Identifier( E : in ESQL_Reader ) return String is -- Get the current identifier begin return E.Current; end Identifier; ---========================================================================--- ---=== D A T A B A S E H A N D L I N G ===--- ---========================================================================--- -------------------------- -- Insert_DB_Table_Name -- -------------------------- procedure Insert_DB_Table_Name( E : ESQL_Reader; Name : in Identifier_String ) is --- Info : Database_Table_Record; --- begin Info.Name := Name; DB_Table.Insert( Databases, Trim(Name, Right), Info ); exception when DB_Table.Already_Stored => Warning( E, Trim(Name, Right ) & " multiple declared "); end Insert_DB_Table_Name; ---------------------- -- Is_Database_Name -- ---------------------- function Is_Database_Name( Name : in Identifier_String ) return Boolean is --- Db_Info : Database_Table_Record; --- begin DB_Table.Fetch( Databases, Trim(Name,Right), DB_Info ); return True; exception when DB_Table.Entry_Not_Found => return False; end Is_Database_Name; --------------------------- -- Insert_Statement_Name -- --------------------------- procedure Insert_STATEMENT_Name( E : in ESQL_Reader; Name : in Identifier_String ) is --- Info : Statement_Table_Record; begin Info.Name := Upper_Case(Name); Statement_Table.Insert( Statements, Trim(Upper_Case(Name), Right), Info ); exception when Statement_Table.Already_Stored => Warning( E, Trim(Name, Right ) & " multiple declared "); end Insert_STATEMENT_Name; ---------------------- -- Is_Statement_Name -- ---------------------- function Is_Statement_Name( Name : in Identifier_String ) return Boolean is --- Stmt_Info : Statement_Table_Record; begin Statement_Table.Fetch( Statements, Trim(Upper_Case(Name),Right), Stmt_Info ); return True; exception when Statement_Table.Entry_Not_Found => return False; end Is_Statement_Name; ---========================================================================--- ---=== T Y P E H A N D L I N G ===--- ---========================================================================--- ------------------- -- Is_SQL92_Type -- ------------------- function Is_SQL92_Type ( name : Identifier_String ) return Boolean is -- check for an allowed SQL 92 Ada type Tmp : Identifier_String := Upper_Case(Name); -- begin for i in ISO92_Host_Var_Type'Range loop if Ada_SQL92_Types(I) = Tmp or To_Identifier("SQL_STANDARD." & Trim(Ada_SQL92_Types(I), Right)) = Tmp then return True; end if; end loop; return False; end Is_SQL92_Type; ---------------- -- SQL92_Type -- ---------------- function SQL92_Type( Name : Identifier_String ) return ISO92_Host_Var_Type is -- Tmp : Identifier_String := Upper_Case( Name ); -- begin for I in ISO92_Host_Var_Type'Range loop if Ada_SQL92_Types(I) = Tmp or To_Identifier("SQL_STANDARD." & Trim(Ada_SQL92_Types(I), Right)) = Tmp then return I; end if; end loop; return ISO92_Unknown_Type ; end SQL92_Type; --------------------------- -- Type_Of_Host_Variable -- --------------------------- function Type_Of_Host_Variable( Name : in Identifier_String ) return ISO92_Host_Var_Type is --- Variable : Host_Variable_Record ; Cap_Name : Identifier_String := Upper_Case(Name); --- begin Fetch( Host_Vars, Trim(Cap_Name,Right), Variable ); return SQL92_Type( Variable.Base_Type ); exception when others => -- Put_Line("Name not found : '" & Cap_Name & "'"); return ISO92_Unknown_Type; end Type_Of_Host_Variable; -------------------------- -- Host_Var_type_String -- -------------------------- function Host_Var_Type_String( S : in Identifier_String ) return String is -- return the type string of a host variable Var_Type : ISO92_Host_Var_Type := Type_Of_Host_Variable(S); begin if Var_Type = GNADE_VARCHAR_TYPE then Var_Type := ISO92_CHAR_TYPE; end if; return ISO92_Host_Var_Type'Image(Var_Type); end Host_Var_Type_String; ----------------------- -- Add_Host_Variable -- ----------------------- procedure Add_Host_Variable( Name : in String; Base_Type : in String ) is -- Add a symbol and the data type. If the value already exists -- simply update with the base type. Variable : Host_Variable_Record; Cap_Name : Identifier_String := Upper_Case( Name ); --- begin Variable.Name := Cap_Name; Variable.Base_Type := base_type; Insert( Host_Vars, Trim(Cap_Name,Right), Variable); exception when Already_Stored => Update( Host_Vars, Trim(Cap_Name,Right), Variable ); -- Bug fix: 1601.4 when others => raise; end Add_Host_Variable; ---========================================================================--- ---=== S O U R C E C O D E G E N E R A T O R ===--- ---========================================================================--- --------- -- Ada -- --------- procedure Ada( e : in ESQL_reader; statement : in String; comment : in String := "" ) is -- This procedure inserts a nice Ada statement into the result -- file applying the correct itendation level. Nesting_Level : Integer renames e.Nesting_Level; --- begin if comment = "" then Insert( e.Reader, ( (Nesting_Level*3) * " " ) & statement ); else Insert( e.Reader, ((Nesting_Level*3) * " " ) & statement & "-- " & comment ); end if; end Ada; ----------------- -- Ada_Declare -- ----------------- procedure Ada_Declare( E : ESQL_Reader ) is -- This outputs a declare statement. Applying this procedure -- will yield the correct layout for the variable declarations. Nesting_Level : Integer renames e.Nesting_Level; Ada_Declare : Boolean renames e.Ada_Declare; -- begin Ada( e, "declare" ); Ada_Declare := True; Nesting_Level := Nesting_Level + 1; end Ada_Declare; --------------- -- Ada_Begin -- --------------- procedure Ada_Begin( e : ESQL_Reader ) is -- Refere to Ada_Declare Nesting_Level : Integer renames e.Nesting_Level; Ada_Declare : Boolean renames e.Ada_Declare; -- begin if not Ada_Declare then Ada(e, "begin"); Nesting_Level := Nesting_Level + 1; else Ada_Declare := False; Nesting_Level := Nesting_Level - 1; Ada_Begin( e ); end if; end Ada_Begin; ------------- -- Ada_End -- ------------- procedure Ada_End( e : in ESQL_reader ) is -- Close a text block. For details refer to Ada_Declare. Nesting_Level : Integer renames e.Nesting_Level; begin Nesting_Level := Nesting_Level - 1; Ada(e, "end;"); end Ada_End; ------------------- -- Ada_Exception -- ------------------- procedure Ada_Exception( E : in ESQL_Reader ) is -- Insert an exception clause Nesting_Level : Integer renames E.Nesting_Level; begin Nesting_Level := Nesting_Level - 1; Ada( e, "exception" ); Nesting_Level := Nesting_Level + 1; end Ada_Exception; ------------------------ -- Indicator_Variable -- ------------------------ function Indicator_Variable( host_var : Identifier_String ) return String is -- This creates the name of an indicator variable -- for a host variable. begin return Name(host_var) & "_Indicator" ; end Indicator_Variable; ------------------ -- GNADE_Handle -- ------------------ function GNADE_Handle ( Name : in String ) return String is -- Generate the name if a DB connection mentioned in the -- AT clause. begin return "GNADE_DB_" & Trim(Name, Right) ; end GNADE_Handle; ------------------ -- GNADE_Handle -- ------------------ function GNADE_Handle ( e : in ESQL_Reader ) return String is -- Generate the name of the current GNADE handle begin return GNADE_Handle( E.Connection ); end GNADE_Handle; ------------ -- Invoke -- ------------ function Invoke( S : in String ) return String is -- invoke a procedure from the embedded SQL package begin return To_String(Option_DBCS) & "." & S; end Invoke; ---------------------- -- Invoke_Connector -- ---------------------- function Invoke_Connector( S : in String ) return String is -- invoke the correct connector module. If no external impl. -- is given use the default connection module of the esql translator begin if Option_Connect_Pkg = Null_Unbounded_String then return Invoke(S); end if; return To_String(Option_Connect_Pkg) & "." & S; end; ------------------ -- SQLCA_Access -- ------------------ function SQLCA_Access( E : ESQL_Reader ) return String is -- This returns the correct way of accessing the sql -- communication area. begin return Trim(E.SQLCA_Name, Right) & "'Address"; end SQLCA_Access; --------------- -- SQLCA_Var -- --------------- function SQLCA_Var( E : in ESQL_Reader; Var : in String ) return String is begin return Trim(E.SQLCA_Name, Right) & "." & Var; end SQLCA_Var; ------------------- -- SQLCA_Declare -- ------------------- procedure SQLCA_Ada_Declare( E : in ESQL_Reader ) is begin Ada( E, "SQLCA : aliased ESQL_SUPPORT.SQLCA_TYPE;" ); end SQLCA_Ada_Declare; ---------------- -- String_Arg -- ---------------- function String_Arg( s : Identifier_String ) return String is -- Generate a string argument. If the variable is -- not defined (blank) and empty string will be -- returned. begin if s = Blank_Identifier then return Quote(""); end if; return Trim( s, Right ); end String_Arg; ----------------- -- Make_Access -- ----------------- function Make_Access( E : in ESQL_Reader; N : in String ) return String is begin return Trim(N, Right) & "'Access"; end Make_Access; ----------------- -- Cursor_Name -- ----------------- function Cursor_Name( E : ESQL_Reader; S : String ) return String is begin return To_String(E.Package_Name) & "." & Trim(S, Right); end Cursor_Name; ---------------- -- Cursor_Arg -- ---------------- function Cursor_Arg( e : ESQL_reader ) return String is -- This returns the currently declared cursor argument begin if e.Current_Cursor /= Blank_Identifier then -- Bug fix 0701.2 return ", Cursor => " & Quote( Cursor_Name(E, e.Current_Cursor) ) ; else return ""; end if; end Cursor_Arg; -------------------- -- Context_Object -- -------------------- function Context_Object( E : ESQL_Reader ) return String is -- return the correct context object begin if E.Cursor_Is_Local then return "GNADE_L_CONTEXT"; else return "GNADE_G_CONTEXT"; end if; end Context_Object; ----------------- -- Long_String -- ----------------- function Long_String( E : in ESQL_Reader; Query : in Unbounded_String ) return String is -- This function returns a SQL string in a Ada 95 representation -- by appling the following rules: -- -- R.1 - Output a long string in chunks of 60 characters -- per line by rewriting: -- ...." -> ...." & "....... -- -- R.2 - SQL Strings are translated into a Ada 95 strings -- X = "RFI" -> ...X = " & """" & "RFI" & """" ... Temp : String(1..60) := (others=>' '); Next : Positive := Temp'First; Result : Unbounded_String := Null_Unbounded_String; Intend : constant String := ((E.Nesting_Level + 1) * 3) * " " ; S : constant String := To_String(Query); function Add_Line ( Previous_Text : in Unbounded_String; New_Text : in String) return Unbounded_String is begin if Previous_Text = Null_Unbounded_String then return To_Unbounded_String (Quote (New_Text)); else return Previous_Text & " &" & Latin_1.LF & Intend & Quote (New_Text); end if; end Add_Line; begin for I in 1..S'Length loop if not (Next in Temp'Range) then -- R.1 Result := Add_Line (Result, Temp); Next := Temp'First; end if; if S(I) = '"' then -- R.2 Result := Add_Line (Result, Temp(1..Next-1)); Next := Temp'First; Result := Add_Line (Result, S(I) & S(I) ); else Temp(Next) := S(I); Next := Next + 1; end if; end loop; if Next > 1 then Result := Add_Line (Result, Temp(1 .. Next -1 )); end if; return To_String( Result ); end Long_String; ---------------- -- Ada_Action -- ---------------- procedure Ada_Action( E : in ESQL_Reader; Action : in ESQL_Reserved_Words; Target : in Identifier_String; Comment : in String := "" ) is Info : constant String := "Line" & Natural'Image(E.Query_Line_Number) & " in package " & To_String( E.Package_Name ) & " : " & Comment ; begin case Action is when ESQL_GOTO => Ada( e, " GOTO " & Name( target ) & ";" ); when Ada_DO => Ada( e, " " & Name( target ) & ";" ); -- Pro*Ada when ADA_RAISE => Ada( E, " Raise_Exception(" & Name( Target ) & "'Identity,"); Ada( E, " " & Quote( Info & " failed " ) & " & Latin_1.LF & " & SQLCA_Var(E, "message" ) & ");" ); when Others=> null; end case; end Ada_Action; ---------------- -- ODBC_Debug -- ---------------- procedure ODBC_Debug( E : in ESQL_Reader; Query : in Unbounded_String := Null_Unbounded_String; Comments : in String := ""; Reason : in String := ""; Force : in Boolean := False ) is -- insert the debug code if requiered by setting up the query info -- and some additional comments Info : constant String := To_String( E.Package_Name ) & " at" & Natural'Image(E.Query_Line_Number) & ", " & Comments ; Q : Unbounded_String := To_Unbounded_String(Quote("")); begin if Query /= Null_Unbounded_String then Q := Query; end if; if Option_Debug_Code or Force then Ada (E, "ESQL_SUPPORT.DEBUG(" ); if Reason = "" then Ada (E, " " & Quote( Info ) & "," ); else Ada (E, " " & Quote( Info ) & "& " & Reason & "," ); end if; Ada (E, " " & To_String(Q) & "," ); Ada (E, " " & "SQLCA'Address);" ); Ada (E, ""); end if; end ODBC_Debug; ---------------- -- ODBC_Debug -- ---------------- procedure ODBC_Debug( E : in ESQL_Reader; Query : in String := ""; Comments : in String := ""; Reason : in String := ""; Force : in Boolean := False) is begin ODBC_Debug( E, To_Unbounded_String(Query), Comments, Reason, Force ); end ODBC_Debug; ------------------- -- ODBC_packages -- ------------------- procedure ODBC_Packages( -- Insert the code to invoke the support packages used by -- the ODBC package if it not already inserted. e : in ESQL_Reader ) is begin if e.Packages_Inserted then return; else ADA( E, "with Ada.Exceptions; use Ada.Exceptions;" ); Ada( E, "with Ada.Characters.Latin_1; use Ada.Characters;" ); Ada( e, "WITH GNU.DB.ESQL_ISO92_TYPES; USE GNU.DB.ESQL_ISO92_TYPES;"); Ada( e, "WITH GNU.DB.ESQL_SUPPORT; USE GNU.DB.ESQL_SUPPORT;" ); Ada( E, "WITH GNU.DB.ESQL_SUPPORT." & To_String(Option_DBCS) & "; " ); Ada( E, "USE GNU.DB.ESQL_SUPPORT." & To_String(Option_DBCS) & "; " ); Ada( E, "USE GNU.DB.ESQL_SUPPORT;" ); Ada( E, "WITH GNU.DB.SQLCLI;" ); Ada( E, "USE GNU.DB;" ); if Option_Connect_Pkg /= Null_Unbounded_String then Ada( E, "WITH " & To_String(Option_Connect_Pkg) & "; "); end if; Ada( E, "" ); Ada( E, "pragma Elaborate_All(GNU.DB.ESQL_SUPPORT." & To_String(Option_DBCS) & ");" ); Ada( E, "" ); Mark_Source_Line( E.Reader ); E.Packages_Inserted := True; end if; Ada( e, "" ); Ada( e, "" ); end ODBC_Packages; ------------------ -- ODBC_Prelude -- ------------------ procedure ODBC_Prelude( e : in ESQL_Reader ) is -- This code we be written before every query, specialy the -- length indicators for each host variable used here are made -- available. Nbr_Of_Parameters : Natural renames e.Nbr_Of_Parameters; Parameters : Identifier_Array renames e.Parameters; Columns : Identifier_Array renames e.Columns; Nbr_Of_Columns : Natural renames e.Nbr_Of_Columns; DB_Name : Identifier_String renames e.DB_Name; Indicators : Identifier_Array renames e.Indicators; Parameter_Ind : Identifier_Array renames e.Parameter_Ind; -- begin Comment(E.Reader, "*** Query ***" ); if (Nbr_Of_Columns > 0 or Nbr_Of_Parameters > 0) then Ada_Declare(e); for i in 1..Nbr_Of_Columns loop if Indicators(i) = Blank_Identifier then Ada( e, Indicator_Variable(Columns(i)) & " : aliased SQL_STANDARD.INDICATOR_TYPE := 0;" ); end if; end loop; for i in 1..Nbr_Of_Parameters loop if Parameter_Ind(I) = Blank_Identifier then Ada( e, Indicator_Variable(Parameters(i)) & " : aliased SQL_STANDARD.INDICATOR_TYPE := 0;" ); end if; end loop; end if; Ada_Begin(e); end ODBC_Prelude; ------------------------ -- ODBC_Prepare_Query -- ------------------------ procedure ODBC_Prepare_Query( E : in ESQL_Reader ) is -- Prepare the query. The prepare is only used if there are -- columns of parameters to bind. -- -- The following rules do apply: -- -- R.2 - Insert a PREPARE if the query contains parameters and -- result columns. Query : Unbounded_String renames e.Query_String; Query_Variable : Unbounded_String renames e.Query_Variable; Nbr_Of_Parameters : Natural renames e.Nbr_Of_Parameters; Nbr_Of_Columns : Natural renames e.Nbr_Of_Columns; Cursor_To_Declare : Identifier_String renames e.Cursor_To_Declare; Current_Cursor : Identifier_String renames e.Current_Cursor; Is_Reopenable : Boolean renames E.Cursor_Is_Reopenable; Q : Unbounded_String := Null_Unbounded_String; -- begin Ada( E, "-- Prepare"); if Query /= Null_Unbounded_String then Q := To_Unbounded_String( Long_String(E, Query) ); else Q := Query_Variable; end if; if Cursor_To_Declare /= Blank_Identifier then -- R.1 Current_Cursor := Cursor_To_Declare; end if; if ( Nbr_of_Parameters > 0 or Nbr_Of_Columns > 0 or -- R.2 Cursor_To_Declare /= Blank_Identifier ) -- R.1 and Q /= Null_Unbounded_String then Ada( E, Invoke("PREPARE(") & GNADE_Handle(E) & "," ); Ada( E, " " & Context_Object(E) & "," ); Ada( E, " " & To_String(Q) & "," ); Ada( E, " " & SQLCA_Access(E) & "," ); Ada( E, " " & "Is_Reopenable =>" & Boolean'Image(Is_Reopenable) & Cursor_Arg(e) & ");" ); E.Eval_Result := True; else E.Eval_Result := False; end if; end ODBC_Prepare_Query; ------------------ -- ODBC_Execute -- ------------------ procedure ODBC_Execute( e : in ESQL_Reader ) is -- Execute the command. If there are columns exptected to -- be returned by the DBCS a fetch is executed. -- -- The following rules do apply: -- R.1 - If there is a cursor to be closed, only a close cursor -- statement is generated -- R.2 - If the query is not part of an declare cursor caluse -- an execute is directly inserted. Otherwise it is left -- to open cursor evaluation. -- R.3 - In case of an FETCH operation we include only the -- fetch. -- R.4 - In case of an dynamic SQL statement use the cursor -- as derived from the statement name. -- R.5 - In case of an open cursor, simply insert an execute -- on the cursor, which creates the result set. Query : Unbounded_String renames e.Query_String; Nbr_Of_Parameters : Natural renames e.Nbr_Of_Parameters; Nbr_Of_Columns : Natural renames e.Nbr_Of_Columns; Columns : Identifier_Array renames e.Columns; Inject_Fetch : Boolean renames e.Inject_Fetch; Cursor_To_Close : Identifier_String renames e.Cursor_To_Close; Cursor_To_Open : Identifier_String renames e.Cursor_To_Open; Cursor_To_Declare : Identifier_String renames e.Cursor_To_Declare; Current_Cursor : Identifier_String renames e.Current_Cursor; Cursor_Dynamic_SQL: Identifier_String renames E.Cursor_Dynamic_SQL; Finalize_Cursor : Boolean renames e.Finalize_Cursor; begin Ada( E, "-- Execute"); if Query /= Null_Unbounded_String then if Cursor_To_Declare = Blank_Identifier then -- R.2 if Nbr_of_Parameters > 0 or Nbr_Of_Columns > 0 then -- the query has been prepared ealier. Ada( e, Invoke("EXECUTE(") & GNADE_Handle(E) & "," & SQLCA_Access(E) & Cursor_Arg(E) & ");"); else -- no preparation has been done, do an direct execute. Ada( e, Invoke("EXECUTE(") & GNADE_Handle(E) & "," & SQLCA_Access(E) & ", " ); Ada( e, " Statement => " & Long_String(E, Query) & Cursor_Arg(E) & ");"); end if; ODBC_Debug(E, Comments => "Execute", Query => Long_String(E, Query)); end if; elsif Cursor_Dynamic_SQL /= Blank_Identifier then -- R.4 Current_Cursor := Cursor_Dynamic_SQL; Ada( E, Invoke("EXECUTE(") & GNADE_Handle(E) & "," & SQLCA_Access(E) & Cursor_Arg(E) & ");"); ODBC_Debug( E, Query => "", Comments => "Execute"); elsif Cursor_To_Close /= Blank_Identifier then -- R.1 Ada( e, Invoke("CLOSE_CURSOR(") & GNADE_Handle(E) & "," ); Ada( e, " " & Quote( Cursor_Name( E, Cursor_To_Close ) ) & "," ); Ada( E, " Finalize=>" & Boolean'Image(Finalize_Cursor) & ");" ); ODBC_Debug(E, Query => "", Comments => "CLOSE_CURSOR" ); elsif Cursor_To_Open /= Blank_Identifier then Ada( e, Invoke("EXECUTE(") & GNADE_Handle(E) & "," & SQLCA_Access(E) & "," & "CURSOR =>" & Quote( Cursor_Name( E, Cursor_To_Open ) ) & ");"); ODBC_Debug(E, Query => "", Comments => "EXECUTE " ); end if; --- Bug fix 0701.3: In case of fetch we only insert the fetch command but --- the query is Null_Unbounded_String. if Inject_Fetch then Ada( e, Invoke("FETCH(") & GNADE_Handle(E) & "," & SQLCA_Access(E) & Cursor_Arg(E) & ");" ); end if; E.Eval_Result := True; end ODBC_Execute; -------------------------- -- ODBC_Bind_Parameters -- -------------------------- procedure ODBC_Bind_Parameters( e : in ESQL_Reader ) is -- Bind the parameters if the query Nbr_Of_Parameters : Natural renames e.Nbr_Of_Parameters; Parameters : Identifier_Array renames E.Parameters; Parameter_Ind : Identifier_Array renames E.Parameter_Ind; procedure Bindparameter( No : in Natural; Variable : in String; Size : in String; Ctype : in String; Indicator : in String ) is -- create the ESQL_Support.Bindparamter call begin ADA( E, Invoke("BINDPARAMETER(") ); Ada( E, " " & GNADE_Handle(E) & "," ); Ada( E, " " & Natural'Image(No) & "," ); Ada( E, " " & Name(variable) & "'Address" & "," ); Ada( E, " " & Name(Size) & "'Size" & "," ); Ada( E, " " & Ctype & "," ); Ada( e, " " & Make_Access(E, Indicator) ); Ada( E, " " & Cursor_Arg(e) ); Ada( E, " );" ); end Bindparameter; --- begin for i in 1..Nbr_Of_Parameters loop Ada( e, "", comment => "Parameter Binding " & Parameters(i) ); case Type_Of_Host_Variable( Parameters(I) ) is --------------------------------------------------------------- -- Handle all standard data types which requiere an explicit -- -- indicator type. -- --------------------------------------------------------------- when ISO92_CHAR_TYPE..ISO92_INDICATOR_TYPE | GNADE_BINARY_TYPE => declare Ind_Variable : Identifier_String := Blank_Identifier; begin if Parameter_Ind(I) /= Blank_Identifier then Ind_Variable := Parameter_Ind(i); else Ind_Variable := To_Identifier( Indicator_Variable(Parameters(I)) ); end if; Bindparameter( No => I, Variable => Parameters(I), Size => Parameters(I), Ctype => Host_Var_Type_String(Parameters(I)), Indicator => Ind_Variable ); end; --------------------------------------------------------------- -- Handle the GNADE implementation of strings with variable -- -- length. -- --------------------------------------------------------------- when GNADE_VARCHAR_TYPE | GNADE_VARBINARY_TYPE => Bindparameter( No => I, Variable => Name(Parameters(I)) & ".Value", Size => Name(Parameters(I)) & ".Value", Ctype => Host_Var_Type_String(Parameters(I)), Indicator => Name(Parameters(I)) & ".Length" ); when others => Syntax_Error( E, "binding to unknown data type " ); end case; end loop; end ODBC_Bind_Parameters; ----------------------- -- ODBC_Bind_Columns -- ----------------------- procedure ODBC_Bind_Columns( e : in ESQL_Reader ) is -- Bind the columns as they have been specified e.q. by -- the into clause. Current_Cursor : Identifier_String renames e.Current_Cursor; Columns : Identifier_Array renames e.Columns; Nbr_Of_Columns : Natural renames e.Nbr_Of_Columns; Indicators : Identifier_Array renames e.Indicators; Indicator_Var : Identifier_String; procedure BindColumn( No : in Natural; Variable : in String; Size : in String; Ctype : in String; Indicator : in String ) is begin Ada( E, " " & Invoke("BINDCOLUMN(") ); Ada( E, " " & GNADE_Handle(E) & "," ); Ada( E, " " & Natural'Image(No) & "," ); Ada( E, " " & Name(Variable) & "'Address" & "," ); Ada( E, " " & Name(Size) & "'Size" & "," ); Ada( E, " " & Ctype & "," ); Ada( E, " " & Make_Access(E, Indicator) ); Ada( E, " " & Cursor_Arg(e) & ");" ); end Bindcolumn; begin if Nbr_Of_Columns > 0 then -- only in cases of a named cursor we check the number of bound -- columns. if Current_Cursor /= Blank_Identifier then Ada( E, "IF " & Invoke("Columns(") & GNADE_Handle(E) & Cursor_Arg(E) &") = 0 THEN"); end if; for I in 1..Nbr_Of_Columns loop case Type_Of_Host_Variable( Columns(I) ) is -------------------------------------------------------------- -- Handle the ISO standard types. -- -------------------------------------------------------------- when ISO92_CHAR_TYPE..ISO92_INDICATOR_TYPE | GNADE_BINARY_TYPE => if Indicators(I) = Blank_Identifier then Indicator_Var := To_Identifier(Indicator_Variable(Columns(I))); else Indicator_Var := Indicators(i); end if; Bindcolumn( No => I, Variable => Columns(I), Size => Columns(I), Ctype => Host_Var_Type_String(Columns(I)), Indicator => Indicator_Var ); -------------------------------------------------------------- -- GNADE implementation of VAHRCHAR -- -------------------------------------------------------------- when GNADE_VARCHAR_TYPE | GNADE_VARBINARY_TYPE => Bindcolumn( No => I, Variable => Name(Columns(I)) & ".Value", Size => Name(Columns(I)) & ".Value", Ctype => Host_Var_Type_String(Columns(I)), Indicator => Name(Columns(I)) & ".Length" ); -------------------------------------------------------------- when others => null; end case; end loop; if Current_Cursor /= Blank_Identifier then Ada( E, "END IF;" ); end if; end if; end ODBC_Bind_Columns; -------------------------- -- ODBC_Evaluate_Result -- -------------------------- procedure ODBC_Evaluate_Result( E : in ESQL_Reader; Comment : in String := "" ) is -- Generate the Ada code in order to verify the return codes -- of the ODBC interface. Not_Found_Action : ESQL_Reserved_Words renames e.Not_Found_Action; Not_Found_Target : Identifier_String renames e.Not_Found_target; SQL_Error_Action : ESQL_Reserved_Words renames e.SQL_Error_Action; SQL_Error_Target : Identifier_String renames e.SQL_Error_Target; SQL_Warning_Action : ESQL_Reserved_Words renames e.SQL_Warning_Action; SQL_Warning_Target : Identifier_String renames e.SQL_Warning_Target; Query : Unbounded_String renames e.Query_String; Query_Variable : Unbounded_String renames e.Query_Variable; Q : Unbounded_String ; -- begin if not E.Eval_Result then return; end if; Ada( e, "-- Evaluate_Result" ); if Query /= Null_Unbounded_String then Q := Query ; elsif Query_Variable /= Null_Unbounded_String then Q := Query_Variable; else Q := To_Unbounded_String( E.Cursor_Dynamic_SQL ); end if; Ada( E, "SQLCODE := " & SQLCA_Var(E, "SQLCODE") & ";"); Ada( E, "SQLSTATE := " & SQLCA_Var(E, "STATE") & ";"); if SQL_Error_Action /= ESQL_Continue then Ada( e, "IF ( SQLSTATE(1..2) /= ESQL_SUPPORT.SUCCESS_CLASS AND" ); Ada( E, " SQLSTATE(1..2) /= ESQL_SUPPORT.WARNING_CLASS AND " ); Ada( E, " SQLSTATE(1..2) /= ESQL_SUPPORT.NOTFOUND_CLASS) OR" ); Ada( E, " SQLCODE in SQL_STANDARD.SQL_ERROR THEN" ); Ada_Action( E, SQL_Error_Action, SQL_Error_Target, Comment ); Ada( e, "END IF;"); end if; -- Pro*Ada extension if SQL_Warning_Action /= ESQL_Continue then Ada( e, "IF SQLSTATE(1..2) = ESQL_SUPPORT.WARNING_CLASS THEN" ); Ada_Action( E, SQL_Warning_Action, SQL_Warning_Target, Comment ); Ada( e, "END IF;"); end if; if Not_Found_Action /= ESQL_Continue then Ada( e, "IF SQLSTATE(1..2) = ESQL_SUPPORT.NOTFOUND_CLASS OR" ); Ada( e, " SQLCODE in SQL_STANDARD.NOT_FOUND THEN" ); Ada_Action( E, Not_Found_Action, Not_Found_Target, Comment ); Ada( e, "END IF;" ); end if; end ODBC_Evaluate_Result; ----------------- -- ODBC_Finish -- ----------------- procedure ODBC_Finish( E : in ESQL_reader ) is -- End of an SQL Query block. Not_Found_Action : ESQL_Reserved_Words renames e.Not_Found_Action; SQL_Error_Action : ESQL_Reserved_Words renames e.SQL_Error_Action; SQL_Warning_Action : ESQL_Reserved_Words renames e.SQL_Warning_Action; begin -- Section 19.2 Chapter, general rules 1c for clearing WHENEVER -- conditions. if not Option_ISO92_Exception then SQL_Error_Action := ESQL_Continue; SQL_Warning_Action := ESQL_Continue; Not_Found_Action := ESQL_Continue; end if; Ada( E, "exception"); Ada( E, " when The_Error : Others =>"); ODBC_Debug( E, Query => "", Force => True, Comments => "*** ", Reason => "Exception_Information(The_Error)" ); Ada( E, " raise;"); Ada_End(e); end ODBC_Finish; ---------------------- -- ODBC_SQL_Context -- ---------------------- procedure ODBC_SQL_Context( e : in ESQL_Reader ) is -- This procedure generates the implict SQL context. The procedure -- generates the local and the global environment. begin if not e.Global_SQL_Env_Set then if not Option_No_SQLSTATE then Ada( e, "SQLCODE : SQL_STANDARD.SQLCODE_TYPE ;" ); Ada( e, "SQLSTATE : SQL_STANDARD.SQLSTATE_TYPE;" ); end if; SQLCA_Ada_Declare(E); Ada( e, "" ); Ada( e, "GNADE_DB_DEFAULT : " & Invoke("CONNECTION_HANDLE") & " := NULL;" ); Ada( E, "GNADE_G_CONTEXT : " & Invoke("CONTEXT_TYPE") & ";" ); Ada( e, "" ); e.Global_SQL_Env_Set := True; else null; end if; end ODBC_SQL_Context; ------------------ -- ODBC_Connect -- ------------------ procedure ODBC_Connect( E : in ESQL_Reader ) is -- Generate the name of the connection handle and call the -- connect primitive of ESQL_Support. Exception_Inserted : Boolean := False; Connection_Errors : Connection_Error_Array renames E.Connection_Errors; begin Ada_Begin( E ); if E.DB_Name /= Blank_Identifier then Ada( e, GNADE_Handle(E) & ":=" & Invoke_Connector("Connect(") & String_Arg( E.DB_Name ) & ", " & String_Arg( E.Login_Name ) & ", " & String_Arg( E.Password ) & ");" ); else Ada(e, " NULL;" ); end if; Ada( e, "" ); for I in Connection_Error_Type loop if Connection_Errors(I).Action /= ESQL_Continue then if not Exception_Inserted then Exception_Inserted := True; Ada_Exception( E ); end if; case I is when Connection_Failure => Ada( E, "when GNU.DB.SQLCLI.CONNECTION_ERROR =>" ); when Authorization_Failure => Ada( E, "when GNU.DB.SQLCLI.INVALID_AUTH_SPEC =>" ); when Other_Fault => Ada( E, "when Others =>" ); end case; Ada_Action( E, Connection_Errors(I).Action, Connection_Errors(I).Target ); end if; end loop; Ada_End( E ); E.Connection_Errors := ( others => Null_Connection_Error ); end ODBC_Connect; --------------------- -- ODBC_Disconnect -- --------------------- procedure ODBC_Disconnect( E : in ESQL_Reader ) is -- gnerate a diconnect poricedure call Connection_To_Close : Identifier_String renames E.Cursor_To_Close; Connection : Identifier_String renames E.Connection; Perform_Commit : Boolean renames E.Perform_Commit; begin Connection := Connection_To_Close; Ada( E, Invoke_Connector("DISCONNECT(") & GNADE_Handle(E) & "," & Context_Object(E) & "," & "Commit => " & Boolean'Image(Perform_Commit) & ");" ); end ODBC_Disconnect; ---========================================================================--- ---=== P A R S E R P R O C E D U R E S ===--- ---========================================================================--- -------------------------- -- Verify_Host_Variable -- -------------------------- procedure Verify_Host_Variable( e : in ESQL_Reader; name : in Identifier_String ) is -- Check wether a name is defined in the table of all host variables. Variable : Host_Variable_Record ; begin Fetch( Host_Vars, Trim(Upper_Case(Name),Right), Variable ); exception when Entry_Not_Found => Syntax_Error( e, "'" & Trim(Name,Right) & "' not defined in DECLARE SECTION" ); end Verify_Host_Variable; ----------------------------- -- Ada_Variable_Constraint -- ----------------------------- procedure Ada_Variable_Constraint( e : in ESQL_Reader ) is -- -- This procedure handles constraints e.g. X(1..10). This feature -- is not realy supported but it will be provided in the -- future. -- Current : ESQL_Reserved_Words; begin Current := Next_Symbol(e); if Current = ESQL_Open_Bracket then Pedantic( e, "constraints in host variables not supported"); Skip_Till( e, ESQL_Close_Bracket ); else Push_Back_Current_Token(e); end if; end Ada_Variable_Constraint; ---------------------------- -- Embedded_Host_Variable -- ---------------------------- procedure Embedded_Host_Variable( e : in ESQL_Reader; Variable_Name : out Identifier_String; Indicator_Name : out Identifier_String ) is -- Handle the host variable syntax: -- ':' [ [ 'INDICATOR' ':' ] ] Current : ESQL_Reserved_Words; begin Expect( e, ESQL_Colon ); Expect( e, ESQL_Identifier ); Variable_Name := Identifier(e); Verify_Host_Variable( e, Variable_Name ); Ada_Variable_Constraint(e); Current := Next_Symbol(e); if Current = ESQL_Indicator then -- Pro*Ada extension Pedantic( E, "using non ISO/92 indicator keyword" ); Current := Next_Symbol(E); if Current /= ESQL_Colon then Syntax_Error( E, "Expected host variable after INDICATOR"); end if; end if; if Current = ESQL_Colon then -- expecting an indicator variable for the current column Expect( e, ESQL_Identifier ); Indicator_Name := Identifier(E); Verify_Host_Variable( e, Indicator_Name ); else Indicator_Name := Blank_Identifier; Push_Back_Current_Token(E); end if; end Embedded_Host_Variable; -------------------------- -- Embedded_INTO_Clause -- -------------------------- procedure Embedded_INTO_Clause( e : in ESQL_Reader ) is -- INTO Current : ESQL_Reserved_Words; Columns : Identifier_Array renames e.Columns; Indicators : Identifier_Array renames e.Indicators; Nbr_Of_Columns : Natural renames e.Nbr_Of_Columns; -- begin for i in Columns'Range loop Embedded_Host_Variable(E, Columns(I), Indicators(I)); Nbr_Of_Columns := Nbr_Of_Columns + 1; Current := Next_Symbol(e); exit when Current /= ESQL_Comma; end loop; end Embedded_INTO_Clause; ----------------------------- -- ISO92_Fetch_From_Cursor -- ----------------------------- procedure ISO92_Fetch_From_Cursor( E : ESQL_Reader ) is -- FETCH FROM [ INTO ..... ; ] -- FETCH [ INTO ] -- FETCH USING [ STATEMENT ] [ INTO .... ; ] Current : ESQL_Reserved_Words; Current_Cursor : Identifier_String renames e.Current_Cursor; Current_Statement: Identifier_String renames e.Current_Cursor; Inject_Fetch : Boolean renames e.Inject_Fetch; --- begin Current := Next_Symbol(E); case Current is when ESQL_From => Expect( E, ESQL_Identifier ); Current_Cursor := Upper_Case(Identifier(E)); --****-- when ESQL_Using => Current := Next_Symbol(E); if Current /= ESQL_Statement then Push_Back_Current_Token(E); end if; Expect( E, ESQL_Identifier ); Current_Cursor := Upper_Case(Identifier(E)); --****-- when ESQL_Into => Current_Cursor := Blank_Identifier; Push_Back_Current_Token(E); when others => Syntax_Error( E, "excpected token in FETCH clause" ); end case; Inject_Fetch := True; -- force the generation of a fetch Current := Next_Symbol(E); if Current = ESQL_Into then Embedded_INTO_Clause(E); end if; Push_Back_Current_Token(E); Skip_Till( E, e.ESQL_Terminator ); end ISO92_Fetch_From_Cursor; --------------------- -- Append_To_Query -- --------------------- function Append_To_Query( E : in ESQL_Reader; Query : in Unbounded_String ) return Unbounded_String is -- this function appends the current token to the query string -- passed. -- R.1 - If the current symbol is a terminal then no blank -- will be appended -- R.2 - If we find a dot, this function consumes the next -- string as well, because we assume it to be a part -- for a relation name (e.g. employees.empno). This is -- is an ugly solution but the best place to put it. Result : Unbounded_String := Query; Current : ESQL_Reserved_Words := E.Current_Keyword; S : Unbounded_String := To_Unbounded_String( Name(E.Current) ); begin while Current = ESQL_DOT loop -- R.2 Result := Result & "."; Current := Next_Symbol(E); Result := Result & To_Unbounded_String( Name( E.Current ) ); Current := Next_Symbol(E); if Current /= ESQL_DOT then Push_Back_Current_Token(E); S := Null_Unbounded_String; end if; end loop; if not Is_Terminal(E.Current_Keyword) then -- R.1 Result := Result & " "; end if; Result := Result & S; return Result; end Append_To_Query; ------------------------- -- ISO92_SQL_Statement -- ------------------------- procedure ISO92_SQL_Statement( E : in ESQL_Reader; Previous_Token : in ESQL_Reserved_Words := ESQL_Null ) is -- Parse the queries by reading all data till the current terminator -- symbol and building ODBC query and then bind the parameters. -- -- The previous_token parameter shall be used in case where it -- is not possible to use the Push_Back mechanism, as e.g. i case -- of the handling of the BEGIN token. -- -- BEGIN DECLARE ---> Declare section -- BEGIN ---> ISO92 query. Current : ESQL_Reserved_Words; Query : Unbounded_String renames e.Query_String; Columns : Identifier_Array renames e.Columns; Indicators : Identifier_Array renames e.Indicators; Nbr_Of_Columns : Natural renames e.Nbr_Of_Columns; Inject_Fetch : Boolean renames e.Inject_Fetch; Operation : ESQL_Reserved_Words := ESQL_Null; begin if previous_token /= ESQL_NULL then Query := Query & To_Unbounded_String( Trim(Keywords(Previous_Token),Right) ); end if; -- process and INTO's in the SELECT or FETCH Current := Next_Symbol(e); case Current is -- Pro*Ada Syntax: Select [INTO ] FROM when ESQL_Select => Operation := Current; Query := Append_To_Query( E, Query ); Current := Next_Symbol(e); while Current /= ESQL_INTO and Current /= E.ESQL_Terminator and Current /= ESQL_FROM loop Query := Append_To_Query( E, Query ); Current := Next_Symbol(E); end loop; if Current = ESQL_INTO then -- this hack is used to identify a temporary table e,g -- SELECT ... INTO [TEMPORARY|TEMP] Current := Next_Symbol(E); if Current = ESQL_TEMPORARY or Current = ESQL_TEMP then Query := Query & " INTO "; else Push_Back_Current_Token(E); Embedded_INTO_Clause(E); Inject_Fetch := True; end if; end if; Push_Back_Current_Token(E); -- Pro*Ada Syntax: Fetch FROM [ INTO ] when ESQL_Fetch => ISO92_Fetch_From_Cursor(E); Query := Null_Unbounded_String; Push_Back_Current_Token(E); when ESQL_Semicolon => -- this is a WoA for queries as i.e. 'EXEC SQL BEGIN ;' Push_Back_Current_Token(e); when Others => Query := Append_To_Query( E, Query ); end case; -- handle the remaining part of the query Current := Next_Symbol( E ); while Current /= e.ESQL_Terminator loop if Current = ESQL_Colon then declare Parameter : Identifier_String; begin Expect(e, ESQL_Identifier); Parameter := Identifier(E); Verify_Host_Variable( e, Identifier(e) ); Ada_Variable_Constraint(e); Query := Query & "? " ; Current := Next_Symbol(E); if Current = ESQL_Indicator then Expect(E, ESQL_Colon ); Expect(E, ESQL_Identifier); Add_Parameter( e, Parameter, Identifier(E) ); elsif Current = ESQL_Colon then Expect( E, ESQL_Identifier ); Add_Parameter( e, Parameter, Identifier(E) ); else Push_Back_Current_Token(E); Add_Parameter( e, Parameter ); end if; end; else Query := Append_To_Query( E, Query ); end if; Current := Next_Symbol( e ); end loop; end ISO92_SQL_Statement; ---------------------- -- Table_Definition -- ---------------------- procedure Table_Definition( E : in ESQL_Reader; Table_Name : in Identifier_String ) is -- Handle a tabledefintion based upon embedded SQL: -- -- '(' ')' -- table_definition := [ ',' ] Current : ESQL_Reserved_Words; Column_Name : Identifier_String := Blank_Identifier; Column_Type : Identifier_String := Blank_Identifier; Length : Natural := 0; procedure Schema( S : in String ) is begin if Option_Schema then Put_Line(Schema_File, S ); end if; end Schema; function Is_Allowed_Type ( S : in Identifier_String ) return Boolean is begin for I in SQL_Type_Mapping'Range loop if S = Sql_Type_Mapping(I) then return True; end if; end loop; return False; end ; Result : Unbounded_String := Null_Unbounded_String; begin Expect( E, ESQL_Open_Bracket ); if Option_Verbose then Put_Line(" Table : " & Table_Name ); end if; Schema( "CREATE TABLE " & Trim(Table_Name, Right) & " ( " ); Current := Next_Symbol(E); while Current /= ESQL_Close_Bracket loop declare Nesting : Integer := 0; begin if Current = ESQL_Identifier then Column_Name := Identifier(E); else Syntax_Error(E, "keyword in column name not allowed"); end if; if Option_Verbose then Put_Line( " " & Column_Name ); end if; -- read in the data type name Expect(E, ESQL_Identifier ); Column_Type := Identifier(E); Result := To_Unbounded_String( Name( Column_Name ) & " " & Name( Column_Type ) & " " ); -- scan in the rest of the definition e.g. attributes. loop Current := Next_Symbol(E); case Current is when ESQL_Open_Bracket => Nesting := Nesting + 1; when ESQL_Close_Bracket => if Nesting > 0 then Nesting := Nesting - 1; else -- closing bracket of the table decl. exit; end if; when ESQL_Comma => -- end ofthe column definition if Nesting = 0 then Result := Result & "," ; exit; end if; when others => null; end case; Result := Result & To_Unbounded_String( Name( E.Current) &" " ); end loop; Schema( To_String( Result ) ); exit when Current /= ESQL_Comma; Current := Next_Symbol(E); end; end loop; Schema( ");" ); Schema(""); end Table_Definition; ---------------------- -- Embedded_Declare -- ---------------------- procedure Embedded_Declare( e : ESQL_Reader ) is -- Handle the declare clause: -- DECLARE CUSOR .... -- DECLARE DATABASE -- DECLARE TABLE -- DECLARE STATEMENT Current : ESQL_Reserved_Words; Query : Unbounded_String renames e.Query_String; AName : Identifier_String; Cursor_To_Declare : Identifier_String renames E.Cursor_To_Declare; begin Expect( E, ESQL_Identifier ); aName := Identifier(e); Current := Next_Symbol(e); case Current is when ESQL_DATABASE => -- Pro*Ada extension Insert_DB_Table_Name(E, aName); Ada( E, GNADE_Handle( AName ) & " : " & Invoke("CONNECTION_HANDLE")); when ESQL_TABLE => Table_Definition(E, AName); Skip_Till( E, E.ESQL_Terminator ); when ESQL_STATEMENT => Pedantic(E, "using non ISO/92 dynamic SQL declare construct"); Insert_STATEMENT_Name(E, AName ); E.Statement_Name := AName; Skip_Till( E, e.ESQL_Terminator ); when others => -- DECLARE name [REOPENABLE | LOCAL ] CURSOR FOR SQL statement Cursor_To_Declare := Upper_Case(AName); case Current is when ESQL_Reopenable => Pedantic(E, "using non ISO/92 reopenable cursor"); E.Cursor_Is_Reopenable := True; Expect( E, ESQL_CURSOR ); when ESQL_Local => Pedantic(E, "using non ISO/92 local cursor"); E.Cursor_Is_Local := True; Expect( E, ESQL_CURSOR ); when ESQL_CURSOR => null; when others => Syntax_Error( E, "unexpected token " & ESQL_Reserved_Words'Image(Current) & " in DECLARE clause"); end case; Expect( E, ESQL_FOR ); -- Handle the query part ISO92_SQL_Statement(e); E.Inject_Fetch := False; ODBC_Prelude( e ); ODBC_Prepare_Query( e ); ODBC_Evaluate_Result (E, Comment => "Prepare"); ODBC_Bind_Parameters( e ); ODBC_Bind_Columns( e ); ODBC_Execute( e ); ODBC_Evaluate_Result (E, Comment => "Declare Cursor"); ODBC_Finish(e); end case; end Embedded_Declare; -------------------------- -- Embedded_Var_Declare -- -------------------------- procedure Embedded_Var_Declare( E : in ESQL_Reader ) is -- Analyze the VAR decalraton of PRO*Ada, but do nothing -- with the information. -- VAR host_variable is ..... ; Current : ESQL_Reserved_Words; -- begin if Option_Pedantic then Syntax_Error(E, "non ISO/92 VAR clause is not supported"); else Warning( E, "non ISO/92 VAR clause ignored" ); end if; Current := Next_Symbol(E); if Current = ESQL_Colon then Current := Next_Symbol(E); end if; Expect( E, ADA_IS ); Skip_Till( E, E.ESQL_Terminator ); end Embedded_Var_Declare; ---------------------------- -- Ada_Variable_Defintion -- ---------------------------- procedure Ada_Variable_Definition( e : in ESQL_Reader ) is -- -- Section 19.3 -- [,] ':' ...... ';' -- -- The information after the type is not analyzed by the -- parser, it is simply copied throught into the result -- file. The Ada compiler has to deal with it. -- -- All host viariables will be defined with the attribute -- aliased. -- -- R.1 - In order to accept package names in front of types only -- one package name is prepended: -- type ::= [ '.' ] -- Names : Identifier_Array(1..50); Base_Type : Identifier_String := Blank_Identifier; Length : Natural := 0; Current : ESQL_Reserved_Words; --- begin Identifier_List( e, Names, Length, mode => Accept_Token ); Expect(e, ESQL_Colon, mode => Accept_Token, Where => "host variable defintion"); Expect(e, ESQL_Identifier, Mode => Defere_Copy ); -- R.1 Base_Type := Identifier(E); Current := Next_Symbol(E, Mode => Defere_Copy ); if Current = ESQL_Dot then Base_Type := Append( Base_Type, "." ); Expect(e, ESQL_Identifier, Mode => Defere_Copy ); Base_Type := Append( Base_Type, Identifier(E)); else Push_Back_Current_Token(E); end if; if SQL92_Type( Base_Type ) = ISO92_INDICATOR_TYPE then Accept_String( E.Reader, " aliased " ); end if; case SQL92_Type( Base_Type ) is when ISO92_CHAR_TYPE => Current := Next_Symbol(E, Mode => Accept_Token); if Current = ESQL_Character then Syntax_Error( E, "CHARACTER SET CLAUSE not supported"); elsif Current /= ESQL_Open_Bracket then Syntax_Error( E, "( missing in CHAR type specification"); end if; Expect( E, ESQL_Identifier, Mode => Accept_Token ); Expect( E, ESQL_Range, Mode => Accept_Token ); Expect( E, ESQL_Identifier, Mode => Accept_Token ); Expect( E, ESQL_Close_Bracket, Mode => Accept_Token); when ISO92_BIT_TYPE => Expect( E, ESQL_Open_Bracket, Mode => Accept_Token ); Expect( E, ESQL_Identifier, Mode => Accept_Token ); Expect( E, ESQL_Range, Mode => Accept_Token ); Expect( E, ESQL_Identifier, Mode => Accept_Token ); Expect( E, ESQL_Close_Bracket, Mode => Accept_Token ); when ISO92_Unknown_Type => Syntax_Error( e, "Type " & Name(Base_Type) & " is not a predefined SQL/92 type" ); when others => null; end case; Skip_Till(e, ESQL_Semicolon, mode => Accept_Token ); for i in 1..Length loop Add_Host_Variable( Names(i), Base_Type ); end loop; end Ada_Variable_Definition; ---------------------------------------- -- Embedded_Character_Set_Declaration -- ---------------------------------------- procedure Embedded_Character_Set_Declaration( e : in ESQL_Reader ) is -- Handle: -- SQL NAMES ARE -- Remark: -- The semantics of the commandare not yet evaluated -- at all. Current : ESQL_Reserved_Words; -- begin Current := Next_Symbol( e, mode => Defere_Copy ); if Current /= ESQL_SQL then Accept_Symbol(e); Push_Back_Current_Token(e); return; end if; Expect( e, ESQL_SQL ); Expect( e, ESQL_Names ); Expect( e, ESQL_Are ); Pedantic( e, "embedded character set declaration not supported"); Skip_Till( e, ESQL_Semicolon, mode => Suppress_Token ); end Embedded_Character_Set_Declaration; ---------------------------------- -- Embedded_SQL_Declare_Section -- ---------------------------------- procedure Embedded_SQL_Declare_Section( e : in out ESQL_Reader ) is -- Parse the declaration section for ESQL for parameters. -- -- EXEC SQL BEGIN DECLARE SECTION [] -- -- ':' ....';' -- ....... -- EXEC SQL END DECLARE SECTION [] -- -- The type will only be parsed partialy, because the -- name is suffcient to verify if there exist a mapping -- between underlying ODBC and the Ada type. Current : ESQL_Reserved_Words; Host_Variable : Identifier_String := Blank_Identifier; Host_Type : Identifier_String := Blank_Identifier; --- begin Expect(e, ESQL_Declare, where => "declare section" ); Expect(e, ESQL_Section ); SQL_Terminator(e); Ada( E, "" ); Ada( E, " GNADE_L_CONTEXT : " & Invoke("CONTEXT_TYPE") & ";" ); Current := Next_Symbol( e, mode => Defere_Copy); if Current = ESQL_SQL then Embedded_Character_Set_Declaration(e); else while Current /= ESQL_EXEC loop -- host variable definition Push_Back_Current_Token(e); Ada_Variable_Definition(e); Current := Next_Symbol( e, mode => Defere_Copy ); end loop; end if; ODBC_SQL_Context(e); Expect( e, ESQL_SQL ); Expect( e, ESQL_END ); Expect( e, ESQL_Declare ); Expect( e, ESQL_Section ); SQL_Terminator(e); end Embedded_SQL_Declare_Section; ---------------------- -- Condition_Action -- ---------------------- function Condition_Action ( e : ESQL_Reader ) return ESQL_Reserved_Words is -- -- Handle the action clause of a WHENEVER CLAUSE -- -- actions :== { 'GOTO' | 'GO' 'TO' } -- | 'RAISE' -- | 'DO' -- | 'CONTINUE' -- ; Action : ESQL_Reserved_Words; -- begin Action := Next_Symbol(e); case Action is when ESQL_GO | ESQL_GOTO => -- ISO/92 -- handle GO TO and GOTO if Action = ESQL_GO then Expect( e, ESQL_TO ); end if; Action := ESQL_GOTO; when ESQL_Continue => -- ISO/92 null; when ADA_Raise | Ada_DO => -- Pro*Ada extension Pedantic(e, "using non ISO/92 action in 'whenever' clause"); when Others => Syntax_Error( e, "unexpected token " & Name(e.Current) & " in action of when ever clause"); end case; return Action; end Condition_Action; ------------------------------------ -- Embedded_Exception_Declaration -- ------------------------------------ procedure Embedded_Exception_Declaration( e : in ESQL_Reader ) is -- -- Declare Exception handling :== -- WHENEVER -- -- condition :== { 'NOT FOUND' | 'SQLERROR' | 'SQLWARNING' } -- Current : ESQL_Reserved_Words; Not_Found_Action : ESQL_Reserved_Words renames e.Not_Found_Action; Not_Found_Target : Identifier_String renames e.Not_Found_target; SQL_Error_Action : ESQL_Reserved_Words renames e.SQL_Error_Action; SQL_Error_Target : Identifier_String renames e.SQL_Error_Target; SQL_Warning_Action : ESQL_Reserved_Words renames e.SQL_Warning_Action; SQL_Warning_Target : Identifier_String renames e.SQL_Warning_Target; --- begin Current := Next_Symbol(e); case Current is when ESQL_Not => -- NOT FOUND Expect( e, ESQL_Found ); Not_Found_Action := Condition_Action(e); if Not_Found_Action /= ESQL_Continue then Expect( e, ESQL_Identifier ); Not_Found_Target := Identifier(e); end if; when ESQL_SQL_Error => SQL_Error_Action := Condition_Action(e); if SQL_Error_Action /= ESQL_Continue then Expect( e, ESQL_Identifier ); SQL_Error_Target := Identifier(e); end if; when ESQL_SQL_Warning => -- Pro*Ada Extension Pedantic( e, "non ISO/92 SQLWARNING cause in whenever clause used"); SQL_Warning_Action := Condition_Action(e); if SQL_Warning_Action /= ESQL_Continue then Expect( e, ESQL_Identifier ); SQL_Warning_Target := Identifier(e); end if; when Others => Syntax_Error(e, "unexpected condition " & Name( e.Current) & " in whenever clause"); end case; Skip_Till( E, E.ESQL_Terminator ); end Embedded_Exception_Declaration; ---------------------- -- Embedded_Connect -- ---------------------- procedure Embedded_Connect( e : ESQL_Reader ) is -- -- CONNECT [ user ] -- [ BY ] -- [ TO { | DEFAULT } ] -- [ AT ] -- [ PORT ] -- [ AS ] -- [ IDENTIFIED BY ] ] -- [ ON ] [RAISE|GOTO] -- -- This syntax is a mixture of several other dialects. Hope fully -- if meets the requirements of every body. -- -- Current : ESQL_Reserved_Words; DB_Name : Identifier_String renames e.DB_Name; Login_Name : Identifier_String renames e.Login_Name; Password : Identifier_String renames e.Password; Connection : Identifier_String renames e.Connection; Host : Identifier_String renames E.Host; Port : Identifier_String renames E.Port; Error_Name : constant array( Connection_Error_Type ) of Identifier_String := ( Connection_Failure => "COMMUNICATION ", Authorization_Failure => "AUTHORIZATION ", Other_Fault => "OTHER " ); -- begin Current := Next_Symbol(E); if Current = ESQL_Identifier then Login_Name := Identifier(E); Current := Next_Symbol(E); end if; while Current /= ESQL_Semicolon loop case Current is when ESQL_BY => Expect( E, ESQL_Identifier ); Connection := Identifier(E); if not Is_Database_Name(Connection) then Syntax_Error( E, Name(Connection) & " not a database " ); end if; when ESQL_TO => Current := Next_Symbol(E); if Current = ESQL_DEFAULT then Warning( E, "default in to clause of connect ignored"); end if; DB_Name := Identifier(E); when ESQL_AS => Expect( E, ESQL_Identifier); if Login_Name /= Blank_Identifier then Warning(E, "username already defined, ignoring: " & Trim(Identifier(E),Right)); else Login_Name := Identifier(E); end if; when ESQL_Identified => Expect( E, ESQL_BY ); Expect( E, ESQL_Identifier); Password := Identifier(E); when ESQL_AT => Expect( E, ESQL_Identifier ); Host := Identifier(E); when ESQL_ON => declare Error : Connection_Error_Type := Other_Fault; Found : Boolean := False; begin -- ON ERROR [RAISE|GOTO|CALL] Expect( E, ESQL_Identifier ); for I in Connection_Error_Type loop if Error_Name(I) = Identifier(E) then Error := I; Found := True; exit; end if; end loop; if not Found then Syntax_Error( E, "unknown error type in ON clause"); end if; Expect( E, ESQL_Error ); Current := Next_Symbol(E); if Current /= ADA_Raise and Current /= ADA_DO and Current /= ESQL_Goto then Syntax_Error( E, "unknown action in ON clause" ); else E.Connection_Errors( Error ).Action := Current; end if; Expect( E, ESQL_Identifier ); E.Connection_Errors( Error ).Target := Identifier(E); end; when others => Syntax_Error(E, "unexpected token in CONNECT clause" ); end case; Current := Next_Symbol(E); end loop; end Embedded_Connect; ------------------------- -- Embedded_Disconnect -- ------------------------- procedure Embedded_Disconnect( E : in out ESQL_Reader ) is -- -- diconnect from the selected data base: -- DISCONNECT [ ALL | ] [ COMMIT ] ';' -- Current : ESQL_Reserved_Words; Connection_To_Close : Identifier_String renames E.Cursor_To_Close; Connection : Identifier_String renames E.Connection; Perform_Commit : Boolean renames E.Perform_Commit; begin Connection_To_Close := Connection; Current := Next_Symbol(E); case Current is when ESQL_All => Current := Next_Symbol(E); when ESQL_Identifier => if Connection /= Default_Connection then Pedantic(E, "overriding connection in AT clause"); end if; Connection_To_Close := Identifier(E); Current := Next_Symbol(E); when others => null; end case; if Current = ESQL_Commit then -- GNU extension Perform_Commit := True; else Push_Back_Current_Token(E); end if; Skip_Till( E, E.ESQL_Terminator ); end Embedded_Disconnect; ------------------------- -- Embedded_Connection -- ------------------------- procedure Embedded_Database( E : in out ESQL_Reader ) is -- DATABASE IS -- -- This construct allows to set the referenced data base -- to the identifier specified. -- Instance_Name : Identifier_String := Blank_Identifier; Cursor_Name : Identifier_String := Blank_Identifier; begin Expect( E, ADA_Is ); Expect( E, ESQL_Identifier); Ada( E, GNADE_Handle(E.Connection) & ":=" & GNADE_Handle(Identifier(E)) & ";" ); end Embedded_Database; ---------------------- -- Embedded_Include -- ---------------------- procedure Embedded_INCLUDE( e : in out ESQL_Reader ) is -- INCLUDE [SQLCA | DATABASE ] [ NAMED [BY] ] -- INCLUDE STATEMENT HANDLE [ ] OF -- -- This command is used to insert certain strings into the Ada 95 -- code (e.g. the Connection Handle). In order to allow to embedd -- the result into a procedure Argument no final ';' is -- expected. Current : ESQL_Reserved_Words; Object : ESQL_Reserved_Words; Instance_Name : Identifier_String := Blank_Identifier; Cursor_Name : Identifier_String := Blank_Identifier; begin Object := Next_Symbol(E); Current := Next_Symbol(E); case Current is when ESQL_NAMED => Current := Next_Symbol(E); if Current = ESQL_BY then Current := Next_Symbol(E); end if; if Current = ESQL_Identifier then Instance_Name := Identifier(E); else Syntax_Error( E, "keyword in NAMED BY clause of include not allowed"); end if; when ESQL_Semicolon => null; when ESQL_Handle => Pedantic(E, "non ISO/92 include clause used"); case Object is when ESQL_Statement => Current := Next_Symbol(E); if Current = ESQL_Identifier then Cursor_Name := Identifier(E); Current := Next_Symbol(E); end if; if Current /= ESQL_OF then Syntax_Error(E, "missing OF in DATABASE HANDLE clause"); else Current := Next_Symbol(E); end if; Instance_Name := Identifier(E); when ESQL_Connection => Expect( E, ESQL_OF, Where => "DATABASE CONNECTION clause"); Expect( E, ESQL_Identifier ); Instance_Name := Identifier(E); when others => Syntax_Error(E, "HANDLE clause used in wrong context" ); end case; when others => if Option_Pedantic then Syntax_Error( E, "unknown token in INCLUDE clause" ); else Warning( E, "unknown token in INCLUDE clause ignored" ); end if; end case; Push_Back_Current_Token(E); -- gnerate the code case Object is when ESQL_SQLCA => if Instance_Name /= Blank_Identifier then E.SQLCA_Name := Instance_Name; else E.SQLCA_Name := Default_SQLCA_Name; end if; Ada( E, " " & Trim(E.SQLCA_Name,Right) & " : aliased SQLCA_TYPE; " ); Skip_Till( E, E.ESQL_Terminator ); when ESQL_DATABASE => Accept_String(E.Reader, GNADE_Handle(Trim(Instance_Name,Right)) ); when ESQL_STATEMENT => if Option_DBCS = "ODBC" then Accept_String( E.Reader, "ODBC_Stmt_Handle( " & GNADE_Handle(Trim(Instance_Name,Right)) & "," & String_Arg( Cursor_Name ) & ")" ); else Warning(E, "cannot generate STATEMENT HANDLE clause for selected dbcs"); end if; when ESQL_CONNECTION => if Option_DBCS = "ODBC" then Accept_String( E.Reader, "ODBC_Con_Handle( " & GNADE_Handle(Trim(Instance_Name,Right)) & ")" ); else Warning(E, "cannot generate STATEMENT HANDLE clause for selected dbcs"); end if; when others => Warning( E, "include clause for " & Trim(Identifier(E),Right) & " ignored" ); end case; end Embedded_INCLUDE; -------------------- -- Embedded_Reset -- -------------------- procedure Embedded_Reset( e : in out ESQL_Reader ) is -- This resets include operation for the SQLCA. Current : ESQL_Reserved_Words; begin Current := Next_Symbol(E); if Current = ESQL_SQLCA then Current := Next_Symbol(E); if Current /= E.ESQL_Terminator then E.SQLCA_Name := Identifier(E); else E.SQLCA_Name := DEFAULT_SQLCA_Name; Push_Back_Current_Token(E); end if; else Warning( E, "RESET clause for " & Trim(Identifier(E),Right) & " ignored" ); end if; Skip_Till( E, E.ESQL_Terminator ); end Embedded_Reset; ------------------- -- Embedded_Set -- ------------------- procedure Embedded_Set( E : in out ESQL_Reader ) is -- -- SET CONNECTION -- Connect the default data base to the given connection. -- -- All other set targets are currently ignored. -- Current : ESQL_Reserved_Words; begin Current := Next_Symbol(E); case Current is when ESQL_Connection => Expect( E, ESQL_Identifier ); Ada(E, GNADE_Handle("DEFAULT") & ":=" & GNADE_Handle(Trim(Identifier(E),Right)) ); when others => Pedantic(E, "Unkown set clause ignored" ); end case; end Embedded_Set; ------------------ -- Close_Cursor -- ------------------ procedure Embedded_Close_Cursor( e : ESQL_Reader ) is -- Map the close cursor into a ESQL_SUPPORT (ODBC) operation. Current : ESQL_Reserved_Words; Finalize_Cursor : Boolean renames e.Finalize_Cursor; -- begin Current := Next_Symbol(E); if Current = ESQL_Statement then Expect( E, ESQL_Identifier ); if not Is_Statement_Name(Identifier(E)) then Syntax_Error(E, "unknown statemen in close clause"); return; end if; Push_Back_Current_Token(E); else Push_Back_Current_Token(E); end if; Expect( E, ESQL_Identifier ); e.Cursor_To_Close := Upper_Case( e.Current ); Current := Next_Symbol(E); -- GNU Ada extension if Current = ESQL_Final then Finalize_Cursor := True; Pedantic(E, "using close cursor with FINAL clause"); else Push_Back_Current_Token(E); end if; Skip_Till( E, e.ESQL_Terminator ); end Embedded_Close_Cursor; -------------------------- -- Embedded_Open_Cursor -- -------------------------- procedure Embedded_Open_Cursor( E : ESQL_Reader ) is -- Handle OPEN .... ; Cursor_To_Open : Identifier_String renames e.Cursor_To_Open; -- begin Expect( E, ESQL_Identifier ); Cursor_To_Open := Upper_Case(Identifier(E)); Skip_Till( E, E.ESQL_Terminator ); end Embedded_Open_Cursor; ---------------------- -- Embedded_Prepare -- ---------------------- procedure Embedded_Prepare( E : in ESQL_Reader ) is -- PREPARE -- FROM { | } -- [ USING ] Current : ESQL_Reserved_Words; Statement : Identifier_String := Blank_Identifier; Cursor_To_Declare : Identifier_String renames e.Cursor_To_Declare; Query_Variable : Unbounded_String renames e.Query_Variable; -- begin Pedantic( E, "using non ISO/92 dynamic SQL prepare statement"); Expect( E, ESQL_Identifier ); Statement := Identifier(E); if not Is_Statement_Name(Statement) then Syntax_Error(E, "unknown statement in prepare clause"); return; end if; Cursor_To_Declare := Upper_Case(Statement); Expect( E, ESQL_From ); Expect( E, ESQL_Identifier ); if OPTION_Debug then Put_Line( "Dynamic statement " & Identifier(E) ); end if; Query_Variable := To_Unbounded_String( Trim(Identifier(E),Right) ); Current := Next_Symbol(E); if Current = ESQL_Using then declare Variable : Identifier_String := Blank_Identifier; Indicator : Identifier_String := Blank_Identifier; begin E.Nbr_Of_Parameters := 0; loop Embedded_Host_Variable(E, Variable, Indicator ); Add_Parameter( E, Variable, Indicator ); Current := Next_Symbol(E); exit when Current /= ESQL_Comma; end loop; Push_Back_Current_Token(E); end ; end if; Skip_Till( E, E.ESQL_Terminator ); end ; ---------------------- -- Embedded_Execute -- ---------------------- procedure Embedded_Execute( E : in ESQL_Reader ) is -- Handle the syntax of the dynmic embedded sql execute -- EXECUTE -- [ USING ] -- EXECUTE [ DECLARE ] BEGIN ... [EXCEPTION] END -- EXECUTE IMMEDIATE Current : ESQL_Reserved_Words; Statement : Identifier_String := Blank_Identifier; Columns : Identifier_Array renames e.Columns; Indicators : Identifier_Array renames e.Indicators; Cursor_Dynamic_SQL : Identifier_String renames E.Cursor_Dynamic_SQL; Nbr_Of_Columns : Natural renames e.Nbr_Of_Columns; Inject_Fetch : Boolean renames e.Inject_Fetch; -- begin Current := Next_Symbol(E); case Current is when ESQL_Identifier => Statement := Upper_Case(Identifier(E)); if not Is_Statement_Name(Statement) then Syntax_Error(E, "unknown statement '" & Trim( Statement, Right) & "' in execute clause"); return; end if; Cursor_Dynamic_SQL := Statement; Current := Next_Symbol(E); if Current = ESQL_Using then for i in Columns'Range loop Embedded_Host_Variable(E, Columns(I), Indicators(I)); Nbr_Of_Columns := Nbr_Of_Columns + 1; Current := Next_Symbol(e); exit when Current /= ESQL_Comma; end loop; end if; when ESQL_Immediate => Expect( E, ESQL_Identifier, Where => " execute clause " ); when ESQL_Declare | ESQL_Begin => Syntax_Error(E, "plsql blocks not supported in execute clause"); when others => Syntax_Error(E, "unknown statement '" & Trim( Statement, Right) & "' in execute clause"); end case; end Embedded_Execute; ---------------------------- -- Embedded_SQL_Statement -- ---------------------------- procedure Embedded_SQL_Statement( e : in out ESQL_Reader ) is -- -- Parse the esql statements. The parsing begins after -- the ESQL prefix. If the prefix is not found, the -- procedure returns. -- -- Copying to the result file is defered till the -- point that we know how to proceed. -- Current : ESQL_Reserved_Words; Limit : Natural; DB_Name : Identifier_String renames e.DB_Name; Nesting_Level : Natural renames e.Nesting_Level; --- begin -- clear the transient data fo the parser E.Nbr_Of_Columns := 0; E.Nbr_Of_Parameters := 0; E.DB_Name := Blank_Identifier; E.Connection := Default_Connection; E.Max_Count := 0; E.Ada_Declare := False; E.Query_String := Null_Unbounded_String; E.Query_Variable := Null_Unbounded_String; E.Inject_Fetch := False; E.Cursor_To_Declare := Blank_Identifier; E.Current_Cursor := Blank_Identifier; E.Cursor_To_Close := Blank_Identifier; E.Cursor_To_Open := Blank_Identifier; E.Cursor_Dynamic_SQL := Blank_Identifier; E.Cursor_Is_Reopenable := False; E.Finalize_Cursor := False; E.Cursor_Is_Local := False; E.Statement_Name := Blank_Identifier; E.Connection_Errors := ( others => Null_Connection_Error ); E.Eval_Result := False; if E.Nbr_Of_Syntax_Errors > Option_Error_Limit then Warning( E, "Number of errors exceed limit "); Warning( E, "*** Aborted ***" ); raise End_Of_File_Exception; end if; -- process the file contents Current := Next_Symbol(e, mode => Defere_Copy ); case Current is -- ******************************************************************* -- This section is only needed to control the code intendation in -- order to get nice code formating. It will work only in most cases. -- ******************************************************************* when ADA_Package => -- Section 19.3, Syntaxrule 14: Insert a global SQL context -- Accept_Symbol( e ); Current := Next_Symbol(E, Mode => Defere_Copy ); Accept_Symbol(E ); if Current /= ADA_BODY then return; --****-- end if; ODBC_Packages( e ); -- read in the package name including any subpackage names E.Package_Name := Null_Unbounded_String; loop Expect( e, ESQL_Identifier, mode => Accept_Token ); E.Package_Name := E.Package_Name & Name(Identifier(E)); Current := Next_Symbol(E, Mode => Accept_Token); exit when Current /= ESQL_DOT; E.Package_Name := E.Package_Name & "."; end loop; if Current /= ADA_IS then Syntax_Error(E, "Keyword 'IS' missing after package identifier"); end if; if Option_Verbose then Put_Line(" Package : " & To_String(E.Package_Name)); end if; Flush(e.Reader); -- write out: package body x is Nesting_Level := Nesting_Level + 1; ODBC_SQL_Context( E ); return; --****-- when ESQL_Begin | ADA_Loop | ADA_If | ADA_Case | Ada_Record => Nesting_Level := Nesting_Level + 1; Accept_Symbol( E ); return; --****-- when ESQL_End => Accept_Symbol( E ); Current := Next_Symbol(e, mode => Defere_Copy ); case Current is when ADA_RECORD | ADA_CASE | ADA_IF | ADA_Loop => Nesting_Level := Nesting_Level - 1; Accept_Symbol( E ); when others => Push_Back_Current_Token( E ); end case; return; --****-- -- ********************************************************************* when Ada_Procedure | Ada_Function => if E.Package_Name = Null_Unbounded_String then declare Name : Identifier_String := Blank_Identifier; begin Expect( E, ESQL_Identifier, Mode => Accept_Token ); Name := Identifier(E); Current := Next_Symbol(E, Mode => Accept_Token ); if Current = ESQL_Open_Bracket then Skip_Till( E, ESQL_Close_Bracket, Mode => Accept_Token ); Current := Next_Symbol(E, Mode => Accept_Token ); end if; if Current /= ADA_Is then return; end if; ODBC_Packages( e ); E.Package_Name := To_Unbounded_String(Trim(Name, Right )); if Option_Verbose then Put_Line(" Unit : " & To_String(E.Package_Name)); end if; Nesting_Level := Nesting_Level + 1; Flush(e.Reader); Ada( E, "--Is--"); ODBC_SQL_Context( E ); end; end if; return; --****-- -- ******************************************************************* -- ISO/92 Ada Style of invokation as EXEC SQL. Processing of the -- queries is done below -- ******************************************************************* when ESQL_EXEC => Current := Next_Symbol(e, mode => Defere_Copy ); if Current /= ESQL_SQL then Accept_Symbol( E ); return; --***-- end if; E.ESQL_Terminator := ESQL_Semicolon; -- ****************************************************************** -- in all other cases accept and return. -- ****************************************************************** when Others => pragma Debug( Put_Line( "copies " & E.Current ) ); Accept_Symbol( E ); return; --****-- end case; E.Query_Line_Number := Current_Line( E.Reader ); -- ********************************************************************** -- Process the SQL Queries by checking for the AT/FOR extension and then -- handling different key words. -- ********************************************************************** Current := Next_Symbol(e); -- Pro*Ada extension : AT and FOR attributes while Current = ESQL_FOR or Current = ESQL_AT loop case Current is when ESQL_FOR => Expect( e, ESQL_Identifier ); Limit := Natural'Value(e.Current); Pedantic( E, "FOR clause ignored"); when ESQL_AT => Expect( e, ESQL_Identifier ); if not Is_Database_Name( E.Current ) then if Option_Pedantic then Syntax_Error(E, "database " & Name(E.Current) & " not declared" ); else Warning(E, "database " & Name(E.Current) & " not declared" ); end if; end if; e.Connection := e.Current; when Others => null; end case; Current := Next_Symbol(e); end loop; -- process the different major keywords of embedded SQL case Current is when ESQL_Begin => -- The following mess is used to handle the following -- two different cases: -- -- EXEC SQL BEGIN DECLARE ---> Declare section -- EXEC SQL BEGIN ; ---> POSTGRES begin query. Current := Next_Symbol(e); Push_Back_Current_Token(e); if Current = ESQL_DECLARE then Embedded_SQL_Declare_Section(e); Mark_Source_Line( E.Reader ); else ISO92_SQL_Statement(e, previous_token => ESQL_Begin); ODBC_Prelude( e ); ODBC_Prepare_Query( e ); ODBC_Evaluate_Result (E, Comment => "Prepare"); ODBC_Bind_Parameters( e ); ODBC_Bind_Columns( e ); ODBC_Execute( e ); ODBC_Evaluate_Result (E, Comment => "Query"); ODBC_Finish(e); Mark_Source_Line( E.Reader ); end if; when ESQL_Declare => Embedded_Declare(e); when ESQL_VAR => -- non ISO/92 PRO*Ada Embedded_Var_Declare(E); when ESQL_WHENEVER => Embedded_Exception_Declaration(e); when ESQL_Connect => -- GNADE Extension Embedded_Connect(e); ODBC_Connect(e); Mark_Source_Line( E.Reader ); when ESQL_Disconnect => Embedded_Disconnect(E); ODBC_Disconnect(E); Mark_Source_Line( E.Reader ); when ESQL_Database => Embedded_Database(E); Mark_Source_Line( E.Reader ); when ESQL_Include => -- non ISO/92 Pro*Ada Embedded_Include(E); when ESQL_Reset => -- GNU extension Embedded_Reset(E); when ESQL_Set => Embedded_Set(E); when ESQL_Close => Embedded_Close_Cursor(E); ODBC_Execute( E ); Mark_Source_Line( E.Reader ); when ESQL_Open => Embedded_Open_Cursor(E); ODBC_Execute( e ); ODBC_Evaluate_Result (E, Comment => " Open "); Mark_Source_Line( E.Reader ); when ESQL_Prepare => -- Dynamic SQL support Embedded_Prepare(E); ODBC_Prelude( E ); ODBC_Prepare_Query( E ); ODBC_Evaluate_Result (E, Comment => " Prepare Query "); ODBC_Bind_Parameters( E ); ODBC_Evaluate_Result (E, Comment => " Bind Parameters"); ODBC_Finish(e); Mark_Source_Line( E.Reader ); when ESQL_Execute => Embedded_Execute(E); ODBC_Prelude( e ); ODBC_Bind_Columns( e ); ODBC_Evaluate_Result (E, Comment => "Binding columns"); ODBC_Execute( e ); ODBC_Evaluate_Result (E, Comment => "Execute Statement"); ODBC_Finish(e); Mark_Source_Line( E.Reader ); when Others => -- Handle SQL queries Push_Back_Current_Token(e); ISO92_SQL_Statement(e); ODBC_Prelude( e ); ODBC_Prepare_Query( e ); ODBC_Evaluate_Result (E, Comment => "Prepare Query"); ODBC_Bind_Parameters( e ); ODBC_Bind_Columns( e ); ODBC_Execute( e ); ODBC_Evaluate_Result (E, Comment => " Query "); ODBC_Finish(e); Mark_Source_Line( E.Reader ); end case; -- ********************************************************************** -- * H A N D L E E X C E P T I O N S * -- ********************************************************************** exception when Syntax_Exception => Skip_Till( e, ESQL_Semicolon ); when End_Of_File_Exception => raise; when The_Error : Others => Warning( e, "Exception " & Exception_Name( The_Error ) & " occured " ); Warning( E, " " & Exception_Message( The_Error ) ); raise; end Embedded_SQL_Statement; --------------------- -- New_ESQL_Parser -- --------------------- function New_ESQL_Parser( f : in File_Reader ) return ESQL_Reader is -- Create a new instance of the ESQL Parser Result : ESQL_Reader := new ESQL_Reader_Type; -- begin Result.Reader := f; Result.Nbr_Of_Syntax_Errors := 0; return Result; end New_ESQL_Parser; ------------------------ -- Delete_ESQL_Reader -- ------------------------ procedure Delete_ESQL_Reader( E : in out ESQL_Reader ) is begin null; end Delete_ESQL_Reader; ---------------------- -- Number_Of_Errors -- ---------------------- function Number_Of_Errors( E : ESQL_Reader ) return Natural is -- Return the number of errors found by the parser. begin return E.Nbr_Of_Syntax_Errors; end Number_Of_Errors; ---------------------- -- Number_Of_Errors -- ---------------------- function Number_Of_Warnings( E : ESQL_Reader ) return Natural is -- Return the number of errors found by the parser. begin return E.Nbr_Of_Warnings; end Number_Of_Warnings; end ESQL_Parser; gnade-1.6.2.orig/esql/esql_parser.ads0000644000175000017500000001107207467277266017402 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNat Ada Database Environment -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/esql/esql_parser.ads,v $ --| Description : Scanner for the embedded SQL translator -- -- Author : Michael Erdmann -- -- Created On : 22-Dec-2000 -- -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2002/05/11 20:27:34 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2000-2002 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- This package contains the esql parser. The result of the -- -- parse process is stored in the ESQL_Reader data. As a consequence -- -- the code generation is a part of this package as well. -- -- -- -- Restrictions -- -- ============ -- -- -- -- References -- -- ========== -- -- -- ------------------------------------------------------------------------------- --* Translator packages with Scanner; package ESQL_Parser is type ESQL_Reader is private; Syntax_Exception : exception ; End_Of_File_Exception : exception ; --| --| Create new instance of the ESQL Parser. --| function New_ESQL_Parser( F : in Scanner.File_Reader ) return ESQL_Reader; --| --| delete the parser and close all resources --| procedure Delete_ESQL_Reader( E : in out ESQL_Reader ); --| --| Parse the a ESQL Statement. This prepares the data --| for the code generation --| procedure Embedded_SQL_Statement( e : in out ESQL_Reader ); function Number_Of_Errors( E : ESQL_Reader ) return Natural; function Number_Of_Warnings( E : ESQL_Reader ) return Natural; ------------------------------------------------------------------------- private type ESQL_Reader_Type; type ESQL_Reader is access ESQL_Reader_Type; end ESQL_Parser; gnade-1.6.2.orig/esql/esql_support.gpr0000644000175000017500000000102610026361753017615 0ustar lbrentalbrentawith "../gnade" ; project Esql_Support is for Languages use ("Ada"); for Source_Dirs use ("."); for Object_Dir use "."; package Compiler is for Default_Switches ("ada") use ("-g"); end Compiler; package Builder is for Default_Switches ("ada") use ("-g", "-gnatQ"); end Builder; package Binder is for Default_Switches ("ada") use ("-static"); end Binder; package Linker is for Default_Switches ("ada") use ("-g"); end Linker; end Esql_Support; gnade-1.6.2.orig/esql/esql_variables.adb0000644000175000017500000001240607755664546020040 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/esql/esql_variables.adb,v $ -- Description : Subsituation of strings -- Author : Michael Erdmann -- -- Created : 03.08.2002 -- -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2003/11/16 12:11:18 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2002 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- This software is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- -- -- Contact -- -- ======= -- -- Error reports shall be handled via http://gnade.sourceforge.net -- -- Features and ideas via: gnade-develop@lists.sourceforge.net -- -- -- -- Author contact: -- -- purl:/net/michael.erdmann -- -- -- ------------------------------------------------------------------------------- with Ada.Text_IO; use Ada.Text_IO; with GNU.DB.Support.Tables; with GNU.DB.Support; use GNU.DB.Support; pragma Elaborate_All( GNU.DB.Support.Tables ); package body ESQL_Variables is Version : constant String := "$Id: esql_variables.adb,v 1.6 2003/11/16 12:11:18 merdmann Exp $" ; pragma Unreferenced( Version ); --------------------- -- Variable_Record -- --------------------- type Variable_Record is record Value : Unbounded_String := Null_Unbounded_String; Used : Boolean := False; end record; package Variable_Table is new Tables( Variable_Record ); use Variable_Table; -- This table contains all variables known to gesql VT : Variable_Table.Tree_Node_Access := Variable_Table.Create_Tree; --------- -- Add -- --------- procedure Add( Name : in String; Value : in String ) is -- add a new variable to the table of variables. V : Variable_Record ; begin V.Value := To_Unbounded_String(Value); V.Used := False; Variable_Table.Insert( VT, Name, V ); exception when Variable_Table.Already_Stored => raise Existing; end Add; ----------- -- Value -- ----------- function Value( Name : in String ) return Unbounded_String is -- retrieve the value of a variable. If found assume the -- variable as used and mark it. Result : Variable_Record; begin Variable_Table.Fetch( VT, Name, Result ); if not Result.Used then Result.Used := True; Variable_Table.Update( VT, Name, Result ); end if; return Result.Value; exception when Variable_Table.Entry_Not_Found => raise Not_Existing; end Value; end ESQL_Variables; gnade-1.6.2.orig/esql/esql_variables.ads0000644000175000017500000000727207632655511020050 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/esql/esql_variables.ads,v $ -- Description : Subsituation of strings -- Author : Michael Erdmann -- -- Created : 03.08.2002 -- -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2003/03/09 15:18:33 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2002 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- This software is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- -- -- Contact -- -- ======= -- -- Error reports shall be handled via http://gnade.sourceforge.net -- -- Features and ideas via: gnade-develop@lists.sourceforge.net -- -- -- -- Author contact: -- -- purl:/net/michael.erdmann -- -- -- ------------------------------------------------------------------------------- with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; package ESQL_Variables is procedure Add( Name : in String; Value : in String ); function Value( Name : in String ) return Unbounded_String; Not_Existing : exception; Existing : exception; end ESQL_Variables; gnade-1.6.2.orig/esql/gesql.gpb0000644000175000017500000000465107476172373016174 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Sune Falk -- -- Copyright (C) 2000-2001 Sune Falk -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Text_IO; use Ada.Text_IO; with Driver; use Driver; procedure gesql is Version : constant String := "$Id: gesql.gpb,v 1.4 2002/06/01 16:23:23 merdmann Exp $"; begin Driver.Main( $Version ); end gesql; gnade-1.6.2.orig/esql/gnade-esql.gpr0000644000175000017500000000154010670336676017111 0ustar lbrentalbrenta-- $Id: gnade-esql.gpr,v 1.2 2007/09/07 21:08:14 persan Exp $ with "../gnade.gpr" ; with "../support/gnade-support.gpr"; with "../../dbi/odbc/gnade-odbc.gpr"; Project Gnade.ESQL is for Languages use ("Ada"); for Source_Dirs use ("." ); for Object_Dir use Gnade'Object_Dir; for Exec_Dir use "." ; for Main use ("gesql.adb"); package Builder is for Default_Switches ("Ada") use Gnade.Builder'Default_Switches ("Ada"); end Builder; package Compiler is for Default_Switches ("Ada") use Gnade.Compiler'Default_Switches ("Ada"); end Compiler; package Binder is for Default_Switches ("Ada") use Gnade.Binder'Default_Switches ("Ada"); end Binder; package Linker is for Default_Switches ("Ada") use Gnade.Linker'Default_Switches ("Ada"); end Linker; package IDE renames Gnade.Ide; end Gnade.ESQL; gnade-1.6.2.orig/esql/gnu-db-esql_iso92_types.ads0000644000175000017500000001006507501455440021427 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/esql/gnu-db-esql_iso92_types.ads,v $ -- Description : Types shared between support and code generator -- -- Author : Michael Erdmann -- -- Created : 10.6.2002 -- -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2002/06/11 20:18:40 $ -- Status : $State: Exp $ -- -- -- Copyright (C) 2002 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- This software is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- This package contains types which are shared between the code generator -- -- of the esql translator. It has been placed in a seperate file in order -- -- to avoid the linking of the odbc support with the esql translator. -- -- -- -- Contact -- -- ======= -- -- Error reports shall be handled via http://gnade.sourceforge.net -- -- Features and ideas via: gnade-develop@lists.sourceforge.net -- -- -- -- Author contact: -- -- purl:/net/michael.erdmann -- -- -- ------------------------------------------------------------------------------- package GNU.DB.ESQL_ISO92_Types is type ISO92_Host_Var_Type is ( ISO92_CHAR_TYPE, ISO92_BIT_TYPE, ISO92_SMALLINT_TYPE, ISO92_INT_TYPE, ISO92_REAL_TYPE, ISO92_DOUBLE_PRECISION_TYPE, ISO92_SQLCODE_TYPE, ISO92_SQLSTATE_TYPE, ISO92_INDICATOR_TYPE, ISO92_Unknown_Type, -- GNADE specific data types GNADE_VARCHAR_TYPE, GNADE_BINARY_TYPE, GNADE_VARBINARY_TYPE ); end GNU.DB.ESQL_ISO92_Types; gnade-1.6.2.orig/esql/gnu-db-esql_support-odbc.adb0000644000175000017500000007554710550145577021663 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNat Ada Database Environment -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/esql/gnu-db-esql_support-odbc.adb,v $ -- Description : Small interface to ODBC for the ESQL translator -- -- Author : Michael Erdmann -- -- Created On : 22-Dec-2000 -- -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2007/01/07 10:29:19 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2000-2003 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- -- -- This package is a wrapper around the ODBC interface in order -- -- to make the code generation easier. -- -- -- -- It contains the following sections: -- -- -- -- Section 1. General support procedures -- -- Section 2. Cursor Management -- -- Section 3. Type Conversion -- -- Section 4. Database access procedures -- -- Section 5. Column Access procedures -- -- Section 6. Paramter Access procedures. -- -- -- -- The package maintains the list of cursors dynamicaly. -- -- -- -- -- -- Restrictions -- -- ============ -- -- No Tasking support -- -- -- -- References -- -- ========== -- -- //1// - (Second Informal Review Draft) ISO/IEC 9075:1992, Database -- -- Language SQL- July 30, 1992 -- -- -- ------------------------------------------------------------------------------- --* Ada with Ada.Finalization; use Ada.Finalization; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Text_IO; use Ada.Text_IO; with Ada.Strings.Fixed; use Ada.Strings.Fixed; with Ada.Command_Line; use Ada.Command_Line; with System.Address_To_Access_Conversions; with Ada.Unchecked_Conversion; with Interfaces.C; use System; use Ada; with GNU.DB.SQLCLI; use GNU.DB.SQLCLI; with GNU.DB.SQLCLI.Environment_Attribute; use GNU.DB.SQLCLI.Environment_Attribute; with GNU.DB.SQLCLI.Connection_Attribute; use GNU.DB.SQLCLI.Connection_Attribute; with Unchecked_Deallocation; use Ada.Strings; use System; use Ada; with SQL_STANDARD; use SQL_STANDARD; with GNU.DB.Support.Tables; use GNU.DB.Support; package body GNU.DB.ESQL_Support.ODBC is Version : constant String := "$Id: gnu-db-esql_support-odbc.adb,v 1.27 2007/01/07 10:29:19 merdmann Exp $"; pragma Unreferenced (Version); use type Interfaces.C.int; package CLI renames GNU.DB.SQLCLI; package SQLCA is new Address_To_Access_Conversions( Object => SQLCA_Type ); use SQLCA; -- this a a mapping table which maps the ESQL data types to the -- ODBC data type. type ODBC_Type_Mapping is array ( ISO92_Host_Var_Type ) of SQL_C_DATA_TYPE; To_C_DATA_TYPE : constant ODBC_Type_Mapping := ( ISO92_CHAR_TYPE => SQL_C_CHAR, ISO92_BIT_TYPE => SQL_C_BIT, ISO92_SMALLINT_TYPE => SQL_C_SHORT, ISO92_INT_TYPE => SQL_C_SLONG, ISO92_REAL_TYPE => SQL_C_FLOAT, ISO92_DOUBLE_PRECISION_TYPE => SQL_C_DOUBLE, ISO92_SQLCODE_TYPE => SQL_C_DEFAULT, ISO92_SQLSTATE_TYPE => SQL_C_DEFAULT, ISO92_INDICATOR_TYPE => SQL_C_DEFAULT, ISO92_Unknown_Type => SQL_C_DEFAULT, GNADE_VARCHAR_TYPE => SQL_C_CHAR, GNADE_BINARY_TYPE => SQL_C_BINARY, GNADE_VARBINARY_TYPE => SQL_C_BINARY ); -- -- this is used to maintain a list of cursors per connection. each -- cursor is simply a statement handle and the name of the cusor. -- type Handle_Array is array( Positive range <> ) of SQLHSTMT; subtype Handle_Number is Positive range 1..50; ----------------- -- Cursor_Type -- ----------------- type Cursor_Type is record Name : Unbounded_String := Null_Unbounded_String; Current : Handle_Number := Handle_Number'First; Handle : Handle_Array(Handle_Number) := (others => SQL_NULL_HANDLE); Nbr_Of_Columns : Natural := 0; -- if a column is bound Is_Reopenable : Boolean := False; end record; Null_Cursor : constant Cursor_Type := ( Name => Null_Unbounded_String, Current => Handle_Number'First, Handle => (others => SQL_NULL_HANDLE ), Nbr_Of_Columns => 0, Is_Reopenable => False ); package Cursor_Table is new Tables( Cursor_Type ); use Cursor_Table; --------------------- -- Connection_Data -- --------------------- type Connection_Data is record -- this is the data as it is maintained per data base connection EnvironmentHandle : SQLHENV; ConnectionHandle : SQLHDBC; Default_Statement : SQLHSTMT := SQL_NULL_HANDLE; Cursors : Cursor_Table.Tree_Node_Access := null; end record; --------------------- -- Cursor_CTX_Type -- --------------------- type Cursor_CTX_Type is record Name : Unbounded_String := Null_Unbounded_String; H : Connection_Handle := null; end record; type Cursor_CTX_Array is array ( Positive range <> ) of Cursor_CTX_Type; type Context_Data_Type is record Cursor : Cursor_CTX_Array(1..50); end record; Option_Show_RT_Errors : Boolean := False; Option_Show_RT_Warnings : Boolean := False; --- ********************************************************************* --- --- ** SECTION 1. S U P P O R T P R O C E D U R E S *** --- --- ** ==================================== *** --- --- ** *** --- --- ********************************************************************* --- --------------------- -- Get_Cursor_Data -- --------------------- function Get_Cursor_Data( H : in Connection_Handle; Name : in String; Sense : in Boolean := False ) return Cursor_Type is -- This function returns the reference to the cursor data stored in -- the connection. -- The parameter sense controls wether a exception or a null pointer -- should be given back in case, that the cursor is not found. Connection : Connection_Data_Access := H.Data; Cursors : Cursor_Table.Tree_Node_Access renames Connection.Cursors; Cursor_Data : Cursor_Type; begin Cursor_Table.Fetch( Cursors, Name, Cursor_Data ); return Cursor_Data; exception when others => if Sense then return Null_Cursor; else Error( H.all, "cursor " & Name & " not found " ); raise General_Error; end if; end Get_Cursor_Data; ------------- -- Columns -- ------------- function Columns( H : in Connection_Handle; Cursor : in String ) return Natural is -- -- Indicate if there have been columns bound to the -- cursor. -- Cursor_Data : Cursor_Type := Get_Cursor_Data(H, Cursor ); begin return Cursor_Data.Nbr_Of_Columns; end Columns; ---------------- -- Initialize -- ---------------- procedure Initialize( Item : in out Context_Type ) is -- Initialize the local sql context Data : constant Context_Data_Access := new Context_Data_Type; begin for I in 1..Argument_Count loop if Argument(I) = "--esql-errors" then Option_Show_RT_Errors := True; elsif Argument(I) = "--esql-warnings" then Option_Show_RT_Warnings := True; end if; end loop; Item.Data := Data; end Initialize; -------------- -- Finalize -- -------------- procedure Finalize( Item : in out Context_Type ) is -- delete all resources as they are registered with the context. For -- odbc this is the statement handles. Data : Context_Data_Access := Item.Data; procedure Free is new Unchecked_Deallocation( Context_Data_Type, Context_Data_Access); begin for I in Data.Cursor'Range loop if Data.Cursor(I).Name /= Null_Unbounded_String then declare Name : Unbounded_String renames Data.Cursor(I).Name; H : Connection_Handle renames Data.Cursor(I).H; Cursor_Data : Cursor_Type; Connection : Connection_Data_Access := H.Data; begin Cursor_Data := Get_Cursor_Data( H, To_String(Name), Sense => True); if Cursor_Data /= Null_Cursor then for J in Handle_Number'Range loop if Cursor_Data.Handle(J) /= SQL_NULL_HANDLE then SQLFreeStmt( Cursor_Data.Handle(J), SQL_CLOSE ); SQLFreeHandle (SQL_HANDLE_STMT, Cursor_Data.Handle(J)); end if; end loop; Delete( Connection.Cursors, To_String(Name) ); end if; exception when General_Error => null; end; end if; end loop; Free( Data ); end Finalize; ---------------- -- Add_Cursor -- ---------------- procedure Add_Cursor( Ctx : in out Context_Type; H : in Connection_Handle; C : in String ) is -- Add a cursor to the contect the following rules do apply: -- R.1 If the cursor alrady exisit, dont enter the same name -- twice. -- R.2 If a free entry in the cursor table is found, insert -- the name and the connection handle. -- Data : Context_Data_Access := Ctx.Data; Name : Unbounded_String := To_Unbounded_String(C); begin for I in Data.Cursor'Range loop if Data.Cursor(I).Name /= Null_Unbounded_String -- R.1 and then Data.Cursor(I) = ( Name, H ) then return; end if; if Data.Cursor(I).Name = Null_Unbounded_String then -- R.2 Data.Cursor(I) := ( Name, H ); return; end if; end loop; end Add_Cursor; --- ********************************************************************* --- --- ** SECTION 2. C U R S O R M A N A G E M E N T *** --- --- ********************************************************************* --- ---------------- -- Get_Cursor -- ---------------- function Get_Cursor( H : in Connection_Handle; Cursor : in String ) return SQLHSTMT is -- -- Try to locate the handle of the given cursor. if no cursor -- is given, the default handle is used. In case no cursor -- is found an exception will be raised. -- Connection : constant Connection_Data_Access := H.Data; Cursor_Data : Cursor_Type; -- begin if Cursor = "" then return Connection.Default_Statement; end if; Cursor_Data := Get_Cursor_Data( H, Cursor ); -- Put_Line("Get_Cursor " & Natural'Image(Cursor_Data.Current)); return Cursor_Data.Handle(Cursor_Data.Current); exception when Cursor_Table.Entry_Not_Found => Warning( H.all, "*** Cursor '" & Cursor & " not found, using default cursor ****" ); return Connection.Default_Statement; end Get_Cursor; --- ********************************************************************* --- --- ** SECTION 3. T Y P E C O N V E R S I O N *** --- --- ********************************************************************* --- --- ********************************************************************* --- --- ** SECTION 4. O D B C I n t e r f a c e *** --- --- ********************************************************************* --- ------------- -- Warning -- ------------- procedure Warning( Object : in Connection_Type; Text : in String ) is pragma Unreferenced (Object); begin if not Option_Show_RT_Warnings then return; end if; Put_Line( "*** Warning *** " & Text ); end Warning; ------------ -- Error -- ------------ procedure Error( Object : in Connection_Type; Text : in String ) is pragma Unreferenced (Object); begin if not Option_Show_RT_Errors then return; end if; Put_Line( "*** Error *** " & Text ); end Error; ------------- -- Connect -- ------------- function Connect( Source : in String; UserName : in String; Password : in String ) return Connection_Handle is -- Connect to the data base. Result : constant Connection_Handle := new Connection_Type; begin Connect( Result.all, Source, UserName, Password ); return Result; end Connect; ------------- -- Connect -- ------------- procedure Connect( Connection_Obj : in out Connection_Type'Class; Source : in String; UserName : in String; Password : in String ) is -- Connect to the data base. Data : Connection_Data_Access := new Connection_Data; EnvironmentHandle : SQLHENV renames Data.EnvironmentHandle ; ConnectionHandle : SQLHDBC renames Data.ConnectionHandle ; --- begin Connection_Obj.Data := Data; Data.Cursors := Cursor_Table.Create_Tree; SQLAllocHandle ( SQL_HANDLE_ENV, SQL_NULL_HANDLE, EnvironmentHandle); SQLSetEnvAttr ( EnvironmentHandle, Environment_Attribute_ODBC_Version' (Attribute => SQL_ATTR_ODBC_VERSION, Value => SQL_OV_ODBC3) ); SQLAllocHandle ( SQL_HANDLE_DBC, EnvironmentHandle, ConnectionHandle); begin SQLSetConnectAttr( ConnectionHandle, Connection_Attribute_Unsigned'(Attribute => SQL_ATTR_LOGIN_TIMEOUT, Value => 30)); exception when Not_Implemented => null; end; SQLConnect ( ConnectionHandle => ConnectionHandle, ServerName => Source, UserName => UserName, Authentication => Password ); end Connect; ------------------ --- Disconnect --- ------------------ procedure Disconnect( H : in out Connection_Handle; Global_CTX : in out Context_Type; Commit : in Boolean := False ) is -- Disconnect from the data base -- -- R.1 - Check in the global context table for all cursors -- which have been created on this data base connection. -- R.2 - Delete every resource held by this data base in the -- context table. -- R.3 - Drop the data base connection -- Connection : Connection_Data_Access := H.Data; EnvironmentHandle : SQLHENV renames Connection.EnvironmentHandle ; ConnectionHandle : SQLHDBC renames Connection.ConnectionHandle ; StatementHandle : SQLHSTMT renames Connection.Default_Statement ; CTX : Context_Data_Access := Global_CTX.Data; --- begin if StatementHandle /= SQL_NULL_HANDLE then SQLFreeHandle (SQL_HANDLE_STMT, StatementHandle); end if; if Commit then SQLCommit (ConnectionHandle); end if; for I in CTX.Cursor'Range loop if CTX.Cursor(I).H = H and then -- R.1 CTX.Cursor(I).Name /= Null_Unbounded_String then declare Name : Unbounded_String renames CTX.Cursor(I).Name; Cursor_Data : Cursor_Type; begin -- R.2 Cursor_Data := Get_Cursor_Data( H, To_String(Name)); for J in Handle_Number'Range loop if Cursor_Data.Handle(J) /= SQL_NULL_HANDLE then SQLFreeStmt( Cursor_Data.Handle(J), SQL_CLOSE ); SQLFreeHandle (SQL_HANDLE_STMT, Cursor_Data.Handle(J)); end if; end loop; Delete( Connection.Cursors, To_String(Name) ); Name := Null_Unbounded_String; end; end if; end loop; -- R.3 SQLDisconnect (ConnectionHandle); SQLFreeHandle (SQL_HANDLE_DBC, ConnectionHandle); SQLFreeHandle (SQL_HANDLE_ENV, EnvironmentHandle); end Disconnect; ------------------- -- Get_SQL_State -- ------------------- procedure Get_SQL_State( Handle : SQLHSTMT; SCA : SQLCA_Access ) is begin SCA.Message := ( others => ' ' ); SCA.State := EMPTY_SQLSTATE; Move( Source => SQL_Error_Message( SQL_HANDLE_STMT, Handle, SCA.State'Access), Target => SCA.Message ); end Get_SQL_State; ------------- -- Prepare -- ------------- procedure Prepare( H : in Connection_Handle; Context : in out Context_Type; S : in String; Result : in Address; Cursor : in String := ""; Is_Reopenable : in Boolean := False; Is_Local : in Boolean := False ) is pragma Unreferenced (Is_Local); -- -- R.1 If a cursor name is given, we check if it is already -- exisiting. If so, a exception is raised if the cursor -- is not reopenable. -- R.2 If no cursor name is passed we release the the prev. -- default statement handle and allocate a new one. -- R.3 After excution of the prepare, the sql state is fetched. -- RC : SQLRETURN := 0; Connection : Connection_Data_Access := H.Data; StatementHandle : SQLHSTMT; Cursor_Data : Cursor_Type; CA : SQLCA.Object_Pointer := To_Pointer( Result ); begin SQLAllocHandle ( SQL_HANDLE_STMT, Connection.ConnectionHandle, StatementHandle); if Cursor /= "" then begin -- R.1 Insert(Connection.Cursors, Cursor, Cursor_Data ); Cursor_Data.Current := 1; exception when Cursor_Table.Already_Stored => if not Is_Reopenable then raise No_Reopenable_Cursor; else Cursor_Data.Current := Cursor_Data.Current + 1; end if; end; -- SQLSetCursorName( StatementHandle, Cursor ); Cursor_Data.Handle(Cursor_Data.Current) := StatementHandle; Cursor_Data.Name := To_Unbounded_String(Cursor); Cursor_Data.Nbr_Of_Columns := 0; Cursor_Data.Is_Reopenable := Is_Reopenable; Update(Connection.Cursors, Cursor, Cursor_Data ); Add_Cursor( Context, H, Cursor ); else -- R.2 if Connection.Default_Statement /= SQL_NULL_HANDLE then SQLCloseCursor( Connection.Default_Statement ); SQLFreeStmt( Connection.Default_Statement, SQL_CLOSE ); SQLFreeHandle (SQL_HANDLE_STMT, Connection.Default_Statement); end if; Connection.Default_Statement := StatementHandle; end if; RC := SQLPrepare ( StatementHandle, S); CA.SqlCode := RC; if RC = CLI.SQL_ERROR then -- R.3 Get_SQL_State( StatementHandle, SQLCA_Access(CA) ); else CA.State := EMPTY_SQLSTATE; end if; end Prepare; ------------- -- Execute -- ------------- procedure Execute( H : in Connection_Handle; Result : in Address; Statement : in String := ""; Cursor : in String := "" ) is -- -- R.1 If a statement for execution is passed, assume that not the -- default statement handle has to be used. -- R.2 If a no statement has been given, we may assume cursor -- handling, which means, the cursors has been defined either -- by a prepare or a decalre cursor. -- RC : CLI.SQLRETURN; Connection : constant Connection_Data_Access := H.Data; StatementHandle : SQLHSTMT; CA : SQLCA.Object_Pointer := To_Pointer( Result ); -- begin if Statement /= "" then -- R.1 SQLAllocHandle ( SQL_HANDLE_STMT, Connection.ConnectionHandle, StatementHandle); RC := SQLExecDirect ( StatementHandle, Statement ); CA.SqlCode := RC; if RC = CLI.SQL_ERROR then Get_SQL_State( StatementHandle, SQLCA_Access(CA) ); else CA.State := EMPTY_SQLSTATE; CA.Affected_Rows := Integer( SQLRowCount(StatementHandle) ); end if; SQLFreeStmt( StatementHandle, SQL_CLOSE ); SQLFreeHandle (SQL_HANDLE_STMT, StatementHandle ); else -- R.2 StatementHandle := Get_Cursor(H, Cursor); RC := SQLExecute( StatementHandle ); if RC = CLI.SQL_ERROR then Get_SQL_State( StatementHandle, SQLCA_Access(CA) ); else CA.State := EMPTY_SQLSTATE; CA.Affected_Rows := Integer( SQLRowCount(StatementHandle) ); end if; end if; end Execute; ------------------ -- Close_Cursor -- ------------------ procedure Close_Cursor( H : in Connection_Handle; Cursor : in String; Finalize : in Boolean := False ) is -- -- Close the named cursor. This will deallocate all -- resources held by this cursor. -- Connection : Connection_Data_Access := H.Data; Cursors : Cursor_Table.Tree_Node_Access renames Connection.Cursors; Cursor_Data : Cursor_Type := Get_Cursor_Data( H, Cursor ); begin SQLCloseCursor( Cursor_Data.Handle(Cursor_Data.Current) ); -- Cursor_Data.Handle(Cursor_Data.Current) := SQL_NULL_HANDLE; if Cursor_Data.Current > 1 then Cursor_Data.Current := Cursor_Data.Current - 1; end if; if Finalize and Cursor_Data.Current = 1 then Delete( Cursors, Cursor ); Cursor_Data.Name := Null_Unbounded_String; else Update( Cursors, Cursor, Cursor_Data ); end if; end Close_Cursor; ----------- -- Fetch -- ----------- procedure Fetch( H : in Connection_Handle; Result : in Address; Cursor : in String := "" ) is -- Execute a fetch operation. A fetch operation is either -- used with DECALRE cursor or used with a simple -- direct query (select ... into,,). RC : SQLRETURN := 0; StatementHandle : constant SQLHSTMT := Get_Cursor(H, Cursor); CA : SQLCA.Object_Pointer := To_Pointer( Result ); begin RC := SQLFetch (StatementHandle); CA.SqlCode := RC; CA.State := EMPTY_SQLSTATE; if RC /= CLI.SQL_SUCCESS then Get_SQL_State(StatementHandle, SQLCA_Access(CA)); end if; end Fetch; ----------- -- Count -- ----------- function Count ( H : Connection_Handle; Cursor : in String := "" ) return Integer is -- return the number of rows in the result set Count : aliased SQLINTEGER; RC : SQLRETURN := 0; StatementHandle : constant SQLHSTMT := Get_Cursor(H, Cursor); --- begin RC := SQLRowCount (StatementHandle, Count'Access); if RC = SQL_SUCCESS then return Integer(Count); end if; return 0; end Count; ---------------------- -- ODBC_Stmt_Handle -- ---------------------- function ODBC_Stmt_Handle( H : in Connection_Handle; Name : in String ) return SQLHSTMT is begin return Get_Cursor( H, Name ); end ODBC_Stmt_Handle; --------------------- -- ODBC_Con_Handle -- --------------------- function ODBC_Con_Handle( H : in Connection_Handle ) return SQLHDBC is Connection : constant Connection_Data_Access := H.Data; begin return Connection.ConnectionHandle; end ODBC_Con_Handle; --- ********************************************************************* --- --- ** SECTION 4. C O L U M N B I N D I N G *** --- --- ********************************************************************* --- function To_SQLPOINTER is new Ada.Unchecked_Conversion ( Source => Address, Target => SQLPOINTER ); ------------------- -- Mark_As_Bound -- ------------------- procedure Mark_As_Bound( H : Connection_Handle; Cursor : String ) is -- -- This procedure increment the number of bound columns. This -- information is used by the esql generated code to see if -- columns already has bound. -- Data : Cursor_Type; Connection : Connection_Data_Access := H.Data; Cursors : Cursor_Table.Tree_Node_Access renames Connection.Cursors; begin if Cursor = "" then return; end if; Data := Get_Cursor_Data( H, Cursor ); Data.Nbr_Of_Columns := Data.Nbr_Of_Columns + 1; Cursor_Table.Update(Cursors, Cursor, Data ); end Mark_As_Bound; ---------------- -- BindColumn -- ---------------- procedure BindColumn( H : in Connection_Handle; Column_Number : in Natural; Column_Data : in Address ; Length : in Natural ; Column_Type : in ISO92_Host_Var_Type ; Result : access INDICATOR_TYPE; Cursor : in String := "" ) is -- bind a column to the given data field. RC : SQLRETURN; pragma Warnings (Off, RC); StatementHandle : constant SQLHSTMT := Get_Cursor(H, Cursor); Size : constant SQLINTEGER := SQLINTEGER( Length / 8 ); --- begin RC := SQLBindCol ( StatementHandle, SQL_Column_Number(Column_Number), To_C_DATA_TYPE( Column_Type ), To_SQLPOINTER( Column_Data ), Size, Result ); Mark_As_Bound(H, Cursor ); end BindColumn; ------------------- -- BindParameter -- ------------------- procedure BindParameter( H : in Connection_Handle; Number : in Natural; Data : in Address; Length : in Natural; Column_Type : in ISO92_Host_Var_Type; Indicator : access INDICATOR_TYPE; Cursor : in String := "" ) is --- RC : SQLRETURN; pragma Warnings (Off, RC); StatementHandle : constant SQLHSTMT := Get_Cursor(H, Cursor); Size : constant SQLINTEGER := SQLINTEGER( Length / 8 ); SQL_Type : SQL_DATA_TYPE := SQL_INTEGER; --- begin if Column_Type = ISO92_CHAR_TYPE then SQL_Type := SQL_VARCHAR; end if; RC := SQLBindParameter ( StatementHandle, SQL_Parameter_Number(Number), SQL_PARAM_INPUT, To_C_DATA_TYPE( Column_Type ), SQL_Type, SQLUINTEGER(Size), 0, To_SQLPOINTER(Data), Size, Indicator); end BindParameter; end GNU.DB.ESQL_Support.ODBC; gnade-1.6.2.orig/esql/gnu-db-esql_support-odbc.ads0000644000175000017500000003511610016606503021654 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNat Ada Database Environment -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/esql/gnu-db-esql_support-odbc.ads,v $ -- Description : Small interface to ODBC for the ESQL translator -- -- Author : Michael Erdmann -- -- Created On : 22-Dec-2000 -- -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2004/02/24 08:37:23 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2000-2003 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- -- -- This package is a wrapper around the ODBC interface in order -- -- to make the code generation easier. -- -- The package is generaly not intended as an programming API for the -- -- progrmmer. -- -- -- -- Restrictions -- -- ============ -- -- R.1 - The number of reopens per reopenable cursor is limited. -- -- R.2 - No Tasking support -- -- -- -- References -- -- ========== -- -- //1// - (Second Informal Review Draft) ISO/IEC 9075:1992, Database -- -- Language SQL- July 30, 1992 -- -- -- ------------------------------------------------------------------------------- with Ada.Finalization; use Ada.Finalization; with System; use System; with SQL_STANDARD; use SQL_STANDARD; with GNU.DB.SQLCLI; use GNU.DB.SQLCLI; with GNU.DB.ESQL_ISO92_Types; use GNU.DB.ESQL_ISO92_Types; package GNU.DB.ESQL_Support.ODBC is type Connection_Type is tagged private; type Connection_Handle is access Connection_Type'Class; type Context_Type is private; type Context_Access is access Context_Type; --------------------------------------------------------------------------- --| Description : --| Connect to a data base --| Preconditions : --| P.1 - Not already connected. --| Postconditions : --| --| Exceptions : --| --| Note : --------------------------------------------------------------------------- function Connect( Source : in String; UserName : in String; Password : in String ) return Connection_Handle; procedure Connect( Connection_Obj : in out Connection_Type'Class; Source : in String; UserName : in String; Password : in String ); --------------------------------------------------------------------------- --| Description : --| Disconnect from a data base --| Preconditions : --| --| Postconditions : --| --| Exceptions : --| --| Note : --------------------------------------------------------------------------- procedure Disconnect( H : in out Connection_Handle; Global_CTX : in out Context_Type; Commit : in Boolean := False ); --- ================================================================= --- --- Q U E R Y AND C U R S O R H A N D L I N G --- --- --- --- The following procedures are only for use by the esql code --- --- generator. --- ================================================================= --- --------------------------------------------------------------------------- --| Description : --| Prepare a query. This is used by the ESQL code generator --| when the query contains a host viariable as parameter or --| in the INTO clause. --| --| Preconditions : --| P.1 - Database is connected --| --| Postconditions : --| C.1 - Cursor is created if the Cursor paramter has been set. --| (see Note 1 and Note 2 below). --| C.2 - The query has been processed by the underlying DBCS. --| C.3 - The resul codes are stored in the SQLCA. --| --| Exceptions : --| Any --| --| Note : --| N.1 - Is_Reopenable allows to stack the cursors, which means --| at the same time you may have several cursors with the --| same name acitve but only the last defined cursor of the --| name is active. --| --| N.2 - Is_local indicates, that the cursor has to be allocate --| locally in the local context. If the local context is left, --| the cursor is closed. --| --------------------------------------------------------------------------- procedure Prepare( H : in Connection_Handle; Context : in out Context_Type; S : in String; Result : in Address; Cursor : in String := ""; Is_Reopenable : in Boolean := False; Is_Local : in Boolean := False ); --------------------------------------------------------------------------- --| Description : --| Execute a prepared statement or the statement as it is given in the --| statement parameter. --| --| Preconditions : --| P.1 - Database is connected --| Postconditions : --| C.1 - The result set is created the underlying daatabase using --| the specified cusor. --| C.2 - The resul codes are stored in the SQLCA. --| Exceptions : --| Any --| Note : --| None --------------------------------------------------------------------------- procedure Execute( H : in Connection_Handle; Result : in Address ; Statement : in String := ""; Cursor : String := "" ); --------------------------------------------------------------------------- --| Description : --| Close the named cusor. --| Preconditions : --| P.1 - Database is connected --| P.2 - Cursor does exist. --| Postconditions : --| C.1 - The current cursor is closed and the next active --| cursor is made active if the cursor is reopenable. --| C.2 - All cursors of this name are deallocated if the --| Finalize indicator is set. --| Exceptions : --| Any --| Note : --------------------------------------------------------------------------- procedure Close_Cursor( H : in Connection_Handle; Cursor : in String; Finalize : in Boolean := False ); --------------------------------------------------------------------------- --| Description : --| Fetch the result using the specified cursor. --| Preconditions : --| --| Postconditions : --| --| Exceptions : --| --| Note : --------------------------------------------------------------------------- procedure Fetch( H : in Connection_Handle; Result : in Address; Cursor : String := "" ); --------------------------------------------------------------------------- --| Description : --| --| Preconditions : --| --| Postconditions : --| --| Exceptions : --| --| Note : --------------------------------------------------------------------------- function Columns( H : in Connection_Handle; Cursor : in String ) return Natural; --------------------------------------------------------------------------- --| Description : --| Return the number of rows found by the query. --| Preconditions : --| --| Postconditions : --| --| Exceptions : --| --| Note : --------------------------------------------------------------------------- function Count ( H : Connection_Handle; Cursor : String := "" ) return Integer; --------------------------------------------------------------------------- --| Description : --| --| Preconditions : --| --| Postconditions : --| --| Exceptions : --| --| Note : --------------------------------------------------------------------------- --function Is_Null ( -- s : in SQL_STANDARD.INDICATOR_TYPE ) return Boolean; --------------------------------------------------------------------------- --| Description : --| Get the current statement handle --| Preconditions : --| P.1 - Connected to a data base --| Postconditions : --| C.1 - If no cursor name has been given, the default statement --| handle of the last query is returned. --| C.2 - If a cursor is named, the statement handle of the --| cursor is returned. --| Exceptions : --| Any. --| Note : --------------------------------------------------------------------------- function ODBC_Stmt_Handle( H : in Connection_Handle; Name : in String ) return SQLHSTMT; procedure Warning( Object : Connection_Type; Text : String ); procedure Error( Object : Connection_Type; Text : String ); --------------------------------------------------------------------------- --| Description : --| Return the ODBC connection handle --| Preconditions : --| P.1 - Connected to a data base --| Postconditions : --| C.1 - Function returns the ODBC connection handle --| Exceptions : --| --| Note : --------------------------------------------------------------------------- function ODBC_Con_Handle( H : in Connection_Handle ) return SQLHDBC; --- ================================================================= --- --- BIND ALL ISO/92 Types to columns --- --- --- --- The following procedures are only for use by the code generator. --- --- Each of the procedures below takes the following arguments: --- --- Connection Handle --- --- Column_Number - Indicating the position of the columns in --- --- the range 1.. --- --- Cursor - If no cursor is specified, the default --- --- statement handle will be used. --- --- Column_Data - Pointer to a variable where the result --- --- is stored later. --- --- Result - Indicator variable indcating the result --- --- The funct. Is_Null may be used to check --- --- for a Null value. --- --- ================================================================= --- procedure BindColumn( H : Connection_Handle; Column_Number : Natural; Column_Data : Address; Length : Natural; Column_Type : ISO92_Host_Var_Type; Result : access INDICATOR_TYPE; Cursor : in String := "" ); procedure BindParameter( H : Connection_Handle; Number : Natural; Data : Address; Length : Natural; Column_Type : ISO92_Host_Var_Type; Indicator : access INDICATOR_TYPE; Cursor : String := "" ) ; private -- Connection data type Connection_Data; type Connection_Data_Access is access Connection_Data; type Connection_Type is tagged record Data : Connection_Data_Access := null; end record; -- Context data type Context_Data_Type ; type Context_Data_Access is access Context_Data_Type; type Context_Type is new Controlled with record Data : Context_Data_Access := null; end record; procedure Initialize( Item : in out Context_Type ); procedure Finalize( Item : in out Context_Type ); end GNU.DB.ESQL_Support.ODBC; gnade-1.6.2.orig/esql/gnu-db-esql_support.adb0000644000175000017500000002311407735615752020745 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/esql/gnu-db-esql_support.adb,v $ -- Description : Simple ODBC interface for the esql translator -- -- Author : Michael Erdmann -- -- Created : 22.12.2000 -- -- Last Modified By: $Author: stephen_leake $ -- Last Modified On: $Date: 2003/09/28 17:35:38 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2000 - 2003 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- This software is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- This package contains procedures to adopt the SQL_STANDARD data -- -- type to the Ada Style data types. -- -- -- -- Contact -- -- ======= -- -- Error reports shall be handled via http://gnade.sourceforge.net -- -- Features and ideas via: gnade-develop@lists.sourceforge.net -- -- -- -- Author contact: -- -- purl:/net/michael.erdmann -- -- -- ------------------------------------------------------------------------------- with Ada.Text_IO; use Ada.Text_IO; with System; use System; with System.Address_To_Access_Conversions; with Ada.Unchecked_Conversion; with GNU.DB.SQLCLI; use GNU.DB.SQLCLI; package body GNU.DB.ESQL_Support is Version : constant String := "$Id: gnu-db-esql_support.adb,v 1.39 2003/09/28 17:35:38 stephen_leake Exp $"; pragma Unreferenced (Version); package SQLCA is new System.Address_To_Access_Conversions (Object => SQLCA_Type); use SQLCA; function To_Char is new Ada.Unchecked_Conversion (Source => SQL.SQLCHAR, Target => Character); function To_SQLCHAR is new Ada.Unchecked_Conversion (Target => SQL.SQLCHAR, Source => Character); --------------- -- To_String -- --------------- procedure To_String ( Item : in SQL_STANDARD.CHAR; Target : out String) is -- Copy SQL characters to Ada string and pad the result with spaces Next : Natural := Target'First; Ch : Character; begin for I in Item'Range loop Ch := To_Char (Item (I)); exit when Ch = Character'Val (0); if Next not in Target'Range then raise Constraint_Error; end if; Target (Next) := Ch; Next := Next + 1; end loop; -- Fill the rest of Target with spaces for I in Next .. Target'Last loop Target (I) := Character'Val (32); end loop; end To_String; --------------- -- To_String -- --------------- function To_String ( Item : SQL_STANDARD.CHAR) return String is -- Convert to Ada string Result : String (1 .. Item'Length); begin To_String (Item, Result); return Result; end To_String; ---------- -- Move -- ---------- procedure Move ( S : in String; C : out SQL_STANDARD.CHAR ) is -- copy from string to sql char L : constant Positive := S'Length ; begin for I in C'Range loop if I > L then C(I) := To_SQLCHAR(Character'Val(32)); else C(I) := To_SQLCHAR(S(I)); end if; end loop; end Move; ------------- -- Is_Null -- ------------- function Is_Null ( s : SQL_STANDARD.INDICATOR_TYPE ) return Boolean is -- Return true if the indicator type indicates a null value. begin return s = SQL_NULL_DATA; end Is_Null; ----------- -- DEBUG -- ----------- procedure DEBUG( Where : in String; Query : in String; RC : in System.Address) is -- -- This procedure generates debugging information. It is -- invoked directly after an execute. -- SCA : constant SQLCA_Access := SQLCA_Access(To_Pointer( RC )); begin Put_Line( Where ); Put_Line( Query ); Put_Line( "SQL State : " & SCA.State & " SQL Code :" & SQLCODE_TYPE'Image(SCA.SqlCode) ); Put_Line( "---------------"); end DEBUG; --------------- -- To_String -- --------------- function To_String( This : in GNADE.VARCHAR ) return String is Len : Positive := 1 ; begin if not Is_Null( This.Length ) and This.Length > 0 then Len := Positive( This.Length ); return To_String( This.Value(1..Len) ); else return ""; end if; end To_String; ---------------- -- To_VARCHAR -- ---------------- procedure To_VARCHAR( Value : in String; Result : out GNADE.VARCHAR ) is Len : constant Positive := Value'Length; begin Move( Value, Result.Value ); Result.Length := INDICATOR_TYPE(Len); end To_VARCHAR; ------------- -- Is_Null -- ------------- function Is_Null( This : in GNADE.VARCHAR ) return Boolean is begin return Is_Null( This.Length ); end Is_Null; ------------ -- Length -- ------------ function Length( This : in GNADE.VARCHAR ) return Natural is begin if not Is_Null( This.Length ) then return Integer( This.Length ); else return 0; end if; end Length; --------------- -- To_Binary -- --------------- function To_Binary( Src : in String ) return GNADE.BINARY is Result : GNADE.BINARY(1..Src'Length); Dest : Positive := 1; begin for I in Src'Range loop Result(Dest) := To_SQLCHAR( Src(I) ); Dest := Dest + 1; end loop; return Result; end To_Binary; --------------- -- To_Binary -- --------------- function To_Binary( This : in GNADE.VARBINARY ) return GNADE.BINARY is Len : Positive := 1 ; begin if not Is_Null( This.Length ) and This.Length > 0 then Len := Positive( This.Length ); return This.Value(1..Len); else raise Is_Empty; end if; end To_Binary; --------------- -- To_Binary -- --------------- procedure To_Binary( This : in GNADE.VARBINARY; Dest : out GNADE.BINARY; Len : out Positive ) is J : Positive := Dest'First; begin if not Is_Null( This.Length ) and This.Length > 0 then Len := Positive( This.Length ); for I in 1..Len loop Dest(J) := This.Value(I); J := J + 1; exit when not ( J in Dest'Range ) ; end loop; else raise Is_Empty; end if; end To_Binary; ------------------ -- To_VARBINARY -- ------------------ procedure To_VARBINARY( Value : in GNADE.BINARY; Result : out GNADE.VARBINARY ) is Dest : Natural := 1; begin for Src in Value'Range loop Result.Value(Dest):= Value(Src); Dest := Dest + 1; end loop; Result.Length := INDICATOR_TYPE( Dest-1 ); end To_VARBINARY; ------------ -- Length -- ------------ function Length( This : in GNADE.VARBINARY ) return Natural is begin if not Is_Null( This.Length ) then return Integer( This.Length ); else return 0; end if; end Length; end GNU.DB.ESQL_Support; gnade-1.6.2.orig/esql/gnu-db-esql_support.ads0000644000175000017500000001621407735616020020756 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- Filename : $Source: /cvsroot/gnade/gnade/esql/gnu-db-esql_support.ads,v $ -- Description : Support package for ISO92 and GNADE ESQL types -- -- Author : Michael Erdmann -- -- Created : 22.12.2000 -- -- Last Modified By: $Author: stephen_leake $ -- Last Modified On: $Date: 2003/09/28 17:36:16 $ -- Status : $State: Exp $ -- -- -- Copyright (C) 2000, 2002 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Functional Description -- -- ====================== -- -- This package contains support procedures for ISO92 and GNADE SQL types -- -- It is intended to simplify the development of ESQL applications. -- -- -- -- Restrictions -- -- ============ -- -- None -- -- -- -- References -- -- ========== -- -- None -- -- -- -- Author -- -- ====== -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with SQL_STANDARD; use SQL_STANDARD; with System; use System; package GNU.DB.ESQL_Support is -- ******************************************************************** -- -- * SQL Communication Area * -- -- * ====================== * -- -- * * -- -- * This type is only provided for Oracle compatibilty. In the moment* -- -- * it is not clear what kind of information will be available with * -- -- * ODBC. * -- -- ******************************************************************** -- type SQLCA_Type is record Message : aliased String(1..255 ); State : aliased SQLSTATE_TYPE; SqlCode : aliased SQLCODE_TYPE; Affected_Rows : aliased Integer := 0; end record; type SQLCA_Access is access all SQLCA_Type ; SUCCESS_CLASS : constant String := "00" ; WARNING_CLASS : constant String := "01" ; NOTFOUND_CLASS : constant String := "02" ; ERROR_CLASS : constant String := "HY" ; --| --| This procedure is used by the esql code generator internally --| to print out the result of a query after an ODBC command --| has been issued. --| procedure DEBUG( Where : in String; Query : in String; RC : in System.Address); function Is_Null ( s : SQL_STANDARD.INDICATOR_TYPE ) return Boolean; -- ******************************************************************** -- -- * S U P P O R T F O R * -- -- * SQL_STANDARD.CHAR * -- -- ******************************************************************** -- function To_String( Item : in SQL_STANDARD.CHAR ) return String; procedure To_String( Item : in SQL_STANDARD.CHAR; Target : out String ); procedure Move( S : in String ; C : out SQL_STANDARD.CHAR ); --- ******************************************************************* --- --- * S U P P O R T F O R * --- --- * GNADE.VARCHAR * --- --- ******************************************************************* --- Is_Empty : exception; function To_String( This : in GNADE.VARCHAR ) return String; procedure To_VARCHAR( Value : in String; Result : out GNADE.VARCHAR); function Is_Null( This : in GNADE.VARCHAR ) return Boolean; function Length( This : in GNADE.VARCHAR ) return Natural; function To_Binary( Src : in String ) return GNADE.BINARY; function To_Binary( This : in GNADE.VARBINARY ) return GNADE.BINARY; procedure To_Binary( This : in GNADE.VARBINARY; Dest : out GNADE.BINARY; Len : out Positive ); procedure To_VARBINARY( Value : in GNADE.BINARY; Result : out GNADE.VARBINARY ); function Length( This : in GNADE.VARBINARY ) return Natural; Out_Of_Resources : exception ; No_Reopenable_Cursor : exception ; General_Error : exception ; end GNU.DB.ESQL_Support; gnade-1.6.2.orig/esql/options.ads0000644000175000017500000001210007632655512016532 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/esql/options.ads,v $ -- Description : Main driver for the embedded SQL translator -- Author : Michael Erdmann -- -- Created : 22.12.2000 -- -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2003/03/09 15:18:34 $ -- Status : $State: Exp $ -- -- -- Copyright (C) 2002 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- This software is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- This package contains the Option flags for the esql translator -- -- -- -- Contact -- -- ======= -- -- Error reports shall be handled via http://gnade.sourceforge.net -- -- Features and ideas via: gnade-develop@lists.sourceforge.net -- -- -- -- Author contact: -- -- purl:/net/michael.erdmann -- -- -- ------------------------------------------------------------------------------- with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Text_IO; use Ada.Text_IO; package Options is -- print out the activities Option_Verbose : Boolean := False; -- if true, no copyright notices etc are printed out Option_SILENT : Boolean := False; -- this forces the checks to be pedantic, which means deviations from -- ISO are indicated a warnings. Option_Pedantic : Boolean := False; -- Controls the eception behaviour. If true the ISO/92 Section 19.2 -- will be applied, which means after each embedded SQL all conditions -- are cleared. Option_ISO92_Exception : Boolean := False; -- This will generate additional in line debug code Option_Debug_Code : Boolean := False; -- this is the max. number of error before the processing stops. Option_Error_Limit : Natural := 200; -- do not insert the sqlstate/sqlcode automatically Option_No_SQLSTATE : Boolean := False; -- Debugging output Option_DEBUG : Boolean := False; -- dbcs name Option_DBCS : Unbounded_String := To_Unbounded_String("ODBC"); -- schema file Option_SCHEMA : Boolean := False; Schema_File : File_Type; -- GNAT specific swithches Option_GNAT_Sref : Boolean := True; -- compiler option type Target_Compiler_Type is ( GNU_Ada, Aonix, Unknown ); Target_Compiler : Target_Compiler_Type := GNU_Ada; -- this is the name of the connection package which might be used -- to overwrite the Connection_Type. Option_Connect_Pkg : Unbounded_String := Null_Unbounded_String; end Options; gnade-1.6.2.orig/esql/scanner.adb0000644000175000017500000006437710545001507016460 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/esql/scanner.adb,v $ -- Description : Scanner for the embedded SQL translator -- -- Author : Michael Erdmann -- -- Created : 8.12.2000 -- -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2006/12/28 17:47:51 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2000-2006 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- This software is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- This module provides the lexical scanner for the esql translator. Each -- -- token read in is copied into a output line if the user decides to accept -- -- the copy. If the tokenizer has reached the end of a line, the text -- -- stored in the output buffer will be written into the output file. -- -- Additionaly the user may insert additional strings into the output -- -- line. -- -- -- -- This module provides additionaly the service to print out messaged -- -- according to the gcc style containing line and column number. -- -- -- -- Contact -- -- ======= -- -- Error reports shall be handled via http://gnade.sourceforge.net -- -- Features and ideas via: gnade-develop@lists.sourceforge.net -- -- -- -- Author contact: -- -- purl:/net/michael.erdmann -- -- -- ------------------------------------------------------------------------------- with Ada.Exceptions; use Ada.Exceptions; with Ada.Strings; use Ada.Strings; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Unchecked_Conversion; with Ada.Text_IO; use Ada.Text_IO; with Ada.Characters.Latin_1; use Ada.Characters; with Ada.Strings.Fixed; use Ada.Strings.Fixed; with Ada.Characters.Handling; use Ada.Characters.Handling; with Options; use Options; with Esql_Variables; use Esql_Variables; package body Scanner is Version : constant String := "$Id: scanner.adb,v 1.24 2006/12/28 17:47:51 merdmann Exp $"; type File_Reader_Type is record File : File_Type; Line : String(1..512); Line_Length : Natural := 1; Read_Pos : Natural := 0; Output : File_Type; Accepted_Length : Natural := 0; Accepted_Line : String(1..8000); Temp_Buffer : String(1..8000); Temp_Pos : Natural := 0; Current_Character : Character := ' '; Begin_Of_Token : Natural := 0; Current_Line_Nbr : Natural := 0; File_Name : Unbounded_String := Null_Unbounded_String; Last_Line : Boolean := False; end record; Space : constant Character := ' '; Tab : constant Character := Latin_1.HT; ------------------ -- Accept_Input -- ------------------ procedure Accept_Input( F : in out File_Reader ) is -- procedures accepts the characters read so far -- are copied into the output file. begin for I in 1..F.Temp_Pos loop F.Accepted_Length := F.Accepted_Length + 1; F.Accepted_Line( F.Accepted_Length ) := F.Temp_Buffer(I); end loop; f.Temp_Pos := 0; end Accept_Input; ------------------ -- Ignore_Input -- ------------------ procedure Ignore_Input( F : in out File_Reader ) is -- Don't copy the charcter to the output stream. begin f.Temp_Pos := 0; end Ignore_Input; ------------------- -- Accept_String -- ------------------- procedure Accept_String( f : in out File_Reader; s : in String ) is -- This procedure inserts a string into the accept buffer. begin -- Put_Line( "(" & F.Accepted_Line( 1..F.Accepted_Length ) & ")" ); for i in S'Range loop f.Accepted_Length := f.Accepted_Length + 1; f.Accepted_Line( f.Accepted_Length ) := S(i); end loop; -- Put_Line( "<" & F.Accepted_Line( 1..F.Accepted_Length ) &">" ); end Accept_String; ---------------- -- Substitute -- ---------------- procedure Substitute( S : in String; Result : out String; Length : out Natural ) is -- replace variable definitions within an input line. -- -- R.1 - If we find a comment copy everything without -- any substitution -- R.2 - If we find a $ substitute. -- -- NOTE: -- This is a horrible hack, but it works. Since this limits -- the substitution to simple lines this will be a subject -- of rework later on. I : Natural := S'First; J : Natural := S'First; End_Of_Input : exception; function Is_Identifier( Ch : in Character ) return Boolean is begin return (Ch in 'a'..'z') or (Ch in 'A'..'Z') or (Ch in '0'..'9') or Ch = '_'; end Is_Identifier; -- copy a char into the result procedure Copy( Ch : in Character ) is begin if J not in Result'Range then raise End_Of_Input; else Result(J) := Ch; J := J + 1; Length := Length + 1; end if; end Copy; -- get the next char from the input function Next_Char return Character is Ch : Character; begin if I not in S'Range then raise End_Of_Input; else Ch := S(I); end if; I := I + 1; return Ch; end Next_Char; begin Length := 0; while I in S'Range loop declare Var : String( 1..1024 ); L : Natural := Var'First; begin -- R.1 if S(I) = '-' and ( (I+1 in S'Range) and then S(I+1) = '-' ) then while I in S'Range loop Copy( Next_Char ); end loop; exit; end if; -- R.2 handle a subsitution if S(I) = '$' then I := I + 1; -- read in the identifier while I in S'Range and then Is_Identifier(S(I)) loop Var(L) := Next_Char; L := L + 1; end loop; L := L - 1; Last_Variable_Name := To_Unbounded_String( Var( 1..L ) ); -- copy into output declare V : constant String := To_String( Value( Var(1..L) ) ); begin for K in V'Range loop Copy( V(K) ); end loop; end ; elsif S(I) = ''' then Copy( Next_Char ); Copy( Next_Char ); Copy( Next_Char ); elsif S(I) = '"' then Copy( Next_Char ); while I in S'Range and then S(I) /= '"' loop Copy( Next_Char ); end loop; else Copy( Next_Char ); end if; end; end loop; exception when End_Of_Input => Put_Line( "end of input " & Result( 1..Length ) ); end Substitute; -------------- -- Get_Char -- -------------- procedure Get_Char( F : in File_Reader; CH : out Character; Tmp : Boolean := True ) is -- this function reads in the characters from the input -- file. Each line which has been read in completly -- but character wise processed. -- Each character read is first copied into a temporary -- buffer which is appended to the output line buffer, -- if the application accepts the token. -- The output buffer is written out upon end of the line -- which contains only the accepted parts of the input -- line. R : Natural renames F.Read_Pos; T : Natural renames F.Temp_Pos; L : Natural renames F.Line_Length; begin if R = 0 -- get_char is called the first time or R > L -- or end of the line is reached then if not F.Last_Line then declare Tmp : String( 1..1024 ); begin f.Current_Line_Nbr := f.Current_Line_Nbr + 1; -- invoke the substituation of prep. symbols. Get_Line( F.File, Tmp, L ); Substitute( Tmp(1..L), F.Line, L ); F.Line(L+1) := ' '; L := L + 1; -- this removes any CR/LF combintation as they are found -- with Windows NT. for I in 1..L loop if F.Line(I) < ' ' then F.Line(I) := ' '; end if; end loop; if Option_DEBUG then Put_Line( "Processing line " & Integer'Image(F.Current_Line_Nbr)); end if; exception when ESQL_Variables.Not_Existing => raise; when others => F.Last_Line := True; end; R := 1; CH := ' '; else -- -- If we have reached End_Of_File make sure that -- any saved line is written to the output -- if R = 1 and then F.Accepted_Length > 0 then Put_Line( F.Output, F.Accepted_Line(1..f.Accepted_Length)); F.Accepted_Length := 0; T := 0; end if; -- if this was the last line then indicate end of file if Option_Debug then Put_Line("EOF"); end if; CH := ASCII.EOT; end if; else if R = 1 and then F.Accepted_Length > 0 then Put_Line( f.Output, F.Accepted_Line(1..f.Accepted_Length) ); F.Accepted_Length := 0; T := 0; end if; CH := F.Line( R ); R := R + 1; if Tmp then T := T + 1; F.Temp_Buffer( T ) := F.Current_Character; end if; end if; end Get_Char; ---------------- -- Look_Ahead -- ---------------- function Look_Ahead( F : in File_Reader) return Character is -- this function reads in the characters from the input -- file. Each line which has been read in completly -- will be printed into the output stream. The trick of -- removing the embedded SQL string will be done later R : Natural renames F.Read_Pos; T : Natural renames F.Temp_Pos; L : Natural renames F.Line_Length; begin if R = 0 or R = L + 1 then if F.Last_Line then return ASCII.EOT; else return ' '; end if; else return f.Line( R ); end if; end Look_Ahead; ----------- -- Flush -- ----------- procedure Flush( F : in out File_Reader ) is -- Write out the already accepted code and the remaining part R : Natural renames F.Read_Pos; T : Natural renames F.Temp_Pos; L : Natural renames F.Line_Length; begin if F.Accepted_Length > 0 then Put(f.Output, F.Accepted_Line(1..f.Accepted_Length) ); f.Accepted_Length := 0; end if; Put_Line( f.Output, f.Line( R..L ) ); T := 0; R := 0; end Flush; --------------- -- Get_Token -- --------------- procedure Get_Token( F : in out File_Reader; Token : out Token_Type ) is -- get a token from the input buffer CH : Natural := 1; -- SAVE CHARACTER ---------------------------------------------------- procedure Save_Character( Tmp : in Boolean := True ) is begin if CH < token.Lexicon'Length then Token.Lexicon(CH) := F.Current_Character; CH := CH + 1; end if; Get_Char(F, F.Current_Character, Tmp ); end Save_Character; -- GET IDENTIFIER ------------------------------------------------------ -- -- bug fix: 0502.2 the ' is part of an identifier in order to meet the -- lexical rules of SQL. procedure Get_Identifier is begin Token.Lexical_Unit := Identifier_Lex; Token.Lexicon := Blank_Identifier; Save_Character; -- Add characters to the representation until invalid char found loop if (f.Current_Character not in 'a'..'z') and (f.Current_Character not in 'A'..'Z') and (f.Current_Character not in '0'..'9') and (f.Current_Character /= '_') and (F.Current_Character /= ''') then exit; else Save_Character; end if; end loop; end Get_Identifier; -- GET NUMERIC LITERAL ------------------------------------------ procedure Get_Numeric_Literal is -- GET INTEGER ------------------------------------------------ procedure Get_Integer is begin loop if (f.Current_Character in '0'..'9') or (f.Current_Character = '_') then Save_Character; else exit; end if; end loop; end Get_Integer; -- GET EXPONENT ------------------------------------------------- procedure Get_Exponent is begin Save_Character; if (f.Current_Character = '+') or (f.Current_Character = '-') then Save_Character; end if; Get_Integer; end Get_Exponent; -- GET EXTENDED INTEGER ----------------------------------- procedure Get_Extended_Integer is begin loop if (f.Current_Character in '0'..'9') or (f.Current_Character = '_') or (f.Current_Character in 'a'..'f') then Save_Character; else exit; end if; end loop; end Get_Extended_Integer; begin -- GET NUMERIC LITERAL Token.Lexical_Unit := Numeric_Literal_Lex; Token.Lexicon := Blank_Identifier; Save_Character; Get_Integer; if f.Current_Character = '.' then Save_Character; Get_Integer; if f.Current_Character = 'E' then Save_Character; Get_Exponent; end if; elsif f.Current_Character = '#' then Save_Character; Get_Extended_Integer; if f.Current_Character = '.' then Save_Character; Get_Extended_Integer; end if; if f.Current_Character = '#' then Save_Character; Get_Exponent; end if; end if; end Get_Numeric_Literal; -- GET STRING ----------------------------------------------- procedure Get_Ada_String is String_Begin : Integer := F.Current_Line_Nbr; begin Token.Lexical_Unit := String_Lex; Token.Lexicon := Blank_Identifier; Save_Character; -- Add chars until """ " or """ or """" found loop if f.Current_Character = '"' then Save_Character; if f.Current_Character = '"' then Save_Character; else exit; end if; else Save_Character; end if; if F.Current_Character = ASCII.EOT then Message( F, " error : end of file in string starting at" & Integer'Image(String_Begin) ); raise Lexical_Error; end if; if Is_Control( F.Current_Character ) then Message( F, " error : control character in string starting at" & Integer'Image(String_Begin) ); raise Lexical_Error; end if; end loop; end Get_Ada_String; --| --| This is an SQL Style string --| procedure Get_SQL_String is String_Begin : Integer := F.Current_Line_Nbr; begin Token.Lexical_Unit := String_Lex; Token.Lexicon := Blank_Identifier; Save_Character; -- Add chars until """ " or """ or """" found loop if f.Current_Character = ''' then Save_Character; if f.Current_Character = ''' then Save_Character; else exit; end if; else Save_Character; end if; if F.Current_Character = ASCII.EOT then Message( F, " error : end of file in string starting at" & Integer'Image(String_Begin) ); raise Lexical_Error; end if; if Is_Control( F.Current_Character ) then Message( F, " error : control character in string starting at" & Integer'Image(String_Begin) ); raise Lexical_Error; end if; end loop; end Get_SQL_String; -- GET COMMENT -------------------------------------------------- procedure Get_Comment is begin Token.Lexical_Unit := Comment_Lex; Token.Lexicon := Blank_Identifier; Save_Character; if f.Current_Character = '-' then F.Temp_Pos := F.Temp_Pos + 1; F.Temp_Buffer( F.Temp_Pos ) := F.Current_Character; Accept_Input(F); Flush(F); Save_Character; else Token.Lexical_Unit := Delimiter_Lex; end if; end Get_Comment; -- GET DELIMITER ----------------------------------------------- procedure Get_Delimiter is begin Token.Lexical_Unit := Delimiter_Lex; Token.Lexicon := Blank_Identifier; -- Check for the single and double operators case f.Current_Character is when '=' => Save_Character; if f.Current_Character = '>' then Save_Character; end if; when '.' => Save_Character; if f.Current_Character = '.' then Save_Character; end if; when '*' => Save_Character; if f.Current_Character = '*' then Save_Character; end if; when ':' => Save_Character; if f.Current_Character = '=' then Save_Character; end if; when '/' => Save_Character; if f.Current_Character = '=' then Save_Character; end if; when '>' => Save_Character; if (f.Current_Character = '=') or (f.Current_Character = '>') then Save_Character; end if; when '<' => Save_Character; if (f.Current_Character = '=') or (f.Current_Character = '<') or (f.Current_Character = '>') then Save_Character; end if; when '&' | '(' | ')' | '+' | ',' | '-' | ';' | '|' => Save_Character; when ASCII.EOT => Token.Lexical_Unit := End_Of_File_Lex; when others => Token.Lexical_Unit := Unknown_Lex; Save_Character; end case; end Get_Delimiter; begin -- GET TOKEN -- Skip white space while (f.Current_Character = Space) or (f.Current_Character = Tab) loop Get_Char(f, f.Current_Character); end loop; f.Begin_Of_Token := f.Read_Pos; -- The first character determines token type case F.Current_Character is when '$' | 'a'..'z' | 'A'..'Z' | '0'..'9' => Get_Identifier; when Latin_1.Quotation => Get_Ada_String; when ''' => -- bug fix: 0802.1 Get_SQL_String; when '-' => Get_Comment; when others => Get_Delimiter; end case; pragma Debug( Put_Line( "Current_character " & F.Current_Character ) ); pragma Debug( Put_Line( "Temp_buffer<" & F.Temp_Buffer(1..F.Temp_Pos)&">")); end Get_Token; ------------- -- Comment -- ------------- procedure Comment( F : in out File_Reader; Text : in String ) is -- Place a comment in the output file. If the GNAT compiler is -- used we use the Source_Reference pragma to line up with the -- input line. begin Put_Line (F.Output, "--% " & To_String( F.File_Name ) & " at" & Natural'Image(f.Current_Line_Nbr) & " : " & text ); end Comment; ---------------------- -- Mark_Source_Line -- ---------------------- procedure Mark_Source_Line( F : in out File_Reader ) is -- Place a pragma into the output indicating the currently -- processed source line. -- Line : Natural := F.Current_Line_Nbr + 1; begin if Option_GNAT_Sref then Put_Line (F.Output, "pragma Source_Reference(" & Natural'Image(Line+1) & "," & '"' & To_String( F.File_Name ) & '"' & ");" ); end if; end Mark_Source_Line; ------------ -- Insert -- ------------ procedure Insert( f : in out File_Reader; -- Place a comment in the output file text : in String ) is begin Put_Line(f.Output, text ); end Insert; ------------- -- Message -- ------------- procedure Message( f : in File_Reader; text : in String ) is -- Indicate a syntax error Col : Natural renames f.Begin_of_Token; Row : Natural renames f.Current_Line_Nbr; function Strip( S : in String ) return String is begin return S(2..S'Last) ; end Strip; begin Put_Line( Standard_Error, To_String(f.File_Name) & ":" & Strip(Natural'Image(Row)) & ":" & Strip(Natural'Image(Col)) & ":" & text ); end Message; ------------------ -- Current_Line -- ------------------ function Current_Line( F : in File_Reader ) return Natural is -- Get the current line number begin return F.Current_Line_Nbr; end Current_Line; ---------- -- Open -- ---------- function Open( Input_File_Name : in String; Output_File_Name : in String ) return File_Reader is --- Result : File_Reader := new File_Reader_Type; --- begin Open( File => Result.File, Mode => In_File, Name => Input_File_Name ); Create( Result.Output, Mode => Out_File, Name => Output_File_Name ); Result.File_Name := To_Unbounded_String(Input_File_Name); return Result; end Open; ----------- -- Close -- ----------- procedure Close( f : in out File_Reader ) is begin Close( f.File ); Close( f.Output ); end Close; ------------ -- Delete -- ------------ procedure Delete( f : in out File_Reader ) is begin Delete( f.Output ); end Delete; end Scanner; gnade-1.6.2.orig/esql/scanner.ads0000644000175000017500000001457607524013503016477 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/esql/scanner.ads,v $ -- Description : Scanner for the embedded SQL translator -- -- Author : Michael Erdmann -- -- Created : 12.12.2000 -- -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2002/08/06 18:36:51 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2000 - 2002 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- This software is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- This package provides the lexical scanner. Addtionaly for each token -- -- the application may decide to copy the characters read so far into -- -- the output file. -- -- -- -- Contact -- -- ======= -- -- Error reports shall be handled via http://gnade.sourceforge.net -- -- Features and ideas via: gnade-develop@lists.sourceforge.net -- -- -- -- Author contact: -- -- purl:/net/michael.erdmann -- -- -- ------------------------------------------------------------------------------- with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; --* Ada package Scanner is type File_Reader is private; --| --| Token types --| type Lexical_Unit_Type is ( Identifier_Lex, Numeric_Literal_Lex, Character_Literal_Lex, String_Lex, Delimiter_Lex, Comment_Lex, Unknown_Lex, End_Of_File_Lex ); subtype Identifier_String is String(1..48); Blank_Identifier : constant Identifier_String := (others=>' '); type Token_Type is record Lexicon : Identifier_String := Blank_Identifier ; Lexical_Unit : Lexical_Unit_Type := Unknown_Lex; end record; Null_Token : constant Token_Type := ( Blank_Identifier, Unknown_Lex ); Lexical_Error : exception; --| --| Open a file reader on the given input file name. The output --| file is newly created. An exisiting file is overwritten. --| function Open( Input_File_Name : in String; Output_File_Name : in String ) return File_Reader; --| --| Close the file reader --| procedure Close( f : in out File_Reader ); procedure Delete( f : in out File_Reader ); --| --| Get the next token. The procedure returns the End_Of_File_Lex --| token if file end has been reached. --| procedure Get_Token( f : in out File_Reader; Token : out Token_Type ); --| --| Mark the data read till the end of the current token as --| accepted, which means it will be copied into the output --| file --| procedure Accept_Input( f : in out File_reader ); --| --| Ingnore the source text till the end of the current token, --| which means the text is not copied into the output file. --| procedure Ignore_Input( f : in out File_Reader ); --| --| Insert a string into the accept buffer --| procedure Accept_String( f : in out File_Reader; s : in String ); --| --| Write out the accepted text and the remaining text till --| end of the line. --| procedure Flush( f : in out File_Reader ); procedure Message( f : in File_Reader; text : in String ); --| --| Place a comment in the output source --| procedure Comment( F : in out File_Reader; text : in String ); procedure Mark_Source_Line( F : in out File_Reader ); procedure Insert( f : in out File_Reader; text : in String ); function Current_Line( F : in File_Reader ) return Natural; Last_Variable_Name : Unbounded_String := Null_Unbounded_String; -------------------------------------------------------------------------- private type File_Reader_Type; type File_Reader is access File_Reader_Type; end Scanner; gnade-1.6.2.orig/esql/sql_standard.ads0000644000175000017500000002455607735616052017540 0ustar lbrentalbrenta--| --| Filename : $Source: /cvsroot/gnade/gnade/esql/sql_standard.ads,v $ --| Description : Scanner for the embedded SQL translator --| Author : Michael Erdmann --| Created On : 22.12.2000 --| Last Modified By: $Author: stephen_leake $ --| Last Modified On: $Date: 2003/09/28 17:36:42 $ --| Status : $State: Exp $ --| --| Copyright (C) 2000, 2002 Michael Erdmann --| --| This program is free software; you can redistribute it and/or --| modify it under the terms of the GNU General Public License --| as published by the Free Software Foundation; either version 2 --| of the License, or (at your option) any later version. --| --| This program/code is distributed in the hope that it will be useful, --| but WITHOUT ANY WARRANTY; without even the implied warranty of --| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --| GNU General Public License for more details. --| --| You should have received a copy of the GNU General Public License along --| with this program; if not, write to the Free Software Foundation, Inc., --| 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --| --| As a special exception, if other files instantiate generics from this --| unit, or you link this unit with other files to produce an executable, --| this unit does not by itself cause the resulting executable to be --| covered by the GNU General Public License. This exception does not --| however invalidate any other reasons why the executable file might be --| covered by the GNU Public License. --| --| Functional Description --| ====================== --| This package contains the SQL types as they are required --| by the ISO/92 standart. it links the ODBC data types with the --| SQL/92 data types. --| This file exists only for compatibilty with the ISO/92 --| document. --| --| Restrictions --| ============ --| --| References --| ========== --| --| /1/ - (Second Informal Review Draft) ISO/IEC 9075:1992, Database --| Language SQL- July 30, 1992 --| --| History --| ======= --| --| with GNU.DB.SQLCLI; use GNU.DB.SQLCLI; package SQL_STANDARD is package SQL renames GNU.DB.SQLCLI; type CHAR is array( Positive range <>) of SQL.SQLCHAR; type BIT is array (Natural range <>) of SQL.SQL_BOOLEAN; subtype SMALLINT is SQL.SQLSMALLINT; subtype INT is SQL.SQLINTEGER; subtype REAL is SQL.SQLREAL; subtype DOUBLE_PRECISION is SQL.SQLDOUBLE; subtype INDICATOR_TYPE is SQL.SQLINTEGER; subtype SQLCODE_TYPE is SQL.SQLRETURN; subtype SQL_ERROR is SQLCODE_TYPE range SQLCODE_TYPE'First .. -1; subtype NOT_FOUND is SQLCODE_TYPE range 100 .. 100; subtype SQLSTATE_TYPE is SQL.SQLSTATE; package SQLSTATE_CODES is AMBIGUOUS_CURSOR_NAME_NO_SUBCLASS : constant SQLSTATE_TYPE :="3C000"; CARDINALITY_VIOLATION_NO_SUBCLASS : constant SQLSTATE_TYPE :="21000"; CONNECTION_EXCEPTION_NO_SUBCLASS : constant SQLSTATE_TYPE :="08000"; CONNECTION_EXCEPTION_CONNECTION_DOES_NOT_EXIST : constant SQLSTATE_TYPE :="08003"; CONNECTION_EXCEPTION_CONNECTION_FAILURE : constant SQLSTATE_TYPE :="08006"; CONNECTION_EXCEPTION_CONNECTION_NAME_IN_USE : constant SQLSTATE_TYPE :="08002"; CONNECTION_EXCEPTION_SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION: constant SQLSTATE_TYPE :="08001"; CONNECTION_EXCEPTION_SQLSERVER_REJECTED_ESTABLISHMENT_OF_SQLCONNECTION: constant SQLSTATE_TYPE :="08004"; CONNECTION_EXCEPTION_TRANSACTION_RESOLUTION_UNKNOWN : constant SQLSTATE_TYPE :="08007"; DATA_EXCEPTION_NO_SUBCLASS: constant SQLSTATE_TYPE :="22000"; DATA_EXCEPTION_CHARACTER_NOT_IN_REPERTOIRE: constant SQLSTATE_TYPE :="22021"; DATA_EXCEPTION_DATETIME_FIELD_OVERFLOW: constant SQLSTATE_TYPE :="22008"; DATA_EXCEPTION_DIVISION_BY_ZERO: constant SQLSTATE_TYPE :="22012"; DATA_EXCEPTION_ERROR_IN_ASSIGNMENT: constant SQLSTATE_TYPE :="22005"; DATA_EXCEPTION_INDICATOR_OVERFLOW: constant SQLSTATE_TYPE :="22022"; DATA_EXCEPTION_INTERVAL_FIELD_OVERFLOW: constant SQLSTATE_TYPE :="22015"; DATA_EXCEPTION_INVALID_CHARACTER_VALUE_FOR_CAST: constant SQLSTATE_TYPE :="22018"; DATA_EXCEPTION_INVALID_DATETIME_FORMAT: constant SQLSTATE_TYPE :="22007"; DATA_EXCEPTION_INVALID_ESCAPE_CHARACTER: constant SQLSTATE_TYPE :="22019"; DATA_EXCEPTION_INVALID_ESCAPE_SEQUENCE: constant SQLSTATE_TYPE :="22025"; DATA_EXCEPTION_INVALID_PARAMETER_VALUE: constant SQLSTATE_TYPE :="22023"; DATA_EXCEPTION_INVALID_TIME_ZONE_DISPLACEMENT_VALUE: constant SQLSTATE_TYPE :="22009"; DATA_EXCEPTION_NULL_VALUE_NO_INDICATOR_PARAMETER: constant SQLSTATE_TYPE :="22002"; DATA_EXCEPTION_NUMERIC_VALUE_OUT_OF_RANGE: constant SQLSTATE_TYPE :="22003"; DATA_EXCEPTION_STRING_DATA_LENGTH_MISMATCH: constant SQLSTATE_TYPE :="22026"; DATA_EXCEPTION_STRING_DATA_RIGHT_TRUNCATION: constant SQLSTATE_TYPE :="22001"; DATA_EXCEPTION_SUBSTRING_ERROR: constant SQLSTATE_TYPE :="22011"; DATA_EXCEPTION_TRIM_ERROR: constant SQLSTATE_TYPE :="22027"; DATA_EXCEPTION_UNTERMINATED_C_STRING: constant SQLSTATE_TYPE :="22024"; DEPENDENT_PRIVILEGE_DESCRIPTORS_STILL_EXIST_NO_SUBCLASS: constant SQLSTATE_TYPE :="2B000"; DYNAMIC_SQL_ERROR_NO_SUBCLASS: constant SQLSTATE_TYPE :="07000"; DYNAMIC_SQL_ERROR_CURSOR_SPECIFICATION_CANNOT_BE_EXECUTED: constant SQLSTATE_TYPE :="07003"; DYNAMIC_SQL_ERROR_INVALID_DESCRIPTOR_COUNT: constant SQLSTATE_TYPE :="07008"; DYNAMIC_SQL_ERROR_INVALID_DESCRIPTOR_INDEX: constant SQLSTATE_TYPE :="07009"; DYNAMIC_SQL_ERROR_PREPARED_STATEMENT_NOT_A_CURSOR_SPECIFICATION: constant SQLSTATE_TYPE :="07005"; DYNAMIC_SQL_ERROR_RESTRICTED_DATA_TYPE_ATTRIBUTE_VIOLATION: constant SQLSTATE_TYPE :="07006"; DYNAMIC_SQL_ERROR_USING_CLAUSE_DOES_NOT_MATCH_DYNAMIC_PARAMETER_SPEC: constant SQLSTATE_TYPE :="07001"; DYNAMIC_SQL_ERROR_USING_CLAUSE_DOES_NOT_MATCH_TARGET_SPEC: constant SQLSTATE_TYPE :="07002"; DYNAMIC_SQL_ERROR_USING_CLAUSE_REQUIRED_FOR_DYNAMIC_PARAMETERS: constant SQLSTATE_TYPE :="07004"; DYNAMIC_SQL_ERROR_USING_CLAUSE_REQUIRED_FOR_RESULT_FIELDS: constant SQLSTATE_TYPE :="07007"; FEATURE_NOT_SUPPORTED_NO_SUBCLASS: constant SQLSTATE_TYPE :="0A000"; FEATURE_NOT_SUPPORTED_MULTIPLE_ENVIRONMENT_TRANSACTIONS: constant SQLSTATE_TYPE :="0A001"; INTEGRITY_CONSTRAINT_VIOLATION_NO_SUBCLASS: constant SQLSTATE_TYPE :="23000"; INVALID_AUTHORIZATION_SPECIFICATION_NO_SUBCLASS: constant SQLSTATE_TYPE :="28000"; INVALID_CATALOG_NAME_NO_SUBCLASS: constant SQLSTATE_TYPE :="3D000"; INVALID_CHARACTER_SET_NAME_NO_SUBCLASS: constant SQLSTATE_TYPE :="2C000"; INVALID_CONDITION_NUMBER_NO_SUBCLASS: constant SQLSTATE_TYPE :="35000"; INVALID_CONNECTION_NAME_NO_SUBCLASS: constant SQLSTATE_TYPE :="2E000"; INVALID_CURSOR_NAME_NO_SUBCLASS: constant SQLSTATE_TYPE :="34000"; INVALID_CURSOR_STATE_NO_SUBCLASS: constant SQLSTATE_TYPE :="24000"; INVALID_SCHEMA_NAME_NO_SUBCLASS: constant SQLSTATE_TYPE :="3F000"; INVALID_SQL_DESCRIPTOR_NAME_NO_SUBCLASS: constant SQLSTATE_TYPE :="33000"; INVALID_SQL_STATEMENT_NAME_NO_SUBCLASS: constant SQLSTATE_TYPE :="26000"; INVALID_TRANSACTION_STATE_NO_SUBCLASS: constant SQLSTATE_TYPE :="25000"; INVALID_TRANSACTION_TERMINATION_NO_SUBCLASS: constant SQLSTATE_TYPE :="2D000"; NO_DATA_NO_SUBCLASS: constant SQLSTATE_TYPE :="02000"; REMOTE_DATABASE_ACCESS_NO_SUBCLASS: constant SQLSTATE_TYPE :="HZ000"; SUCCESSFUL_COMPLETION_NO_SUBCLASS: constant SQLSTATE_TYPE :="00000"; SYNTAX_ERROR_OR_ACCESS_RULE_VIOLATION_NO_SUBCLASS: constant SQLSTATE_TYPE :="42000"; SYNTAX_ERROR_OR_ACCESS_RULE_VIOLATION_IN_DIRECT_STATEMENT_NO_SUBCLASS: constant SQLSTATE_TYPE :="2A000"; SYNTAX_ERROR_OR_ACCESS_RULE_VIOLATION_IN_DYNAMIC_STATEMENT_NO_SUBCLASS: constant SQLSTATE_TYPE :="37000"; TRANSACTION_ROLLBACK_NO_SUBCLASS: constant SQLSTATE_TYPE :="40000"; TRANSACTION_ROLLBACK_INTEGRITY_CONSTRAINT_VIOLATION: constant SQLSTATE_TYPE :="40002"; TRANSACTION_ROLLBACK_SERIALIZATION_FAILURE: constant SQLSTATE_TYPE :="40001"; TRANSACTION_ROLLBACK_STATEMENT_COMPLETION_UNKNOWN: constant SQLSTATE_TYPE :="40003"; TRIGGERED_DATA_CHANGE_VIOLATION_NO_SUBCLASS: constant SQLSTATE_TYPE :="27000"; WARNING_NO_SUBCLASS: constant SQLSTATE_TYPE :="01000"; WARNING_CURSOR_OPERATION_CONFLICT: constant SQLSTATE_TYPE :="01001"; WARNING_DISCONNECT_ERROR: constant SQLSTATE_TYPE :="01002"; WARNING_IMPLICIT_ZERO_BIT_PADDING: constant SQLSTATE_TYPE :="01008"; WARNING_INSUFFICIENT_ITEM_DESCRIPTOR_AREAS: constant SQLSTATE_TYPE :="01005"; WARNING_NULL_VALUE_ELIMINATED_IN_SET_FUNCTION: constant SQLSTATE_TYPE :="01003"; WARNING_PRIVILEGE_NOT_GRANTED: constant SQLSTATE_TYPE :="01007"; WARNING_PRIVILEGE_NOT_REVOKED: constant SQLSTATE_TYPE :="01006"; WARNING_QUERY_EXPRESSION_TOO_LONG_FOR_INFORMATION_SCHEMA: constant SQLSTATE_TYPE :="0100A"; WARNING_SEARCH_CONDITION_TOO_LONG_FOR_INFORMATION_SCHEMA: constant SQLSTATE_TYPE :="01009"; WARNING_STRING_DATA_RIGHT_TRUNCATION_WARNING: constant SQLSTATE_TYPE :="01004"; WITH_CHECK_OPTION_VIOLATION_NO_SUBCLASS: constant SQLSTATE_TYPE :="44000"; end SQLSTATE_CODES; -- GNADE SPECIFIC DATA TYPES package GNADE is type VARCHAR( Max : Positive ) is record Value : aliased CHAR( 1..Max ) := (others => 32); Length : aliased INDICATOR_TYPE := 0; end record; type BINARY is array( Positive range <>) of SQL.SQLCHAR; type VARBINARY( Max : Positive ) is record Value : aliased GNADE.BINARY( 1..Max ) ; Length : aliased INDICATOR_TYPE := 0; end record; end GNADE; end SQL_STANDARD; gnade-1.6.2.orig/esql/test/0000755000175000017500000000000011040716254015320 5ustar lbrentalbrentagnade-1.6.2.orig/esql/test/oracle/0000755000175000017500000000000011040716254016565 5ustar lbrentalbrentagnade-1.6.2.orig/esql/test/oracle/Makefile0000644000175000017500000000763107235000225020227 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/esql/test/oracle/Makefile,v $ ## Description : Makefile for the embedded SQL samples ## Author : Juergen Pfeifer ## Created On : 03-Jan-2001 ## Last Modified By: $Author: me $ ## Last Modified On: $Date: 2001/01/28 11:20:53 $ ## Status : $State: Exp $ ## ## Copyright (C) 2000-2001 ## ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## This makefile builds the sample programs for embedded SQL. ## ## Restrictions ## ============ ## ## References ## ========== ## include ../../../make.conf ESQLFLAGS = -nosqlstate -nodebugcode -pedantic $(FLAGS) ESQL=../../esql PROGRAMS=simple # all :: simple.adb # ------------------------------------------------------------------------- # # C O M P I L E R R U L E S # # ------------------------------------------------------------------------- # .SUFFIXES: .adb .adq .adq.adb: $(ESQL) $(ESQLFLAGS) $*.adq # ------------------------------------------------------------------------- # # E X E C U T A B L E S # # ------------------------------------------------------------------------- # simple.adb: simple.adq # ------------------------------------------------------------------------- # # C L E A N T H E D I R E C T O R Y # # ------------------------------------------------------------------------- # clean: rm -rf $(PROGRAMS) b~*.* *.o *.ali core *~ distclean :: clean gnade-1.6.2.orig/esql/test/oracle/README0000644000175000017500000000101307236236543017452 0ustar lbrentalbrentaThis directory contains a code example taken from Oracle. The intention is to provide a migration handbook containing migration hints. This files lists the changes which have been done to the original file: - The procedure has to be placed into a package because esql handles only packages - Oracle allows to access normal Ada 95 types and variables outside of the declare section. - SQLCODE and SQLSTATE are automaticaly inserted by the esql translator, a switch has been added to esql to suppress this. gnade-1.6.2.orig/esql/test/oracle/oracle.adb0000644000175000017500000000336307234102600020501 0ustar lbrentalbrentaWITH GNU.DB.ESQL_SUPPORT; USE GNU.DB.ESQL_SUPPORT; WITH GNU.DB.SQLCLI; USE GNU.DB.SQLCLI; USE GNU.DB; pragma Elaborate_All(GNU.DB.ESQL_SUPPORT); package body test is SQLCODE : SQL_STANDARD.SQLCODE_TYPE ; SQLSTATE : SQL_STANDARD.SQLSTATE_TYPE; SQLCA : aliased ESQL_SUPPORT.SQLCA_TYPE; ESQL_SUPPORT_DB_DEFAULT : ESQL_Support.CONNECTION_HANDLE := NULL; a : aliased INT ; b : aliased INT ; c : aliased INT ; --%ESQL at 11 : *** Query *** declare a_Indicator : aliased SQL_STANDARD.INDICATOR_TYPE := 0; b_Indicator : aliased SQL_STANDARD.INDICATOR_TYPE := 0; c_Indicator : aliased SQL_STANDARD.INDICATOR_TYPE := 0; begin ESQL_Support.PREPARE( GNADE_DB_DEFAULT, " SELECT ALL a , b , c FROM t_test", SQLCA'Unrestricted_Access ); SQLCODE := SQLCA.SQLCODE; SQLSTATE := SQLCA.STATE; ESQL_Support.BINDCOLUMN( GNADE_DB_DEFAULT, 1, a'Unrestricted_Access, a_Indicator'Unrestricted_Access ); ESQL_Support.BINDCOLUMN( GNADE_DB_DEFAULT, 2, b'Unrestricted_Access, b_Indicator'Unrestricted_Access ); ESQL_Support.BINDCOLUMN( GNADE_DB_DEFAULT, 3, c'Unrestricted_Access, c_Indicator'Unrestricted_Access ); ESQL_Support.EXECUTE(GNADE_DB_DEFAULT,SQLCA'Unrestricted_Access); ESQL_Support.FETCH (GNADE_DB_DEFAULT,SQLCA'Unrestricted_Access); SQLCODE := SQLCA.SQLCODE; SQLSTATE := SQLCA.STATE; ESQL_Support.DEBUG( " SELECT ALL a , b , c FROM t_test" ,SQLCA'Access); end; end body; gnade-1.6.2.orig/esql/test/oracle/oracle.adq0000644000175000017500000000037107234102600020514 0ustar lbrentalbrentapackage body test is EXEC SQL BEGIN DECLARE SECTION END-EXEC a : INT ; b : INT ; c : INT ; EXEC SQL END DECLARE SECTION END-EXEC EXEC SQL SELECT ALL a,b,c INTO :a, :b, :c FROM t_test ; end body; gnade-1.6.2.orig/esql/test/oracle/simple.adq0000644000175000017500000000573407236236543020570 0ustar lbrentalbrenta with Text_Io, integer_text_io, sql_standard; use text_io, integer_text_io; package body simple is procedure Simple is ORACLE_ID : constant string := "SCOTT/TIGER"; ENAME_LEN : integer; EXEC SQL BEGIN DECLARE SECTION; ENAME : Char(1..20); DEPT_NAME : CHAR(1..14); LOCATION : CHAR(1..13); SQLCODE : sql_standard.sqlcode_type; -- for ANSI mode SQLSTATE : sql_standard.sqlstate_type; -- ANSI mode EXEC SQL END DECLARE SECTION; SQL_ERROR : exception; SQL_WARNING : exception; --| --| check if the data base returned rows, this code has to be changed --| for gnade esql in the way shown below --| function EMPLOYEE_EXISTS return boolean is begin return (SQLCA.SQLCODE in SQL_STANDARD.SQL_ERROR); end EMPLOYEE_EXISTS; begin EXEC SQL WHENEVER SQLERROR raise SQL_ERROR; EXEC SQL WHENEVER SQLWARNING raise SQL_WARNING; -- Connect to the data base EXEC SQL CONNECT "gnade" IDENTIFIED BY "xxxxxxx" TO ORACLE_ID ; Put_Line("Connected to :" & ORACLE_ID); loop PUT("Enter employee last name (CR to exit): "); GET_LINE(ENAME, ENAME_LEN); exit when ENAME_LEN = 0; -- SELECT statements that return one row can use a -- simple SELECT statement. Otherwise, a cursor must be -- declared for the SELECT, and a FETCH statement is used. EXEC SQL SELECT INITCAP(loc), INITCAP(dname) INTO :LOCATION, :DEPT_NAME FROM employees, departments WHERE dept.deptno = emp.deptno AND EMP.ENAME = upper(:ENAME(1..ENAME_LEN)); if EMPLOYEE_EXISTS then NEW_LINE; PUT("Employee "); PUT(ENAME(1..ENAME_LEN)); PUT(" works for department " & DEPT_NAME); PUT(" in " & LOCATION); else PUT_LINE("Sorry, no such employee (try ALLEN or JONES)"); NEW_LINE; -- The following lines illustrate the use of SQLSTATE and SQLCODE PUT("The SQLSTATE error code is: "); PUT_LINE(string(sqlstate)); PUT("The SQLCODE error code is: "); PUT(integer(sqlcode),1); end if; NEW_LINE; NEW_LINE; end loop; NEW_LINE; PUT_LINE("Good bye."); -- Disconnect from the database. EXEC SQL COMMIT RELEASE; exception -- Turn off error checking, since we do not want -- to raise an exception when logging out under -- any circumstance. EXEC SQL WHENEVER SQLERROR CONTINUE; EXEC SQL WHENEVER SQLWARNING CONTINUE; when SQL_ERROR => PUT_LINE(" ** ORACLE ERROR OCCURRED **"); NEW_LINE; PUT_LINE(SQLCA.MESSAGE); EXEC SQL ROLLBACK RELEASE; when SQL_WARNING => PUT_LINE(" ** ORACLE WARNING OCCURRED **"); NEW_LINE; EXEC SQL ROLLBACK RELEASE; end Simple; end SIMPLE; gnade-1.6.2.orig/esql/test/syntax/0000755000175000017500000000000011040716254016646 5ustar lbrentalbrentagnade-1.6.2.orig/esql/test/syntax/Makefile0000644000175000017500000001063407523546602020323 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/esql/test/syntax/Makefile,v $ ## Description : Makefile for the ESQL Syntax test ## Author : Juergen Pfeifer ## Created On : 03-Jan-2001 ## Last Modified By: $Author: merdmann $ ## Last Modified On: $Date: 2002/08/05 19:09:54 $ ## Status : $State: Exp $ ## ## Copyright (C) 2000-2001 ## ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## This makefile builds the sample programs for embedded SQL. ## ## Restrictions ## ============ ## ## References ## ========== ## include ../../../make.conf # #ESQLFLAGS = -pedantic $(FLAGS) ESQLFLAGS = -pedantic $(FLAGS) #ESQLFLAGS = $(FLAGS) ESQL=$(bindir)/gesql PROGRAMS=simple # all :: $(PROGRAMS) # ------------------------------------------------------------------------- # # C O M P I L E R R U L E S # # ------------------------------------------------------------------------- # .SUFFIXES: .adb .gpq .gpq.adb: $(ESQL) $(ESQLFLAGS) \ -DDBUSER=\"$(DBUSER)\" \ -DDBPASSWD=\"$(DBPASSWD)\" \ -DDBSOURCE=\"$(DBSOURCE)\" \ $*.gpq # ------------------------------------------------------------------------- # # E X E C U T A B L E S # # ------------------------------------------------------------------------- # #testdb: main.adb test.adb test.ads # $(ADAMAKE) -o testdb -I../../ $(ADAFLAGS) main.adb -cargs $(CFLAGS) \ # $(APP_BIND_FLAGS) $(APP_LINK_FLAGS) -largs -lodbc # # # simple test program implemented as package # simple.adb: simple.gpq simple: simple.adb $(ADAMAKE) simple -o simple $(ADAFLAGS) -g $(CFLAGS) \ $(APP_BIND_FLAGS) $(APP_LINK_FLAGS) -largs # ------------------------------------------------------------------------- # # C L E A N T H E D I R E C T O R Y # # ------------------------------------------------------------------------- # clean: rm -rf $(PROGRAMS) b~*.* *.o *.ali core test.adb simple.adb *~ distclean :: clean gnade-1.6.2.orig/esql/test/syntax/main.adb0000644000175000017500000000471107455776571020274 0ustar lbrentalbrenta--| --| Filename : $Source: /cvsroot/gnade/gnade/esql/test/syntax/main.adb,v $ --| Description : This is a test program for the gnade ODBC wrapper --| Author : Michael Erdmann --| Created On : 8.12.2000 --| Last Modified By: $Author: merdmann $ --| Last Modified On: $Date: 2002/04/13 09:42:17 $ --| Status : $State: Exp $ --| --| Copyright (C) 2000 Michael Erdmann --| --| This program is free software; you can redistribute it and/or --| modify it under the terms of the GNU General Public License --| as published by the Free Software Foundation; either version 2 --| of the License, or (at your option) any later version. --| --| This program/code is distributed in the hope that it will be useful, --| but WITHOUT ANY WARRANTY; without even the implied warranty of --| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --| GNU General Public License for more details. --| --| You should have received a copy of the GNU General Public License along --| with this program; if not, write to the Free Software Foundation, Inc., --| 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --| --| As a special exception, if other files instantiate generics from this --| unit, or you link this unit with other files to produce an executable, --| this unit does not by itself cause the resulting executable to be --| covered by the GNU General Public License. This exception does not --| however invalidate any other reasons why the executable file might be --| covered by the GNU Public License. --| --| Functional Description --| ====================== --| --| --| Restrictions --| ============ --| --| References --| ========== --| --| --| History --| ======= --| $Log: main.adb,v $ --| Revision 1.3 2002/04/13 09:42:17 merdmann --| - bug 543343 fixed --| - added CLOSE { STATEMENT | } --| --| Revision 1.2 2001/02/14 21:07:40 me --| - Cursor Handling reworkred --| - Reopeanble cursors added --| --| Revision 1.1 2001/02/11 19:21:41 me --| - syntax test code added, base on the test.adq from smaples --| - SET CONNECTION clause corrected --| --| Revision 1.1 2001/01/05 09:11:47 me --| test.esql has been moved into the smaples/esql directory. --| --| --| with Ada.Text_IO; use Ada.Text_IO; use Ada; with Test; procedure Main is begin Put_Line("******* Generated Queries (test.esql) ****" ); Test.Get_Manager(3); Test.Get_Manager(3); Test.Salary_Of_All_Departments; end Main; gnade-1.6.2.orig/esql/test/syntax/simple.gpq0000644000175000017500000000742507523546602020671 0ustar lbrentalbrenta--| --| Filename : $Source: /cvsroot/gnade/gnade/esql/test/syntax/simple.gpq,v $ --| Description : A simple test example for embedded SQL --| Author : Michael Erdmann --| Created On : 8.12.2000 --| Last Modified By: $Author: merdmann $ --| Last Modified On: $Date: 2002/08/05 19:09:54 $ --| Status : $State: Exp $ --| --| Copyright (C) 2000-2002 Michael Erdmann --| --| This program is free software; you can redistribute it and/or --| modify it under the terms of the GNU General Public License --| as published by the Free Software Foundation; either version 2 --| of the License, or (at your option) any later version. --| --| This program/code is distributed in the hope that it will be useful, --| but WITHOUT ANY WARRANTY; without even the implied warranty of --| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --| GNU General Public License for more details. --| --| You should ha#ve received a copy of the GNU General Public License along --| with this program; if not, write to the Free Software Foundation, Inc., --| 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --| --| As a special exception, if other files instantiate generics from this --| unit, or you link this unit with other files to produce an executable, --| this unit does not by itself cause the resulting executable to be --| covered by the GNU General Public License. This exception does not --| however invalidate any other reasons why the executable file might be --| covered by the GNU Public License. --| --| Functional Description --| ====================== --| --| This is an example for embedded SQL. It demonstrates the ISO/92 --| features and addtional esql extensions. --| --| --| Restrictions --| ============ --| --| References --| ========== --| --| with Ada.Text_IO; use Ada.Text_IO; with SQL_STANDARD; use SQL_STANDARD; with Ada.Strings.Fixed; use Ada.Strings.Fixed; with Ada.Strings; use Ada.Strings; with GNU.DB.SQLCLI; use GNU.DB.SQLCLI; procedure Simple is Nothing_Found : exception; Some_Error : exception; My_Exception : exception; package IO is new Ada.Text_IO.Integer_IO (Integer); use IO; EXEC SQL DECLARE DB01 DATABASE ; -- **************************************************************** -- EXEC SQL DECLARE DEPARTMENTS TABLE ( DEPTNO INT, NAME CHAR ( 1..40 ), LOCATION CHAR ( 1..40 ) ); EXEC SQL DECLARE EMPLOYEES TABLE ( EMPNO INT, NAME CHAR( 1..40 ), FIRSTNAME CHAR( 1..40 ), DEPTNO INT, SINCE CHAR( 1..20 ), MANAGER INT, JOB CHAR( 1..20 ), PROMOTION CHAR( 1..50 ), SALARY REAL ) ; -- ***************************************************************** -- EXEC SQL BEGIN DECLARE SECTION END-EXEC name : CHAR(1..40); depno_ind : INDICATOR_TYPE := 0; empno, depno : INT; dep_location : CHAR (1..40); EXEC SQL END DECLARE SECTION END-EXEC procedure Handle_Wrong_Password is begin Put_Line("Password wrong!"); raise Some_Error; end Handle_Wrong_Password; begin EXEC SQL CONNECT $DBUSER IDENTIFIED BY $DBPASSWD BY DB01 TO $DBSOURCE ON COMMUNICATION ERROR RAISE Some_Error ON AUTHORIZATION ERROR DO Handle_Wrong_Password ; -- Hallo Test EXEC SQL at DB01 SELECT NAME INTO :Name FROM EMPLOYEES; while SQLCODE not in SQL_STANDARD.NOT_FOUND loop Put_Line( ">" & To_String( Name ) ); EXEC SQL at DB01 FETCH INTO :Name; end loop; exception when Some_Error => EXEC SQL DISCONNECT ALL; end Simple; gnade-1.6.2.orig/esql/test/syntax/test.adq0000644000175000017500000002625307514343644020336 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNat Ada Database Environment -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/esql/test/syntax/test.adq,v $ -- Description : ESQL Testcode -- -- Author : Michael Erdmann -- -- Created On : 22-Dec-2000 -- -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2002/07/14 18:49:08 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2000-2002 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- -- -- References -- -- ========== -- -- //1// - (Second Informal Review Draft) ISO/IEC 9075:1992, Database -- -- Language SQL- July 30, 1992 -- -- -- ------------------------------------------------------------------------------- with Ada.Text_IO; use Ada.Text_IO; with SQL_STANDARD; use SQL_STANDARD; with Ada.Strings.Fixed; use Ada.Strings.Fixed; with Ada.Strings; use Ada.Strings; package body Test is Nothing_Found : exception; Some_Error : exception; package IO is new Ada.Text_IO.Integer_IO (Integer); use IO; EXEC SQL DECLARE DB01 DATABASE ; -- EXEC SQL DECLARE employees TABLE ; -- this will cause a warning ----------------- -- Get_Manager -- ----------------- procedure Get_Manager( manager : in Integer ) is -- -- This example exercises the following fetures: -- -- * SQL Invoction for a named connection -- * WHENEVER CLAUSE -- A) Call of a procedure in case of NOT FOUND -- B) Handling of CONTINUE clause -- -- * SQLCA -- A) Local communication area -- B) Accessing the Message contents -- C) -- * DATA BASE CONNECTIONS -- Passing a data base connection as input parameter -- to a procedure. -- -- * HOST VIARIABLES -- * INDICATOR -- -- -- EXEC SQL BEGIN DECLARE SECTION END-EXEC name : CHAR(1..40) := (others=>32); name_ind : INDICATOR_TYPE := 0; depno_ind : INDICATOR_TYPE := 0; empno, depno : INT; Manager_To_Find : INT := INT(manager) ; dep_location : CHAR(1..20) := (others=>32); Total_Expense : REAL; Total_Expense_Ind : INDICATOR_TYPE := 0; Can_Fax : BIT(1); Last_Updated : CHAR(1..40) EXEC SQL END DECLARE SECTION END-EXEC --------------- -- Not_Found -- --------------- procedure Not_Found is -- -- This is a local handler which is called in case -- no touple is found. -- begin Put_Line("** procedure Nothing_Found called" ); Put_Line("** Error message: " & Trim( SQLCA.Message, Right ) ); end Not_Found; -------------------- -- Print_Employee -- -------------------- procedure Print_Employee( His_Number : Integer; EXEC SQL DECLARE DB01x DATABASE ) is --- EXEC SQL INCLUDE SQLCA NAMED BY MY_SQLCA; --- begin empno := INT(His_Number); EXEC SQL WHENEVER NOT FOUND DO Not_Found; EXEC SQL AT DB01x SELECT NAME, DEPTNO INTO :name, :depno FROM EMPLOYEES WHERE EMPNO = :empno ; EXEC SQL AT DB01x SELECT LOCATION INTO :dep_location FROM DEPARTMENTS WHERE DEPTNO = :depno ; if SQLCODE not in SQL_STANDARD.NOT_FOUND then Put_Line( "Employee : " & Trim(To_String(Name),Right) & " working in dep. " & INT'Image(depno) & " located at " & Trim(To_String(dep_location),Right) ); end if; EXEC SQL WHENEVER NOT FOUND CONTINUE; EXEC SQL RESET SQLCA ; end Print_Employee; --- begin Put_Line("Printing all employees working for Manager " & Integer'Image(Manager) ); Put_Line(""); EXEC SQL AT DB01 DECLARE emp_cursor LOCAL CURSOR FOR SELECT EMPNO, NAME, DEPTNO FROM EMPLOYEES WHERE MANAGER = :Manager_To_Find INDICATOR :name_ind ; EXEC SQL WHENEVER NOT FOUND DO Not_Found; EXEC SQL WHENEVER SQLERROR RAISE Some_Error; Put_Line("Emp. Number Employee"); Put_Line("=========== ======================"); EXEC SQL AT DB01 OPEN emp_cursor ; -- read out all data seleted by the query loop EXEC SQL AT DB01 FETCH FROM emp_cursor INTO :empno, :name, :depno INDICATOR :depno_ind ; exit when SQLCODE in SQL_STANDARD.NOT_FOUND; Put( Integer(empno), width => 10 ); -- employee number Put( " " & To_String(Name) & " " ); -- name of the employee if Is_Null( depno_ind ) then Put( "department number not defined" ); else Put (Integer(depno), Width => 10); end if; New_Line; end loop; Put_Line(""); EXEC SQL AT DB01 CLOSE emp_cursor; ------------------------------------------------------------------------- Put_Line("Reopen the cursor and second run"); EXEC SQL AT DB01 OPEN emp_cursor ; -- read out all data seleted by the query loop EXEC SQL AT DB01 FETCH FROM emp_cursor INTO :empno, :name, :depno INDICATOR :depno_ind ; exit when SQLCODE in SQL_STANDARD.NOT_FOUND; Put( Integer(empno), width => 10 ); -- employee number Put( " " & To_String(Name) & " " ); -- name of the employee if Is_Null( depno_ind ) then Put( "department number not defined" ); else Put (Integer(depno), Width => 10); end if; New_Line; end loop; Put_Line(""); EXEC SQL AT DB01 CLOSE emp_cursor ; -- This will perform a single query Put_Line( "Printing Employee Data" ); Print_Employee(1, EXEC SQL INCLUDE DATABASE NAMED DB01; ); Print_Employee(2, EXEC SQL INCLUDE DATABASE NAMED DB01; ); Put_Line( "calulating total salary"); EXEC SQL AT DB01 SELECT sum(SALARY) INTO :Total_Expense INDICATOR :Total_Expense_ind FROM EMPLOYEES WHERE EMPNO > 60000; if not Is_Null( Total_Expense_Ind ) then Put_Line("Total salary : " & REAL'Image(Total_Expense) ); else Put_Line("No toal salary"); end if; exception when Nothing_Found => Put_Line("Nobody found"); EXEC SQL WHENEVER NOT FOUND CONTINUE; EXEC SQL WHENEVER SQLERROR CONTINUE; -- EXEC SQL AT DB01 END ; when Others => Put_Line( "Exception " ); EXEC SQL WHENEVER NOT FOUND CONTINUE; EXEC SQL WHENEVER SQLERROR CONTINUE; -- EXEC SQL AT DB01 END ; raise; end Get_Manager; ------------------- -- Dynamic Query -- ------------------- procedure Salary_Of_All_Departments is --- problem from F. Fabien EXEC SQL INCLUDE SQLCA NAMED BY MY_SQLCA; EXEC SQL DECLARE DEP_CURSOR STATEMENT; EXEC SQL BEGIN DECLARE SECTION END-EXEC depno_ind : INDICATOR_TYPE := 0; depno : INT; Total_Expense : REAL; Total_Expense_Ind : INDICATOR_TYPE := 0; EXEC SQL END DECLARE SECTION END-EXEC S : constant STRING := "SELECT sum(SALARY) " & "FROM EMPLOYEES " & "WHERE DEPTNO = ? " ; begin EXEC SQL AT DB01 PREPARE Dep_Cursor FROM S USING :depno; for I in 1000..1003 loop Depno := INT(I); Total_Expense := Real(0.0); EXEC SQL AT DB01 EXECUTE Dep_Cursor USING :Total_Expense :Total_Expense_Ind; EXEC SQL AT DB01 FETCH USING STATEMENT DEP_CURSOR INTO :Total_Expense :Total_Expense_Ind; If not Is_Null( Total_Expense_Ind ) then Put_Line("Total salary : " & REAL'Image(Total_Expense) ); else Put_Line("No toal salary"); end if; EXEC SQL at DB01 CLOSE STATEMENT Dep_Cursor; end loop; end Salary_Of_All_Departments; begin Put_Line("Opening connection to Database" ); EXEC SQL CONNECT "gnade" IDENTIFIED BY "gnade" BY DB01 TO "gnade" ; -- Hallo Test Put_Line("Setting default connection" ); EXEC SQL SET CONNECTION DB01 ; end Test; --- end of file gnade-1.6.2.orig/esql/test/syntax/test.ads0000644000175000017500000000017507455776571020350 0ustar lbrentalbrentapackage Test is procedure Get_Manager( Manager : Integer ); procedure Salary_Of_All_Departments; end Test; gnade-1.6.2.orig/etc/0000755000175000017500000000000011040716254014150 5ustar lbrentalbrentagnade-1.6.2.orig/etc/Makefile0000644000175000017500000000604710033070410015603 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/etc/Makefile,v $ ## Description : The top level makefile of GNADE ## Author : Michael Erdmann ## Created On : 03-Jan-2001 ## Last Modified By: $Author: merdmann $ -- ## Last Modified On: $Date: 2004/04/01 19:44:08 $ -- ## Status : $State: Exp $ -- ## -- ## Copyright (C) 2000-2004 -- ## -- ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## all install clean distclean : $(MAKE) -C./profile.d $@ gnade-1.6.2.orig/etc/config.site0000755000175000017500000001232110041276752016311 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/etc/config.site,v $ ## Description : site specific configuration file ## Author : Michael Erdmann ## Created On : 14-Apr-2002 ## Last Modified By: $Author: merdmann $ ## Last Modified On: $Date: 2004/04/20 19:45:46 $ ## Status : $State: Exp $ ## -- ## Copyright (C) 2000-2004 ## ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## ## If your system deviates from the predefined values change it here. ## ## ## VARIABLE: site_gnadehome ## NOTE: This is the place wehre the binaries and the linbraries are ## stored after installaton ## Default: /usr/local/gnade #site_gnadehome= ## ## VARIABLE: site_etcdir ## NOTE: This is the place where all binaries are installed and ## where the gnade binaries will be put during installtion ## Default: /etc #site_etcdir= ## ## VARIABLE: site_bindir ## NOTE: This is the place where all binaries are installed and ## where the gnade binaries will be put during installtion ## Default: /usr/bin #site_bindir= ## ## VARIABLE: site_tooldir ## NOTE: This is the place where all binaries are installed and ## where the gnade binaries will be put during installtion ## Default: /usr/bin #site_tooldir= ## ## VARIABLE: site_libdir ## NOTE: This is the place where all libraries are located. After ## running the installation script, the gnade libraries will ## be put here. ## Default: $site_gnadehome/lib #site_libdir= ## VARIABLE: site_adadir ## NOTE: This is the place where all the ada library files ## including the adb and ads files will be installed in. ## Default: $site_gnadehome/include #site_adadir= ## VARIABLE: site_docdir ## NOTE: This is the place where all the ada library files ## including the adb and ads files will be installed in. ## Default: $site_gnadehome/doc #site_docdir= ## ## VARIABLE: site_pkgconfig_path ## NOTE: This variable specifies where the gnu pksgconfig directory is ## is located. ## ## Default: ## site_pkgconfig_path=/usr/local/lib/pkgconfig ## ##site_pkgconfig_path= ## ## ## VARIABLE: site_gnat_path ## NOTE: This variable specifies where the GNAT ada complier frontend is ## located. ## ## Default: ## site_gnat_path=/usr/gnat/bin ## ##site_gnat_path= ## ## ## ## VARIABLE: site_db_libs ## NOTE: This variable contains a list of space speparated places where your ## database vendors libraries are located, specially the ## native libraries and the odbc drivers. ## Default: None ## site_db_libs="/usr/lib/mysql /usr/lib/unixODBC /usr/local/pgsql/lib /Library/MySQL/lib/mysql " ## ## VARIABLE: site_odbc_dmlibs ## NOTE: Add the list of places where you have installed your odbc driver ## manager seperated by blanks ## site_odbc_dmlibs="/usr/lib c:/GNAT/lib/win32" gnade-1.6.2.orig/etc/profile.d/0000755000175000017500000000000011040716276016036 5ustar lbrentalbrentagnade-1.6.2.orig/etc/profile.d/Makefile0000644000175000017500000000745710043524241017502 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/etc/profile.d/Makefile,v $ ## Description : The top level makefile of GNADE ## Author : Michael Erdmann ## Created On : 03-Jan-2001 ## Last Modified By: $Author: merdmann $ -- ## Last Modified On: $Date: 2004/04/27 18:38:25 $ -- ## Status : $State: Exp $ -- ## -- ## Copyright (C) 2000-2004 -- ## -- ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## include ../../make.conf profile=$(gnadeetcdir)/profile.d ## configured=$(wildcard *.in) target=$(subst .in,,$(configured)) all install clean distclean :: $(MAKE) $@-$(BUILDOS) ## ## Prepare environment scripts for Linux ## all-linux all-linux-gnu all-cygwin:: install -d $(profile) for i in $(target) ; do $(PREP) -s -f ../../make.conf $$i.in $$i ; done all-cygwin:: install -m 0555 gnade.sh $(profile) all-linux all-linux-gnu:: install -m 0555 $(target) $(profile) install-linux install-linux-gnu install-cygwin: ## ## remove all produced targets of this makefile ## clean :: $(RM) *~ *~*~ $(RM) $(target) clean-linux clean-linux-gnu clean-cygwin: distclean-linux distclean-linux-gnu distclean-cygwin: clean ## ## Create environment scripts for windows. ## all-win32 install-win32 clean-win32 distclean-win32: gnade-1.6.2.orig/etc/profile.d/README0000644000175000017500000000015610032101327016701 0ustar lbrentalbrentaThis file contains the profile scripts for multiple shells. The install.sh file installs all GNADE profiles. gnade-1.6.2.orig/etc/profile.d/gnade.bash.in0000644000175000017500000000074510544005112020352 0ustar lbrentalbrenta# # $Id: gnade.bash.in,v 1.3 2006/12/25 17:28:42 merdmann Exp $ # GNADE_BASEPATH=/usr/local/gnade export GNADE_BASEPATH if test "x$GPS_DOC_PATH" = "x" ; then GPS_DOC_PATH=$GNADE_BASEPATH/doc else GPS_DOC_PATH=$GPS_DOCPATH:$GNADE_BASEPATH/doc fi export GPS_DOC_PATH PATH=$PATH:$GNADE_BASEPATH/bin export PATH # ADA_INCLUDE_PATH=$GNADE_BASEPATH/include:$ADA_INCLUDE_PATH export ADA_INCLUDE_PATH ADA_OBJECTS_PATH=$GNADE_BASEPATH/lib:$ADA_OBJECTS_PATH export ADA_OBJECTS_PATH gnade-1.6.2.orig/etc/profile.d/gnade.csh.in0000644000175000017500000000070710544005112020210 0ustar lbrentalbrenta# # $Id: gnade.csh.in,v 1.3 2006/12/25 17:28:42 merdmann Exp $ # GNADE_BASEPATH=/usr/local/gnade export GNADE_BASEPATH if test "x$GPS_DOC_PATH" = "x" ; then GPS_DOC_PATH=$GNADE_BASEPATH/doc else GPS_DOC_PATH=$GPS_DOCPATH:$GNADE_BASEPATH/doc fi export GPS_DOC_PATH setenv PATH $PATH:$GNADE_BASEPATH/bin export PATH # setenv ADA_INCLUDE_PATH $GNADE_BASEPATH/include:$ADA_INCLUDE_PATH setenv ADA_OBJECTS_PATH $GNADE_BASEPATH/lib:$ADA_OBJECTS_PATH gnade-1.6.2.orig/etc/profile.d/gnade.sh.in0000644000175000017500000000073710544005113020051 0ustar lbrentalbrenta# # $Id: gnade.sh.in,v 1.3 2006/12/25 17:28:43 merdmann Exp $ # GNADE_BASEPATH=/usr/local/gnade export GNADE_BASEPATH if test "x$GPS_DOC_PATH" = "x" ; then GPS_DOC_PATH=$GNADE_BASEPATH/doc else GPS_DOC_PATH=$GPS_DOCPATH:$GNADE_BASEPATH/doc fi export GPS_DOC_PATH PATH=$PATH:$GNADE_BASEPATH/bin export PATH ADA_INCLUDE_PATH=$GNADE_BASEPATH/include:$ADA_INCLUDE_PATH export ADA_INCLUDE_PATH ADA_OBJECTS_PATH=$GNADE_BASEPATH/lib:$ADA_OBJECTS_PATH export ADA_OBJECTS_PATH gnade-1.6.2.orig/ide/0000755000175000017500000000000011040716254014136 5ustar lbrentalbrentagnade-1.6.2.orig/ide/Makefile0000644000175000017500000001003110043635123015566 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/ide/Makefile,v $ ## Description : IDE components -- ## Author : Michael Erdmann -- ## Created On : 1-May-2002 -- ## Last Modified By: $Author: merdmann $ -- ## Last Modified On: $Date: 2004/04/28 05:00:03 $ -- ## Version : $Revision: 1.1 $ ## Status : $State: Exp $ ## -- ## Copyright (C) 2002,2003 -- ## -- ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## This package is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## Contact -- ## ======= -- ## Error reports shall be handled via http://gnade.sourceforge.net -- ## Features and ideas via: gnade-develop@lists.sourceforge.net -- ## -- ## Author contact: -- ## purl:/net/michael.erdmann -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## ## Restrictions ## ============ ## None ## ## References ## ========== ## None ## ## ## include ../make.conf ## list of all supported ide's components=gps ## current=$(firstword $(components) ) all clean distclean:: ifneq ($(current),) $(MAKE) -C./$(current) components=$(filter-out $(current),$(components)) $@ endif ## ## Cleanup ## clean:: rm -rf *~ *~*~ distclean:: clean gnade-1.6.2.orig/ide/README0000644000175000017500000000031410043005030014775 0ustar lbrentalbrentaThis directory contains support components for different IDE's. gps - all component you my need for GPS from ACT. All components will be copied into the shared directory when it comes to building. gnade-1.6.2.orig/ide/gps/0000755000175000017500000000000011040716254014727 5ustar lbrentalbrentagnade-1.6.2.orig/ide/gps/Makefile0000644000175000017500000000755310043635123016376 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/ide/gps/Makefile,v $ ## Description : IDE components -- ## Author : Michael Erdmann -- ## Created On : 1-May-2002 -- ## Last Modified By: $Author: merdmann $ -- ## Last Modified On: $Date: 2004/04/28 05:00:03 $ -- ## Version : $Revision: 1.1 $ ## Status : $State: Exp $ ## -- ## Copyright (C) 2002,2003 -- ## -- ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## This package is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## Contact -- ## ======= -- ## Error reports shall be handled via http://gnade.sourceforge.net -- ## Features and ideas via: gnade-develop@lists.sourceforge.net -- ## -- ## Author contact: -- ## purl:/net/michael.erdmann -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## ## Restrictions ## ============ ## None ## ## References ## ========== ## None ## ## ## include ../../make.conf all: $(CP) *.xml *.sh $(vardir) ## ## Cleanup ## clean:: rm -rf *~ *~*~ distclean:: clean gnade-1.6.2.orig/ide/gps/gesql.xml0000644000175000017500000000565410027000434016564 0ustar lbrentalbrenta gesql ESQL Translation Testdatabse gesql Ada .gpq -- " ' True True False Project %p Project.get_tool_switches_as_string %1 GNADE gesql %1 %f make clean make install GNADE Install Cleanup Run ESQL on current gnade-1.6.2.orig/ide/gps/gpsaddons.sh0000755000175000017500000000004410042274106017242 0ustar lbrentalbrenta#!/bin/sh cp *.xml ~/.gps/customize gnade-1.6.2.orig/ide/gps/sql.xml0000644000175000017500000000275310027000434016245 0ustar lbrentalbrenta sql -q Database sql .sql Project %p Project.get_tool_switches_as_string %1 SQL echo sql -f %f %1 SQL Execute Query gnade-1.6.2.orig/pkg-config/0000755000175000017500000000000011040716276015425 5ustar lbrentalbrentagnade-1.6.2.orig/pkg-config/Makefile0000644000175000017500000000647207546474216017111 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/pkg-config/Makefile,v $ ## Description : Makefile for the pkg-config file ## Author : Michael Erdmann ## Created On : 27-Sep-2002 ## Last Modified By: $Author: merdmann $ ## Last Modified On: $Date: 2002/10/02 04:39:42 $ -- ## Status : $State: Exp $ -- ## -- ## Copyright (C) 2000-2002 -- ## -- ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## ## Restrictions ## ============ ## None ## ## References ## ========== ## Non ## sinclude conf.local sinclude ../make.conf # all: ## ## ## clean: rm -rf *~ ## ## Install the *.pc file ## install: ## ## Clean up the local directory ## distclean : clean rm -rf gnade.pc gnade-1.6.2.orig/pkg-config/gnade.pc.in0000644000175000017500000000046307646316102017440 0ustar lbrentalbrenta# This is a comment include=@site_adadir@ Name: gnade Description: GNAT Database Development Environment Version: @version@ #Requires: #Conflicts: foobar <= 4.5 Libs: -L@site_libdir@ -lgnadeodbc -lgnadeesql -lgnadeaux @pkgconfig_libs@ @odbc_dmlib@ Cflags: -I${include} -A${include} gnade-1.6.2.orig/projects/0000755000175000017500000000000011040716254015226 5ustar lbrentalbrentagnade-1.6.2.orig/projects/gnade-odbc.gpr0000644000175000017500000000052310670060305017720 0ustar lbrentalbrenta-- $Id: gnade-odbc.gpr,v 1.2 2007/09/06 20:19:17 persan Exp $ with "gnade" ; with "gnade-support"; project Gnade.Odbc is for Languages use ("Ada"); for Source_Dirs use ("../../include/GNADE/odbc"); for Library_name use "gnadeodbc"; for Library_Dir use "../GNADE/odbc"; for Externally_Built use "True"; end Gnade.Odbc; gnade-1.6.2.orig/projects/gnade-sqlite.gpr0000644000175000017500000000043310663647716020335 0ustar lbrentalbrentawith "gnade" ; with "gnade-support" ; Project Gnade.SQLite is for Source_Dirs use ("../../include/GNADE/SQLite"); for Object_Dir use "."; for Library_Dir use "../GNADE/SQLite"; for Library_Name use "gnadesqlite3"; for Externally_Built use "True"; end Gnade.SQLite; gnade-1.6.2.orig/projects/gnade-support.gpr0000644000175000017500000000041110670060305020521 0ustar lbrentalbrentawith "gnade"; project Gnade.support is for Languages use ("Ada"); for Source_Dirs use ("../../include/GNADE/support"); for Library_Dir use "../GNADE/support"; for Library_Name use "gnadesupport"; for Externally_Built use "True"; end Gnade.support; gnade-1.6.2.orig/projects/gnade.gpr0000644000175000017500000000023310663647716017034 0ustar lbrentalbrenta-- -- $Id: gnade.gpr,v 1.1 2007/08/24 21:38:22 persan Exp $ -- project Gnade is for Source_Dirs use (); for externally_Built use "True"; end Gnade; gnade-1.6.2.orig/rpm/0000755000175000017500000000000011040716254014173 5ustar lbrentalbrentagnade-1.6.2.orig/rpm/Makefile0000644000175000017500000001252210033614551015633 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/rpm/Makefile,v $ ## Description : Build RPMS from the distribution -- ## Author : Michael Erdmann -- ## Created On : 1-May-2002 -- ## Last Modified By: $Author: merdmann $ -- ## Last Modified On: $Date: 2004/04/03 20:07:05 $ -- ## Version : $Revision: 1.13 $ ## Status : $State: Exp $ ## -- ## Copyright (C) 2002,2003 -- ## -- ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## This package is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## Contact -- ## ======= -- ## Error reports shall be handled via http://gnade.sourceforge.net -- ## Features and ideas via: gnade-develop@lists.sourceforge.net -- ## -- ## Author contact: -- ## purl:/net/michael.erdmann -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## ## Restrictions ## ============ ## None ## ## References ## ========== ## None ## ## ## include ../make.conf DIST=$(exportdir)/gnade-src-$(VERSION).tar.gz STAGE=a ## ## Where the RPM is loacted on your system. You may have to adopt this ## to your system. ## RPM=/usr/src/packages RPMSRC=$(RPM)/SOURCES/gnade.tar.gz RPMS=$(RPM)/RPMS/$(ARCH) SRPMS=$(RPM)/SRPMS M4FLAGS= --define=VERSION=$(VERSION) \ --define=NATIVE_BINDINGS="$(NATIVE_BINDINGS)" \ --define=BUILD=`cat .version` ## ## Per default do nothing ## all: ## ## In case of a distribution we build the list of files to be included. ## dist: @if test `id -g` = "0" ; then \ $(MAKE) rpm ;\ else \ echo "*** Warining, RPM needs to be build as user root, step skiped ****" ; \ fi ## ## Build the rpms ## rpm: $(RPMSRC) rm -rf *.rpm m4 $(M4FLAGS) gnade.m4 > gnade.spec ( export PATH=/usr/local/bin:/usr/gnat/bin:$$PATH && \ rpmbuild -b$(STAGE) --target=$(ARCH) gnade.spec ) >build.log 2>build.error mv $(RPMS)/gnade-$(VERSION)*.rpm $(exportdir) mv $(SRPMS)/gnade-$(VERSION)*.rpm $(exportdir) $(RPMSRC): $(DIST) version cp $(DIST) $(RPMSRC) ##$(RPMFILES): ## (cd .. && $(RPMLIST) ) ## ## count the build number up each time we make an rpm ## version: @if [ ! -f .version ] ; \ then echo 1 > .version ; \ else expr 0`cat .version` + 1 > .version ; \ fi @echo "RPM Build : " `cat .version` ## ## ## dep: ## ## Cleanup ## clean: rm -rf *~ *~*~ gnade.spec *.log distclean: clean rm -rf $(RPMFILES) rm -rf $(expordir) *.rpm rm .version publish: ncftpput upload.sourceforge.net /incoming $(exportdir)/gnade-$(VERSION)-*.src.rpm ncftpput upload.sourceforge.net /incoming $(exportdir)/gnade-$(VERSION)-*.i686.rpm gnade-1.6.2.orig/rpm/README0000644000175000017500000000030607552070015015053 0ustar lbrentalbrentaThis directory provides the environment to create rpm files. In order to build them you need to perform the following steps: make distclen ./configure make make dist cd rpm su make rpm gnade-1.6.2.orig/rpm/gnade.m40000644000175000017500000000417710033070410015510 0ustar lbrentalbrentaSummary: GNat Ada Database Environment Name: gnade Version: VERSION Release: BUILD Copyright: GPL Group: Development/Tools Source: gnade.tar.gz BuildRoot: /tmp/%{name}-buildroot %description This package contains the libraries and tools to integrate RDMS products into a GNAT basesd Ada 95 applications. %prep %setup -n gnade-src-VERSION %build ./configure --root=$RPM_BUILD_ROOT/usr/local/gnade --nosamples --all make make documentation %install make install %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %doc README COPYING TODO AUTHORS doc/* samples/standalone /usr/local/gnade/include/*.ads /usr/local/gnade/include/*.adb /usr/local/gnade/include/*.ali /usr/local/gnade/lib/libgnade*.a /usr/local/gnade/lib/libgnade*.so.* /usr/local/gnade/bin/gesql /usr/local/gnade/bin/sql /usr/local/gnade/bin/imp /usr/local/gnade/bin/exp /usr/local/gnade/bin/lsodbc /usr/local/gnade/bin/gnade-config /usr/local/gnade/shared/* /usr/local/gnade/doc/* /usr/local/gnade/etc/* %post profdir=/etc/profile.d if test -e $profdir ; then for i in gnade.sh gnade.bash gnade.csh ; do echo -n "Installing $i ..." ; cp -a /usr/local/gnade/etc/$i $profdir echo " done." done fi echo echo -n "Seting up linker configuration ..." libpath=/usr/local/gnade/lib if ! grep $libpath /etc/ld.so.conf > /dev/null ; then echo $libpath >> /etc/ld.so.conf ldconfig fi echo " done." echo %postun profdir=/etc/profile.d if test -e $profdir ; then for i in $profdir/gnade.* ; do echo -n "Deinstalling $i ..." ; rm -f $i echo " done." done fi echo %changelog * Sun Feb 22 2003 Michael Erdmann - Build for SuSe including the changes from Vasile. * Sun Feb 16 2003 Vasile Alaiba - Build for Mandrake 9.0, only PostgreSQL and MySQL (removed others from %build) - Changed %files section to list files with wildcards - Changed BuildRoot location to /tmp/{name}-buildroot - Changed %install section to peek files from $RPM_BUILD_ROOT * Fri Dec 27 2002 Michael Erdmann Michael.erdmann@snafu.de - Now building under SuSe * Thu Oct 11 2002 Michael Erdmann Michael.erdmann@snafu.de - first attempt gnade-1.6.2.orig/samples/0000755000175000017500000000000011040716254015041 5ustar lbrentalbrentagnade-1.6.2.orig/samples/Makefile0000644000175000017500000000775610056410456016521 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/samples/Makefile,v $ ## Description : Top level makefile for the various examples ## Author : Juergen Pfeifer ## Created On : 03-Jan-2001 ## Last Modified By: $Author: merdmann $ ## Last Modified On: $Date: 2004/05/30 16:51:58 $ ## Status : $State: Exp $ ## ## Copyright (C) 2000-2004 ## ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## This makefile recursively visits subdirectories with various samples ## and performs the make steps there. ## ## If a data base is given, the data base specific programs are ## expected to be stared under . If no data base ## has been specified in the configure command the code is not ## compiled. ## ## The scripts the generate the sample data base which is the same for ## all examples is expected under sample_db. ## ## Restrictions ## ============ ## None ## ## References ## ========== ## Non ## .PHONY: mysql oci postgres sqlite odbc esql include ../make.conf SAMPLES=$(NATIVE_BINDINGS) all :: $(foreach i,$(SAMPLES), $i-all) clean:: $(foreach i,$(SAMPLES), $i-clean) distclean:: $(foreach i,$(SAMPLES), $i-distclean) $(foreach i,$(SAMPLES), $i-all): $(MAKE) -C./$(subst -all,,$@) all $(foreach i,$(SAMPLES), $i-clean): $(MAKE) -C./$(subst -clean,,$@) clean $(foreach i,$(SAMPLES), $i-distclean): $(MAKE) -C./$(subst -distclean,,$@) distclean #distclean clean :: # $(MAKE) -C./adbc $@ # $(MAKE) -C./oci $@ # $(MAKE) -C./postgres $@ # $(MAKE) -C./mysql $@ # $(MAKE) -C./sqlite $@ # $(MAKE) -C./odbc $@ # $(MAKE) -C./esql $@ # $(MAKE) -C./sample_db $@ gnade-1.6.2.orig/samples/README0000644000175000017500000000111510027125042015710 0ustar lbrentalbrentaPurpose ======= This directory contains sample code in order to test an demonstrate certain features of the GNADE project. Contents ======== esql - Embedded SQL examples mysql - Example for MySQL bindings odbc - Example for ODBC usage postgres - Example for Postgres bindings sample_db - A sample data base used by all examples oci - Oracle call interface bindings adbc - Ada database connectivity standalone - This is a standalone example which relies on the installed GNADE. If you are developing applications with GNADE use this example as a basis. gnade-1.6.2.orig/samples/adbc/0000755000175000017500000000000011040716276015736 5ustar lbrentalbrentagnade-1.6.2.orig/samples/adbc/Makefile0000644000175000017500000001065310670456072017406 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## Ada Database Connectivity (ADBC) - Makefile -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/samples/adbc/Makefile,v $ ## Description : Makefile to build the example code for GNU ADO -- ## Author : Michael Erdmann -- ## Created On : 27.1.2002 -- ## Last Modified By: $Author: persan $ -- ## Last Modified On: $Date: 2007/09/08 08:24:26 $ -- ## Version : $Revision: 1.4 $ ## Status : $State: Exp $ ## -- ## Copyright (C) 2000-2004 M.Erdmann -- ## -- ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## This package is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## Contact -- ## ======= -- ## Error reports shall be handled via http://gnade.sourceforge.net -- ## Features and ideas via: gnade-develop@lists.sourceforge.net -- ## -- ## Author contact: -- ## purl:/net/michael.erdmann -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## This makefile build the example code for the GNU ADO Interface. ## ## Restrictions ## ============ ## None ## ## References ## ========== ## None ## ## ## sinclude ../conf.local include ../../make.conf # MYSQL_LIBS=-L/usr/lib/mysql ADAFLAGS = -a -I$(ADAINCLUDE) -g -gnatf all: gnatmake -p -Pgnade-adbc-samples.gpr libs: \ $(ADALIB)/$(LIBNAME).a \ $(ADALIB)/$(LIBNAME).so \ $(libdir)/$(LIBNAME).so.$(SO_MAJOR) \ headers client: client.adb gnatmake $(ADAFLAGS) client.adb -o client $(APP_LINK_FLAGS) $(MYSQL_LIBS) clean: $(RM) -rf client *.exe lib-obj $(RM) *.ali *.o core $(RM) b~* *~ *.bak gnade-1.6.2.orig/samples/adbc/client.adb0000644000175000017500000001556707442435172017706 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/samples/adbc/client.adb,v $ -- Description : Ada Database Objects - Test client -- -- Author : Michael Erdmann -- -- Created : 18.1.2002 -- -- Last Modified By: $Author: merdmann $ -- -- Last Modified On: $Date: 2002/03/09 16:38:18 $ -- -- Version : $Revision: 1.3 $ -- Status : $State: Exp $ -- -- -- Copyright (C) 2001 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- This software is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- This is the test client for the ADO packages -- -- -- -- -- -- -- -- Restrictions -- -- ============ -- -- Only Linux -- -- -- -- Contact -- -- ======= -- -- Error reports shall be handled via http://gnade.sourceforge.net -- -- Features and ideas via: gnade-develop@lists.sourceforge.net -- -- -- -- Author contact: -- -- purl:/net/michael.erdmann -- -- -- ------------------------------------------------------------------------------- with Ada.Text_IO; use Ada.Text_IO; with GNU.DB.ADBC.Connection; use GNU.DB.ADBC.Connection; with GNU.DB.ADBC.Driver; use GNU.DB.ADBC.Driver; with GNU.DB.ADBC.Statement; use GNU.DB.ADBC.Statement; with GNU.DB.ADBC.Resultset; use GNU.DB.ADBC.Resultset; with GNU.DB.ADBC.Hostvariable; use GNU.DB.ADBC.Hostvariable; with GNU.DB.ADBC.Driver.MySQL; use GNU.DB.ADBC.Driver.MySQL; with GNU.DB.ADBC; use GNU.DB.ADBC; with GNU.DB.ADBC.Hostvariable; use GNU.DB.ADBC.Hostvariable; with GNU.DB.ADBC.Hostvariable.Types; use GNU.DB.ADBC.Hostvariable.Types; procedure Client is X : Driver.Handle := Driver.MySQL.Create; C : Connection.Object(X); S : Statement_ID; R : Resultset_ID; subtype Name_Type is String(1..50); subtype Empno_Type is Integer range 1..999; V : SQL_String ; E : SQL_Integer; begin Connect(C, "gnade", Password => "", Database => "gnade" ); -- prepare a query S := Prepare( C, "select empno, name, firstname from EMPLOYEES " & "where empno > :emp and job = :id" ); Bind(S, "id", V ); Bind(S, "emp", E ); Put_Line("Executing query and running through result set"); -- execute a query Value( V, "Genius" ); Value( E, 5 ); R := Execute(C, S ); -- retrieve the result declare package D_Empname is new String_Domain( Size => Name_Type'Length, Result => R, Name => "name"); package D_Firstname is new String_Domain( Size => Name_Type'Length, Result => R, Name => "firstname"); package D_Empno is new Integer_Domain( Number_Type => Empno_Type, Result => R, Name => "empno"); begin while not End_Of_Result(R) loop Fetch( R ); Put_Line( Integer'Image(D_Empno.Value) & " " & D_Empname.Value & D_Firstname.Value ); end loop; Fetch( R, First ); Put_Line( "First record is: " & D_Empname.Value ); Put_Line(""); Put_Line("Same result set backwards"); Fetch( R, Last ); while not Begin_Of_Result(R) loop Put_Line( Integer'Image(D_Empno.Value) & " " & D_Empname.Value & D_Firstname.Value ); Fetch( R, Previous ); end loop; end ; Deallocate( R ); Put_Line("************** Executing next query ******************"); R := Execute( C, "select * from EMPLOYEES" ); Put_Line( "Nbr of Records :" & Integer'Image( Number_Of_Records(R))); Deallocate(R); Put_Line("*********** Disconnecting from database **************"); R := Execute( C,"insert INTO DEPARTMENTS VALUES( 1111x, 'hallo', 'xxx')" ); Deallocate(R); R := Execute( C, "select * from DEPARTMENTS" ); Put_Line( "Nbr of Records :" & Integer'Image( Number_Of_Records(R))); Deallocate(R); Disconnect(C); end Client; gnade-1.6.2.orig/samples/adbc/gnade-adbc-samples.gpr0000644000175000017500000000163510670450003022053 0ustar lbrentalbrenta-- $Id: gnade-adbc-samples.gpr,v 1.1 2007/09/08 07:32:19 persan Exp $ with "../../gnade"; with "../../dbi/adbc/gnade-adbc.gpr"; project Gnade.adbc.Samples is for Languages use ("Ada"); for Source_Dirs use ("."); for Object_Dir use Gnade'Object_Dir; for Exec_Dir use Gnade'Exec_Dir; for Main use ("client.adb" ); for Exec_Dir use Gnade'Exec_Dir; package Builder is for Default_Switches ("Ada") use gnade.Builder'Default_Switches ("Ada"); end Builder; package Compiler is for Default_Switches ("Ada") use gnade.Compiler'Default_Switches ("Ada"); end Compiler; package Binder is for Default_Switches ("Ada") use gnade.Binder'Default_Switches ("Ada"); end Binder; package Linker is for Default_Switches ("Ada") use gnade.Linker'Default_Switches ("Ada"); end Linker; package Ide is for Vcs_Kind use "CVS"; end Ide; end Gnade.adbc.Samples; gnade-1.6.2.orig/samples/esql/0000755000175000017500000000000011040716276016011 5ustar lbrentalbrentagnade-1.6.2.orig/samples/esql/Makefile0000644000175000017500000001040310537576263017461 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/samples/esql/Makefile,v $ ## Description : Makefile for the embedded SQL samples ## Author : Juergen Pfeifer ## Created On : 03-Jan-2001 ## Last Modified By: $Author: merdmann $ ## Last Modified On: $Date: 2006/12/12 19:02:11 $ ## Status : $State: Exp $ ## ## Copyright (C) 2000-2001, 2004 ## ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## This makefile builds the sample programs for embedded SQL. ## ## Restrictions ## ============ ## None ## ## References ## ========== ## None ## sinclude ../conf.local sinclude ../../make.conf # all exported executable mainunits=simple.adb simplepkg.adb dynamic.adb insert.adb attachment.adb nobel_co.adb binaries=$(subst .adb,$(bin),$(mainunits)) prepunits=$(subst .gpq,.adb,$(wildcard *.gpq)) # add the connection information dep. on the configured data base DBAUTH= -DDBUSER=\"$(DBUSER)\" \ -DDBPASSWD=\"$(DBPASSWD)\" \ -DDBSOURCE=\"$(DBSOURCE)\" # generate debug code #DEBUG=-debugcode ESQLFLAGS = $(DEBUG) -s $(FLAGS) $(DBAUTH) # ------------------------------------------------------------------------- # # E X E C U T A B L E S # # ------------------------------------------------------------------------- # all build :: $(prepunits) $(ADAMAKE) -Pesql.gpr $(mainunits) -largs $(DMLINKEROPT) # # the same test program as above, implemented as a simple procedure # in the file. # dynamic.adb: dynamic.gpq $(ESQL) -connectpkg Dynamic_Connect $(ESQLFLAGS) dynamic.gpq # ------------------------------------------------------------------------- # # C L E A N T H E D I R E C T O R Y # # ------------------------------------------------------------------------- # clean: $(RM) $(PROGRAMS) b~*.* *.o *.ali core *~ $(RM) $(prepunits) $(binaries) distclean :: clean gnade-1.6.2.orig/samples/esql/Makefile.esql0000644000175000017500000000577210027000434020411 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/samples/esql/Makefile.esql,v $ ## Description : Makefile for the embedded SQL samples ## Author : Juergen Pfeifer ## Created On : 03-Jan-2001 ## Last Modified By: $Author: merdmann $ ## Last Modified On: $Date: 2004/03/20 08:30:20 $ ## Status : $State: Exp $ ## ## Copyright (C) 2000-2001 ## ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## This makefile builds the sample programs for embedded SQL. ## ## Restrictions ## ============ ## None ## ## References ## ========== ## None ## all build clean distclean dist: $(MAKE) -C./ $@ gnade-1.6.2.orig/samples/esql/README0000644000175000017500000000071307367056712016703 0ustar lbrentalbrentaThis directory contains example files for the gesql translator: simple_pkg - readout the employee database simple - same as above, but implemented as a single procedure nobel_co - a more complex example dynamic - Example for dynamic sql attachment - Handling of varbinary type for blobs. It support the following features: - copy a file into a blob - read a file from a blob into a file - list all blobs - delete a blob gnade-1.6.2.orig/samples/esql/attachment.gpq0000644000175000017500000002153507524013503020653 0ustar lbrentalbrenta--| --| Filename : $Source: /cvsroot/gnade/gnade/samples/esql/attachment.gpq,v $ --| Description : Example program for VARBINARY --| Author : Michael Erdmann --| Created On : 8.12.2000 --| Last Modified By: $Author: merdmann $ --| Last Modified On: $Date: 2002/08/06 18:36:51 $ --| Status : $State: Exp $ --| --| Copyright (C) 2000 Michael Erdmann --| --| This program is free software; you can redistribute it and/or --| modify it under the terms of the GNU General Public License --| as published by the Free Software Foundation; either version 2 --| of the License, or (at your option) any later version. --| --| This program/code is distributed in the hope that it will be useful, --| but WITHOUT ANY WARRANTY; without even the implied warranty of --| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --| GNU General Public License for more details. --| --| You should have received a copy of the GNU General Public License along --| with this program; if not, write to the Free Software Foundation, Inc., --| 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --| --| As a special exception, if other files instantiate generics from this --| unit, or you link this unit with other files to produce an executable, --| this unit does not by itself cause the resulting executable to be --| covered by the GNU General Public License. This exception does not --| however invalidate any other reasons why the executable file might be --| covered by the GNU Public License. --| --| Functional Description --| ====================== --| This example demonstrates the use of dynamic sql and the usage of --| the VARBINARY type. --| --| Restrictions --| ============ --| --| References --| ========== --| --| with Ada.Command_Line; use Ada.Command_Line; with Ada.Text_IO; use Ada.Text_IO; with Ada.Sequential_IO; with Ada.Unchecked_Conversion; with GNU.DB.SQLCLI; use GNU.DB.SQLCLI; with SQL_STANDARD; use SQL_STANDARD; procedure Attachment is VERSION : constant String := "$Id: attachment.gpq,v 1.6 2002/08/06 18:36:51 merdmann Exp $"; Blob_Size : constant Positive := 10000; Key : Integer := 0; Next_Arg : Positive := 1; package BINARY_IO is new Ada.Sequential_IO( SQLCHAR ); use BINARY_IO; Insert_Failed : exception; EXEC SQL DECLARE DB01 DATABASE ; EXEC SQL DECLARE ATTACHMENTS TABLE ( ID INT NOT NULL PRIMARY KEY, USED INT, CREATION DATE, TITLE VARCHAR(256), DATA VARBINARY(10000) ); ----------------------- -- Insert_Attachment -- ----------------------- procedure Insert_Attachment( key : in Integer; name : in String ) is -- Insert an attachment into the attachment table by opening -- the given file and copying the file contents into the -- buffer. Buffer : GNADE.BINARY( 1..Blob_Size ); inFile : BINARY_IO.File_Type; Next : Positive := 1; SQL_Insert : constant String := "INSERT INTO ATTACHMENTS VALUES ( ?, ?, ?, '" & name & "', ? )"; -- embedded SQL specifications EXEC SQL BEGIN DECLARE SECTION END-EXEC ID : INT := INT(key); USED : INT := 1; CREATION : CHAR(1..10); DATA : GNADE.VARBINARY( Blob_Size ); EXEC SQL END DECLARE SECTION END-EXEC EXEC SQL DECLARE insert STATEMENT ; begin -- read the file into the binary buffer and transfer it -- into the VARBINARY variable. BINARY_IO.Open( name => name, file => infile, Mode => In_File ); loop BINARY_IO.Read( inFile, Buffer(Next) ); exit when End_Of_File( inFile ); Next := Next + 1; if not ( Next in Buffer'Range ) then Next := Buffer'Last; exit; end if; end loop; BINARY_IO.Close( inFile ); To_VARBINARY( Buffer( 1..Next), Data ); Move( "2001-02-02", CREATION); -- prepare the insert statement EXEC SQL AT DB01 PREPARE insert FROM SQL_Insert USING :ID, :USED, :CREATION, :DATA ; Put_Line( "Inserting blob " & Integer'Image( Key ) & " with size " & Natural'Image( Length ( Data ) ) ); EXEC SQL AT DB01 WHENEVER SQLERROR RAISE Insert_Failed ; EXEC SQL AT DB01 EXECUTE insert ; end Insert_Attachment; -------------------- -- Get_Attachment -- -------------------- procedure Get_Attachment( Key : in Integer; Name : in String ) is -- retrieve a blob from the data base an print it out on -- stanard output. Result : GNADE.BINARY( 1..Blob_Size); Length : Positive; Outp : BINARY_IO.File_Type; -- embedded SQL viariable EXEC SQL BEGIN DECLARE SECTION END-EXEC ID : INT := INT(key); DATA : GNADE.VARBINARY( Blob_Size ); Title : GNADE.VARCHAR(256); EXEC SQL END DECLARE SECTION END-EXEC begin EXEC SQL AT DB01 SELECT Title, Data INTO :Title, :Data FROM ATTACHMENTS WHERE ID = :ID; if not ( SQLCODE in SQL_STANDARD.NOT_FOUND ) then To_Binary( Data, Result, Length ); Put_Line("Found attachment '" & To_String( Title ) & "' " & "blob size " & Natural'Image(Length) & " characters" ); BINARY_IO.Create( Outp, Name => Name ); for I in 1..Length loop BINARY_IO.Write( Outp, Result(I) ); end loop; BINARY_IO.Close( Outp ); else Put_Line("*** attachment not found ***" ); end if; end Get_Attachment; ---------------------- -- List_Attachments -- ---------------------- procedure List_Attachments is Key : Integer; EXEC SQL BEGIN DECLARE SECTION END-EXEC ID : INT; USED : INT; Title : GNADE.VARCHAR(80); Data : GNADE.VARBINARY(Blob_Size); EXEC SQL END DECLARE SECTION END-EXEC package IIO is new Ada.Text_IO.Integer_IO (Integer); use IIO; begin Put_Line(""); EXEC SQL AT DB01 DECLARE Attachment_List CURSOR FOR SELECT ID, USED, TITLE, DATA FROM ATTACHMENTS; EXEC SQL AT DB01 OPEN Attachment_List; Put_Line(" Key Size Object Title "); Put_Line("============ ======= =================================="); loop EXEC SQL AT DB01 FETCH FROM Attachment_List INTO :ID, :USED, :TITLE, :DATA; exit when SQLCODE in SQL_STANDARD.NOT_FOUND; Key := Integer(ID); Put( Key, Width => 12 ); Put( Length( Data ), Width => 8 ); Put_line( " " & To_String( Title ) ); end loop; EXEC SQL AT DB01 CLOSE Attachment_List; Put_Line(""); end List_Attachments; ----------------------- -- Delete_Attachment -- ----------------------- procedure Delete_Attachment( Key : in Integer ) is -- embedded SQL viariable EXEC SQL BEGIN DECLARE SECTION END-EXEC ID : INT := INT(key); Title : GNADE.VARCHAR(256); EXEC SQL END DECLARE SECTION END-EXEC begin EXEC SQL AT DB01 SELECT Title INTO :Title FROM ATTACHMENTS WHERE ID = :ID; if not ( SQLCODE in SQL_STANDARD.NOT_FOUND ) then Put_Line("Attachment '" & To_String( Title ) & "' will be deleted" ); EXEC SQL at DB01 DELETE FROM ATTACHMENTS WHERE ID = :ID; else Put_Line("*** attachment not found ***" ); end if; end Delete_Attachment; begin if Argument_Count < 1 then Put_Line("usage:" ); Put_Line(" attachment { { -i | -x | -d } | -l } "); Put_Line(""); Put_Line("This commands allows to insert/extract or delete a file from"); Put_Line("the attachment relation"); Set_Exit_Status(1); return; end if; -- connect to gnade data base EXEC SQL CONNECT $DBUSER IDENTIFIED BY $DBPASSWD BY DB01 TO $DBSOURCE ; if Argument( Next_Arg )(1) /= '-' then Key := Integer'Value( Argument(Next_Arg) ); Next_Arg := Next_Arg + 1; end if; while Next_Arg <= Argument_Count loop exit when Argument(Next_Arg)(1) /= '-'; case Argument(Next_Arg)(2) is when 'I' | 'i' => Next_Arg := Next_Arg + 1; Insert_Attachment( Key, Argument(Next_Arg) ); when 'X' | 'x' => Next_Arg := Next_Arg + 1; Get_Attachment( Key, Argument(Next_Arg) ); when 'D' | 'd' => Delete_Attachment( Key ); when 'L' | 'l' => List_Attachments; when others => Put_Line("Unknown option found '" & Argument( Next_Arg ) & "'" ); end case; Next_Arg := Next_Arg + 1; end loop; Set_Exit_Status(0); end Attachment; gnade-1.6.2.orig/samples/esql/dynamic.gpq0000644000175000017500000001343110670447717020161 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/samples/esql/dynamic.gpq,v $ -- Description : Demonstration lfor dynamic SQL -- -- Author : Michael Erdmann -- -- Created On : 22-Dec-2000 -- -- Last Modified By: $Author: persan $ -- Last Modified On: $Date: 2007/09/08 07:31:27 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2000-2003 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- -- -- -- -- Restrictions -- -- ============ -- -- No Tasking support -- -- -- -- References -- -- ========== -- -- //1// - (Second Informal Review Draft) ISO/IEC 9075:1992, Database -- -- Language SQL- July 30, 1992 -- -- -- ------------------------------------------------------------------------------- with Ada.Text_IO; use Ada.Text_IO; with SQL_STANDARD; use SQL_STANDARD; with Ada.Strings.Fixed; use Ada.Strings.Fixed; with Ada.Strings; use Ada.Strings; with GNU.DB.SQLCLI; use GNU.DB.SQLCLI; procedure Dynamic is General_Error : exception; EXEC SQL WHENEVER SQLERROR raise General_Error; package IO is new Ada.Text_IO.Integer_IO (int); use IO; EXEC SQL declare DB01 DATABASE ; procedure Browse_Names ( Query : in String; Key : in Natural ) is S : constant String := "SELECT EMPNO, NAME FROM EMPLOYEES WHERE " & Query & " ?"; EXEC SQL begin declare SECTION end-EXEC Name : char (1 .. 40); Name_Ind : Indicator_Type := 0; Key_Ind : INDICATOR_TYPE := 0; Key_Value : int := int (Key); Empno : int; Empno_Ind : INDICATOR_TYPE := 0; EXEC SQL end declare SECTION end-EXEC EXEC SQL declare Test_Sql STATEMENT ; begin EXEC SQL at DB01 PREPARE Test_Sql FROM S USING : Key_Value ; EXEC SQL at DB01 EXECUTE Test_Sql USING : EMPNO INDICATOR : EMPNO_IND, : NAME : NAME_IND ; loop EXEC SQL at DB01 FETCH USING STATEMENT Test_Sql INTO : EMPNO INDICATOR : EMPNO_IND, : NAME : NAME_IND; exit when SQLCODE in SQL_STANDARD.NOT_FOUND; Put ( Empno, Width => 8 ); Put ( " " & To_String ( Name ) ); Put_Line (""); end loop; EXEC SQL at DB01 CLOSE Test_Sql FINAL ; end Browse_Names; begin EXEC SQL CONNECT $DBUSER IDENTIFIED BY $DBPASSWD BY DB01 TO $DBSOURCE ; Browse_Names ( Query => "EMPNO >", Key => 5 ); Put_Line ( "Second query ... DEPTNO > 1003" ); Browse_Names ( Query => "DEPTNO >", Key => 1003 ); Put_Line ( "End of Program" ); end Dynamic; gnade-1.6.2.orig/samples/esql/dynamic_connect.adb0000644000175000017500000000126207632655512021626 0ustar lbrentalbrentawith Ada.Text_IO; use Ada.Text_IO; package body Dynamic_Connect is procedure Error( C : in My_Connect_Type; T : in String ) is begin Put_Line("** Error: " & T ); end Error; procedure Warning( C : in My_Connect_Type; T : in String ) is begin Put_Line("*** Warning: " & T ); end Warning; function Connect( Source : in String; UserName : in String; Password : in String ) return ODBC.Connection_Handle is Result : ODBC.Connection_Handle := new My_Connect_Type; begin ODBC.Connect( Result.all, Source, UserName, Password ); return Result; end Connect; end Dynamic_Connect; gnade-1.6.2.orig/samples/esql/dynamic_connect.ads0000644000175000017500000001067207632655512021654 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNat Ada Database Environment -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/samples/esql/dynamic_connect.ads,v $ -- Description : Small interface to ODBC for the ESQL translator -- -- Author : Michael Erdmann -- -- Created On : 08-March-2003 -- -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2003/03/09 15:18:34 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2003 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- This is an example which demonstrates how to divert the error output -- -- of the ESQL support into a file. -- -- -- -- -- -- Restrictions -- -- ============ -- -- None -- -- -- -- References -- -- ========== -- -- //1// - (Second Informal Review Draft) ISO/IEC 9075:1992, Database -- -- Language SQL- July 30, 1992 -- -- -- ------------------------------------------------------------------------------- with Ada.Text_IO; use Ada.Text_IO; with GNU.DB.ESQL_Support.ODBC; use GNU.DB.ESQL_Support; package Dynamic_Connect is type My_Connect_Type is new ODBC.Connection_Type with record null; end record; procedure Error( C : in My_Connect_Type; T : in String ); procedure Warning( C : in My_Connect_Type; T : in String ); function Connect( Source : in String; UserName : in String; Password : in String ) return ODBC.Connection_Handle; end Dynamic_Connect; gnade-1.6.2.orig/samples/esql/esql.gpr0000644000175000017500000000157610027000434017462 0ustar lbrentalbrenta-- $Id: esql.gpr,v 1.4 2004/03/20 08:30:20 merdmann Exp $ with "../../gnade"; project ESQL is for Languages use ("Ada", "Gesql"); for Source_Dirs use ("."); for Object_Dir use "."; for Main use ("simple.adb simplepkg.adb dynamic.adb insert.adb attachment.adb nobel_co.adb"); for Exec_Dir use "." ; package Linker is for Default_Switches ("ada") use ( GNADE.LibOpt, "-lgnadeesql", "-lgnadeaux", "-lgnadeodbc") ; end Linker; package Binder is for Default_Switches ("ada") use ("-static" ); end Binder; package Compiler is for Default_Switches ("ada") use ("-g", GNADE.IncludeOPT ); end Compiler; package Builder is for Default_Switches ("ada") use ("-g", "-gnatQ", GNADE.IncludeOPT ); end Builder; package Ide is for Vcs_Kind use "CVS"; end Ide; end ESQL; gnade-1.6.2.orig/samples/esql/gnade-esql-samples.gpr0000644000175000017500000000262210670334037022206 0ustar lbrentalbrenta-- $Id: gnade-esql-samples.gpr,v 1.1 2007/09/07 20:44:15 persan Exp $ with "../../gnade"; with "../../dbi/odbc/gnade-odbc.gpr"; with "../../dbi/adbc/gnade-adbc.gpr"; with "../../esql/gnade-esql.gpr"; project Gnade.esql.Samples is for Languages use ("Ada","Gesql"); for Source_Dirs use ("."); for Object_Dir use Gnade'Object_Dir; for Exec_Dir use Gnade'Exec_Dir; for Main use ("simple.adb", "simplepkg.adb", "dynamic.adb", "insert.adb", "attachment.adb", "nobel_co.adb"); for Exec_Dir use Gnade'Exec_Dir; package Builder is for Default_Switches ("Ada") use gnade.Builder'Default_Switches ("Ada"); end Builder; package Compiler is -- for Default_Switches ("Ada") use gnade.Compiler'Default_Switches ("Ada"); end Compiler; package Binder is for Default_Switches ("Ada") use gnade.Binder'Default_Switches ("Ada"); end Binder; package Linker is for Default_Switches ("Ada") use gnade.Linker'Default_Switches ("Ada"); end Linker; package Ide is for Vcs_Kind use Gnade.IDE'Vcs_Kind; for Default_Switches ("GNADE") use ("-DDBSOURCE=""" & External ("DBSOURCE", "gnade") & """", "-DDBUSER=""" & External ("DBUSER", "gnade") & """", "-DDBPASSWD=""" & External ("DBPASSWD", "gnade") & """"); end Ide; end Gnade.esql.Samples; gnade-1.6.2.orig/samples/esql/insert.gpq0000644000175000017500000001144707657221637020050 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/samples/esql/insert.gpq,v $ -- Description : Demonstration lfor dynamic SQL -- -- Author : Michael Erdmann -- -- Created On : 22-Dec-2000 -- -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2003/05/10 16:06:55 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2000-2003 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- -- -- -- -- Restrictions -- -- ============ -- -- No Tasking support -- -- -- -- References -- -- ========== -- -- //1// - (Second Informal Review Draft) ISO/IEC 9075:1992, Database -- -- Language SQL- July 30, 1992 -- -- -- ------------------------------------------------------------------------------- with Ada.Text_IO; use Ada.Text_IO; with SQL_STANDARD; use SQL_STANDARD; with Ada.Strings.Fixed; use Ada.Strings.Fixed; with Ada.Strings; use Ada.Strings; with GNU.DB.SQLCLI; use GNU.DB.SQLCLI; procedure Insert is General_Error : exception; EXEC SQL WHENEVER SQLERROR RAISE General_Error; EXEC SQL DECLARE DB01 DATABASE ; S : constant String := "INSERT INTO DEPARTMENTS (DEPTNO,NAME) VALUES (?,?) "; EXEC SQL BEGIN DECLARE SECTION END-EXEC Name : CHAR(1..40); Name_ind : indicator_type := 0; Deptno : INT; Deptno_Ind : INDICATOR_TYPE := 0; EXEC SQL END DECLARE SECTION END-EXEC EXEC SQL DECLARE test_sql STATEMENT ; begin EXEC SQL CONNECT $DBUSER IDENTIFIED BY $DBPASSWD BY DB01 TO $DBSOURCE ; Move("Test", Name ); Name_Ind := 4; Deptno := INT(4711); EXEC SQL AT DB01 PREPARE test_sql FROM S USING :deptno, :Name INDICATOR :Name_Ind ; EXEC SQL AT DB01 EXECUTE test_sql USING :Deptno, :Name INDICATOR :Name_Ind; EXEC SQL at DB01 CLOSE test_sql; end Insert; gnade-1.6.2.orig/samples/esql/nobel.ads0000644000175000017500000000025607243742013017602 0ustar lbrentalbrentapackage Nobel is procedure Print_Departement( Departement : Integer ); procedure Report_All_Departements; procedure Connect; procedure Disconnect; end Nobel; gnade-1.6.2.orig/samples/esql/nobel.gpq0000644000175000017500000002037707643477450017646 0ustar lbrentalbrenta--| --| Filename : $Source: /cvsroot/gnade/gnade/samples/esql/nobel.gpq,v $ --| Description : This is a sample program for esql. --| Author : Michael Erdmann --| Created On : 8.12.2000 --| Last Modified By: $Author: merdmann $ --| Last Modified On: $Date: 2003/04/05 07:00:56 $ --| Status : $State: Exp $ --| --| Copyright (C) 2000, 2001 Michael Erdmann --| --| This program is free software; you can redistribute it and/or --| modify it under the terms of the GNU General Public License --| as published by the Free Software Foundation; either version 2 --| of the License, or (at your option) any later version. --| --| This program/code is distributed in the hope that it will be useful, --| but WITHOUT ANY WARRANTY; without even the implied warranty of --| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --| GNU General Public License for more details. --| --| You should have received a copy of the GNU General Public License along --| with this program; if not, write to the Free Software Foundation, Inc., --| 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --| --| As a special exception, if other files instantiate generics from this --| unit, or you link this unit with other files to produce an executable, --| this unit does not by itself cause the resulting executable to be --| covered by the GNU General Public License. This exception does not --| however invalidate any other reasons why the executable file might be --| covered by the GNU Public License. --| --| Functional Description --| ====================== --| --| This is an example for embedded SQL. It demonstrates the ISO/92 --| features and addtional esql extensions. --| --| --| Restrictions --| ============ --| --| References --| ========== --| --| with Ada.Text_IO; use Ada.Text_IO; with SQL_STANDARD; use SQL_STANDARD; with Ada.Strings.Fixed; use Ada.Strings.Fixed; with Ada.Strings; use Ada.Strings; with Ada.Text_IO.Editing; use Ada.Text_IO.Editing; package body Nobel is Nothing_Found : exception; Some_Error : exception; type Euro is delta 0.01 digits 18; package Euro_IO is new Decimal_Output( Num => Euro, Default_Currency => "EU"); EXEC SQL DECLARE DB01 DATABASE ; procedure X( EXEC SQL DECLARE DB DATABASE ) is begin null; end X; ----------------------- -- Print_Departement -- ----------------------- procedure Print_Departement( departement : in Integer ) is -- -- Print all members of a departement -- EXEC SQL BEGIN DECLARE SECTION ; Name : CHAR(1..15); First_Name : CHAR(1..15); First_Name_Ind : INDICATOR_TYPE := 0; Job : CHAR(1..15); Job_Ind : INDICATOR_TYPE := 0; Depno : INT := INT( Departement ); Empno : INT; Manager : INT; Manager_Ind : INDICATOR_TYPE := 0; Manager_Name : CHAR(1..15); dep_location : CHAR(1..15); Salary : DOUBLE_PRECISION := 0.0; EXEC SQL END DECLARE SECTION ; Average_Salary : Euro := 0.0; N : Natural := 0; EXEC SQL INCLUDE SQLCA ; -- Make a private SQLCA package IIO is new Ada.Text_IO.Integer_IO (Integer); use IIO; begin EXEC SQL AT DB01 DECLARE emp_cursor LOCAL CURSOR FOR SELECT EMPNO, FIRSTNAME, NAME, JOB, MANAGER, SALARY FROM EMPLOYEES WHERE deptno = :Depno ORDER BY EMPNO, NAME; -- read out all data seleted by the query EXEC SQL AT DB01 OPEN emp_cursor; Put_Line("Empno Firstname Fam. Name Manager Salary "); Put_Line("===== ============ ============== ============== ==============="); loop EXEC SQL AT DB01 FETCH FROM emp_cursor INTO :Empno, :First_Name INDICATOR :First_Name_Ind, :Name, :Job INDICATOR :Job_Ind, :Manager INDICATOR :Manager_Ind, :SALary; exit when SQLCODE in SQL_STANDARD.NOT_FOUND; if not Is_Null( Manager_Ind ) then EXEC SQL AT DB01 SELECT EMPLOYEES.NAME INTO :Manager_Name FROM EMPLOYEES WHERE EMPNO = :Manager ; if SQLCODE in SQL_STANDARD.NOT_FOUND then Put_Line("Manager not defined"); end if; end if; Put( Integer(Empno), width => 5 ); Put(" "); if not Is_Null( First_Name_Ind ) then Put( To_String(First_Name) ); else Put( "************** " ); end if; Put( To_String(Name) ); if not Is_Null( Manager_Ind ) then Put( To_String(Manager_Name) ); else Put( "************** " ); end if; Put( Euro'Image(Euro(Salary)) ); Average_Salary := Average_Salary + Euro(Salary); N := N + 1; Put_Line(""); end loop; EXEC SQL AT DB01 CLOSE emp_cursor; Put_Line(""); if N > 0 then Put_Line("Average salary : " & Euro'Image( Average_Salary / N ) ); Put_Line(""); end if; end Print_Departement; ----------------------------- -- Report_All_Departements -- ----------------------------- procedure Report_All_Departements is -- -- Report all departement of the company -- EXEC SQL BEGIN DECLARE SECTION END-EXEC Name : CHAR(1..15); Deptno : INT; Location : CHAR(1..15); EXEC SQL END DECLARE SECTION END-EXEC EXEC SQL INCLUDE SQLCA; -- Make a private SQLCA begin EXEC SQL AT DB01 DECLARE Dep_Cursor LOCAL CURSOR FOR SELECT DEPTNO,NAME,LOCATION FROM DEPARTMENTS; EXEC SQL AT DB01 OPEN Dep_Cursor; loop declare EXEC SQL BEGIN DECLARE SECTION END-EXEC street : GNADE.VARCHAR(50); city : GNADE.VARCHAR(50); NO : GNADE.VARCHAR(10); ZIPCODE : INT; loc2find : GNADE.VARCHAR(50); EXEC SQL END DECLARE SECTION END-EXEC begin EXEC SQL AT DB01 FETCH FROM Dep_Cursor INTO :Deptno, :Name, :Location ; exit when SQLCODE in SQL_STANDARD.NOT_FOUND; Put_Line( "Departement : " & INT'Image(Deptno) & " at location : " & To_String(location) ); To_VARCHAR( To_String(location), loc2find ); EXEC SQL AT DB01 SELECT STREET, CITY, NO, ZIPCODE INTO :street, :city, :no, :zipcode FROM LOCATIONS WHERE NAME = :loc2find; if not ( SQLCODE in SQL_STANDARD.NOT_FOUND ) then Put_line("Address : " & To_String( street ) & " No. " & To_String( no ) & ", " & INT'Image(zipcode) & " " & To_String( city ) ); else Put_Line("*** Address not known ***"); end if; Put_Line(""); Print_Departement( Integer( Deptno ) ); end; end loop; EXEC SQL AT DB01 CLOSE Dep_Cursor; EXEC SQL AT DB01 SELECT DEPTNO INTO :Deptno FROM EMPLOYEES WHERE NAME = 'Erdmann' ; Put_Line("Mr. Erdmann works at department " & INT'Image(Deptno) ); end Report_All_Departements; ------------- -- Connect -- ------------- procedure Connect is connection_failed : exception; begin EXEC SQL CONNECT $DBUSER IDENTIFIED BY $DBPASSWD BY DB01 TO $DBSOURCE ON COMMUNICATION ERROR RAISE connection_failed; exception when connection_failed => Put_Line("*** Database not connected ***"); end Connect; --------------- -- Diconnect -- --------------- procedure Disconnect is begin EXEC SQL DISCONNECT DB01 COMMIT ; end Disconnect; end Nobel; gnade-1.6.2.orig/samples/esql/nobel_co.adb0000644000175000017500000000020107243742013020230 0ustar lbrentalbrentawith Nobel; use Nobel; procedure Nobel_Co is begin Connect; Report_All_Departements; Disconnect; end Nobel_Co; gnade-1.6.2.orig/samples/esql/simple.gpq0000644000175000017500000001653207524021410020011 0ustar lbrentalbrenta--| --| Filename : $Source: /cvsroot/gnade/gnade/samples/esql/simple.gpq,v $ --| Description : A simple test example for embedded SQL --| Author : Michael Erdmann --| Created On : 8.12.2000 --| Last Modified By: $Author: merdmann $ --| Last Modified On: $Date: 2002/08/06 19:27:04 $ --| Status : $State: Exp $ --| --| Copyright (C) 2000-2002 Michael Erdmann --| --| This program is free software; you can redistribute it and/or --| modify it under the terms of the GNU General Public License --| as published by the Free Software Foundation; either version 2 --| of the License, or (at your option) any later version. --| --| This program/code is distributed in the hope that it will be useful, --| but WITHOUT ANY WARRANTY; without even the implied warranty of --| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --| GNU General Public License for more details. --| --| You should have received a copy of the GNU General Public License along --| with this program; if not, write to the Free Software Foundation, Inc., --| 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --| --| As a special exception, if other files instantiate generics from this --| unit, or you link this unit with other files to produce an executable, --| this unit does not by itself cause the resulting executable to be --| covered by the GNU General Public License. This exception does not --| however invalidate any other reasons why the executable file might be --| covered by the GNU Public License. --| --| Functional Description --| ====================== --| --| This is an example for embedded SQL. It demonstrates the ISO/92 --| features and addtional esql extensions. --| --| --| Restrictions --| ============ --| --| References --| ========== --| --| with Ada.Text_IO; use Ada.Text_IO; with SQL_STANDARD; use SQL_STANDARD; with Ada.Strings.Fixed; use Ada.Strings.Fixed; with Ada.Strings; use Ada.Strings; with GNU.DB.SQLCLI; use GNU.DB.SQLCLI; procedure Simple is Nothing_Found : exception; Some_Error : exception; My_Exception : exception; package IO is new Ada.Text_IO.Integer_IO (Integer); use IO; EXEC SQL DECLARE DB01 DATABASE ; -- **************************************************************** -- EXEC SQL DECLARE DEPARTMENTS TABLE ( DEPTNO INT, NAME CHAR ( 1..40 ), LOCATION CHAR ( 1..40 ) ); EXEC SQL DECLARE EMPLOYEES TABLE ( EMPNO INT, NAME CHAR( 1..40 ), FIRSTNAME CHAR( 1..40 ), DEPTNO INT, SINCE CHAR( 1..20 ), MANAGER INT, JOB CHAR( 1..20 ), PROMOTION CHAR( 1..50 ), SALARY REAL ) ; -- ***************************************************************** -- procedure Get_Manager( manager : in Integer ) is --- EXEC SQL BEGIN DECLARE SECTION END-EXEC name : CHAR(1..40); depno_ind : INDICATOR_TYPE := 0; empno, depno : INT; Manager_To_Find : INT := INT(manager) ; dep_location : CHAR (1..40); EXEC SQL END DECLARE SECTION END-EXEC H : SQLHSTMT; C : SQLHDBC ; procedure Not_Found is begin Put_Line("** procedure Not_Found called" ); Put_Line("** Error message: " & Trim( SQLCA.Message, Right ) ); end Not_Found; -- -- test a single query without cursor -- procedure Print_Employee( His_Number : Integer; EXEC SQL DECLARE DB01x DATABASE ) is --- EXEC SQL INCLUDE SQLCA NAMED BY MY_SQLCA; --- begin empno := INT(His_Number); EXEC SQL WHENEVER NOT FOUND DO Not_Found; EXEC SQL AT DB01x SELECT NAME, DEPTNO INTO :name, :depno FROM EMPLOYEES WHERE EMPNO = :empno ; EXEC SQL AT DB01x SELECT LOCATION INTO :dep_location FROM DEPARTMENTS WHERE DEPTNO = :depno ; if SQLCODE not in SQL_STANDARD.NOT_FOUND then Put_Line( "Employee : " & Trim(To_String(Name),Right) & " working in dep. " & INT'Image(depno) & " located at " & Trim(To_String(dep_location),Right) ); end if; -- get the ODBC handles H := EXEC SQL INCLUDE STATEMENT HANDLE OF DB01x ; C := EXEC SQL INCLUDE CONNECTION HANDLE OF DB01x ; EXEC SQL WHENEVER NOT FOUND CONTINUE; EXEC SQL RESET SQLCA ; end Print_Employee; -------------------- -- List_All_Names -- -------------------- procedure List_All_Names is begin EXEC SQL at DB01 SELECT NAME INTO :Name FROM EMPLOYEES; while SQLCODE not in SQL_STANDARD.NOT_FOUND loop Put_Line( ">" & To_String( Name ) ); EXEC SQL at DB01 FETCH INTO :Name; end loop; end List_All_Names; begin Put_Line("Printing all employees working for Manager " & Integer'Image(Manager) ); Put_Line(""); EXEC SQL AT DB01 DECLARE emp_cursor CURSOR FOR SELECT EMPNO, NAME, DEPTNO FROM EMPLOYEES WHERE MANAGER = :Manager_To_Find ; EXEC SQL WHENEVER NOT FOUND DO Not_Found; EXEC SQL WHENEVER SQLERROR RAISE Some_Error; Put_Line("Emp. Number Employee"); Put_Line("=========== ======================"); EXEC SQL AT DB01 OPEN emp_cursor ; -- read out all data seleted by the query loop EXEC SQL AT DB01 FETCH FROM emp_cursor INTO :empno, :name, :depno INDICATOR :depno_ind ; exit when SQLCODE in SQL_STANDARD.NOT_FOUND; Put( Integer(empno), width => 10 ); -- employee number Put( " " & To_String(Name) & " " ); -- name of the employee if Is_Null( depno_ind ) then Put( "department number not defined" ); else Put (Integer(depno), Width => 10); end if; New_Line; end loop; Put_Line(""); EXEC SQL AT DB01 CLOSE emp_cursor; -- This will perform a single query Put_Line( "Printing Employee Data" ); Print_Employee(1, EXEC SQL INCLUDE DATABASE NAMED DB01 ); Print_Employee(2, EXEC SQL INCLUDE DATABASE NAMED DB01 ); List_All_Names; exception when Nothing_Found => Put_Line("Nobody found"); EXEC SQL WHENEVER NOT FOUND CONTINUE; EXEC SQL WHENEVER SQLERROR CONTINUE; EXEC SQL AT DB01 END ; when Others => Put_Line( "Exception " ); EXEC SQL WHENEVER NOT FOUND CONTINUE; EXEC SQL WHENEVER SQLERROR CONTINUE; EXEC SQL AT DB01 END ; raise; end Get_Manager; procedure Handle_Wrong_Password is begin Put_Line("Password wrong!"); raise Some_Error; end Handle_Wrong_Password; begin EXEC SQL CONNECT $DBUSER IDENTIFIED BY $DBPASSWD BY DB01 TO $DBSOURCE ON COMMUNICATION ERROR RAISE Some_Error ON AUTHORIZATION ERROR DO Handle_Wrong_Password ; -- Hallo Test Get_Manager(3); exception when Some_Error => EXEC SQL DISCONNECT ALL; end Simple; gnade-1.6.2.orig/samples/esql/simple_pkg.ads0000644000175000017500000000014007303666452020636 0ustar lbrentalbrentapackage Simple_Pkg is procedure Get_Manager( Manager : Integer ); end Simple_Pkg; gnade-1.6.2.orig/samples/esql/simple_pkg.gpq0000644000175000017500000001531410027000434020642 0ustar lbrentalbrenta--| --| Filename : $Source: /cvsroot/gnade/gnade/samples/esql/simple_pkg.gpq,v $ --| Description : This is the main driver for the embedded SQL translator --| Author : Michael Erdmann --| Created On : 8.12.2000 --| Last Modified By: $Author: merdmann $ --| Last Modified On: $Date: 2004/03/20 08:30:20 $ --| Status : $State: Exp $ --| --| Copyright (C) 2000 Michael Erdmann --| --| This program is free software; you can redistribute it and/or --| modify it under the terms of the GNU General Public License --| as published by the Free Software Foundation; either version 2 --| of the License, or (at your option) any later version. --| --| This program/code is distributed in the hope that it will be useful, --| but WITHOUT ANY WARRANTY; without even the implied warranty of --| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --| GNU General Public License for more details. --| --| You should have received a copy of the GNU General Public License along --| with this program; if not, write to the Free Software Foundation, Inc., --| 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --| --| As a special exception, if other files instantiate generics from this --| unit, or you link this unit with other files to produce an executable, --| this unit does not by itself cause the resulting executable to be --| covered by the GNU General Public License. This exception does not --| however invalidate any other reasons why the executable file might be --| covered by the GNU Public License. --| --| Functional Description --| ====================== --| --| This is an example for embedded SQL. It demonstrates the ISO/92 --| features and addtional esql extensions. --| --| --| Restrictions --| ============ --| --| References --| ========== --| --| with Ada.Text_IO; use Ada.Text_IO; with SQL_STANDARD; use SQL_STANDARD; with Ada.Strings.Fixed; use Ada.Strings.Fixed; with Ada.Strings; use Ada.Strings; with GNU.DB.SQLCLI; use GNU.DB.SQLCLI; package body Simple_Pkg is Nothing_Found : exception; Some_Error : exception; package IO is new Ada.Text_IO.Integer_IO (Integer); use IO; EXEC SQL DECLARE DB01 DATABASE ; -- **************************************************************** -- EXEC SQL DECLARE DEPARTMENTS TABLE ( DEPTNO INT, NAME CHAR ( 1..40 ), LOCATION CHAR ( 1..40 ) ); EXEC SQL DECLARE EMPLOYEES TABLE ( EMPNO INT, NAME CHAR( 1..40 ), FIRSTNAME CHAR( 1..40 ), DEPTNO INT, SINCE CHAR( 1..20 ), MANAGER INT, JOB CHAR( 1..20 ), PROMOTION CHAR( 1..50 ), SALARY REAL ) ; -- ***************************************************************** -- EXEC SQL DECLARE test_sql STATEMENT ; -- ***************************************************************** -- procedure Get_Manager( manager : in Integer ) is --- EXEC SQL BEGIN DECLARE SECTION END-EXEC name : CHAR(1..40); depno_ind : INDICATOR_TYPE := 0; empno, depno : INT; Manager_To_Find : INT := INT(manager) ; dep_location : CHAR (1..40); EXEC SQL END DECLARE SECTION END-EXEC H : SQLHSTMT; C : SQLHDBC ; procedure Not_Found is begin Put_Line("** procedure Nothing_Found called" ); Put_Line("** Error message: " & Trim( SQLCA.Message, Right ) ); end Not_Found; -- -- test a single query without cursor -- procedure Print_Employee( His_Number : Integer; EXEC SQL DECLARE DB01x DATABASE ) is --- EXEC SQL INCLUDE SQLCA NAMED BY MY_SQLCA; --- begin empno := INT(His_Number); EXEC SQL WHENEVER NOT FOUND DO Not_Found; EXEC SQL AT DB01x SELECT NAME, DEPTNO INTO :name, :depno FROM EMPLOYEES WHERE EMPNO = :empno ; EXEC SQL AT DB01x SELECT LOCATION INTO :dep_location FROM DEPARTMENTS WHERE DEPTNO = :depno ; if SQLCODE not in SQL_STANDARD.NOT_FOUND then Put_Line( "Employee : " & Trim(To_String(Name),Right) & " working in dep. " & INT'Image(depno) & " located at " & Trim(To_String(dep_location),Right) ); end if; -- get the ODBC handles H := EXEC SQL INCLUDE STATEMENT HANDLE OF DB01x ; C := EXEC SQL INCLUDE CONNECTION HANDLE OF DB01x ; EXEC SQL WHENEVER NOT FOUND CONTINUE; EXEC SQL RESET SQLCA ; end Print_Employee; --- begin Put_Line("Printing all employees working for Manager " & Integer'Image(Manager) ); Put_Line(""); EXEC SQL AT DB01 DECLARE emp_cursor CURSOR FOR SELECT EMPNO, NAME, DEPTNO FROM EMPLOYEES WHERE MANAGER = :Manager_To_Find ; EXEC SQL WHENEVER NOT FOUND DO Not_Found; EXEC SQL WHENEVER SQLERROR RAISE Some_Error; Put_Line("Emp. Number Employee"); Put_Line("=========== ======================"); EXEC SQL AT DB01 OPEN emp_cursor ; -- read out all data seleted by the query loop EXEC SQL AT DB01 FETCH FROM emp_cursor INTO :empno, :name, :depno INDICATOR :depno_ind ; exit when SQLCODE in SQL_STANDARD.NOT_FOUND; Put( Integer(empno), width => 10 ); -- employee number Put( " " & To_String(Name) & " " ); -- name of the employee if Is_Null( depno_ind ) then Put( "department number not defined" ); else Put (Integer(depno), Width => 10); end if; New_Line; end loop; Put_Line(""); EXEC SQL AT DB01 CLOSE emp_cursor; -- This will perform a single query Put_Line( "Printing Employee Data" ); Print_Employee(1, EXEC SQL INCLUDE DATABASE NAMED DB01 ); Print_Employee(2, EXEC SQL INCLUDE DATABASE NAMED DB01 ); exception when Nothing_Found => Put_Line("Nobody found"); EXEC SQL WHENEVER NOT FOUND CONTINUE; EXEC SQL WHENEVER SQLERROR CONTINUE; EXEC SQL AT DB01 END ; when Others => Put_Line( "Exception " ); EXEC SQL WHENEVER NOT FOUND CONTINUE; EXEC SQL WHENEVER SQLERROR CONTINUE; EXEC SQL AT DB01 END ; raise; end Get_Manager; begin EXEC SQL CONNECT "$DBUSER" IDENTIFIED BY "$DBPASSWD" BY DB01 TO "$DBSOURCE" ; -- Hallo Test end Simple_Pkg; --- end of file gnade-1.6.2.orig/samples/esql/simplepkg.adb0000644000175000017500000000442010022642075020446 0ustar lbrentalbrenta--| --| Filename : $Source: /cvsroot/gnade/gnade/samples/esql/simplepkg.adb,v $ --| Description : This is a test program for the gnade ODBC wrapper --| Author : Michael Erdmann --| Created On : 8.12.2000 --| Last Modified By: $Author: merdmann $ --| Last Modified On: $Date: 2004/03/07 15:48:13 $ --| Status : $State: Exp $ --| --| Copyright (C) 2000 Michael Erdmann --| --| This program is free software; you can redistribute it and/or --| modify it under the terms of the GNU General Public License --| as published by the Free Software Foundation; either version 2 --| of the License, or (at your option) any later version. --| --| This program/code is distributed in the hope that it will be useful, --| but WITHOUT ANY WARRANTY; without even the implied warranty of --| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --| GNU General Public License for more details. --| --| You should have received a copy of the GNU General Public License along --| with this program; if not, write to the Free Software Foundation, Inc., --| 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --| --| As a special exception, if other files instantiate generics from this --| unit, or you link this unit with other files to produce an executable, --| this unit does not by itself cause the resulting executable to be --| covered by the GNU General Public License. This exception does not --| however invalidate any other reasons why the executable file might be --| covered by the GNU Public License. --| --| Functional Description --| ====================== --| --| --| Restrictions --| ============ --| --| References --| ========== --| --| --| History --| ======= --| $Log: simplepkg.adb,v $ --| Revision 1.1 2004/03/07 15:48:13 merdmann --| - samples for esql changed --| --| Revision 1.2 2001/05/26 08:45:30 me --| - simple version of simple_pkg added to demonstrate the capability --| to handle files containing only a single procedure. --| --| Revision 1.1 2001/01/05 09:11:47 me --| test.esql has been moved into the smaples/esql directory. --| --| --| with Ada.Text_IO; use Ada.Text_IO; use Ada; with Simple_Pkg; procedure SimplePkg is begin Simple_Pkg.Get_Manager(3); end SimplePkg; gnade-1.6.2.orig/samples/mysql/0000755000175000017500000000000011040716276016212 5ustar lbrentalbrentagnade-1.6.2.orig/samples/mysql/Makefile0000644000175000017500000001037110637241242017651 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/samples/mysql/Makefile,v $ ## Description : Makefile for the embedded SQL samples ## Author : Michael Erdmann ## Created On : 27-Jan-2001 ## Last Modified By: $Author: merdmann $ ## Last Modified On: $Date: 2007/06/23 15:56:18 $ ## Status : $State: Exp $ ## ## Copyright (C) 2000-2001 ## ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## This makefile builds the sample programs for embedded SQL. ## ## all : builds all binaries ## clean : remove all binaries and objects ## newdb : builds a new data base ## distclean : clean up completely ## ## Restrictions ## ============ ## ## References ## ========== ## sinclude ../conf.local sinclude ../../make.conf mainunits=testdb.adb binaries=$(subst .adb,$(bin),$(mainunits)) prepunits=$(subst .gpb,.adb, $(wildcard *.gpb)) DBNAME="gnade" DBPASSWD="" PREPFLAGS= -DDBNAME=\"$(DBNAME)\" \ -DDBUSER=\"$(DBUSER)\" \ -DDBPASSWD=\"$(DBPASSWD)\" all build :: newdb $(binaries) $(binaries): $(prepunits) $(ADAMAKE) -x -Pmysql.gpr $(mainunits) -largs $(APP_LINK_FLAGS_NATIVE) # Build the data base newdb: $(DBNAME).log # create the data base $(DBNAME).log: dbinstall.sql ifeq ($(DATABASE),mysql) - mysqladmin -u $(DBUSER) -f drop $(DBNAME) mysqladmin -u $(DBUSER) create $(DBNAME) mysql -u gnade $(DBNAME) < dbinstall.sql endif $(DATE) > $(DBNAME).log # ------------------------------------------------------------------------- # # C L E A N T H E D I R E C T O R Y # # ------------------------------------------------------------------------- # clean: ifeq ($(DATABASE),mysql) - mysqladmin -u $(DBUSER) -f drop $(DBNAME) else @echo "*** Database for MySQL test not cleared ***" endif $(RM) $(DBNAME).log $(RM) $(binaries) b~*.* *.o *.ali core testdb.adb *~ *~*~ *.log distclean :: clean gnade-1.6.2.orig/samples/mysql/Makefile.mysql0000644000175000017500000000617010027065741021020 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/samples/mysql/Makefile.mysql,v $ ## Description : Makefile for the embedded SQL samples ## Author : Michael Erdmann ## Created On : 27-Jan-2001 ## Last Modified By: $Author: merdmann $ ## Last Modified On: $Date: 2004/03/20 16:05:53 $ ## Status : $State: Exp $ ## ## Copyright (C) 2000-2001 ## ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## This makefile builds the sample programs for embedded SQL. ## ## all : builds all binaries ## clean : remove all binaries and objects ## newdb : builds a new data base ## distclean : clean up completely ## ## Restrictions ## ============ ## ## References ## ========== ## all build: $(MAKE) -C./ $@ gnade-1.6.2.orig/samples/mysql/dbinstall.sql0000644000175000017500000000777107617260047020730 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNat Ada Database Environment -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/samples/mysql/dbinstall.sql,v $ -- Description : create the tables for the mysql example -- -- Author : Michael Erdmann -- -- Created On : 22-Dec-2000 -- -- Last Modified By: $Author: merdmann $ -- -- Last Modified On: $Date: 2003/02/02 18:15:03 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2000-2003 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- Create the tables needed for the test program. -- -- -- -- Restrictions -- -- ============ -- -- -- -- References -- -- ========== -- -- -- ------------------------------------------------------------------------------- use testdb ; create table Test ( id char(30), create_Time date, value float, data longblob ); insert into Test (id, create_time, value, data ) values ( "Hallo", "1999-10-11", 10.3, BINARY "HHHHYYY" ); insert into Test (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into Test (id, create_time, value ) values ( "Otto", "1999-11-11", 10.5 ); gnade-1.6.2.orig/samples/mysql/gnade-mysql-samples.gpr0000644000175000017500000000164210670450003022601 0ustar lbrentalbrenta-- $Id: gnade-mysql-samples.gpr,v 1.1 2007/09/08 07:32:19 persan Exp $ with "../../gnade"; with "../../dbi/mysql/gnade-mysql.gpr"; project Gnade.mysql.Samples is for Languages use ("Ada"); for Source_Dirs use ("."); for Object_Dir use Gnade'Object_Dir; for Exec_Dir use Gnade'Exec_Dir; for Main use ("testdb.adb" ); for Exec_Dir use Gnade'Exec_Dir; package Builder is for Default_Switches ("Ada") use gnade.Builder'Default_Switches ("Ada"); end Builder; package Compiler is for Default_Switches ("Ada") use gnade.Compiler'Default_Switches ("Ada"); end Compiler; package Binder is for Default_Switches ("Ada") use gnade.Binder'Default_Switches ("Ada"); end Binder; package Linker is for Default_Switches ("Ada") use gnade.Linker'Default_Switches ("Ada"); end Linker; package Ide is for Vcs_Kind use "CVS"; end Ide; end Gnade.mysql.Samples; gnade-1.6.2.orig/samples/mysql/mysql.gpr0000644000175000017500000000144610027065741020074 0ustar lbrentalbrenta-- $Id: mysql.gpr,v 1.3 2004/03/20 16:05:53 merdmann Exp $ with "../../gnade"; project MySQL is for Languages use ("Ada"); for Source_Dirs use ("."); for Object_Dir use "."; for Main use ("testdb.adb" ); for Exec_Dir use "."; package Linker is for Default_Switches ("ada") use ("-g", GNADE.LibOpt, "-lgnademysql", gnade.NALINKEROPT ); end Linker; package Binder is for Default_Switches ("ada") use ("-static"); end Binder; package Compiler is for Default_Switches ("ada") use ("-g", GNADE.IncludeOPT ); end Compiler; package Builder is for Default_Switches ("ada") use ( "-gnatQ", GNADE.IncludeOPT ); end Builder; package Ide is for Vcs_Kind use "CVS"; end Ide; end MySQL; gnade-1.6.2.orig/samples/mysql/testdb.gpb0000644000175000017500000001411610056110057020163 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNat Ada Database Environment -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/samples/mysql/testdb.gpb,v $ --| Description : Simple example how to use the mysql bindings -- -- Author : Michael Erdmann -- -- Created On : 22-Dec-2000 -- -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2004/05/29 13:29:19 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2000-2003 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- This program prints out the result of the following query: -- -- select * from test where id='otto' -- -- -- -- Restrictions -- -- ============ -- -- -- -- References -- -- ========== -- -- -- ------------------------------------------------------------------------------- with System; use System; with Ada.Unchecked_Conversion; with Ada.Exceptions; use Ada.Exceptions; with Ada.Text_IO; use Ada.Text_IO; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Calendar; use Ada.Calendar; with GNU.DB.MySQL; use GNU.DB.MySQL; use GNU.DB ; procedure TestDB is Version : constant String := "$Id: testdb.gpb,v 1.9 2004/05/29 13:29:19 merdmann Exp $"; pragma Unreferenced (Version); dBase : MySQL.Object; qId : MySQL.Query_ID; Nbr_Tuples : Integer := 0; function Convert2 is new Ada.Unchecked_Conversion ( Byte_Array_Access, Integer); begin Initialize( dBase ); User( dBase, $DBUSER ); Password( dBase, $DBPASSWD ); Connect( dBase, "localhost" ); Select_DB( dBase, $DBNAME ); ------------------------------------------------------------------------ begin qID := Query( dBase, "select * from Test where id='Otto'"); Put_Line( "Nbr of Rows:" & Integer'Image(Nbr_of_Rows(dBase, qID)) ); while true loop declare Insert_Time : Time; pragma Unreferenced (Insert_Time); Data : Byte_Array_Access; begin Nbr_Tuples := Nbr_Tuples + 1; Data := Blob_Field( DBase, qID, 4 ); Put( " Field length = " & Get_Field_Length(DBase, QId, 4)'Img); Put( " Data address = " & Convert2(Data)'img & ":"); declare function Convert is new Ada.Unchecked_Conversion ( Byte_Array_Access, Address); S : String(1..Get_Field_Length( DBase, QId, 4)+1); for S'address use Convert(Data); begin Put_Line("""" & S & """"); end; Free( Data ); Next( dBase, qID ); exception when Field_Parse_Error => Put_Line("Field parse error"); Next( dBase, qID ); when Others => raise; end; end loop; exception when Field_Type_Error => Put_Line("Field type error"); when No_Query_Result => Put_Line("Query Failed"); when No_More_Rows => Put_Line( "End of Query Tuples:" & Integer'Image( Nbr_Tuples ) ); when The_Error : Others => Put_Line( "An error has occured at record " & Integer'Image( Nbr_Tuples ) ); Put_Line( "Fatal error, uncatched exception " & Exception_Name( The_Error )); end; Drop_Query( dBase, qID ); Finalize( dBase ); end TestDB; gnade-1.6.2.orig/samples/oci/0000755000175000017500000000000011040716276015617 5ustar lbrentalbrentagnade-1.6.2.orig/samples/oci/Makefile0000644000175000017500000000765010026065476017271 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/samples/oci/Makefile,v $ ## Description : Makefile for the oracle binsing samples ## Author : Michael Erdmann ## Created On : 27-Jan-2001 ## Last Modified By: $Author: merdmann $ ## Last Modified On: $Date: 2004/03/17 15:14:06 $ ## Status : $State: Exp $ ## ## Copyright (C) 2000-2001 ## ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## This makefile builds the sample programs for embedded SQL. ## ## all : builds all binaries ## clean : remove all binaries and objects ## newdb : builds a new data base ## distclean : clean up completely ## ## Restrictions ## ============ ## ## References ## ========== ## sinclude ../conf.local sinclude ../../make.conf mainunits= blocking.adb \ dbind.adb \ ddef.adb \ debug.adb \ demo.adb \ dyn.adb \ dyn_bind.adb \ dyn_def.adb \ subscr.adb \ test_lob.adb \ test.adb binaries=$(subst .adb,$(bin),$(mainunits)) prepunits=$(subst .gpb,.adb, $(wildcard *.gpb)) PREPFLAGS= all :: $(binaries) $(binaries): $(prepunits) ## $(ADAMAKE) -Psamples.gpr -XORACLE_HOME=/somewhere $(mainunits) @echo Oracle sample $@ not build # ------------------------------------------------------------------------- # # C L E A N T H E D I R E C T O R Y # # ------------------------------------------------------------------------- # clean: $(RM) $(binaries) b~*.* *.o *.ali core *~ *~*~ *.log distclean :: clean gnade-1.6.2.orig/samples/oci/Makefile.oci0000644000175000017500000001032210042013504020007 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## Oracle Call Interface - Makefile -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/samples/oci/Makefile.oci,v $ ## Description : Makefile to build the example code for GNU ADO -- ## Author : Michael Erdmann -- ## Created On : 27.1.2002 -- ## Last Modified By: $Author: merdmann $ -- ## Last Modified On: $Date: 2004/04/22 19:04:36 $ -- ## Version : $Revision: 1.1 $ ## Status : $State: Exp $ ## -- ## Copyright (C) 2000-2002 -- ## -- ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## This package is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## Contact -- ## ======= -- ## Error reports shall be handled via http://gnade.sourceforge.net -- ## Features and ideas via: gnade-develop@lists.sourceforge.net -- ## -- ## Author contact: -- ## purl:/net/michael.erdmann -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## ## Restrictions ## ============ ## None ## ## References ## ========== ## None ## ## ## sinclude ../conf.local sinclude ../../make.conf # all: @echo "**********************************************" @echo "***** NO TEST CLIENT IS BUILD FOR ORACLE *****"; @echo "**********************************************" clean: rm -rf client rm -rf *.ali *.o core rm -rf b~* *~ *.bak distclean: clean gnade-1.6.2.orig/samples/oci/Makefile.samples0000644000175000017500000001032610042013504020705 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## Oracle Call Interface - Makefile -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/samples/oci/Makefile.samples,v $ ## Description : Makefile to build the example code for GNU ADO -- ## Author : Michael Erdmann -- ## Created On : 27.1.2002 -- ## Last Modified By: $Author: merdmann $ -- ## Last Modified On: $Date: 2004/04/22 19:04:36 $ -- ## Version : $Revision: 1.1 $ ## Status : $State: Exp $ ## -- ## Copyright (C) 2000-2002 -- ## -- ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## This package is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## Contact -- ## ======= -- ## Error reports shall be handled via http://gnade.sourceforge.net -- ## Features and ideas via: gnade-develop@lists.sourceforge.net -- ## -- ## Author contact: -- ## purl:/net/michael.erdmann -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## ## Restrictions ## ============ ## None ## ## References ## ========== ## None ## ## ## sinclude ../conf.local sinclude ../../make.conf # all: @echo "**********************************************" @echo "***** NO TEST CLIENT IS BUILD FOR ORACLE *****"; @echo "**********************************************" clean: rm -rf client rm -rf *.ali *.o core rm -rf b~* *~ *.bak distclean: clean gnade-1.6.2.orig/samples/oci/blocking.adb0000644000175000017500000000632610536751577020102 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Thin Ada95 binding to OCI™ (Oracle® Call Interface™) -- -- Copyright (C) 2000-2004 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: blocking.adb,v 1.8 2006/12/10 09:29:35 merdmann Exp $ -- Example of the non blocking execution. with Ada.Text_IO, OCI.Thick.OCINumber_Var, OCI.Thick.Number_Functions, OCI.Thick.Servers, OCI.Thick.Connections, OCI.Thick.Statements; procedure Blocking is use OCI.Thick; use Ada.Text_IO; Server : Servers.Server := Servers.Attach (""); -- Using the OCI.Thick.Servers package. -- Creating server attachment. -- Empty name mean local server. Connect1 : Connections.Connection := Connections.Logon (DB => Server, User => "scott", Password => "tiger"); Connect2 : Connections.Connection := Connections.Logon (DB => Server, User => "scott", Password => "tiger"); -- Using the OCI.Thick.Connections package. -- Logon to the database and creating database connection Connect3 : Connections.Connection := Connections.Logon (Server_Name => "", User => "scott", Password => "tiger"); Stmt_Text : String := "declare" & ASCII.LF & " Dt Date := Sysdate;" & ASCII.LF & " J Integer;" & ASCII.LF & "begin" & ASCII.LF & " loop" & ASCII.LF & " J := NVL (J, 0) + 1;" & ASCII.LF & " exit when Sysdate - Dt > 1/24/3600;" & ASCII.LF & " end loop;" & ASCII.LF & " :J := NVL (:J, 0) + 1;" & ASCII.LF & "end;" & ASCII.LF; Stmt : Statements.Statement := Statements.Prepare (Stmt_Text); -- Prepearing statement. -- OCI is prepearing statements without any communication with a server. J : OCINumber_Var.Variable; begin -- We can see the server version information. Put_Line (Servers.Server_Version (Server)); New_Line; Servers.Set_Blocking (Server, False); OCINumber_Var.Bind (Stmt, J, "J"); loop Statements.Execute_And_Commit (Connect1, Stmt); exit when not Statements.Is_Executing (Stmt); Servers.Set_Blocking (Server, True); Put ('.'); delay 0.1; end loop; Put_Line ("J = " & Number_Functions.To_String (OCINumber_Var.Value (J), "9999999")); Servers.Set_Blocking (Server, False); loop Statements.Execute (Connect2, Stmt); exit when not Statements.Is_Executing (Stmt); Put ('.'); delay 0.1; end loop; Put_Line ("J = " & Number_Functions.To_String (OCINumber_Var.Value (J), "9999999")); loop Statements.Execute (Connect3, Stmt); exit when not Statements.Is_Executing (Stmt); Put ('.'); delay 0.1; end loop; Put_Line ("J = " & Number_Functions.To_String (OCINumber_Var.Value (J), "9999999")); end Blocking; gnade-1.6.2.orig/samples/oci/change_subscriber.adb0000644000175000017500000000313110636147625021743 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Ada95 Interface to Oracle RDBMS -- -- Copyright (C) 2006 Maxim Reznik -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: change_subscriber.adb,v 1.2 2007/06/20 06:56:21 vagul Exp $ with Ada.Text_IO; with Ada.Strings.Unbounded; package body Change_Subscriber is ------------ -- Notify -- ------------ procedure Notify (Item : in out Subscriber_Type; Data : in Change_Descriptor) is use Ada.Text_IO; pragma Unreferenced (Item); begin Put_Line ("Change_Kind: " & Change_Kinds'Image (Change_Kind (Data))); declare Count : constant Positive := Table_Count (Data); begin for J in 1 .. Count loop Put_Line ("Table_Name: " & Table_Name (Data, J)); Put_Line ("Table_Operation: " & Operation_Kinds'Image (Table_Operation (Data, J))); declare use Ada.Strings.Unbounded; Rows : constant Row_Array := Table_Rows (Data, J); begin for R in Rows'Range loop Put_Line ("Rowid: " & To_String (Rows (R).Id) & " Operation_Kind: " & Operation_Kinds'Image (Rows (R).Kind)); end loop; end; end loop; end; end Notify; end Change_Subscriber; gnade-1.6.2.orig/samples/oci/change_subscriber.ads0000644000175000017500000000140710471310715021755 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Ada95 Interface to Oracle RDBMS -- -- Copyright (C) 2006 Maxim Reznik -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: change_subscriber.ads,v 1.1 2006/08/18 10:09:17 vagul Exp $ with OCI.Thick.Notifications.DB_Change; package Change_Subscriber is use OCI.Thick.Notifications.DB_Change; type Subscriber_Type is new Change_Subscription with null record; procedure Notify (Item : in out Subscriber_Type; Data : in Change_Descriptor); end Change_Subscriber; gnade-1.6.2.orig/samples/oci/date.adb0000644000175000017500000000132710707126563017212 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Thin Ada95 binding to OCI™ (Oracle® Call Interface™) -- -- Copyright (C) 2000-2007 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: date.adb,v 1.6 2007/10/22 14:02:27 vagul Exp $ -- Print OCI formatted date on client side, without connect to Oracle server. with Ada.Text_IO; with OCI.Thick.Date; procedure Date is use OCI.Thick.Date; Now : OCIDate := SysDate; begin Ada.Text_IO.Put_Line (To_String (Now, "YYYY-MM-DD HH24:MI:SS")); end Date; gnade-1.6.2.orig/samples/oci/dbind.adb0000644000175000017500000000211710707126563017353 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Thin Ada95 binding to OCI™ (Oracle® Call Interface™) -- -- Copyright (C) 2000-2007 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: dbind.adb,v 1.5 2007/10/22 14:02:27 vagul Exp $ -- Example of using dynamically allocated bind variables. with Ada.Text_IO; with OCI.Thick.Statements; with OCI.Thick.Strings; procedure DBind is use OCI.Thick; use OCI.Thick.Statements; use OCI.Thick.Strings; Stmt : Statement := Prepare ("begin if false then :result1 := nvl(:result1, 'eeeeeeeeeeeee');" & " end if;" & " end;"); Result1 : Var_Type; Binded : Boolean; begin Bind (Stmt, Result1, "result1", Binded); Ada.Text_IO.Put_Line ("binded " & Boolean'Image (Binded)); Bind (Stmt, Result1, "result2", Binded); Ada.Text_IO.Put_Line ("binded " & Boolean'Image (Binded)); end DBind; gnade-1.6.2.orig/samples/oci/ddef.adb0000644000175000017500000000315410707126563017177 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Thin Ada95 binding to OCI™ (Oracle® Call Interface™) -- -- Copyright (C) 2000-2007 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: ddef.adb,v 1.6 2007/10/22 14:02:27 vagul Exp $ -- Example of Logon and statement execution. with Ada.Text_IO, OCI.Thick.Connections, OCI.Thick.Statements, OCI.Thick.Strings; procedure DDef is use OCI.Thick; use Ada.Text_IO; Connect : Connections.Connection := Connections.Logon (Server_Name => "", User => "scott", Password => "tiger"); -- Using the OCI.Thick.Connections package. -- Logon to the database and creating database connection Stmt : Statements.Statement := Statements.Prepare ("select 'one' from dual union all " & "select 'two' from dual union all " & "select 'three' from dual"); Column : Strings.Variable; -- Unlimited length string. begin -- We can see the server version information. Put_Line (Connections.Server_Version (Connect)); New_Line; -- Statements prepeared with connection should be executed -- without connection. Statements.Execute (Connect, Stmt); Strings.Define (Stmt, Column, 1); while Statements.Fetch (Stmt) loop Put_Line (Strings.Value (Column) & ';'); end loop; end DDef; gnade-1.6.2.orig/samples/oci/debug.adb0000644000175000017500000000134210707126563017360 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Thin Ada95 binding to OCI™ (Oracle® Call Interface™) -- -- Copyright (C) 2000-2007 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: debug.adb,v 1.6 2007/10/22 14:02:27 vagul Exp $ -- Example of using of handle/decriptor allocation debugger. with OCI.Thick.Debug_Allocation; with Ada.Text_IO; procedure Debug is use OCI.Thick.Debug_Allocation; use Ada.Text_IO; begin Put_Line ("Start."); Start; Put_Line ("Print info."); Print_Info; end Debug; gnade-1.6.2.orig/samples/oci/dec_conv_test.adb0000644000175000017500000000700211007574024021101 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Thin Ada95 binding to OCI™ (Oracle® Call Interface™) -- -- Copyright (C) 2006 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: dec_conv_test.adb,v 1.3 2008/05/05 12:05:40 vagul Exp $ -- Example of Decimal<->OCINumber convertions. with Ada.Text_IO; with OCI.Thick.Gen_OCINumber; with OCI.Thick.Number_Functions; with GNAT.Float_Control; with System; with OCI.Thick.Number_Functions; procedure Dec_Conv_Test is use OCI.Thick.Number_Functions; type Decimal_Type is delta 0.001 digits System.Max_Digits; Num : Decimal_Type := Decimal_Type'First + Decimal_Type'Small; Num_Range : Decimal_Type := 1000.0; procedure Test; procedure Test is function To_Decimal is new OCI.Thick.Gen_OCINumber.Num_To_Decimal (Decimal_Type); function To_Number is new OCI.Thick.Gen_OCINumber.Decimal_To_Number (Decimal_Type); Numb : OCI.Thick.OCINumber := To_Number (Num); Fmt : constant String := "FM999999999999900.999"; Image : constant String := To_String (Numb, Fmt); Half_Up : constant OCI.Thick.OCINumber := To_Number (Long_Float (Decimal_Type'Small) / 1.99999999999999); Half_Down : constant OCI.Thick.OCINumber := To_Number (Long_Float (Decimal_Type'Small) / 2.00000000000001); Half : constant OCI.Thick.OCINumber := To_Number (Long_Float (Decimal_Type'Small) / 2.0); begin if Image (Image'Last - 2 .. Image'Last) = "00." then Ada.Text_IO.Put_Line (Image & Num'Img); end if; if To_Decimal (Numb) /= Num then raise Constraint_Error with "Error in " & Image & Num'Img; elsif To_Decimal (Numb + Half_Down) /= Num then raise Constraint_Error with "Error in down round."; elsif To_Decimal (Numb + Half_Up) /= Num + Decimal_Type'Small then raise Constraint_Error with "Error in up round " & To_String (Numb + Half_Up) & Decimal_Type'Image (Num + Decimal_Type'Small); elsif Sign (Numb) < 0 and then To_Decimal (Numb - Half) /= Num - Decimal_Type'Small then raise Constraint_Error with "Error in negative half round " & To_String (Numb - Half); elsif Sign (Numb) > 0 and then To_Decimal (Numb + Half) /= Num + Decimal_Type'Small then raise Constraint_Error with "Error in positive half round " & To_String (Numb + Half); elsif Sign (Numb) = 0 and then not Is_Zero (Numb) then raise Constraint_Error with "Error in zero detection " & To_String (Numb); end if; if To_String (Round (Numb, Decimal_Type'Aft), Fmt) /= Image then Ada.Text_IO.Put_Line ("Error in " & Image); raise Constraint_Error; end if; exception when others => Ada.Text_IO.Put_Line (To_String (Numb)); raise; end Test; begin loop Test; if Num = Num_Range then Num := Decimal_Type'Last - Num_Range; elsif Num = Decimal_Type'First + Num_Range then Num := -Num_Range; elsif Num = Decimal_Type'Last then exit; else Num := Num + Decimal_Type'Small; end if; end loop; end Dec_Conv_Test;gnade-1.6.2.orig/samples/oci/demo.adb0000644000175000017500000000734210707126563017224 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Thin Ada95 binding to OCI™ (Oracle® Call Interface™) -- -- Copyright (C) 2000-2007 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: demo.adb,v 1.7 2007/10/22 14:02:27 vagul Exp $ -- Example of Logon and statement execution. with Ada.Text_IO, OCI.Thick.OCIDate_Var, OCI.Thick.OCINumber_Var, OCI.Thick.String_Bounded, OCI.Thick.Servers, OCI.Thick.Connections, OCI.Thick.Statements, OCI.Thick.Number_Functions, OCI.Thick.Strings; procedure Demo is use OCI.Thick; use Ada.Text_IO; Server : Servers.Server := Servers.Attach (""); -- Using the OCI.Thick.Servers package. -- Creating server attachment. -- Empty name mean local server. Connect : Connections.Connection := Connections.Logon ( DB => Server, User => "scott", Password => "tiger"); -- Using the OCI.Thick.Connections package. -- Logon to the database and creating database connection Easy_Connect : Connections.Connection := Connections.Logon (Server_Name => "", User => "scott", Password => "tiger"); -- We can create connection without previous server attached, -- Just spetsify the server name instead of server. Stmt_Text : String := "select " & "OBJECT_NAME, " -- VARCHAR2(128) & "OBJECT_TYPE, " -- VARCHAR2(18) & "OBJECT_ID, " -- NUMBER & "CREATED " -- DATE & "from user_objects where STATUS = :STATUS"; Stmt_OCI : Statements.Statement := Statements.Prepare (Stmt_Text); -- Using the OCI.Thick.Statements package. -- Prepearing statement. -- OCI is prepearing statements without any communication with a server. Stmt : Statements.Statement := Statements.Prepare (Connect, Stmt_Text); -- Thick binding allow you to emulate ODBC like behavior of prepare. -- It looks like we are using connection for prepearing statement, -- but we are just remember Connection inside of Statement for the -- execute later. -- Define variables for fetch from cursor. Object_Name : Strings.Variable; -- Unlimited length string. Object_Type : String_Bounded.Variable (18); -- Fixed length string. Object_Id : OCINumber_Var.Variable; -- Number Created : OCIDate_Var.Variable; -- Date Status_OCI : Strings.Variable; Status : Strings.Variable; -- Bind variable for Status parameter. begin -- We can see the server version information. Put_Line (Connections.Server_Version (Connect)); New_Line; Strings.Bind (Stmt_OCI, Status_OCI, "Status"); Strings.Bind (Stmt, Status, "Status"); Strings.Set_Value (Status, "VALID"); -- Statements prepeared without connection have to be executed only -- with connection. Statements.Execute (Easy_Connect, Stmt_OCI); -- Statements prepeared with connection should be executed -- without connection. Statements.Execute (Stmt); Strings.Define (Stmt, Object_Name, 1); String_Bounded.Define (Stmt, Object_Type, 2); OCINumber_Var.Define (Stmt, Object_Id, 3); OCIDate_Var.Define (Stmt, Created, 4); while Statements.Fetch (Stmt) loop Put (Strings.Value (Object_Name)); Set_Col (24); Put (String_Bounded.Value (Object_Type)); Set_Col (32); Put_Line (Number_Functions.To_String (OCINumber_Var.Value (Object_Id), "9999999")); end loop; end Demo; gnade-1.6.2.orig/samples/oci/dyn.adb0000644000175000017500000001246710536751577017107 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Thin Ada95 binding to OCI™ (Oracle® Call Interface™) -- -- Copyright (C) 2000-2004 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: dyn.adb,v 1.6 2006/12/10 09:29:35 merdmann Exp $ -- Example of using dynamically allocated bind variables. with Ada.Strings.Fixed; with Ada.Text_IO; with OCI.Thick.Connections; with OCI.Thick.Statements; with OCI.Thick.Strings; procedure Dyn is use OCI.Thick; use OCI.Thick.Connections; use OCI.Thick.Statements; use OCI.Thick.Strings; use Ada.Strings.Fixed; use Ada.Text_IO; Connect : Connection := Logon ("scott/tiger"); Stmt1 : Statement := Prepare (Connect, "begin :Result := null; end;"); Stmt2 : Statement := Prepare (Connect, "begin :Result := '----------------- would see.'; end;"); Stmt3 : Statement := Prepare (Connect, "begin if False then :Result := :Result; end if; end;"); Stmt4 : Statement := Prepare (Connect, "begin :Result := '1'; end;"); Stmt5 : Statement := Prepare (Connect, "begin" & " :Result := '-------';" & " :Result1 := '11111111111';" & " :Result2 := '22222222';" & " end;"); Stmt6 : Statement := Prepare (Connect, "declare Dummy Varchar2 (64) := :Result; "& "begin" & " :Result1 := '11111111111';" & " :Result2 := '22222222';" & " end;"); Stmt7 : Statement := Prepare (Connect, "declare Dummy Varchar2 (64) := :Result1; "& "begin" & " :Result := '-------';" & " :Result2 := '22222222';" & " end;"); Stmt : Statement := Prepare (Connect, "begin" & " if true then" & " :result1 := nvl (:result1, 'eeeeeeeeeeeee');" & " end if;" & " end;"); Sel : Statement := Prepare (Connect, "select * from (" & " select rownum || ', '|| dname ||', '|| loc ||';' from dept" & " union select rownum || ', '|| loc ||', '|| dname ||';' from dept" & " union select loc || ', '|| rownum ||', '|| dname ||';' from dept" & " union select loc || ', '|| dname ||', '|| rownum ||';' from dept" & " union select dname || ', '|| loc ||', '|| rownum ||';' from dept" & " union select dname || ', '|| rownum ||', '|| loc ||';' from dept" & " union all select '22' from dept" & " union all select '2' from dept" & " union all select null from dept" & " union all select '=====================' from dept)" & " where rownum < :cond"); Result : Variable; Result1 : Variable; Result2 : Variable; begin Bind (Stmt1, Result, "Result"); Execute (Stmt1); Put_Line ("Result " & Value (Result, "(null)")); Set_Value (Result, "does not matter"); Execute (Stmt1); Put_Line ("Result " & Value (Result, "(null)")); Bind (Stmt2, Result, "Result"); Execute (Stmt2); Put_Line ("Result " & Value (Result)); Bind (Stmt3, Result, "Result"); Execute (Stmt3); Put_Line ("Result Stmt3 '" & Value (Result) & '''); Bind (Stmt4, Result, "Result"); Execute (Stmt4); Put_Line ("Result Stmt4 '" & Value (Result) & '''); Bind (Stmt5, Result, "Result"); Bind (Stmt5, Result1, "Result1"); Bind (Stmt5, Result2, "Result2"); Execute (Stmt5); Put_Line ("Result Stmt5 '" & Value (Result) & '''); Put_Line ("Result1 Stmt5 '" & Value (Result1) & '''); Put_Line ("Result2 Stmt5 '" & Value (Result2) & '''); Bind (Stmt6, Result, "Result"); Bind (Stmt6, Result1, "Result1"); Bind (Stmt6, Result2, "Result2"); Execute (Stmt6); Put_Line ("Result Stmt6 '" & Value (Result) & '''); Put_Line ("Result1 Stmt6 '" & Value (Result1) & '''); Put_Line ("Result2 Stmt6 '" & Value (Result2) & '''); Clear_Value (Result1); Clear_Value (Result2); Execute (Stmt6); Put_Line ("Result Stmt6 '" & Value (Result) & '''); Put_Line ("Result1 Stmt6 '" & Value (Result1) & '''); Put_Line ("Result2 Stmt6 '" & Value (Result2) & '''); Bind (Stmt7, Result, "Result"); Bind (Stmt7, Result1, "Result1"); Bind (Stmt7, Result2, "Result2"); Clear_Value (Result); Clear_Value (Result2); Execute (Stmt7); Put_Line ("Result Stmt7 '" & Value (Result) & '''); Put_Line ("Result1 Stmt7 '" & Value (Result1) & '''); Put_Line ("Result2 Stmt7 '" & Value (Result2) & '''); Bind (Stmt, Result1, "Result1"); Define (Sel, Result1, 1); Bind (Sel, Result2, "cond"); Ada.Text_IO.Put_Line ("binded"); Set_Value (Result1, 2 * "aBcDeFgH." & "=_"); Ada.Text_IO.Put ("execute"); Execute (Stmt); Ada.Text_IO.Put_Line ("d"); Ada.Text_IO.Put_Line ("Result1 " & Value (Result1) & ';'); Clear_Value (Result1); Execute (Stmt); Ada.Text_IO.Put_Line ("d"); Ada.Text_IO.Put_Line ("Result1 " & Value (Result1, "(null)") & ';'); Set_Value (Result2, "97"); Execute (Sel); while Fetch (Sel) loop if Is_Null (Result1) then Ada.Text_IO.Put_Line ("(null)"); else declare F1 : String := Value (Result1); begin Ada.Text_IO.Put_Line (F1 & '.' & Integer'Image (Character'Pos (F1 (F1'Last)))); end; end if; end loop; end Dyn; gnade-1.6.2.orig/samples/oci/dyn_bind.adb0000644000175000017500000001517510536751600020065 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Thin Ada95 binding to OCI™ (Oracle® Call Interface™) -- -- Copyright (C) 2000-2004 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: dyn_bind.adb,v 1.8 2006/12/10 09:29:36 merdmann Exp $ -- Example/test of using dynamically allocated bind variables. with Ada.Strings.Fixed; with Ada.Text_IO; with OCI.Thick.Connections; with OCI.Thick.Statements; with OCI.Thick.Strings; procedure Dyn_Bind is use OCI.Thick; use OCI.Thick.Connections; use OCI.Thick.Statements; use OCI.Thick.Strings; use Ada.Strings.Fixed; Connect : Connection := Logon ("scott/tiger"); Stmt : Statement := Prepare (Connect, "declare Dummy Varchar2 (64) := :Result;" & " begin if Length (Dummy) > 7 then :Result := :Result; end if;" & " end;"); Stmt0 : Statement := Prepare (Connect, "begin :Result := '1234567'; end;"); Stmt1 : Statement := Prepare (Connect, "begin " & " :Out1 := :In1;" & " :Out2 := :In2;" & " :Out3 := :In3;" & " end;"); Stmt2 : Statement := Prepare (Connect, "begin " & " :Out1 := :In1;" & " :Out2 := :In2;" & " :Out3 := :In3;" & " if :Out3 <> :In3 then" & " :In3 := :Out3;" & " end if;" & " end;"); Stmt3 : Statement := Prepare (Connect, "begin " & " :Out1 := :In1;" & " :Out2 := :In2;" & " :Out3 := :In3;" & " if :Out1 <> :In1 then" & " :In1 := :Out1;" & " end if;" & " end;"); Result, In1, In2, In3, Out1, Out2, Out3, Order : Var_Type; procedure Show_Result; procedure Show_In_Out; procedure Show_Out; procedure Show_Out_Null; procedure Bind_In_Out (Stmt : in out Statement); function Three_Columns (C1, C2, C3 : String) return String; ----------------- -- Bind_In_Out -- ----------------- procedure Bind_In_Out (Stmt : in out Statement) is begin Bind (Stmt, In1, "In1"); Bind (Stmt, In2, "In2"); Bind (Stmt, In3, "In3"); Bind (Stmt, Out1, "Out1"); Bind (Stmt, Out2, "Out2"); Bind (Stmt, Out3, "Out3"); end Bind_In_Out; ----------------- -- Show_Result -- ----------------- procedure Show_Result is begin if Is_Null (Result) then Ada.Text_IO.Put_Line ("Result is null"); else Ada.Text_IO.Put_Line ("Result " & Value (Result) & ';'); end if; end Show_Result; -------------- -- Show_Out -- -------------- procedure Show_Out is begin Ada.Text_IO.Put (Value (Out1) & ' '); Ada.Text_IO.Put (Value (Out2) & ' '); Ada.Text_IO.Put (Value (Out3) & ' '); Ada.Text_IO.New_Line; end Show_Out; procedure Show_Out_Null is begin Ada.Text_IO.Put (Value (Out1, "(null)") & ' '); Ada.Text_IO.Put (Value (Out2, "(null)") & ' '); Ada.Text_IO.Put (Value (Out3, "(null)") & ' '); Ada.Text_IO.New_Line; end Show_Out_Null; ----------------- -- Show_In_Out -- ----------------- procedure Show_In_Out is begin Ada.Text_IO.Put (Value (In1) & ' '); Ada.Text_IO.Put (Value (In2) & ' '); Ada.Text_IO.Put (Value (In3) & ' '); Ada.Text_IO.New_Line; Show_Out; end Show_In_Out; ------------------- -- Three_Columns -- ------------------- function Three_Columns (C1, C2, C3 : String) return String is begin return "select '" & C1 & "' C1, '" & C2 & "' C2, '" & C3 & "' C3 from dual" & ASCII.Lf; end Three_Columns; Stmt4 : Statement := Prepare (Connect, Three_Columns ("", "1", "22") & "union all" & ASCII.Lf & Three_Columns ("22", "1", "") & "union all" & ASCII.Lf & Three_Columns ("333", "22", "1") & "union all" & ASCII.Lf & Three_Columns ("1", "22", "333") & "union all" & ASCII.Lf & Three_Columns ((1 .. 64 => '=', 65 => '!'), "", "") & "union all" & ASCII.Lf & Three_Columns ("", (1 .. 62 => '_', 63 => '^'), "") & "union all" & ASCII.Lf & Three_Columns ("1", "22", (1 .. 63 => '-', 64 => '.')) & "union all" & ASCII.Lf & Three_Columns ("aaaa", "bbb", 50 * (1 => ASCII.LF, 2 .. 79 => '~', 80 => '.')) ); Stmt5 : Statement := Prepare (Connect, Three_Columns ("first", "second", "third") & "union all" & ASCII.Lf & Three_Columns ("first", "second", "third") & "union all" & ASCII.Lf & Three_Columns ("first", "second", "third.") & "union all" & ASCII.Lf & Three_Columns ("first", "second.", "third") & "union all" & ASCII.Lf & Three_Columns ("first.", "second", "third") & "union all" & ASCII.Lf & Three_Columns ("first", "second", "third.") & "union all" & ASCII.Lf & Three_Columns ("first", "second.", "third") & "union all" & ASCII.Lf & Three_Columns ("first.", "second", "third")); begin Bind (Stmt0, Result, "Result"); Execute (Stmt0); Show_Result; Bind (Stmt, Result, "Result"); Ada.Text_IO.Put_Line ("binded"); Set_Value (Result, 2 * "aBcDeFgH." & "=_"); Ada.Text_IO.Put_Line ("execute"); Execute (Stmt); Ada.Text_IO.Put_Line ("done"); Show_Result; Set_Value (Result, "12345"); Ada.Text_IO.Put_Line ("execute"); Execute (Stmt); Ada.Text_IO.Put_Line ("done"); Show_Result; Clear_Value (Result); Ada.Text_IO.Put_Line ("execute"); Execute (Stmt); Ada.Text_IO.Put_Line ("done"); Show_Result; Bind_In_Out (Stmt1); Set_Value (In1, "11"); Set_Value (In2, "2222"); Set_Value (In3, "333333"); Execute (Stmt1); Show_In_Out; Bind_In_Out (Stmt2); Set_Value (In1, "1"); Set_Value (In2, "22"); Set_Value (In3, "333"); Execute (Stmt2); Show_In_Out; Set_Value (In1, "111111111"); Set_Value (In2, "222222"); Set_Value (In3, "333"); Execute (Stmt2); Show_In_Out; Bind_In_Out (Stmt3); Set_Value (In3, (1 .. 63 => '-', 64 => '!')); Execute (Stmt3); Show_In_Out; Set_Value (In1, (1 .. 63 => '=', 64 => '!')); Set_Value (In3, "3"); Execute (Stmt3); Show_In_Out; Execute (Stmt4); Define (Stmt4, Out1, 1); Define (Stmt4, Out2, 2); Define (Stmt4, Out3, 3); while Fetch (Stmt4) loop Show_Out_Null; end loop; Execute (Stmt5); Define (Stmt5, Out1, 1); Define (Stmt5, Out2, 2); Define (Stmt5, Out3, 3); while Fetch (Stmt5) loop Show_Out_Null; end loop; end Dyn_Bind; gnade-1.6.2.orig/samples/oci/dyn_def.adb0000644000175000017500000000377710536751602017716 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Thin Ada95 binding to OCI™ (Oracle® Call Interface™) -- -- Copyright (C) 2000-2004 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: dyn_def.adb,v 1.8 2006/12/10 09:29:38 merdmann Exp $ -- Example of using dynamically allocated define variables. with OCI.Thick.Connections; with OCI.Thick.Statements; with OCI.Thick.Parameters; with Ada.Text_IO; with OCI.Thick.Strings; procedure Dyn_Def is use Ada.Text_IO; use OCI.Thick; use OCI.Thick.Connections; use OCI.Thick.Statements; use OCI.Thick.Strings; Connect : Connection := Logon ("scott/tiger"); Sel : Statement := Prepare (Connect, "select * from emp"); begin Execute (Sel); declare use OCI.Thick.Parameters; Params : Parameter_Array := Get_Parameters (Sel); Result : array (Params'Range) of Variable; begin for i in Params'Range loop Put (Name (Params (i)) & ASCII.HT); Put (Type_Name (Params (i))); Put (SQL_Type'Image (Get_SQL_Type (Params (i)))); Put (Natural'Image (Data_Size (Params (i)))); Put (Integer'Image (Precision (Params (i)))); Put (Integer'Image (Scale (Params (i))) & ASCII.HT); Put (Boolean'Image (Is_Null (Params (i)))); Put_Line (Schema_Name (Params (i))); Define (Sel, Result (i), i); end loop; Put_Line ("Fetch"); while Fetch (Sel) loop Put (Integer'Image (Rows_Processed (Sel)) & ". "); for i in Result'Range loop if Is_Null (Result (i)) then Put ("(null)"); else Put (Value (Result (i))); end if; Put ("; "); end loop; New_Line; end loop; end; Put_Line ("Done."); end Dyn_Def; gnade-1.6.2.orig/samples/oci/gnade-oci-samples.gpr0000644000175000017500000000324310670450003021612 0ustar lbrentalbrenta-- $Id: gnade-oci-samples.gpr,v 1.1 2007/09/08 07:32:19 persan Exp $ with "../../gnade"; with "../../dbi/oci/gnade-oci.gpr"; project Gnade.oci.Samples is for Languages use ("Ada"); for Source_Dirs use ("."); for Object_Dir use Gnade'Object_Dir; for Exec_Dir use Gnade'Exec_Dir; for Main use ("blocking.adb", "date.adb", "dbind.adb", "ddef.adb", "debug.adb", "dec_conv_test.adb", "demo.adb", "dyn.adb", "dyn_bind.adb", "dyn_def.adb", "invalid.adb", "in_null.adb", "mspeed.adb", "object_test.adb", "ocimem.adb", "subscr.adb", "subscr2.adb", "subscriber.adb", "subscriber.ads", "test.adb", "test_dbi.adb", "test_lob.adb", "test_num.adb", "test_numb.adb", "unsigned_conv_test.adb"); for Exec_Dir use Gnade'Exec_Dir; package Builder is for Default_Switches ("Ada") use gnade.Builder'Default_Switches ("Ada"); end Builder; package Compiler is for Default_Switches ("Ada") use gnade.Compiler'Default_Switches ("Ada"); end Compiler; package Binder is for Default_Switches ("Ada") use gnade.Binder'Default_Switches ("Ada"); end Binder; package Linker is for Default_Switches ("Ada") use gnade.Linker'Default_Switches ("Ada"); end Linker; package Ide is for Vcs_Kind use "CVS"; end Ide; end Gnade.oci.Samples; gnade-1.6.2.orig/samples/oci/in_null.adb0000644000175000017500000000302110444471722017724 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Thin Ada95 binding to OCI™ (Oracle® Call Interface™) -- -- Copyright (C) 2000-2006 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: in_null.adb,v 1.1 2006/06/16 09:03:14 vagul Exp $ -- Example of untouched null value. with Ada.Strings.Fixed; with Ada.Text_IO; with OCI.Thick.Connections; with OCI.Thick.Statements; with OCI.Thick.Strings; procedure In_Null is use OCI.Thick; use OCI.Thick.Connections; use OCI.Thick.Statements; use OCI.Thick.Strings; use Ada.Strings.Fixed; Connect : Connection := Logon ("scott/tiger"); Stmt : Statement := Prepare (Connect, "begin if :result1 is not null then" & " :result1 := 'eeeeeeeeeeeee';" & " end if;" & " end;"); Result1 : Var_Type; procedure Show_Result; ----------------- -- Show_Result -- ----------------- procedure Show_Result is begin if Is_Null (Result1) then Ada.Text_IO.Put_Line ("Result1 is null"); else Ada.Text_IO.Put_Line ("Result1 " & Value (Result1) & ';'); end if; end Show_Result; begin Bind (Stmt, Result1, "result1"); Ada.Text_IO.Put_Line ("binded"); Clear_Value (Result1); Ada.Text_IO.Put ("execute"); Execute (Stmt); Ada.Text_IO.Put_Line ("d"); Show_Result; end In_Null; gnade-1.6.2.orig/samples/oci/invalid.adb0000644000175000017500000000267610444471722017731 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Thin Ada95 binding to OCI™ (Oracle® Call Interface™) -- -- Copyright (C) 2006 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: invalid.adb,v 1.1 2006/06/16 09:03:14 vagul Exp $ -- Example of invalid statement. with Ada.Text_IO, OCI.Thick.Connections, OCI.Thick.Statements; procedure Invalid is use OCI.Thick; use Ada.Text_IO; Connect : Connections.Connection := Connections.Logon (Server_Name => "", User => "scott", Password => "tiger"); -- Using the OCI.Thick.Connections package. -- Logon to the database and creating database connection Stmt_Text : String := "eeeeeselect " & "OBJECT_NAME, " -- VARCHAR2(128) & "OBJECT_TYPE, " -- VARCHAR2(18) & "OBJECT_ID, " -- NUMBER & "CREATED " -- DATE & "from user_objects where STATUS"; Stmt : Statements.Statement; begin -- We can see the server version information. Put_Line (Connections.Server_Version (Connect)); New_Line; Stmt := Statements.Prepare (Connect, Stmt_Text); Put_Line (Statements.Statement_Type'Image (Statements.Type_Of_Statement (Stmt))); Statements.Execute (Stmt); end Invalid; gnade-1.6.2.orig/samples/oci/mklib80.bat0000755000175000017500000000113607432411405017555 0ustar lbrentalbrentaecho off rem ---------------------------------------------------------- rem -- The batch file to create static import library -- rem -- for the OCI.DLL under the Win32 platforms for the -- rem -- Oracle version 8.0.x. -- rem -- The ORACLE_HOME environment variable should be -- rem -- properly set before the call of this batch file. -- rem ---------------------------------------------------------- dll2def %ORACLE_HOME%/bin/OCI.dll > OCI.def gnatdll -e OCI.def -d OCI.dll gcc -c ../oci-envcreate80.adb ar -r libOCI.a oci-envcreate80.o pausegnade-1.6.2.orig/samples/oci/mklib8i.bat0000755000175000017500000000073507432411405017652 0ustar lbrentalbrentaecho off rem ---------------------------------------------------------- rem -- The batch file to create static import library -- rem -- for the OCI.DLL under the Win32 platforms. -- rem -- The ORACLE_HOME environment variable should be -- rem -- properly set before the call of this batch file. -- rem ---------------------------------------------------------- dll2def %ORACLE_HOME%/bin/OCI.dll > OCI.def gnatdll -e OCI.def -d OCI.dll pausegnade-1.6.2.orig/samples/oci/mspeed.adb0000644000175000017500000000374710743333234017555 0ustar lbrentalbrentawith Ada.Calendar; with Ada.Command_Line; with Ada.Text_IO; with OCI.Thick.DB; with OCI.Thick.Containers; with OCI.Thick.Connections; with OCI.Thick.Number_Functions; procedure MSpeed is use Ada.Text_IO; use OCI.Thick; use OCI.Thick.Connections; use OCI.Thick.Containers; use OCI.Thick.DB; Int : Natural := 0; Stamp : Ada.Calendar.Time; Int_Count : constant := 100; function Connect_String return String; procedure In_Data (Data : out Data_Holder; Position : in Positive; Iteration : in Positive); procedure Out_Data (Data : in Data_Holder; Position : in Positive; Iteration : in Positive); procedure In_Data (Data : out Data_Holder; Position : in Positive; Iteration : in Positive) is begin Data := To_Data (Int); end In_Data; procedure Out_Data (Data : in Data_Holder; Position : in Positive; Iteration : in Positive) is begin Int := Value (Data); end Out_Data; function Connect_String return String is begin if Ada.Command_Line.Argument_Count >= 1 then return Ada.Command_Line.Argument (1); else return "scott/tiger"; end if; end Connect_String; Connect : Connection := Logon (Connect_String); Inc_Int : Statement := Prepare (Connect, "begin :Int := :Int + 1; end;"); procedure Show_Duration is use Ada.Calendar; begin Put_Line ("spend " & Duration'Image (Clock - Stamp)); end Show_Duration; begin Bind (Inc_Int, Type_Integer, 1); Stamp := Ada.Calendar.Clock; for J in 1 .. Int_Count loop Execute (Inc_Int, In_Data'Access, Out_Data'Access); end loop; Show_Duration; Int := 0; Stamp := Ada.Calendar.Clock; Execute (Inc_Int, In_Data'Access, Out_Data'Access, Count => Int_Count); Show_Duration; Put_Line ("Int" & Int'Img); end MSpeed;gnade-1.6.2.orig/samples/oci/object_test.adb0000644000175000017500000000600210444477475020606 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Thin Ada95 binding to OCI™ (Oracle® Call Interface™) -- -- Copyright (C) 2006 Maxim Reznik. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ with Ada.Text_IO; with Ada.Command_Line; with OCI.Lib; with OCI.Thick.Object; with OCI.Thick.Statements; with OCI.Thick.Connections; with OCI.Thick.String_Bounded; with OCI.Thick.Number_Functions; procedure Object_Test is use OCI.Thick; use type OCI.Lib.Sb2; -- Execute this in database: -- create or replace type Test as object (Left Integer, Right Integer); type Object_Node is record Left, Right : OCINumber; end record; -- Corresponding Ada type type Indicator is record Whole : OCI.Lib.Sb2; -- object is null Left, Right : OCI.Lib.Sb2; -- field is null end record; -- Corresponding nullity information package Test_Type is new Object (Object_Node, Indicator, Type_Name => "TEST"); Session : constant Connections.Connection := Connections.Logon (Ada.Command_Line.Argument (1)); Stmt : Statements.Statement; Text : String_Bounded.Variable (10); Var : Test_Type.Variable; begin -- Use object as IN parameter Test_Type.Create (Session, Var); Test_Type.Get_Value (Var).all.Left := Number_Functions.To_Number ("1", "99"); Test_Type.Get_Value (Var).all.Right := Number_Functions.To_Number ("2", "99"); Test_Type.Get_Indicator (Var).all := (others => OCI.Lib.Not_Null_Indicator); Stmt := Statements.Prepare (Session, "declare X Test := :Param; begin :Res := X.Left + X.Right; end;"); Test_Type.Bind (Stmt, Var, 1); String_Bounded.Bind (Stmt, Text, 2); Statements.Execute (Stmt); Ada.Text_IO.Put_Line ("1 + 2 = " & String_Bounded.Get_Value (Text)); -- Use object as OUT parameter Stmt := Statements.Prepare (Session, "begin :Result := Test(2, 1); end;"); Test_Type.Bind (Stmt, Var, 1); Statements.Execute (Stmt); declare Result : constant Object_Node := Test_Type.Get_Value (Var); Ind : constant Indicator := Test_Type.Get_Indicator (Var); begin if Ind.Whole = OCI.Lib.Null_Indicator then Ada.Text_IO.Put_Line ("This is null object"); else if Ind.Whole = OCI.Lib.Null_Indicator then Ada.Text_IO.Put_Line ("Result.Left is null"); else Ada.Text_IO.Put_Line ("Result.Left=" & Number_Functions.To_String (Result.Left, "99")); end if; if Ind.Whole = OCI.Lib.Null_Indicator then Ada.Text_IO.Put_Line ("Result.Right is null"); else Ada.Text_IO.Put_Line ("Result.Right=" & Number_Functions.To_String (Result.Right, "99")); end if; end if; end; Test_Type.Free (Var); end Object_Test; gnade-1.6.2.orig/samples/oci/ocimem.adb0000644000175000017500000000737510444471722017555 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Thin Ada95 binding to OCI™ (Oracle® Call Interface™) -- -- Copyright (C) 2006 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: ocimem.adb,v 1.1 2006/06/16 09:03:14 vagul Exp $ -- Test for simultaneous multitasking connect. with Ada.Exceptions; with Ada.Text_IO; with Ada.Unchecked_Deallocation; with OCI.Thick.Connections; with System; procedure OCIMem is use Ada.Text_IO; use type System.Address; type Element is mod 2**8; type Array_Type is array (1 .. 4096) of Element; type List_Record; type List_Access is access all List_Record; type List_Record is record Data : Array_Type; Prev : List_Access; Next : List_Access; end record; List_Length : constant := 100_000; Sample : Array_Type; First : List_Access; Last : List_Access; C : List_Access; Char : Character; procedure Test_Link; procedure Free is new Ada.Unchecked_Deallocation (List_Record, List_Access); task type DB_Connection; protected Start_Line is entry Wait (You_Number : out Positive); procedure Start; private Go : Boolean := False; Count : Natural := 0; end Start_Line; ---------------- -- Start_Line -- ---------------- protected body Start_Line is entry Wait (You_Number : out Positive) when Go is begin Count := Count + 1; You_Number := Count; end Wait; procedure Start is begin Go := True; end Start; end Start_Line; --------------- -- Test_Link -- --------------- procedure Test_Link is begin C := First; while C /= null loop if C.Data /= Sample then Put_Line ("Data broken."); raise Program_Error; end if; if C.Next /= null and then C.Data'Address > C.Next.Data'Address then Put_Line ("Less address"); end if; C := C.Next; end loop; end Test_Link; ------------------- -- DB_Connection -- ------------------- task body DB_Connection is package OTC renames OCI.Thick.Connections; My_Number : Positive; OC : OTC.Connection; begin Start_Line.Wait (My_Number); OC := OTC.Logon ("scott/tiger"); if My_Number = 3 then Put_Line (OTC.Server_Version (OC)); end if; exception when E : others => Put_Line (Ada.Exceptions.Exception_Information (E)); end DB_Connection; DBC : array (1 .. 8) of DB_Connection; begin for J in Sample'Range loop Sample (J) := Element (J mod Element'Modulus); end loop; for J in 1 .. List_Length loop C := Last; Last := new List_Record'(Data => Sample, Prev => Last, Next => null); if C = null then First := Last; else C.Next := Last; end if; if J rem 1025 = 0 then Put_Line (Integer'Image (J mod Element'Modulus)); end if; end loop; Test_Link; Put_Line ("Tested 1."); for J in 1 .. 10 loop C := First; First := First.Next; Free (C); end loop; First.Prev := null; C := new List_Record'(Sample, Prev => null, Next => First); First.Prev := C; First := C; Start_Line.Start; Put_Line ("DB started."); delay 10.0; Get_Immediate (Char); Test_Link; Put_Line ("Tested 2."); Get_Immediate (Char); end OCIMem; gnade-1.6.2.orig/samples/oci/readme.txt0000644000175000017500000000276310607573446017635 0ustar lbrentalbrentaThe Ada95 Interface to Oracle® RDBMS™ is depend only from Oracle Call Interface library (OCI). The applications using the OCI should be linked with a static or dynamic OCI libraries provided by Oracle corporation. The descriptions of linking for the different UNIX platforms is in the "Oracle Administrator's Reference" chapters "Oracle Call Interface" and "Oracle Precompiler and Oracle Call Interface Linking and Makefiles" There are written that for the UNIX platforms you should do linking like the $ORACLE_HOME/rdbms/demo/demo_rdbms.mk does. Usually it is linking with libclntsh.so shared library. You could use linking switches -L${ORACLE_HOME}/lib -lclntsh. The descriptions of linking for the Win32 platforms is in the "Oracle Call Interface Getting Started Release 8.X.X for Windows NT" topic "Building OCI Applications" chapter "Linking OCI Applications" There are written that under the Win32 platform you should just link with the OCI.DLL file from the %ORACLE_HOME%/bin directory. Oracle corp. provides the import static library for linking with OCI.DLL. It is in the %ORACLE_HOME%/oci/lib/msvc/oci.lib Or you can make the import static libraries youself by using the mklib8i.bat (for versions 8.1.5 and later) or mklib80.bat (for the versions 8.0.x). Author: Dmitriy Anisimkov Contributors: OCI External Procedures Call binding and DB Change notification provided by Maxim Reznik Some serious bug reports provided by Frank Piron gnade-1.6.2.orig/samples/oci/samples.gpr0000644000175000017500000000250110636147625020001 0ustar lbrentalbrentawith "../../dbi/oci/oci.gpr"; project Samples is type OS_Type is ("Unix", "Windows_NT"); OS : OS_Type := external ("OS", "Unix"); for Languages use ("Ada"); for Source_Dirs use ("."); for Object_Dir use "."; for Main use ("blocking.adb", "date.adb", "dbind.adb", "ddef.adb", "debug.adb", "demo.adb", "dyn.adb", "dyn_bind.adb", "dyn_def.adb", "subscr.adb", "subscr2.adb", "test_lob.adb", "test.adb", "dec_conv_test.adb", "in_null.adb", "invalid.adb", "ocimem.adb", "test_num.adb", "test_numb.adb", "mspeed.adb", "unsigned_conv_test.adb"); package Builder is for Default_Switches ("ada") use ("-g", "-gnatQ"); end Builder; package Linker is case OS is when "Unix" => for Default_Switches ("ada") use ("-g", "-L" & external ("ORACLE_HOME") & "/lib", "-lclntsh"); when "Windows_NT" => for Default_Switches ("ada") use ("-g", "-L" & external ("ORACLE_HOME") & "/oci/lib/msvc", "-loci"); end case; end Linker; package Compiler is for Default_Switches ("ada") use ("-g", "-gnat05", "-gnaty"); for Default_Switches ("c") use ("-g"); for Default_Switches ("c++") use ("-g"); end Compiler; end Samples; gnade-1.6.2.orig/samples/oci/subscr.adb0000644000175000017500000000271310536751602017574 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Thin Ada95 binding to OCI™ (Oracle® Call Interface™) -- -- Copyright (C) 2000-2004 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- Anonymous Publish-Subscribe Example. -- Working only with Oracle 8.1.7 and later. -- $Id: subscr.adb,v 1.8 2006/12/10 09:29:38 merdmann Exp $ with Ada.Text_IO; with Ada.Command_Line; with Subscriber; with OCI.Thick.Connections; with OCI.Thick.Notifications; procedure Subscr is use OCI.Thick.Connections; use Subscriber; use Ada.Text_IO; Connect : Connection; Consumer : Subscriber_Type; begin Put_Line ("========="); if Ada.Command_Line.Argument_Count = 1 then Connect := Logon (Ada.Command_Line.Argument (1)); else Connect := Logon ("scott/tiger"); end if; Create (Consumer, "test_subscr_notification", OCI.Thick.Notifications.Anonymous); Register (Consumer, Connect); Enable (Consumer); loop declare Line : String (1 .. 80); Last : Natural; begin Put ('>'); Get_Line (Line, Last); exit when Line (1 .. Last) = "exit"; Post (Consumer, Connect, Line (1 .. Last)); end; end loop; Unregister (Consumer); end Subscr; gnade-1.6.2.orig/samples/oci/subscr2.adb0000644000175000017500000000241110636147625017656 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Ada95 Interface to Oracle RDBMS -- -- Copyright (C) 2006 Maxim Reznik -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- DB Change notification Example. -- Working only with Oracle 10.2 and later. -- $Id: subscr2.adb,v 1.2 2007/06/20 06:56:21 vagul Exp $ with Ada.Text_IO; with Ada.Command_Line; with Change_Subscriber; with OCI.Thick.Statements; with OCI.Thick.Connections; procedure Subscr2 is use OCI.Thick.Statements; use OCI.Thick.Connections; use Change_Subscriber; use Ada.Text_IO; Connect : Connection; Consumer : Subscriber_Type; Query : Statement; begin Put_Line ("========="); if Ada.Command_Line.Argument_Count = 1 then Connect := Logon (Ada.Command_Line.Argument (1)); else Connect := Logon ("scott/tiger"); end if; Create (Consumer, Need_Rowids => True); Query := Prepare (Connect, "select * from acct"); Register (Consumer, Connect); Associate (Consumer, Query); delay 30.0; Unregister (Consumer); end Subscr2; gnade-1.6.2.orig/samples/oci/subscriber.adb0000644000175000017500000000143010536751602020431 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Thin Ada95 binding to OCI™ (Oracle® Call Interface™) -- -- Copyright (C) 2000-2004 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: subscriber.adb,v 1.6 2006/12/10 09:29:38 merdmann Exp $ with Ada.Text_IO; package body Subscriber is ------------ -- Notify -- ------------ procedure Notify (Item : in out Subscriber_Type; Buffer : in Buffer_Type) is pragma Unreferenced (Item); begin Ada.Text_IO.Put_Line ("Data " & To_String (Buffer)); end Notify; end Subscriber; gnade-1.6.2.orig/samples/oci/subscriber.ads0000644000175000017500000000132410536751602020454 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Thin Ada95 binding to OCI™ (Oracle® Call Interface™) -- -- Copyright (C) 2000-2004 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: subscriber.ads,v 1.6 2006/12/10 09:29:38 merdmann Exp $ with OCI.Thick.Notifications; package Subscriber is use OCI.Thick.Notifications; type Subscriber_Type is new Subscription with null record; procedure Notify (Item : in out Subscriber_Type; Buffer : in Buffer_Type); end Subscriber; gnade-1.6.2.orig/samples/oci/test.adb0000644000175000017500000001442210607576175017263 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Thin Ada95 binding to OCI™ (Oracle® Call Interface™) -- -- Copyright (C) 2000-2007 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: test.adb,v 1.11 2007/04/13 03:43:57 vagul Exp $ with Text_IO, Ada.Integer_Text_IO, Ada.Long_Float_Text_IO, Ada.Strings.Unbounded, Ada.Exceptions, OCI.Thick.Date, OCI.Thick.Integer_Var, OCI.Thick.OCIDate_Var, OCI.Thick.Long_Float_Var, OCI.Thick.OCINumber_Var, OCI.Thick.String_Var, OCI.Thick.String_Bounded, OCI.Thick.Servers, OCI.Thick.Connections, OCI.Thick.Statements, OCI.Thick.Parameters, OCI.Thick.Number_Functions, OCI.Thick.Debug_Allocation, OCI.Environments, OCI.Thick.Strings; procedure Test is use Text_IO, OCI.Thick; use Ada.Integer_Text_IO, Ada.Long_Float_Text_IO, Ada.Strings.Unbounded, Long_Float_Var, Integer_Var, String_Bounded, OCIDate_Var, OCINumber_Var, String_Var, Connections, Servers, Statements, Parameters, Strings, Number_Functions; procedure Main; procedure Main is Strv : Strings.Variable; Strb : String_Bounded.Variable (64); Int : Integer_Var.Variable; Flt : Long_Float_Var.Variable; Numb : OCINumber_Var.Variable; Date : OCIDate_Var.Variable; Param : Parameter; Stmt : Statement; Connect : Connection; DB : Server := Attach (""); oNumb1, oNumb2 : OCINumber; Null_Descr : array (Boolean) of String (1 .. 8) := (False => "NOT NULL", True => " NULL"); begin Connect := Logon (DB, "scott", "tiger"); Put_Line ("Main"); Put_Line ("Connected"); Put_Line (Server_Version (Connect)); Execute (Connect, "alter session set nls_date_format='YYYY-MM-DD HH24:MI:SS'"); Stmt := Prepare (Connect, "select " & "object_name, " & "timestamp, " & "OBJECT_ID, " & "sysdate - created, " & "sysdate-Last_ddl_Time, " & "Last_ddl_Time" & ASCII.Lf & "from user_objects " & "where object_id > :id " & ASCII.Lf & "and object_id < :id + 10000000 and object_name <> :objtype"); declare Names : VStrings := Statements.Bind_Names (Stmt); begin Put_Line ("---------"); for i in Names'Range loop Put_Line (To_String (Names (i))); end loop; end; Bind (Stmt, Strb, "objtype"); Set_Value (Strb, "TABLE"); Bind (Stmt, Int, 1); Set_Value (Int, 2); Execute (Stmt); declare Columns : Parameter_Array := Get_Parameters (Stmt); begin for i in Columns'Range loop Set_Col (01); Put (Name (Columns (i))); Set_Col (25); Put (SQL_Type'Image (Get_SQL_Type (Columns (i)))); Set_Col (38); Put (Type_Name (Columns (i))); Set_Col (40); Put (Integer'Image (Data_Size (Columns (i)))); Set_Col (45); Put (Integer'Image (Precision (Columns (i)))); Set_Col (50); Put (Integer'Image (Scale (Columns (i)))); Set_Col (55); Put (Null_Descr (Is_Null (Columns (i)))); Set_Col (65); Put (Schema_Name (Columns (i))); end loop; -- Param := Columns(1); end; Define (Stmt, Strv, 1); Define (Stmt, Strb, 2); Define (Stmt, Int, 3); Define (Stmt, Flt, 4); Define (Stmt, Numb, 5); Define (Stmt, Date, 6); -- Set_Value(Strv,(1..230=> ' ')); while Fetch (Stmt) loop Set_Col (1); Put (Get_Value (Strv) & ','); Set_Col (16); Put (Get_Value (Strb)); Set_Col (35); Put (Get_Value (Int), Width => 6); Set_Col (42); Put (Get_Value (Flt), Aft => 3, Exp => 0); Set_Col (50); Put (To_String (Get_Value (Numb), "FM999990.99999")); Set_Col (60); Put (OCI.Thick.Date.To_String (Get_Value (Date), "DD Mon RRRR HH24:MI:SS")); end loop; Set_Col (1); Stmt := Prepare (Connect, "begin :result := (sysdate - :client_time)*60*60*24; " & "end;"); Bind (Stmt, Numb, ":result"); Set_Value (Numb, To_Number (4.0)); Bind (Stmt, Date, ":client_time"); Set_Value (Date, OCI.Thick.Date.SysDate); -- client local time Put_Line ("Client time : " & OCI.Thick.Date.To_String (Get_Value (Date), "Day Ddspth Month Yyyyspth HH24:MI:SS")); Execute (Stmt); Put_Line ("Time difference : " & To_String (Get_Value (Numb), "FM999990.099") & " seconds"); oNumb1 := Get_Value (Numb); oNumb2 := abs (oNumb1); Put ("Time difference : "); Put_Line (To_String (oNumb1, "FM999990.099") & " seconds"); Put_Line (To_String (To_Number (To_Long_Float (-oNumb2)), "FM9999999.099999")); Put_Line (To_String (oNumb2, "FM999990.099")); oNumb1 := To_Number (0.5); oNumb2 := oNumb1 + oNumb2; oNumb2 := ArcTan2 (oNumb1, oNumb2); Put_Line ("Arc"); Put_Line (To_String (oNumb2, "FM999990.099")); Put_Line ("---------------------"); OCI.Thick.Debug_Allocation.Print_Info; Put_Line ("Memory allocation count " & Integer'Image (OCI.Environments.Counter.Value) & ASCII.LF & "Last allocated size " & Integer'Image (OCI.Environments.Last_Size) ); exception when E : Lib_Error => Put_Line (Last_Error_Message); when E : others => Put_Line (Ada.Exceptions.Exception_Information (E)); end Main; -- remove comments below to check multitasking task type Parallel is entry Start; entry Wait; end Parallel; task body Parallel is begin accept Start; Main; accept Wait; end Parallel; p : array (1 .. 1) of Parallel; begin Put_Line ("Start"); OCI.Thick.Debug_Allocation.Start; Put_Line ("Started"); for i in p'Range loop p (i).Start; end loop; Main; for i in p'Range loop p (i).Wait; end loop; end Test; gnade-1.6.2.orig/samples/oci/test_dbi.adb0000644000175000017500000002444711007557661020103 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Thin Ada95 binding to OCI (Oracle Call Interface) -- -- Copyright (C) 2006-2007 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: test_dbi.adb,v 1.11 2008/05/05 10:21:37 vagul Exp $ -- Example of using dynamically allocated bind variables. with Ada.Calendar; with Ada.Command_Line; with Ada.Strings.Fixed; with Ada.Text_IO; with GNAT.MD5; -- easy could be removed for non GNAT Ada compiler. with OCI.Thick.DB; with OCI.Thick.Containers.Strings; with OCI.Thick.Connections; with OCI.Thick.Lobs; with OCI.Thick.Number_Functions; procedure Test_DBI is -- TODO: non-blocking support use Ada.Text_IO; use OCI.Thick; use OCI.Thick.Connections; use OCI.Thick.Containers; use OCI.Thick.DB; use ASCII; Stmt : Statement := Prepare ("declare" & LF & " Dfmt Varchar2 (24) := 'YYYY-MM-DD HH24:MI:SS';" & LF & " function Short_Image (Item Varchar2) return Varchar2 is" & LF & " begin" & LF & " if Length (Item) < 32 then" & LF & " return Item;" & LF & " else" & LF & " return Lower (DBMS_Obfuscation_Toolkit.MD5" & LF & " (Input => UTL_RAW.Cast_To_RAW (Item)))" & LF & " || ':' || Length (Item);" & LF & " end if;" & LF & " end Short_Image;" & LF & "begin " & LF & " DBMS_Output.Put ('#1 ' || NVL (To_Char (:Int1), 'nul'));" & " DBMS_Output.Put (' ' || NVL (To_Char (:Date1, Dfmt), 'nul'));" & LF & " DBMS_Output.Put (' ' || NVL (To_Char (:Float1), 'nul'));" & LF & " DBMS_Output.Put (' ' || NVL (To_Char (:Numb1), 'nul'));" & LF & " DBMS_Output.Put_Line (' ' || NVL (:Str1, 'nul'));" & LF & " DBMS_Output.Put ('#2 ' || NVL (To_Char (:Int2), 'nul'));" & " DBMS_Output.Put (' ' || NVL (To_Char (:Date2, Dfmt), 'nul'));" & LF & " DBMS_Output.Put (' ' || NVL (To_Char (:Float2), 'nul'));" & LF & " DBMS_Output.Put (' ' || NVL (To_Char (:Numb2), 'nul'));" & LF & " DBMS_Output.Put_Line (' ' || Short_Image (NVL (:Str2, 'nul')));" & LF & " case NVL (:Int1, :Int2)" & LF & " when 1 then :Int1 := 111;" & LF & " when 2 then :Str2 := 'STR-2.';" & LF & " :Date1 := :Date1 + 1;" & LF & " when 3 then :Float1 := 7000000;" & LF & " :Date1 := To_Date ('2006-10-18 13:21:24', Dfmt);" & LF & "for J in 0 .. 3199 loop" & LF & " if J rem 80 = 0 then" & LF & " :Str2 := :Str2 || Chr (10);" & LF & " else" & LF & " :Str2 := :Str2 || (J rem 10);" & LF & " end if;" & LF & "end loop;" & LF & " end case;" & LF & " end;"); Ind4 : constant String := "/-\|"; function Connect_String return String is begin if Ada.Command_Line.Argument_Count >= 1 then return Ada.Command_Line.Argument (1); else return "scott/tiger"; end if; end Connect_String; Stmt2 : Statement := Prepare ("select * from Emp order by EmpNo"); Stmt3 : Statement := Prepare ("select RowNum, E1.EMPNO, E2.EMPNO, E3.EMPNO," & " LPad ('@', RowNum, '1234567890')" & " from Emp E1, Emp E2, Emp E3 order by 1, 2, 3, 4"); DE : constant array (Boolean) of Character := (False => ASCII.HT, True => ASCII.LF); Connect : Connection := Logon (Connect_String); Stmt_Output : Statement := Prepare (Connect, "begin" & " DBMS_Output.Get_Line " & " (Line => :Output, Status => :Status);" & " end;"); Inc_Str : Statement := Prepare (Connect, "begin :Str := :Str || :Char; end;"); Str : Data_Holder := To_Data ("start" & LF); Sample : constant String := "0123456789 #()[]{}<>?.,:;_+|\/-" & "abcdefghijklmnopqrstuvwxyz" & "ABCDEFGHIJKLMNOPQRSTUVWXYZ" & LF; S_Index : Natural := 1; procedure In_Str (Data : out Data_Holder; Position, Iteration : Positive) is Idx : Positive; begin case Position is when 1 => Data := Str; when 2 => if S_Index rem 2 = 0 then Data := Null_Data; else Idx := S_Index / 2 rem Sample'Length + 1; Data := To_Data (Sample (Idx .. Idx)); end if; S_Index := S_Index + 1; when others => raise Program_Error with "Position" & Position'Img & " input absent."; end case; end In_Str; procedure Out_Str (Data : in Data_Holder; Position, Iteration : Positive) is begin if Position = 1 then Str := Data; Put (Ind4 (Iteration rem 4 + 1) & CR); else raise Program_Error with "Position" & Position'Img & " output error."; end if; end Out_Str; procedure Test_Out (Data : in Data_Holder; Position, Iteration : in Positive) is Cols : constant array (1 .. 5) of Ada.Text_IO.Count := (1, 5, 10, 15, 20); Max_Show : constant := 70; begin if Position = 1 and then Iteration /= Value (Data) then Put_Line ("error iteration" & Iteration'Img & " /=" & Image (Data)); end if; if Iteration <= Max_Show then Set_Col (Cols (Position)); Put (Image (Data)); elsif Position = 5 then declare Line : constant String := Value (Data); begin for J in Line'First .. Line'Last - 1 loop if Integer'Value ("" & Line (J)) /= J rem 10 then Put_Line ("error " & Line); end if; end loop; if Line (Line'Last) /= '@' then Put_Line ("error " & Line); end if; if Iteration = Max_Show + 1 then New_Line; else Put (Ind4 (Iteration rem 4 + 1) & CR); end if; end; end if; end Test_Out; RSet, Data, Output : Strings.Container_Type; NC : Positive; BCols : constant array (1 .. 10) of Ada.Text_IO.Count := (1, 8, 28, 35, 42, 49, 56, 76, 83, 90); Cols : constant array (1 .. 8) of Ada.Text_IO.Count := (1, 7, 14, 24, 31, 51, 56, 65); begin Execute (Connect, "begin DBMS_Output.Enable (Buffer_Size => 4096); end;"); Bind (Stmt_Output, Type_String, "Output"); Bind (Stmt_Output, Type_Integer, "Status"); Output.Name_Bind_Positions (Stmt_Output); Bind (Stmt, Type_Integer, "Int1"); Bind (Stmt, Type_Integer, "Int2"); Bind (Stmt, Type_Long_Float, "Float1"); Bind (Stmt, Type_Long_Float, "Float2"); Bind (Stmt, Type_Number, "Numb1"); Bind (Stmt, Type_Number, "Numb2"); Bind (Stmt, Type_Date, "Date1"); Bind (Stmt, Type_Date, "Date2"); Bind (Stmt, Type_String, "Str1"); Bind (Stmt, Type_String, "Str2"); Data.Name_Bind_Positions (Stmt); Ada.Text_IO.Put_Line ("binded"); for J in 1 .. 3 loop if J rem 2 = 0 then Data.Set (J, "Int1", Iteration => J); Data.Set (Long_Float (J), "Float1", Iteration => J); Data.Set (Number_Functions.To_Number (J), "Numb1", Iteration => J); Data.Set (Ada.Calendar.Time_Of (1998, 11, 22, 3660.0 + Duration (J)), "Date1", Iteration => J); Data.Set ("str" & Integer'Image (-J), "Str1", Iteration => J); else Data.Set (J, "Int2", Iteration => J); Data.Set (Long_Float (J), "Float2", Iteration => J); Data.Set (Number_Functions.To_Number (J), "Numb2", Iteration => J); Data.Set (Ada.Calendar.Time_Of (1998, 11, 22, 3660.0 + Duration (J)), "Date2", Iteration => J); Data.Set ("str" & Integer'Image (-J), "Str2", Iteration => J); end if; end loop; -- Read source code into Data. declare use Ada.Text_IO; use GNAT.MD5; File : File_Type; MD5 : Context; Length : Natural := 0; begin Open (File, In_File, "test_dbi.adb"); Data.Set ("", 10, 2); while not End_Of_File (File) loop declare Line : constant String := Get_Line (File) & ASCII.LF; begin Update (MD5, Line); Data.Append (Line, 10, 2); Length := Length + Line'Length; end; end loop; Put_Line (Digest (MD5) & Integer'Image (Length)); end; Execute (Connect, Stmt, Data); Output.Clear (1); loop Execute (Stmt_Output, Output); case Output.Get ("Status") is when 0 => Ada.Text_IO.Put_Line (Strings.Get (Output, "Output")); when 1 => exit; when others => raise Constraint_Error with Integer'Image (Output.Get ("Status")); end case; end loop; for J in 1 .. Bind_Count (Stmt) loop Set_Col (BCols (J)); Ada.Text_IO.Put (Bind_Name (Stmt, J)); end loop; for J in 1 .. Data.Length loop for K in 1 .. Bind_Count (Stmt) loop Set_Col (BCols (K)); Put (Image (Strings.Get (Data, K, J), "(null)")); end loop; end loop; Data.Clear; Execute (Connect, Stmt2); Define (Stmt2, Type_Integer, 1); Define (Stmt2, Type_String, 2); Define (Stmt2, Type_String, 3); Define (Stmt2, Type_Integer, 4); Define (Stmt2, Type_Date, 5); Define (Stmt2, Type_Number, 6); Define (Stmt2, Type_Long_Float, 7); Define (Stmt2, Type_String, 8); NC := Number_Of_Columns (Stmt2); for K in 1 .. NC loop Set_Col (Cols (K)); Put (Column_Name (Stmt2, K)); end loop; Fetch (Stmt2, RSet, 20); for J in 1 .. RSet.Length loop for K in 1 .. Number_Of_Columns (Stmt2) loop Set_Col (Cols (K)); Put (Image (Strings.Get (RSet, K, J), "(null)")); end loop; end loop; New_Line; Bind (Inc_Str, Type_String, 1); Bind (Inc_Str, Type_String, 2); Execute (Inc_Str, In_Str'Access, Out_Str'Access, Count => 6400); Put_Line (Value (Str)); Execute (Connect, Stmt3); Define (Stmt3, Type_Integer, 1); Define (Stmt3, Type_Number, 2); Define (Stmt3, Type_Number, 3); Define (Stmt3, Type_Number, 4); Define (Stmt3, Type_String, 5); if Fetch (Stmt3, Test_Out'Access, 3000) then raise Constraint_Error with "too many rows"; end if; if Is_Objects_Support then Put_Line ("Objects supported environment."); end if; Put_Line ("Done."); end Test_DBI; gnade-1.6.2.orig/samples/oci/test_lob.adb0000644000175000017500000000773310743333235020113 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Thin Ada95 binding to OCI™ (Oracle® Call Interface™) -- -- Copyright (C) 2006-2007 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: test_lob.adb,v 1.15 2008/01/16 07:47:41 vagul Exp $ -- Example of using dynamically allocated bind variables. with Ada.Calendar; with Ada.Command_Line; with Ada.Strings.Fixed; with Ada.Text_IO; with OCI.Thick.DB; with OCI.Thick.Containers; with OCI.Thick.Connections; with OCI.Thick.Lobs; procedure Test_Lob is -- TODO: non-blocking support -- !!! Multy non-blocking request fail because of Oracle Bug No. 5711162 use Ada.Text_IO; use OCI.Thick; use OCI.Thick.Connections; use OCI.Thick.Containers; use OCI.Thick.DB; use ASCII; function Connect_String return String is begin if Ada.Command_Line.Argument_Count >= 1 then return Ada.Command_Line.Argument (1); else return "scott/tiger"; end if; end Connect_String; Connect : Connection := Logon (Connect_String); Stmt_Lob : Statement := Prepare (Connect, "declare" & LF & " procedure Append (Item in Varchar2) is" & LF & " begin" & LF & " DBMS_Lob.WriteAppend (:Loc, Length (Item), Item);" & LF & " end Append;" & LF & " procedure Delay is" & LF & " pragma Autonomous_Transaction;" & LF & " Dummy Integer;" & LF & " Resource_Busy exception;" & LF & " pragma Exception_Init (Resource_Busy, -30006);" & LF & " begin" & LF & " select DeptNo into Dummy from Dept where DeptNo = 10" & LF & " for update wait 1;" & LF & " Delay;" & LF & " commit;" & LF & " exception" & LF & " when Resource_Busy then rollback;" & LF & " end Delay;" & LF & "begin" & LF & " if :Loc is null then" & LF & " DBMS_Lob.CreateTemporary (:Loc, Cache => True);" & LF & " end if;" & LF & " if DBMS_Lob.GetLength (:Loc) = 10 then" & LF & " Delay; " & LF & " end if;" & LF & " Append (DBMS_Lob.GetLength (:Loc) || :Line);" & LF & "end;"); Loc : Lobs.Locator := Lobs.Create (Connect, Lobs.Char); Line : Positive := 1; Offset : Lobs.Count := 1; procedure In_Lob (Data : out Data_Holder; Position, Iteration : Positive) is use Ada.Strings.Fixed; Name : constant String := Bind_Name (Stmt_Lob, Position); begin if Name = "LOC" then Data := To_Data (Loc); elsif Name = "LINE" then Data := To_Data ((Line rem 15) * Integer'Image (Line) & LF); Line := Line + 1; else raise Constraint_Error with "Wrong bind variable name: " & Name; end if; end In_Lob; procedure Out_Lob (Data : in Data_Holder; Position, Iteration : in Positive) is Name : constant String := Bind_Name (Stmt_Lob, Position); begin Loc := Value (Data); end Out_Lob; begin Bind (Stmt_Lob, Type_Char_Lob, "Loc"); Bind (Stmt_Lob, Type_String, "Line"); -- !!! Multy non-blocking request fail because of Oracle Bug No. 5711162 -- Set_Blocking (Stmt_Lob, False); loop Execute (Stmt_Lob, In_Lob'Access, Out_Lob'Access, Count => 35); exit when not Is_Executing (Stmt_Lob); Put ('.'); delay 0.1; end loop; Set_Blocking (Stmt_Lob, True); loop declare use type Lobs.Count; Line : String (1 .. 256); Last : Natural; begin Lobs.Read (Loc, Offset, Line, Last); Put (Line (1 .. Last)); exit when Last < Line'Last; Offset := Offset + Lobs.Count (Last); end; end loop; end Test_Lob; gnade-1.6.2.orig/samples/oci/test_num.adb0000644000175000017500000001424111007574024020123 0ustar lbrentalbrentawith Ada.Exceptions; with Ada.Text_IO; with GNAT.Float_Control; with Interfaces.C; with System; with OCI.Lib; with OCI.Thick.Gen_OCINumber; with OCI.Thick.Number_Functions; with Ada.Numerics.Discrete_Random; procedure Test_Num is use Ada.Text_IO; use Interfaces; subtype Max_Float_Type is Long_Long_Float; package Max_Random is new Ada.Numerics.Discrete_Random (Integer); Gen : Max_Random.Generator; package Max_Float_IO is new Ada.Text_IO.Float_IO (Max_Float_Type); F : Max_Float_Type := 1.0; F_Stamp : Max_Float_Type := 0.0; Max_Diff : Max_Float_Type := 0.0; Min_Diff : Max_Float_Type := 0.0; Direction : Boolean := True; generic type Float_Type is digits <>; procedure Test_Generic (F : Float_Type); procedure Test_Generic (F : Float_Type) is package Float_IO is new Ada.Text_IO.Float_IO (Float_Type); use OCI.Thick; use OCI.Thick.Number_Functions; type Unsigned_Type is mod System.Max_Binary_Modulus; function To_Number is new Gen_OCINumber.Unsigned_To_Number (Unsigned_Type); function To_Number is new Gen_OCINumber.Float_To_Number_Better (Float_Type); function To_Float is new Gen_OCINumber.Num_To_Float_Better (Float_Type); function To_Float_OCI is new Gen_OCINumber.Num_To_Float (Float_Type); N : OCI.Lib.OCINumber := To_Number (F); F2 : Float_Type := To_Float (N); FO : Float_Type := To_Float_OCI (N); Diff : Max_Float_Type := Max_Float_Type ((F2 - F) / abs F); Diff_O : Float_Type := (FO - F) / abs F; begin if Sign (N) = 0 and then not Is_Zero (N) then Put_Line ("Different zero detection " & To_String (N)); end if; if abs Diff_O > 0.001 then Float_IO.Put (F, Aft => Float_Type'Digits + 3); Float_IO.Put (Float_Type'Small, Aft => Float_Type'Digits + 3); Float_IO.Put (Float_Type'Last, Aft => Float_Type'Digits + 3); raise Constraint_Error with Float_Type'Machine_Emin'Img & Float_Type'Machine_Emax'Img & F'Img & FO'Img & ' ' & To_String (N) & " abs Diff_O >" & Float_Type'Image (Float_Type'Small * 100.0); end if; if abs Diff > 0.000001 then Float_IO.Put (F, Aft => 20); New_Line; Float_IO.Put (F2, Aft => 20); New_Line; raise Constraint_Error with "too big difference " & F'Img & ' ' & To_String (N) & F2'Img; end if; if Diff > Max_Diff then Max_Diff := Diff; Put_Line ("Max " & Diff'Img); raise Constraint_Error; elsif Diff < Min_Diff then Min_Diff := Diff; Put_Line ("Min " & Diff'Img); raise Constraint_Error; end if; if N /= To_Number (F2) then if F = F2 then raise Constraint_Error with "overprecision"; end if; Float_IO.Put (F, Aft => 20); New_Line; for J in 1 .. 20 loop Put (To_String (N) & ' '); Float_IO.Put (To_Float (N), Aft => 20); New_Line; exit when N = To_Number (To_Float (N)); N := To_Number (To_Float (N)); end loop; raise Program_Error; end if; end Test_Generic; ---------- -- Test -- ---------- procedure Test (Item : Max_Float_Type) is procedure Test_Float is new Test_Generic (Float); procedure Test_Long_Float is new Test_Generic (Long_Float); procedure Test_Max_Float is new Test_Generic (Long_Long_Float); begin Test_Max_Float (Item); Test_Long_Float (Long_Float (Item)); if abs Item <= Max_Float_Type (Float'Last) and then abs Item >= Float'Small then Test_Float (Float (Item)); end if; end Test; function Random return Max_Float_Type is begin return Max_Float_Type (Max_Random.Random (Gen)); end Random; begin Max_Random.Reset (Gen); Test (F); GNAT.Float_Control.Reset; for J in 1 .. 388 loop F := -F * 2.0; Put (F'Img & J'Img); Test (F); Put_Line (" 1.0/"); Test (1.0 / F); end loop; F := 1.0 / F; for J in 389 .. 402 loop F := -F / 2.0; Put_Line (F'Img & J'Img); Test (F); end loop; F := Random; for J in 1 .. 2000000000 loop declare use Ada.Exceptions; begin Test (F); if Direction then -- Only when Direction is true Otherwise we would leap around zero F := F + Random; Test (F); end if; for K in 1 .. 100 loop F := F * Random / Random; Test (F); end loop; exception when E : OCI.Thick.Lib_Error => if F_Stamp = F then Put_Line ("F_Stamp " & F'Img); return; elsif F_Stamp = 0.0 then F_Stamp := F; end if; declare Errmsg : constant String := Exception_Message (E); Ermsg : constant String := Errmsg (4 .. Errmsg'Last); -- Mask first 3 symbols because it could be OCI for object -- environment and ORA for deafult environment, at least in -- Oracle client version 10.2. begin if Ermsg = "-22053: overflow error" & ASCII.LF and then abs F > 1.0E100 then Direction := False; Put (F'Img & ' ' & Errmsg); elsif Ermsg = "-22054: underflow error" & ASCII.LF and then abs F < 1.0E-100 then Direction := True; Put (F'Img & ' ' & Errmsg); else Put_Line ("F " & J'Img & F'Img & ' ' & Errmsg); return; end if; end; when E : others => Put_Line ("F " & J'Img & ' ' & F'Img & ' ' & Exception_Information (E)); return; end; if Direction then F := F * Random; else F := F / Random; end if; end loop; end Test_Num; gnade-1.6.2.orig/samples/oci/test_numb.adb0000644000175000017500000000244210613602174020265 0ustar lbrentalbrentawith Ada.Text_IO; with Ada.Long_Long_Float_Text_IO; with GNAT.Float_Control; with Interfaces.C; with System; with OCI.Thick.Gen_OCINumber; with OCI.Thick.Number_Functions; procedure FNum is use Ada.Text_IO; use Interfaces; subtype LLF is Long_Long_Float; F : LLF := 1.0; procedure Test (F : LLF); procedure Test (F : LLF) is use OCI.Thick; function To_Number is new Gen_OCINumber.Float_To_Number_Better (LLF); function To_Float is new Gen_OCINumber.Num_To_Float_Better (LLF); N : constant OCINumber := To_Number (F); FN : constant LLF := To_Float (N); begin Ada.Long_Long_Float_Text_IO.Put (F, Aft => 20); Put (' ' & Number_Functions.To_String (N)); Put (' ' & Number_Functions.To_String (Number_Functions.Ln (N))); Ada.Long_Long_Float_Text_IO.Put (FN, Aft => 20); if F /= FN then Put (" /="); end if; New_Line; end Test; begin Put_Line ("Long Float" & Long_Float'Size'Img); Put_Line ("Long Long Float" & Long_Long_Float'Size'Img); Put_Line ("double" & C.double'Size'Img); Put_Line ("long double" & C.long_double'Size'Img); for J in 1 .. 20 loop Test (F); F := F + (10.0 ** (-J)) * LLF (J rem 10); end loop; end FNum; gnade-1.6.2.orig/samples/oci/unsigned_conv_test.adb0000644000175000017500000000435310613602174022170 0ustar lbrentalbrenta------------------------------------------------------------------------------ -- Thin Ada95 binding to OCI™ (Oracle® Call Interface™) -- -- Copyright (C) 2007 Dmitriy Anisimkov. -- -- License agreement and authors contact information are in file oci.ads -- ------------------------------------------------------------------------------ -- $Id: unsigned_conv_test.adb,v 1.1 2007/04/25 07:34:20 vagul Exp $ -- Example of Unsigned<->OCINumber convertions. with Ada.Text_IO; with OCI.Thick.Gen_OCINumber; with OCI.Thick.Number_Functions; with GNAT.Float_Control; with System; with OCI.Thick.Number_Functions; procedure Unsigned_Conv_Test is use OCI.Thick.Number_Functions; type Unsigned_Type is mod System.Max_Binary_Modulus; Num : Unsigned_Type := Unsigned_Type'First; Num_Range : Unsigned_Type := 1000; Num_Pos : Unsigned_Type := 16620333769381873238; procedure Test; procedure Test is function To_Unsigned is new OCI.Thick.Gen_OCINumber.Num_To_Unsigned (Unsigned_Type); function To_Number is new OCI.Thick.Gen_OCINumber.Unsigned_To_Number (Unsigned_Type); Numb : OCI.Thick.OCINumber := To_Number (Num); Image : constant String := To_String (Numb); begin if Image'Length > 2 and then Image (Image'Last - 1 .. Image'Last) = "00" then Ada.Text_IO.Put_Line (Image & Num'Img); end if; if To_Unsigned (Numb) /= Num then Ada.Text_IO.Put_Line ("Error in " & Image & Num'Img); raise Constraint_Error; end if; end Test; begin loop Test; if Num = Num_Range then Num := Unsigned_Type'Last / 2 - Num_Range / 2; GNAT.Float_Control.Reset; elsif Num = Unsigned_Type'Last / 2 + Num_Range / 2 then Num := Unsigned_Type'Last / 4 * 3 - Num_Range; elsif Num = Unsigned_Type'Last / 4 * 3 then Num := Num_Pos - Num_Range; elsif Num = Num_Pos then Num := Unsigned_Type'Last - Num_Range; elsif Num = Unsigned_Type'Last then exit; else Num := Num + 1; end if; end loop; end Unsigned_Conv_Test;gnade-1.6.2.orig/samples/odbc/0000755000175000017500000000000011040716276015754 5ustar lbrentalbrentagnade-1.6.2.orig/samples/odbc/Makefile0000644000175000017500000000676610670454347017441 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/samples/odbc/Makefile,v $ ## Description : Makefile for the ODBC binding sample ## Author : Juergen Pfeifer ## Created On : 03-Jan-2001 ## Last Modified By: $Author: persan $ ## Last Modified On: $Date: 2007/09/08 08:10:15 $ ## Status : $State: Exp $ ## ## Copyright (C) 2000-2001 ## ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## This makefile builds the sample programs for the thin ODBC binding. ## ## Restrictions ## ============ ## ## References ## ========== ## sinclude ../../make.conf mainunits=demo.adb binaries=$(subst .adb,$(bin),$(mainunits)) prepunits=$(subst .gpb,.adb,$(wildcard *.gpb)) PREPFLAGS=-DDBSOURCE=\"$(DBSOURCE)\" \ -DDBUSER=\"$(DBUSER)\" \ -DDBPASSWD=\"$(DBPASSWD)\" ifeq ( $(ADDR2LINES), y ) PREPFLAGS+=-Daddr2lines endif all build:: $(prepunits) $(ADAMAKE) -p -Pgnade-odbc-samples.gpr odbc.o: odbc.adb $(ADAMAKE) -c -Podbc.gpr odbc.adb ## ## Clean the directory ## clean:: ${RM} lib-obj $(RM) $(binaries) $(prepunits) $(RM) b~*.ad[bs] core a.out *.o *.ali *~ distclean:: clean gnade-1.6.2.orig/samples/odbc/Makefile.odbc0000644000175000017500000000577610042013504020322 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/samples/odbc/Makefile.odbc,v $ ## Description : Makefile for the ODBC binding sample ## Author : Juergen Pfeifer ## Created On : 03-Jan-2001 ## Last Modified By: $Author: merdmann $ ## Last Modified On: $Date: 2004/04/22 19:04:36 $ ## Status : $State: Exp $ ## ## Copyright (C) 2000-2001 ## ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## This makefile builds the sample programs for the thin ODBC binding. ## ## Restrictions ## ============ ## ## References ## ========== ## all build $(subst .adb,.o,$(wildcard *.adb)) : $(MAKE) -C./ $@ gnade-1.6.2.orig/samples/odbc/demo.gpb0000644000175000017500000002547307632655512017414 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Demo -- -- -- -- B o d y -- -- -- -- $Rev$ -- -- Copyright (C) 2000-2002 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Juergen Pfeifer -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Ada.Characters.Handling; with Ada.Command_Line; with Ada.Strings.Fixed; use Ada.Strings.Fixed; with Ada.Text_IO; use Ada.Text_IO; with Ada.Exceptions; use Ada.Exceptions; with GNU.DB.SQLCLI; use GNU.DB.SQLCLI; with GNU.DB.SQLCLI.Bind; with GNU.DB.SQLCLI.Info; use GNU.DB.SQLCLI.Info; with GNU.DB.SQLCLI.Info.Debug; with GNU.DB.SQLCLI.Environment_Attribute; use GNU.DB.SQLCLI.Environment_Attribute; with GNU.DB.SQLCLI.Environment_Attribute.Debug; with GNU.DB.SQLCLI.Connection_Attribute; use GNU.DB.SQLCLI.Connection_Attribute; with GNU.DB.SQLCLI.Connection_Attribute.Debug; use GNU.DB.SQLCLI; #if addr2lines'Defined then with GNAT.Traceback.Symbolic; #end if; procedure Demo is package RIO is new Ada.Text_IO.Float_IO (SQLDOUBLE); Do_All : Boolean := False; Do_Dump_Env : Boolean := False; Do_Dump_Sources : Boolean := False; Do_Dump_Con_Attr : Boolean := False; Do_Dump_Con_Info : Boolean := False; Do_Dump_Data : Boolean := False; EnvironmentHandle : SQLHENV; ConnectionHandle : SQLHDBC; ServerName : String := String'($DBSOURCE); UserName : String := String'($DBUSER); Authentication : String := String'($DBPASSWD); Quoting_Character : Character := Character'Val (34); procedure Header (Title : in String := ""); function QuoteIdentifier (ID : String) return String; procedure Dump_Sources; procedure Get_Identifier_Info; function QuoteIdentifier (ID : String) return String is begin return Quoting_Character & ID & Quoting_Character; end QuoteIdentifier; pragma Inline (QuoteIdentifier); procedure Header (Title : in String := "") is Len : constant Natural := 2 + Title'Length; Width : constant Natural := 78; Half : constant Natural := (Width - Len) / 2; begin Put (Half * "="); if Len > 2 then Put (" "); Put (Title); Put (" "); else Put ("=="); end if; Put ((Width - (Len + Half)) * "="); New_Line; end Header; procedure Dump_Sources is ServerName : String (1 .. SQL_MAX_DSN_LENGTH); Description : String (1 .. 60); EndFlag : Boolean := False; Direction : SQL_EXTENDED_FETCH_DIRECTION := SQL_FETCH_FIRST; begin loop exit when EndFlag; SQLDataSources (EnvironmentHandle, Direction, ServerName, Description); Direction := SQL_FETCH_NEXT; Put (ServerName); New_Line; Put (Description); New_Line; Put ("--------------------------------"); New_Line; end loop; exception when No_Data => EndFlag := True; end Dump_Sources; procedure Get_Identifier_Info is QC : constant Driver_Info_String := Driver_Info_String (SQLGetInfo (ConnectionHandle, SQL_IDENTIFIER_QUOTE_CHAR)); begin if QC.Value'Length /= 1 then null; else Quoting_Character := QC.Value (QC.Value'First); end if; end Get_Identifier_Info; begin if Ada.Command_Line.Argument_Count > 0 then declare Arg : constant String := Ada.Characters.Handling.To_Lower (Ada.Command_Line.Argument (1)); begin if Arg = "all" then Do_All := True; elsif Arg = "env" then Do_Dump_Env := True; elsif Arg = "sources" then Do_Dump_Sources := True; elsif Arg = "con_attr" then Do_Dump_Con_Attr := True; elsif Arg = "con_info" then Do_Dump_Con_Info := True; elsif Arg = "data" then Do_Dump_Data := True; else Put_Line ("Usage: demo [all | env | sources | con_attr | con_info | data ]"); Ada.Command_Line.Set_Exit_Status (Ada.Command_Line.Failure); return; end if; end; else Do_All := True; end if; SQLAllocHandle (SQL_HANDLE_ENV, SQL_NULL_HANDLE, EnvironmentHandle); SQLSetEnvAttr (EnvironmentHandle, Environment_Attribute_ODBC_Version' (Attribute => SQL_ATTR_ODBC_VERSION, Value => SQL_OV_ODBC3)); if Do_All or else Do_Dump_Env then Header ("Environment Attributes"); GNU.DB.SQLCLI.Environment_Attribute.Debug.Dump (EnvironmentHandle); Header; end if; if Do_All or else Do_Dump_Sources then Dump_Sources; end if; SQLAllocHandle (SQL_HANDLE_DBC, EnvironmentHandle, ConnectionHandle); SQLConnect (ConnectionHandle => ConnectionHandle, ServerName => ServerName, UserName => UserName, Authentication => Authentication); Get_Identifier_Info; if Do_All or else Do_Dump_Con_Attr then Header ("Connection Attributes"); GNU.DB.SQLCLI.Connection_Attribute.Debug.Dump (ConnectionHandle); Header; end if; if Do_All or else Do_Dump_Con_Info then Header ("Connection Info"); GNU.DB.SQLCLI.Info.Debug.Dump (ConnectionHandle); Header; end if; if Do_All or else Do_Dump_Data then declare package Double_Binding is new GNU.DB.SQLCLI.FloatBinding (SQLDOUBLE); package DB renames Double_Binding; type ManagerID is new SQLINTEGER; type ManagerID_Ptr is access all ManagerID; package ManagerID_Binding is new GNU.DB.SQLCLI.Bind (ManagerID, ManagerID_Ptr); package MB renames ManagerID_Binding; StatementHandle : SQLHSTMT; Search_Manager : aliased ManagerID := 2; Len : aliased SQLINTEGER := 0; -- ignored for SQL_C_SLONG, if not negative Name : aliased String := 20 * '.'; Firstname : aliased String := 20 * '.'; Len_Firstname : aliased SQLINTEGER; Len_Name : aliased SQLINTEGER; Len_Salary : aliased SQLINTEGER; Salary : aliased SQLDOUBLE; begin SQLAllocHandle (SQL_HANDLE_STMT, ConnectionHandle, StatementHandle); SQLPrepare (StatementHandle, "SELECT " & QuoteIdentifier ("NAME") & ", " & QuoteIdentifier ("FIRSTNAME") & ", " & QuoteIdentifier ("SALARY") & " FROM " & QuoteIdentifier ("EMPLOYEES") & " " & "WHERE " & QuoteIdentifier ("MANAGER") & " = ? " & "ORDER BY " & QuoteIdentifier ("NAME") & "," & QuoteIdentifier ("FIRSTNAME")); MB.SQLBindParameter (StatementHandle => StatementHandle, ParameterNumber => 1, InputOutputType => SQL_PARAM_INPUT, ValueType => SQL_C_SLONG, ParameterType => SQL_INTEGER, ColumnSize => 0, DecimalDigits => 0, Value => Search_Manager'Access, BufferLength => 0, -- ignored for SQL_C_SLONG StrLen_Or_IndPtr => Len'Access); SQLBindCol (StatementHandle, 1, Name'Access, Len_Name'Access); SQLBindCol (StatementHandle, 2, Firstname'Access, Len_Firstname'Access); DB.SQLBindCol (StatementHandle, 3, Salary'Access, Len_Salary'Access); SQLExecute (StatementHandle); begin loop SQLFetch (StatementHandle); SQLFixNTS (Name, Len_Name); SQLFixNTS (Firstname, Len_Firstname); Put (Name); Put (", "); Put (Firstname); Put (", "); RIO.Put (Item => Salary, Fore => 5, Aft => 2, Exp => 0); New_Line; end loop; exception when No_Data => -- normal loop exit null; end; end; SQLCommit (ConnectionHandle); end if; SQLDisconnect (ConnectionHandle); SQLFreeHandle (SQL_HANDLE_DBC, ConnectionHandle); SQLFreeHandle (SQL_HANDLE_ENV, EnvironmentHandle); #if addr2lines'Defined then exception when Event : others => declare Str : constant String := GNAT.Traceback.Symbolic.Symbolic_Traceback (Event); begin Put_Line (Exception_Name (Event)); Put_Line (Exception_Message (Event)); New_Line; Put_Line (Str); end; #end if; end Demo; gnade-1.6.2.orig/samples/odbc/gnade-odbc-samples.gpr0000644000175000017500000000200210670450003022074 0ustar lbrentalbrenta-- $Id: gnade-odbc-samples.gpr,v 1.1 2007/09/08 07:32:19 persan Exp $ with "../../gnade"; with "../../dbi/odbc/gnade-odbc.gpr"; project Gnade.odbc.Samples is for Languages use ("Ada"); for Source_Dirs use ("."); for Object_Dir use Gnade'Object_Dir; for Exec_Dir use Gnade'Exec_Dir; for Main use ("demo.adb" ); for Exec_Dir use Gnade'Exec_Dir; package Builder is for Default_Switches ("Ada") use Gnade.Builder'Default_Switches ("Ada") ; end Builder; package Compiler is for Default_Switches ("Ada") use Gnade.Compiler'Default_Switches ("Ada") & ("-gnateDDBSOURCE=""src""", "-gnateDDBUSER=""apa""", "-gnateDDBPASSWD=""pwd"""); end Compiler; package Binder is for Default_Switches ("Ada") use gnade.Binder'Default_Switches ("Ada"); end Binder; package Linker is for Default_Switches ("Ada") use gnade.Linker'Default_Switches ("Ada"); end Linker; package Ide is for Vcs_Kind use "CVS"; end Ide; end Gnade.odbc.Samples; gnade-1.6.2.orig/samples/odbc/odbc.gpr0000644000175000017500000000155310023034133017362 0ustar lbrentalbrentawith "../../gnade"; project ODBC is for Languages use ("Ada"); for Source_Dirs use ("."); for Object_Dir use "."; for Main use ("demo.adb"); IncludeOpt := "-I" & gnade.ROOT & "/" & gnade.ARCH &"-include" ; LibOpt := "-L" & gnade.ROOT & "/" & gnade.ARCH & "-lib" ; for Exec_Dir use "."; package Linker is for Default_Switches ("Ada") use ( LibOpt, "-lgnadeaux", "-lgnadeodbc", gnade.DMLINKEROPT ) ; end Linker; package Binder is for Default_Switches ("ada") use ("-static" ); end Binder; package Compiler is for Default_Switches ("ada") use ("-g", IncludeOPT ); end Compiler; package Builder is for Default_Switches ("ada") use ("-g", "-gnatQ", IncludeOPT ); end Builder; package Ide is for Vcs_Kind use "CVS"; end Ide; end ODBC; gnade-1.6.2.orig/samples/postgres/0000755000175000017500000000000011040716276016713 5ustar lbrentalbrentagnade-1.6.2.orig/samples/postgres/Makefile0000644000175000017500000000707210027065741020357 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## ## Filename : $Source: /cvsroot/gnade/gnade/samples/postgres/Makefile,v $ ## Description : Makefile for the direct PostgreSQL binding samples -- ## Author : Juergen Pfeifer -- ## Created On : 03-Jan-2001 -- ## Last Modified By: $Author: merdmann $ -- ## Last Modified On: $Date: 2004/03/20 16:05:53 $ -- ## Status : $State: Exp $ -- ## -- ## Copyright (C) 2000-2003 -- ## -- ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## This makefile builds the sample programs for the direct PostgreSQL ## binding. ## ## Restrictions ## ============ ## ## References ## ========== ## ## sinclude ../conf.local sinclude ../../make.conf all build:: demo PREPFLAGS= -DDBNAME=\"$(SAMPLEDB)\" \ -DDBUSER=\"$(DBUSER)\" -DDBPASSWD=\"$(DBPASSWD)\" ifeq ( $(ADDR2LINES), y ) PREPFLAGS=$(PREPFLAGS) -Daddr2lines endif ## ## Build the demo code ## demo: demo.adb $(ADAMAKE) -Ppostgresql.gpr demo.adb -largs $(APP_LINK_FLAGS_NATIVE) ## ## prepare the configuration specific parts of the demo ## demo.adb: demo.gpb $(ADAPREP) $(PREPFLAGS) demo.gpb demo.adb ## ## clean up ## clean:: $(RM) b~*.ad[bs] core a.out *.o *.ali demo demo.adb *~ *~*~ distclean:: clean gnade-1.6.2.orig/samples/postgres/Makefile.postgresql0000644000175000017500000000610310027065742022554 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## ## Filename : $Source: /cvsroot/gnade/gnade/samples/postgres/Makefile.postgresql,v $ ## Description : Makefile for the direct PostgreSQL binding samples -- ## Author : Juergen Pfeifer -- ## Created On : 03-Jan-2001 -- ## Last Modified By: $Author: merdmann $ -- ## Last Modified On: $Date: 2004/03/20 16:05:54 $ -- ## Status : $State: Exp $ -- ## -- ## Copyright (C) 2000-2003 -- ## -- ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## This makefile builds the sample programs for the direct PostgreSQL ## binding. ## ## Restrictions ## ============ ## ## References ## ========== ## ## all build $(subs .adb,.o,$(wildcard *.adb)): $(MAKE) -C./ $@ gnade-1.6.2.orig/samples/postgres/demo.gpb0000644000175000017500000001216010670447717020342 0ustar lbrentalbrenta--| --| Filename : $Source: /cvsroot/gnade/gnade/samples/postgres/demo.gpb,v $ --| Description : Application Example for Postgres --| Author : J. Pfeifer --| Created On : 5.4.2001 --| Last Modified By: $Author: persan $ --| Last Modified On: $Date: 2007/09/08 07:31:27 $ --| Status : $State: Exp $ --| --| Copyright (C) 2000, 2001 Jürgen Pfeifer --| --| This program is free software; you can redistribute it and/or --| modify it under the terms of the GNU General Public License --| as published by the Free Software Foundation; either version 2 --| of the License, or (at your option) any later version. --| --| This program/code is distributed in the hope that it will be useful, --| but WITHOUT ANY WARRANTY; without even the implied warranty of --| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --| GNU General Public License for more details. --| --| You should have received a copy of the GNU General Public License along --| with this program; if not, write to the Free Software Foundation, Inc., --| 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --| --| As a special exception, if other files instantiate generics from this --| unit, or you link this unit with other files to produce an executable, --| this unit does not by itself cause the resulting executable to be --| covered by the GNU General Public License. This exception does not --| however invalidate any other reasons why the executable file might be --| covered by the GNU Public License. --| --| Functional Description --| ====================== --| This is a demonstration of the native binding to the postgres client --| API. --| --| Restrictions --| ============ --| None --| --| References --| ========== --| //1// - Postgres Manual --| with Ada.Text_IO; use Ada.Text_IO; with GNAT.Traceback.Symbolic; with GNU.DB.PostgreSQL; use GNU.DB.PostgreSQL; procedure Demo is DB : Database (new String'("host=localhost " & " dbname=" & "" & " user=" & "" & " password=" & "")); R : Result; T : TypeID; TI : TypeInfo; package Conn_Status_IO is new Ada.Text_IO.Enumeration_IO (ConnStatus); use Conn_Status_IO; package Boolean_IO is new Ada.Text_IO.Enumeration_IO (Boolean); use Boolean_IO; package PID_IO is new Ada.Text_IO.Integer_IO (Backend_PID); use PID_IO; package Tuple_Index_IO is new Ada.Text_IO.Integer_IO (Tuple_Index); use Tuple_Index_IO; package Field_Index_IO is new Ada.Text_IO.Integer_IO (Field_Index); use Field_Index_IO; package OID_IO is new Ada.Text_IO.Modular_IO (OID); use OID_IO; package IntegerIO is new Ada.Text_IO.Integer_IO (Integer); use IntegerIO; begin Put ("Name : "); Put_Line (Name (DB)); Put ("User : "); Put_Line (User (DB)); Put ("Password : "); Put_Line (Password (DB)); Put ("Host : "); Put_Line (Host (DB)); Put ("Port : "); Put_Line (Port (DB)); Put ("TTY : "); Put_Line (TTY (DB)); Put ("Options : "); Put_Line (Options (DB)); New_Line; Put ("Status : "); Put (Status (DB)); New_Line; Put ("Server-PID : "); Put (Server_PID (DB)); New_Line; New_Line; Put ("Error : "); Put_Line (Error (DB)); New_Line; Put ("Parameters : "); Put_Line (DB.Parameters.all); New_Line; Execute (R, DB, "SELECT * FROM " & Quote_Identifier("employees") & " WHERE " & Quote_Identifier("manager") & "= 2 " & "ORDER BY " & Quote_Identifier("name") & "," & Quote_Identifier("firstname")); Put ("Status : "); Put_Line (Status (R)); Put ("Error : "); Put_Line (Error (R)); Put ("Count : "); Put (Tuple_Count (R)); New_Line; Put ("Fieldcount : "); Put (Field_Count (R)); New_Line; Put ("OID Value : "); Put (OID_Value (R)); New_Line; Put ("Cmd Tuples : "); Put_Line (Command_Tuples (R)); New_Line; for I in 0 .. (Field_Count (R) - 1) loop T := Field_Type (R, I); Load_TypeInfo (DB, T, TI); Put ("Field "); Put (I, 0); Put (" : "); Put (Field_Name (R, I)); Put (", Typ : "); Put(T, 0); Put (", "); Put (Value (TI, 0, "typname") & ", len="); Put (Value (TI, 0, "typlen")); Put (",size="); Put (Field_Size (R, I), 0); Put (",mod="); Put (Field_Modification (R, I), 0); Put (",flen="); Put (Field_Length (R, 0, I), 0); Put (",isnull="); Put (Is_Null (R, 0, I), 0); Put (",cmdStat="); Put_Line (Command_Status (R)); end loop; for I in 0 .. (Tuple_Count (R) - 1) loop Put (Value (R, I, Quote_Identifier("name"))); Put (','); Put_Line (Value (R, I, Quote_Identifier("firstname"))); end loop; exception when Event : PostgreSQL_Error => Put ("PostgreSQL "); Put_Line (Error (DB)); declare Str : constant String := GNAT.Traceback.Symbolic.Symbolic_Traceback (Event); begin Put_Line (Str); end; when Event : others => declare Str : constant String := GNAT.Traceback.Symbolic.Symbolic_Traceback (Event); begin Put_Line (Str); end; end Demo; gnade-1.6.2.orig/samples/postgres/gnade-postgres-samples.gpr0000644000175000017500000000164410670450003024005 0ustar lbrentalbrenta-- $Id: gnade-postgres-samples.gpr,v 1.1 2007/09/08 07:32:19 persan Exp $ with "../../gnade"; with "../../dbi/postgres/gnade-postgres.gpr"; project Gnade.postgres.Samples is for Languages use ("Ada"); for Source_Dirs use ("."); for Object_Dir use Gnade'Object_Dir; for Exec_Dir use Gnade'Exec_Dir; for Main use ("demo.adb" ); for Exec_Dir use "."; package Builder is for Default_Switches ("Ada") use gnade.Builder'Default_Switches ("Ada"); end Builder; package Compiler is for Default_Switches ("Ada") use gnade.Compiler'Default_Switches ("Ada"); end Compiler; package Binder is for Default_Switches ("Ada") use gnade.Binder'Default_Switches ("Ada"); end Binder; package Linker is for Default_Switches ("Ada") use gnade.Linker'Default_Switches ("Ada"); end Linker; package Ide is for Vcs_Kind use "CVS"; end Ide; end Gnade.postgres.Samples; gnade-1.6.2.orig/samples/postgres/postgresql.gpr0000644000175000017500000000147010027065742021631 0ustar lbrentalbrenta-- $Id: postgresql.gpr,v 1.2 2004/03/20 16:05:54 merdmann Exp $ with "../../gnade"; project PostgreSQL is for Languages use ("Ada"); for Source_Dirs use ("."); for Object_Dir use "."; for Main use ("demo.adb" ); for Exec_Dir use "."; package Linker is for Default_Switches ("ada") use ("-g", GNADE.LibOpt, "-lgnadepostgresql", gnade.NALINKEROPT ); end Linker; package Binder is for Default_Switches ("ada") use ("-static"); end Binder; package Compiler is for Default_Switches ("ada") use ("-g", GNADE.IncludeOPT ); end Compiler; package Builder is for Default_Switches ("ada") use ( "-gnatQ", GNADE.IncludeOPT ); end Builder; package Ide is for Vcs_Kind use "CVS"; end Ide; end PostgreSQL; gnade-1.6.2.orig/samples/sample_db/0000755000175000017500000000000011040716276016773 5ustar lbrentalbrentagnade-1.6.2.orig/samples/sample_db/Makefile0000644000175000017500000000704210537576263020450 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/samples/sample_db/Makefile,v $ ## Description : Makefile to build the correct data base ## Author : Juergen Pfeifer ## Created On : 03-Jan-2001 ## Last Modified By: $Author: merdmann $ ## Last Modified On: $Date: 2006/12/12 19:02:11 $ ## Status : $State: Exp $ ## ## Copyright (C) 2000-2001 ## ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## ## all - Create the data base and the user gnade with password ## clean - Delete user and data base ## ## Restrictions ## ============ ## None ## ## References ## ========== ## None ## sinclude ../conf.local sinclude ../../make.conf ## .PHONY: $(DATABASE) ## ## Create the data base ## all createdb :: $(DATABASE) $(DATABASE): $(MAKE) -f Makefile.$@ createdb ## ## Create / Delete a user from the DBCS. ## createuser removeuser removedb:: $(MAKE) -f Makefile.$(DATABASE) $@ ## ## clean up ## distclean:: - $(MAKE) -f Makefile.$(DATABASE) removedb rm -f *~ odbc.ini.sample .database clean:: @echo "*********************************" @echo "** Sample Database not cleared **" @echo "*********************************" gnade-1.6.2.orig/samples/sample_db/Makefile.UNKNOWN0000644000175000017500000000657407275310743021611 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/samples/sample_db/Makefile.UNKNOWN,v $ ## Description : Makefile for the PostgreSQL sample database ## Author : Juergen Pfeifer ## Created On : 03-Jan-2001 ## Last Modified By: $Author: jp $ ## Last Modified On: $Date: 2001/05/06 18:03:15 $ ## Status : $State: Exp $ ## ## Copyright (C) 2000-2001 ## ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## This makefile creates the PostgreSQL sample database used in the ## various GNADE samples and tests. The database is populated with ## sample data. ## ## Restrictions ## ============ ## The user running this makefile must have proper PostgreSQL rights to be ## able to delete the database, create a new one and to create the demo ## user. The demo user has username="gnade" and password="gnade". ## ## References ## ========== ## sinclude ../conf.local sinclude ../../make.conf ## ## Shortcircuit all targets if no ## createuser removeuser createdb removedb:: @echo gnade-1.6.2.orig/samples/sample_db/Makefile.mimer0000644000175000017500000000731110176727314021551 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/samples/sample_db/Makefile.mimer,v $ ## Description : Makefile for MimerSQL bases sample database ## Author : Michael.Erdmann@snafu.de ## Created On : 07-Apr-2001 ## Last Modified By: $Author: merdmann $ ## Last Modified On: $Date: 2005/01/29 15:42:04 $ ## Status : $State: Exp $ ## ## Copyright (C) 2000-2004 ## ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## sinclude ../conf.local sinclude ../../make.conf ##DB=/Programme/Mimer SQL 9.2/ ## ## Create the data base and the user as root ## createuser :: create_user.mimer.sql ifeq ($(OS),) dbinstall -s $(SAMPLEDB) $(DBPASSWD) $(DBPATH) else - $(MKDIR) $(subst /,$(PATHSEP), $(DBPATH)) $(DB)sdbgen -p$(DBPASSWD) $(SAMPLEDB) endif -$(DB)mimcontrol -s $(SAMPLEDB) bsql -uSYSADM -p$(DBPASSWD) -q"read command 'create_user.mimer.sql'" $(SAMPLEDB) create_user.mimer.sql: create_user.mimer.sql.in $(PREP) DBUSER=$(DBUSER) DBPASSWD=$(DBPASSWD) SAMPLEDB=$(SAMPLEDB) $@.in $@ removeuser :: $(RM) -rf $(DB) echo "Please remove $(SMAPLEDB) from /etc/sqlhosts " ## ## Create a data base ## createdb :: bsql -u$(DBUSER) -p$(DBPASSWD) -q"read command 'gnade.mimer.sql'" $(SAMPLEDB) ## ## remove the database ## removedb: bsql -u$(DBUSER) -p$(DBPASSWD) -q"read command 'gnade_remove.mimer.sql'" $(SAMPLEDB) ## ## ## clean: $(RM) create_user.mimer.sql ## ## ## distclean: clean gnade-1.6.2.orig/samples/sample_db/Makefile.mysql0000644000175000017500000000761107643477450021620 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/samples/sample_db/Makefile.mysql,v $ ## Description : Makefile for the PostgreSQL sample database ## Author : Juergen Pfeifer ## Created On : 03-Jan-2001 ## Last Modified By: $Author: merdmann $ ## Last Modified On: $Date: 2003/04/05 07:00:56 $ ## Status : $State: Exp $ ## ## Copyright (C) 2000-2001 ## ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## This makefile creates the PostgreSQL sample database used in the ## various GNADE samples and tests. The database is populated with ## sample data. ## ## Restrictions ## ============ ## The user running this makefile must have proper PostgreSQL rights to be ## able to delete the database, create a new one and to create the demo ## user. The demo user has username="gnade" and password="gnade". ## ## References ## ========== ## sinclude ../conf.local sinclude ../../make.conf AUTH=-u $(DBOPERATOR) -p ## ## Create a user in the mysql data base. ## createuser :: info mysql -f $(AUTH) < create_user.mysql.sql removeuser: info mysql -f $(AUTH) < remove_user.mysql.sql ## ## Create a data base ## createdb :: info .database .database: $(SAMPLEDB).mysql.sql -mysqladmin $(AUTH) -f drop $(SAMPLEDB) mysqladmin $(AUTH) create $(SAMPLEDB) mysql $(AUTH) $(SAMPLEDB) < $(SAMPLEDB).mysql.sql touch .database ## ## remove the database ## removedb: info -mysqladmin $(AUTH) -f drop $(SAMPLEDB) rm -f .database info: @echo "*** INFO *** The database admin user id is $(DBOPERATOR) !" gnade-1.6.2.orig/samples/sample_db/Makefile.oracle0000644000175000017500000001070507321126444021701 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/samples/sample_db/Makefile.oracle,v $ ## Description : Makefile for the PostgreSQL sample database ## Author : Michael Erdmann ## Created On : 03-Jan-2001 ## Last Modified By: $Author: me $ ## Last Modified On: $Date: 2001/07/05 18:08:36 $ ## Status : $State: Exp $ ## ## Copyright (C) 2000-2001 ## ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## This makefile creates the PostgreSQL sample database used in the ## various GNADE samples and tests. The database is populated with ## sample data. ## ## This targets have to be executed as unix user postgres. ## ## createuser - create a new data base user ## removeuser - remove the user ## ## createdb - add the data base ## removedb - remove the data base ## ## Restrictions ## ============ ## The user running this makefile must have proper PostgreSQL rights to be ## able to delete the database, create a new one and to create the demo ## user. ## The createuser and deleteuser has to be executed as postgres superuser. ## ## References ## ========== ## sinclude ../conf.local sinclude ../../make.conf ## ## Configure a new data base user ## createuser: @echo "****************************************************" @echo "** Please create the user manually **" @echo "****************************************************" ## ## Remove the user from the data base ## removeuser: @echo "****************************************************" @echo "** Please remove the user manually **" @echo "****************************************************" ## ## create a database ## createdb: @echo "****************************************************" @echo "** Create the data base manually **" @echo "****************************************************" ## ## remove the data base ## removedb :: @echo "****************************************************" @echo "** Please remove the database manually **" @echo "****************************************************" gnade-1.6.2.orig/samples/sample_db/Makefile.postgres0000644000175000017500000001002407643477450022311 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/samples/sample_db/Makefile.postgres,v $ ## Description : Makefile for the PostgreSQL sample database ## Author : Juergen Pfeifer ## Created On : 03-Jan-2001 ## Last Modified By: $Author: merdmann $ ## Last Modified On: $Date: 2003/04/05 07:00:56 $ ## Status : $State: Exp $ ## ## Copyright (C) 2000-2001 ## ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## This makefile creates the PostgreSQL sample database used in the ## various GNADE samples and tests. The database is populated with ## sample data. ## ## This targets have to be executed as unix user postgres. ## ## createuser - create a new data base user ## removeuser - remove the user ## ## createdb - add the data base ## removedb - remove the data base ## ## Restrictions ## ============ ## The user running this makefile must have proper PostgreSQL rights to be ## able to delete the database, create a new one and to create the demo ## user. ## The createuser and deleteuser has to be executed as postgres superuser. ## ## References ## ========== ## sinclude ../conf.local sinclude ../../make.conf ## ## Configure a new data base user ## ## createuser: su - postgres -c "createuser --createdb --no-adduser $(DBUSER)" ## ## Remove the user from the data base ## removeuser: dropuser $(DBUSER) ## ## create a database ## createdb: .database .database : $(SAMPLEDB).postgres.sql -dropdb $(SAMPLEDB) 2>/dev/null createdb $(SAMPLEDB) psql $(SAMPLEDB) < $(SAMPLEDB).postgres.sql @touch .database ## ## remove the data base ## removedb :: -dropdb $(SAMPLEDB) 2>/dev/null rm -f .database gnade-1.6.2.orig/samples/sample_db/README0000644000175000017500000000113207643477451017665 0ustar lbrentalbrenta------------------------------------------------------------- In order to be able to use the demo database with ODBC you must install and setup ODBC to use the proper drivers and driver settings. For ODBC on Linux we recommend to use unixODBC version 1.8.13 or better (www.unixodbc.org). You may need to copy the file odbcinst.ini from the directory var into one of the following directories: /etc /usr/local/etc If your unixODBC package support ODBCConfig you may use this program to setup your ODBC configuration graphically. ------------------------------------------------------------- gnade-1.6.2.orig/samples/sample_db/README.UNKNOWN0000644000175000017500000000043607262400536021014 0ustar lbrentalbrenta------------------------------------------------------------- *** W A R N I N G *** No database system has been configured. The test database will not be available for the execution of the sample code. ------------------------------------------------------------- gnade-1.6.2.orig/samples/sample_db/README.mimer0000644000175000017500000000115707735317654021004 0ustar lbrentalbrenta------------------------------------------------------------- In order to be able to use the demo database with ODBC you must install and setup ODBC to use the proper drivers and driver settings. For ODBC on Linux we recommend to use unixODBC version 1.8.13 or better (www.unixodbc.org). You may use ./var/odbcinst.ini and ./var/odbc.ini.sample in this directory as a template for what you have to enter in /etc/odbc.ini and /etc/odbcinst.ini If your unixODBC package support ODBCConfig you may use this program to setup your ODBC configuration graphically. ------------------------------------------------------------- gnade-1.6.2.orig/samples/sample_db/README.mysql0000644000175000017500000000115207262400536021016 0ustar lbrentalbrenta------------------------------------------------------------- In order to be able to use the demo database with ODBC you must install and setup ODBC to use the proper drivers and driver settings. For ODBC on Linux we recommend to use unixODBC version 1.8.13 or better (www.unixodbc.org). You may use odbcinst.ini.sample and odbc.ini.sample in this directory as a template for what you have to enter in /etc/odbc.ini and /etc/odbcinst.ini If your unixODBC package support ODBCConfig you may use this program to setup your ODBC configuration graphically. ------------------------------------------------------------- gnade-1.6.2.orig/samples/sample_db/README.oracle0000644000175000017500000000040007321126444021110 0ustar lbrentalbrenta Currently the installation is not automatically done. You need to install the following items: - Oracle 8i - SQL+ - The database as described in the gnade.oracle.sql file. - ODBC drivers of the Oracle 8i have to be inserted in the odbc.ini file. gnade-1.6.2.orig/samples/sample_db/README.postgres0000644000175000017500000000137007431300762021517 0ustar lbrentalbrenta------------------------------------------------------------- If this procedure faiules please ensure that the user gnade has been added by means of the PostgreSQL command createuser -a -d gnade In order to be able to use the demo database with ODBC you must install and setup ODBC to use the proper drivers and driver settings. For ODBC on Linux we recommend to use unixODBC version 1.8.13 or better (www.unixodbc.org). You may use odbcinst.ini.sample and odbc.ini.sample in this directory as a template for what you have to enter in /etc/odbc.ini and /etc/odbcinst.ini If your unixODBC package support ODBCConfig you may use this program to setup your ODBC configuration graphically. ------------------------------------------------------------- gnade-1.6.2.orig/samples/sample_db/create_user.mimer.sql.in0000644000175000017500000000575010176727314023545 0ustar lbrentalbrenta-- ---------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/samples/sample_db/create_user.mimer.sql.in,v $ -- Description : Create the user for the test code -- Author : Sune Falck -- Created On : 6-Apr-2001 -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2005/01/29 15:42:04 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000-2001 -- -- GNADE is copyrighted by the persons and institutions enumerated in the -- -- AUTHORS file. This file is located in the root directory of the -- -- GNADE distribution. -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- GNADE Ada units, or you link GNADE Ada units or libraries with other -- -- files to produce an executable, these units or libraries do not by -- -- itself cause the resulting executable to be covered by the GNU -- -- General Public License. This exception does not however invalidate -- -- any other reasons why the executable file might be covered by the -- -- GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- ---------------------------------------------------------------------------- CREATE DATABANK @SAMPLEDB@ OF 1000 PAGES IN '@SAMPLEDB@.dbf' WITH LOG OPTION; CREATE IDENT @DBUSER@ AS USER USING '@DBPASSWD@'; GRANT DATABANK TO @DBUSER@ WITH GRANT OPTION; GRANT TABLE ON @SAMPLEDB@ TO @DBUSER@; gnade-1.6.2.orig/samples/sample_db/create_user.mysql.sql0000644000175000017500000000616307617260047023174 0ustar lbrentalbrenta-- ---------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/samples/sample_db/create_user.mysql.sql,v $ -- Description : Makefile for the PostgreSQL sample database -- Author : Juergen Pfeifer -- Created On : 03-Jan-2001 -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2003/02/02 18:15:03 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000-2001 -- -- GNADE is copyrighted by the persons and institutions enumerated in the -- -- AUTHORS file. This file is located in the root directory of the -- -- GNADE distribution. -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- GNADE Ada units, or you link GNADE Ada units or libraries with other -- -- files to produce an executable, these units or libraries do not by -- -- itself cause the resulting executable to be covered by the GNU -- -- General Public License. This exception does not however invalidate -- -- any other reasons why the executable file might be covered by the -- -- GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- ---------------------------------------------------------------------------- -- Functional Description -- ====================== -- -- -- Restrictions -- ============ -- -- References -- ========== -- use mysql; GRANT ALL PRIVILEGES ON *.* TO gnade@localhost ; GRANT ALL PRIVILEGES ON *.* TO gnade@"%" ; FLUSH PRIVILEGES; gnade-1.6.2.orig/samples/sample_db/gnade.mimer.sql0000644000175000017500000001753410537576263021726 0ustar lbrentalbrenta-- ---------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/samples/sample_db/gnade.mimer.sql,v $ -- Description : Create the test database with the mimer db -- Author : Sune Falck -- Created On : 6-Apr-2001 -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2006/12/12 19:02:11 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000-2006 -- -- GNADE is copyrighted by the persons and institutions enumerated in the -- -- AUTHORS file. This file is located in the root directory of the -- -- GNADE distribution. -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- GNADE Ada units, or you link GNADE Ada units or libraries with other -- -- files to produce an executable, these units or libraries do not by -- -- itself cause the resulting executable to be covered by the GNU -- -- General Public License. This exception does not however invalidate -- -- any other reasons why the executable file might be covered by the -- -- GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- ---------------------------------------------------------------------------- -- -- Functional Description -- ====================== -- This SQL Script generates the test data base as it is used by -- the code in the ./samples directory. The demo user has username="gnade" -- and password="gnade". -- -- -- Restrictions -- ============ -- The script is for use with the Mimer database. -- -- References -- ========== -- -- www.mimer.com -- -- Prerequisites -- ============= -- -- Install MIMER. Normally a test data base DEVELOP is created at -- the installation which can be used for our purpose -- -- Login as root and create the databse and the user by: -- -- make createuser -- -- Run test programs -- -- Changes compared to the postgres script. -- ======================================== -- -- Removed quotation characters from table and column names -- Changed int4 to INTEGER -- Changed bool to CHARACTER (1) -- Added DATE as qualifier to date constants in insert statements -- Added database DEVELOP to the create table statements -- Added REFERENCES and CHECK clauses and changed order -- so that DEPARTMENTS is defined and loaded before EMPLOYEES -- -- 2001-04-06 Sune Falck ------------------------------------------------------------------------ --CREATE DATABANK DEVELOP -- OF 10 PAGES -- IN 'gnade' -- WITH TRANS OPTION; CREATE TABLE DEPARTMENTS ( DEPTNO INTEGER NOT NULL PRIMARY KEY, NAME CHARACTER(20) NOT NULL, LOCATION CHARACTER(20) ) ; CREATE TABLE EMPLOYEES ( EMPNO INTEGER NOT NULL PRIMARY KEY, NAME CHARACTER (20) NOT NULL, FIRSTNAME CHARACTER (20), DEPTNO INTEGER REFERENCES DEPARTMENTS (DEPTNO), SINCE DATE, MANAGER INTEGER, JOB CHARACTER (20), PROMOTION CHARACTER (1) CHECK (PROMOTION IN ('T', 'F')), SALARY DECIMAL (8,4) ) ; --- Testdata insert into departments values( 1001, 'Sales', 'Berlin' ); insert into departments values( 1000, 'Developement', 'Stuttgart' ); insert into departments values( 1002, 'CM and Production', 'Bonn' ); insert into departments values( 1003, 'Support', 'Chicago' ); insert into departments values( 2000, 'Masterminds', null ); insert into employees values ( 1, 'Erdmann', 'Michael', 1001, DATE'1999-12-31', 2, 'Coding Monkey', 'T', 200.1234 ); insert into employees values ( 2, 'Massalski', 'Marina', 1000, DATE'2000-01-09', null, 'Supervisor', 'F', 200.00 ); insert into employees values ( 3, 'Tully', 'Noel', 1001, DATE'1959-01-23', 2, 'Supervisor', 'T', 200.00 ); insert into employees values ( 4, 'Pfeifer', 'Juergen', 1001, DATE'2001-01-01', 2, 'Designer', 'T', 200.00 ); insert into employees values ( 5, 'Smith', 'John', 1000, DATE'1980-06-11', 3, 'Coding Monkey', 'T', 250.00 ); insert into employees values ( 6, 'Smith', 'John', 1001, DATE'1972-06-11', 3, 'Designer', 'T', 820.00 ); insert into employees values ( 50, 'Simpson', 'Bud', 1003, DATE'1980-06-11', 3, 'Clerk', 'F', 20.00 ); insert into employees values ( 51, 'Bundy', 'Al', 1003, DATE'1980-06-11', 3, 'Clerk', 'F', 10.00 ); insert into employees values ( 52, 'Bundy', 'Peggy', 1003, DATE'1988-06-15', 3, null, 'F', -10.00 ); insert into employees values ( 53, 'Simpson', 'Kelly', 1003, DATE'1995-09-11', 3, 'Secretary', 'F', 20.00 ); insert into employees values (500, 'Rutherford', 'Ernest', 2000, DATE'1930-05-30', 3, 'Genius', 'T',1200.00 ); insert into employees values (501, 'Fermi', null, 2000, DATE'1940-07-29', 3, 'Genius', 'T',1200.00 ); insert into employees values (502, 'Einstein', 'Albert', 2000, DATE'1941-04-30', 2, 'Genius', 'T',1200.00 ); insert into employees values (503, 'Fermi', null, 2000, DATE'1020-08-15', 2, 'Genius', 'T',1200.00 ); CREATE TABLE LOCATIONS ( NAME CHARACTER(20) NOT NULL PRIMARY KEY, CITY VARCHAR(40), STREET VARCHAR(80), NO CHARACTER(5), ZIPCODE INT ) ; insert into locations values( 'Berlin', 'Berlin','Siemensdamm', '50a', 10243 ); insert into locations values( 'Bonn', 'Bonn','Oberkasselerstrasse', '8', 47112 ); insert into locations values( 'Stuttgart', 'Stuttgart','Lorenzweg', '1', 60001 ); insert into locations values( 'Chicage', 'Chicago','Bundy Stree', '9996', 70001 ); CREATE TABLE ATTACHMENTS ( ID INT NOT NULL PRIMARY KEY, USED INT, CREATION DATE, TITLE VARCHAR(256), DATA VARBINARY(10000) ) ; -- ACL Information. This may have to be changed if a different DBCS is used REVOKE ALL on employees from PUBLIC; REVOKE ALL on departments from PUBLIC; REVOKE ALL on locations from PUBLIC; REVOKE ALL on ATTACHMENTS from PUBLIC; GRANT ALL on employees to PUBLIC; GRANT ALL on departments to PUBLIC; GRANT ALL on locations to PUBLIC; GRANT ALL on ATTACHMENTS to PUBLIC; gnade-1.6.2.orig/samples/sample_db/gnade.mysql.sql0000644000175000017500000001437007423613745021752 0ustar lbrentalbrenta-- ---------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/samples/sample_db/gnade.mysql.sql,v $ -- Description : Makefile for the PostgreSQL sample database -- Author : Michael Erdmann -- Created On : 02-April-2001 -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2002/01/23 20:07:01 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000-2001 -- -- GNADE is copyrighted by the persons and institutions enumerated in the -- -- AUTHORS file. This file is located in the root directory of the -- -- GNADE distribution. -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- GNADE Ada units, or you link GNADE Ada units or libraries with other -- -- files to produce an executable, these units or libraries do not by -- -- itself cause the resulting executable to be covered by the GNU -- -- General Public License. This exception does not however invalidate -- -- any other reasons why the executable file might be covered by the -- -- GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- ---------------------------------------------------------------------------- -- Functional Description -- ====================== -- This SQL Script generates the test data base as it is used by -- the code in the ./samples directory. The demo user has username="gnade" -- and password="gnade". -- -- -- Restrictions -- ============ -- This script is intended for use with MySQL. -- -- References -- ========== -- -- build the test data base and store some tupples in it CREATE TABLE EMPLOYEES ( empno int4 NOT NULL, name character(20) NOT NULL, firstname character(20), deptno int4, since date, manager int4, job character(20), promotion bool, salary decimal(8,4) ); CREATE TABLE DEPARTMENTS ( deptno int4 NOT NULL, name character(20) NOT NULL, location character(20) ); --- Testdata insert into EMPLOYEES values ( 1, 'Erdmann', 'Michael', 1001, '1999-12-31', 2, 'Coding Monkey', 'T', 200.1234 ); insert into EMPLOYEES values ( 2, 'Massalski', 'Marina', 1000, '2000-01-09', null, 'Supervisor', 'F', 200.00 ); insert into EMPLOYEES values ( 3, 'Tully', 'Noel', 1001, '1959-01-23', 2, 'Supervisor', 'T', 200.00 ); insert into EMPLOYEES values ( 4, 'Pfeifer', 'Jürgen', 1001, '2001-01-01', 2, 'Designer', 'T', 200.00 ); insert into EMPLOYEES values ( 5, 'Smith', 'John', 1000, '1980-06-11', 3, 'Coding Monkey', 'T', 250.00 ); insert into EMPLOYEES values ( 6, 'Smith', 'John', 1001, '1972-06-11', 3, 'Designer', 'T', 820.00 ); insert into EMPLOYEES values ( 50, 'Simpson', 'Bud', 1003, '1980-06-11', 3, 'Clerk', 'F', 20.00 ); insert into EMPLOYEES values ( 51, 'Bundy', 'Al', 1003, '1980-06-11', 3, 'Clerk', 'F', 10.00 ); insert into EMPLOYEES values ( 52, 'Bundy', 'Peggy', 1003, '1988-06-15', 3, null, 'F', -10.00 ); insert into EMPLOYEES values ( 53, 'Simpson', 'Kelly', 1003, '1995-09-11', 3, 'Secretary', 'F', 20.00 ); insert into EMPLOYEES values (500, 'Rutherford', 'Ernest', 2000, '1930-05-30', 3, 'Genius', 'T',1200.00 ); insert into EMPLOYEES values (501, 'Fermi', null, 2000, '1940-07-29', 3, 'Genius', 'T',1200.00 ); insert into EMPLOYEES values (502, 'Einstein', 'Albert', 2000, '1941-04-30', 2, 'Genius', 'T',1200.00 ); insert into EMPLOYEES values (503, 'Fermi', null, 2000, '1020-08-15', 2, 'Genius', 'T',1200.99 ); insert into DEPARTMENTS values( 1001, 'Sales', 'Berlin' ); insert into DEPARTMENTS values( 1000, 'Developement', 'Stuttgart' ); insert into DEPARTMENTS values( 1002, 'CM and Production', 'Bonn' ); insert into DEPARTMENTS values( 1003, 'Support', 'Chicago' ); insert into DEPARTMENTS values( 2000, 'Masterminds', null ); CREATE TABLE LOCATIONS ( NAME CHARACTER(20) NOT NULL PRIMARY KEY, CITY VARCHAR(40), STREET VARCHAR(80), NO CHARACTER(5), ZIPCODE INT ) ; insert into LOCATIONS values( 'Berlin', 'Berlin','Siemensdamm', '50a', 10243 ); insert into LOCATIONS values( 'Bonn', 'Bonn','Oberkasselerstrasse', '8', 47112 ); insert into LOCATIONS values( 'Stuttgart', 'Stuttgart','Lorenzweg', '1', 60001 ); insert into LOCATIONS values( 'Chicage', 'Chicago','Bundy Stree', '9996', 70001 ); gnade-1.6.2.orig/samples/sample_db/gnade.oracle.sql0000644000175000017500000001450607364523764022060 0ustar lbrentalbrenta-- ---------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/samples/sample_db/gnade.oracle.sql,v $ -- Description : Makefile for the Oracle sample database -- Author : Juergen Pfeifer -- Created On : 03-Jan-2001 -- Last Modified By: François Fabien -- Last Modified On: $Date: 2001/10/21 10:48:20 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000-2001 -- -- GNADE is copyrighted by the persons and institutions enumerated in the -- -- AUTHORS file. This file is located in the root directory of the -- -- GNADE distribution. -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- GNADE Ada units, or you link GNADE Ada units or libraries with other -- -- files to produce an executable, these units or libraries do not by -- -- itself cause the resulting executable to be covered by the GNU -- -- General Public License. This exception does not however invalidate -- -- any other reasons why the executable file might be covered by the -- -- GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- ---------------------------------------------------------------------------- -- Functional Description -- ====================== -- This SQL Script generates the test data base as it is used by -- the code in the ./samples directory. The user must log under SQL*Plus -- and type SQL>@gnade_oracle to execute the script. -- -- -- Restrictions -- ============ -- The script has been build and tested with Oracle 8i Lite on Win95. -- -- References -- ========== -- Decimal follow European rule with ',' as separator and not '.' as US CREATE TABLE EMPLOYEES ( empno int NOT NULL, name character(20) NOT NULL, firstname character(20), deptno int, since date, manager int, job character(20), promotion character(1), salary decimal(8,4)); CREATE TABLE DEPARTMENTS ( deptno int NOT NULL, name character(20) NOT NULL, location character(20)); insert into EMPLOYEES values ( 1, 'Erdmann', 'Michael', 1001, '31-DEC-1999', 2, 'Coding Monkey', 'T', '200,1234' ); insert into EMPLOYEES values ( 2, 'Massalski', 'Marina', 1000, '01-SEP-2000', null, 'Supervisor', 'F', '200,00' ); insert into EMPLOYEES values ( 3, 'Tully', 'Noel', 1001, '23-JAN-1959', 2, 'Supervisor', 'T', '200,00' ); insert into EMPLOYEES values ( 4, 'Pfeifer', 'Jürgen', 1001, '01-JAN-2001', 2, 'Designer', 'T', '200,00' ); insert into EMPLOYEES values ( 5, 'Smith', 'John', 1000, '1980-06-11', 3, 'Coding Monkey', 'T', '250,00' ); insert into EMPLOYEES values ( 6, 'Smith', 'John', 1001, '1972-06-11', 3, 'Designer', 'T', '820,00' ); insert into EMPLOYEES values ( 50, 'Simpson', 'Bud', 1003, '1980-06-11', 3, 'Clerk', 'F', '20,00' ); insert into EMPLOYEES values ( 51, 'Bundy', 'Al', 1003, '1980-06-11', 3, 'Clerk', 'F', '10,00' ); insert into EMPLOYEES values ( 52, 'Bundy', 'Peggy', 1003, '1988-06-15', 3, null, 'F', '-10,00' ); insert into EMPLOYEES values ( 53, 'Simpson', 'Kelly', 1003, '1995-09-11', 3, 'Secretary', 'F', '20,00' ); insert into EMPLOYEES values (500, 'Rutherford', 'Ernest', 2000, '1930-05-30', 3, 'Genius', 'T','1200,00' ); insert into EMPLOYEES values (501, 'Fermi', null, 2000, '1940-07-29', 3, 'Genius', 'T','1200,00' ); insert into EMPLOYEES values (502, 'Poincaré', 'Henri', 2000, '1904-01-01', 2, 'Genius', 'T','1200,00' ); insert into EMPLOYEES values (503, 'Fermi', null, 2000, '1020-08-15', 2, 'Genius', 'T','1200,99' ); insert into DEPARTMENTS values( 1001, 'Sales', 'Berlin' ); insert into DEPARTMENTS values( 1000, 'Developement', 'Stuttgart' ); insert into DEPARTMENTS values( 1002, 'CM and Production', 'Bonn' ); insert into DEPARTMENTS values( 1003, 'Support', 'Chicago' ); insert into DEPARTMENTS values( 2000, 'Masterminds', null ); CREATE TABLE LOCATIONS ( NAME CHARACTER(20) NOT NULL PRIMARY KEY, CITY VARCHAR(40), STREET VARCHAR(80), NO CHARACTER(5), ZIPCODE INT ); insert into locations values( 'Berlin', 'Berlin','Siemensdamm', '50a', 10243 ); insert into locations values( 'Bonn', 'Bonn','Oberkasselerstrasse', '8', 47112 ); insert into locations values( 'Stuttgart', 'Stuttgart','Lorenzweg', '1', 60001 ); insert into locations values( 'Chicage', 'Chicago','Bundy Stree', '9996', 70001 ); commit; gnade-1.6.2.orig/samples/sample_db/gnade.postgres.sql0000644000175000017500000001521707364523764022461 0ustar lbrentalbrenta-- ---------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/samples/sample_db/gnade.postgres.sql,v $ -- Description : Makefile for the PostgreSQL sample database -- Author : Juergen Pfeifer -- Created On : 03-Jan-2001 -- Last Modified By: $Author: me $ -- Last Modified On: $Date: 2001/10/21 10:48:20 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000-2001 -- -- GNADE is copyrighted by the persons and institutions enumerated in the -- -- AUTHORS file. This file is located in the root directory of the -- -- GNADE distribution. -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- GNADE Ada units, or you link GNADE Ada units or libraries with other -- -- files to produce an executable, these units or libraries do not by -- -- itself cause the resulting executable to be covered by the GNU -- -- General Public License. This exception does not however invalidate -- -- any other reasons why the executable file might be covered by the -- -- GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- ---------------------------------------------------------------------------- -- Functional Description -- ====================== -- This SQL Script generates the test data base as it is used by -- the code in the ./samples directory. The demo user has username="gnade" -- and password="gnade". -- -- -- Restrictions -- ============ -- The script has been build and tested with postgres, but i believe -- that the script is quite easy to adopt to others dbcs's. -- -- References -- ========== -- CREATE TABLE "employees" ( "empno" int4 NOT NULL, "name" character(20) NOT NULL, "firstname" character(20), "deptno" int4, "since" date, "manager" int4, "job" character(20), "promotion" bool, "salary" decimal(8,4) ); CREATE TABLE "departments" ( "deptno" int4 NOT NULL, "name" character(20) NOT NULL, "location" character(20) ); --- Testdata insert into "employees" values ( 1, 'Erdmann', 'Michael', 1001, '1999-12-31', 2, 'Coding Monkey', 'T', 200.1234 ); insert into "employees" values ( 2, 'Massalski', 'Marina', 1000, '2000-01-09', null, 'Supervisor', 'F', 200.00 ); insert into "employees" values ( 3, 'Tully', 'Noel', 1001, '1959-01-23', 2, 'Supervisor', 'T', 200.00 ); insert into "employees" values ( 4, 'Pfeifer', 'Jürgen', 1001, '2001-01-01', 2, 'Designer', 'T', 200.00 ); insert into "employees" values ( 5, 'Smith', 'John', 1000, '1980-06-11', 3, 'Coding Monkey', 'T', 250.00 ); insert into "employees" values ( 6, 'Smith', 'John', 1001, '1972-06-11', 3, 'Designer', 'T', 820.00 ); insert into "employees" values ( 50, 'Simpson', 'Bud', 1003, '1980-06-11', 3, 'Clerk', 'F', 20.00 ); insert into "employees" values ( 51, 'Bundy', 'Al', 1003, '1980-06-11', 3, 'Clerk', 'F', 10.00 ); insert into "employees" values ( 52, 'Bundy', 'Peggy', 1003, '1988-06-15', 3, null, 'F', -10.00 ); insert into "employees" values ( 53, 'Simpson', 'Kelly', 1003, '1995-09-11', 3, 'Secretary', 'F', 20.00 ); insert into "employees" values (500, 'Rutherford', 'Ernest', 2000, '1930-05-30', 3, 'Genius', 'T',1200.00 ); insert into "employees" values (501, 'Fermi', null, 2000, '1940-07-29', 3, 'Genius', 'T',1200.00 ); insert into "employees" values (502, 'Einstein', 'Albert', 2000, '1941-04-30', 2, 'Genius', 'T',1200.00 ); insert into "employees" values (503, 'Fermi', null, 2000, '1020-08-15', 2, 'Genius', 'T',1200.00 ); insert into "departments" values( 1001, 'Sales', 'Berlin' ); insert into "departments" values( 1000, 'Developement', 'Stuttgart' ); insert into "departments" values( 1002, 'CM and Production', 'Bonn' ); insert into "departments" values( 1003, 'Support', 'Chicago' ); insert into "departments" values( 2000, 'Masterminds', null ); CREATE TABLE LOCATIONS ( NAME CHARACTER(20) NOT NULL PRIMARY KEY, CITY VARCHAR(40), STREET VARCHAR(80), NO CHARACTER(5), ZIPCODE INT ) ; insert into locations values( 'Berlin', 'Berlin','Siemensdamm', '50a', 10243 ); insert into locations values( 'Bonn', 'Bonn','Oberkasselerstrasse', '8', 47112 ); insert into locations values( 'Stuttgart', 'Stuttgart','Lorenzweg', '1', 60001 ); insert into locations values( 'Chicage', 'Chicago','Bundy Stree', '9996', 70001 ); -- ACL Information. This may have to be changed if a different DBCS is used REVOKE ALL on "employees" from PUBLIC; REVOKE ALL on "departments" from PUBLIC; REVOKE ALL on "locations" from PUBLIC; GRANT ALL on "employees" to PUBLIC; GRANT ALL on "departments" to PUBLIC; GRANT ALL on "locations" to PUBLIC; gnade-1.6.2.orig/samples/sample_db/gnade_remove.mimer.sql0000644000175000017500000000551110022433513023246 0ustar lbrentalbrenta-- ---------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/samples/sample_db/gnade_remove.mimer.sql,v $ -- Description : Remove the database contents -- Author : Sune Falck -- Created On : 06-Apr-2001 -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2004/03/06 20:40:43 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000-2001 -- -- GNADE is copyrighted by the persons and institutions enumerated in the -- -- AUTHORS file. This file is located in the root directory of the -- -- GNADE distribution. -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- GNADE Ada units, or you link GNADE Ada units or libraries with other -- -- files to produce an executable, these units or libraries do not by -- -- itself cause the resulting executable to be covered by the GNU -- -- General Public License. This exception does not however invalidate -- -- any other reasons why the executable file might be covered by the -- -- GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- ---------------------------------------------------------------------------- DROP TABLE EMPLOYEES; DROP TABLE DEPARTMENTS; DROP TABLE LOCATIONS; DROP TABLE ATTACHMENTS; gnade-1.6.2.orig/samples/sample_db/mimersql.sh0000755000175000017500000000546007565512655021204 0ustar lbrentalbrenta#/bin/sh ## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/samples/sample_db/mimersql.sh,v $ ## Description : Help script for MimerSQL ## Author : Michael Erdmann |Michael.Erdmann@snafu.de> ## Created On : 07-Apr-2001 ## Last Modified By: $Author: merdmann $ ## Last Modified On: $Date: 2002/11/16 18:59:57 $ ## Status : $State: Exp $ ## ## Copyright (C) 2000-2001 ## ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- bsql $1 <<-% $2 $3 READ '$4'; EXIT; % gnade-1.6.2.orig/samples/sample_db/odbc.ini.sample.in0000644000175000017500000000036307262423361022273 0ustar lbrentalbrenta[@odbc_source@] Description = ODBC Testdatabase Driver = @odbc_driver@ Database = gnade Servername = localhost Port = 5432 ReadOnly = No RowVersioning = No ShowSystemTables = No ShowOidColumn = No FakeOidIndex = No ConnSettings = gnade-1.6.2.orig/samples/sample_db/remove_user.mysql.sql0000644000175000017500000000615707262114223023217 0ustar lbrentalbrenta-- ---------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/samples/sample_db/remove_user.mysql.sql,v $ -- Description : Makefile for the PostgreSQL sample database -- Author : Juergen Pfeifer -- Created On : 03-Jan-2001 -- Last Modified By: $Author: me $ -- Last Modified On: $Date: 2001/04/02 15:19:47 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000-2001 -- -- GNADE is copyrighted by the persons and institutions enumerated in the -- -- AUTHORS file. This file is located in the root directory of the -- -- GNADE distribution. -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- GNADE Ada units, or you link GNADE Ada units or libraries with other -- -- files to produce an executable, these units or libraries do not by -- -- itself cause the resulting executable to be covered by the GNU -- -- General Public License. This exception does not however invalidate -- -- any other reasons why the executable file might be covered by the -- -- GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- ---------------------------------------------------------------------------- -- Functional Description -- ====================== -- -- -- Restrictions -- ============ -- -- References -- ========== -- use mysql; REVOKE ALL PRIVILEGES ON * FROM gnade@localhost ; REVOKE ALL PRIVILEGES ON * FROM gnade@"%"; FLUSH PRIVILEGES; gnade-1.6.2.orig/samples/sqlite/0000755000175000017500000000000011040716254016342 5ustar lbrentalbrentagnade-1.6.2.orig/samples/sqlite/Makefile0000644000175000017500000000652510027065742020015 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/samples/sqlite/Makefile,v $ ## Description : Makefile for the SQLite examples ## Author : ## Created On : 27-July-2003 ## Last Modified By: $Author: merdmann $ ## Last Modified On: $Date: 2004/03/20 16:05:54 $ ## Status : $State: Exp $ ## ## Copyright (C) 2000-2004 M.Erdmann ## ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNADE; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## This makefile builds the sample programs for the SQLite binding. ## ## all : builds all binaries ## clean : remove all binaries and objects ## newdb : builds a new data base ## distclean : clean up completely ## ## Restrictions ## ============ ## ## References ## ========== ## sinclude ../conf.local sinclude ../../make.conf # mainunits=demo.adb binaries=$(subst .adb,$(bin),$(mainunits)) all build:: $(mainunits) $(ADAMAKE) -Psqlite.gpr $(mainunits) ## ## ## clean: $(RM) $(binaries) b~*.* *.o *.ali core *~ *~*~ *.log distclean :: clean $(RM) -rf demo.db gnade-1.6.2.orig/samples/sqlite/Makefile.sqlite0000644000175000017500000000617410042013505021300 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/samples/sqlite/Makefile.sqlite,v $ ## Description : Makefile for the SQLite examples ## Author : ## Created On : 27-July-2003 ## Last Modified By: $Author: merdmann $ ## Last Modified On: $Date: 2004/04/22 19:04:37 $ ## Status : $State: Exp $ ## ## Copyright (C) 2000-2004 M.Erdmann ## ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNADE; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## This makefile builds the sample programs for the SQLite binding. ## ## all : builds all binaries ## clean : remove all binaries and objects ## newdb : builds a new data base ## distclean : clean up completely ## ## Restrictions ## ============ ## ## References ## ========== ## all build $(subs .adb,.o,$(wildcard *.adb)): $(MAKE) -C./ $@ gnade-1.6.2.orig/samples/sqlite/README0000644000175000017500000000074310011241675017223 0ustar lbrentalbrentaThis directory contains a demo program that uses the ada sqlite binding, GNU.DB.SQLite. I've only tested the code on Windows 2000 with GNAT 3.15p. To use it under windows, download the def and dll files from the website of sqlite. Then create a static import library file as stated in GNAT User's Guide section 25.7.2.2 Gnat-Style Import Library. This means to build the import library "libsqlite.a" as follows: $ gnatdll -e sqlite.def -d sqlite.dll Ching Bon Lam (cblam@gmx.net)gnade-1.6.2.orig/samples/sqlite/demo.adb0000644000175000017500000000366410022677134017751 0ustar lbrentalbrentawith Ada.Text_IO; use Ada.Text_IO; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with GNU.DB.SQLite; use GNU.DB.SQLite; procedure Demo is Version : constant String := "$Id: demo.adb,v 1.4 2004/03/07 19:56:12 merdmann Exp $"; function List (argc : integer; argv : Row_Array; columnNames : Row_Array) return integer is begin for I in argv'Range loop Put_Line(To_String(columnNames(I) & ": " & argv(I))); end loop; return 0; end List; db : GNU.DB.Sqlite.Object; table : Table_Controlled; errmsg : Ustring; begin Put_Line("Opening the file example.db"); Open(db, "demo.db", READ_WRITE, errmsg); Put_Line("Create a table called DEMO with fields bla, ble and blo"); Exec(db, "CREATE TABLE demo(bla INT, ble INT, blo INT);", errmsg); New_Line; Put_Line("Insert 10 rows with (100, 200, 300)"); for I in 1..10 loop Exec(db, "INSERT INTO demo VALUES(100, 200, 300);", errmsg); end loop; New_Line; Put_Line("Select everything in table DEMO"); New_Line; Put_Line("1: Using get_table"); get_table(db, "SELECT * FROM demo;", table, errmsg); Put_Line("table has " & integer'Image(table.table'Last) & " rows"); for I in table.Table'Range loop for J in table.Table(I)'Range loop Put(To_String(table.table(I)(J))); Put(" "); end loop; New_Line; end loop; New_Line; Put_Line("2: Using exec_with_callback"); exec_with_callback(db, "SELECT * FROM demo;", List'Unrestricted_Access, errmsg); New_Line; Put_Line("Drop table DEMO"); Exec(db, "DROP TABLE demo;", errmsg); Close(db); exception -- too lazy to catch specific exceptions when others => if errmsg /= Null_Unbounded_String then Put_Line(To_String(errmsg)); end if; end Demo; gnade-1.6.2.orig/samples/sqlite/sqlite.gpr0000644000175000017500000000164110027065742020362 0ustar lbrentalbrenta-- $Id: sqlite.gpr,v 1.4 2004/03/20 16:05:54 merdmann Exp $ with "../../gnade"; project SQLite is for Languages use ("Ada"); for Source_Dirs use ("."); for Object_Dir use "."; for Main use ("demo.adb" ); IncludeOpt := "-I" & gnade.ROOT & "/" & gnade.ARCH &"-include" ; LibOpt := "-L" & gnade.ROOT & "/" & gnade.ARCH & "-lib" ; for Exec_Dir use "."; package Linker is for Default_Switches ("Ada") use ("-g", LibOpt, "-lgnadesqlite", gnade.NALINKEROPT ); end Linker; package Binder is for Default_Switches ("Ada") use ("-static"); end Binder; package Compiler is for Default_Switches ("Ada") use ("-g", IncludeOPT ); end Compiler; package Builder is for Default_Switches ("Ada") use ( "-gnatQ", IncludeOPT ); end Builder; package Ide is for Vcs_Kind use "CVS"; end Ide; end SQLite; gnade-1.6.2.orig/samples/sqlite3/0000755000175000017500000000000011040716276016431 5ustar lbrentalbrentagnade-1.6.2.orig/samples/sqlite3/Makefile0000644000175000017500000000646610663650252020106 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/samples/sqlite3/Makefile,v $ ## Description : Makefile for the SQLite examples ## Author : ## Created On : 27-July-2003 ## Last Modified By: $Author: persan $ ## Last Modified On: $Date: 2007/08/24 21:42:02 $ ## Status : $State: Exp $ ## ## Copyright (C) 2000-2004 M.Erdmann ## ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNADE; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## This makefile builds the sample programs for the SQLite binding. ## ## all : builds all binaries ## clean : remove all binaries and objects ## newdb : builds a new data base ## distclean : clean up completely ## ## Restrictions ## ============ ## ## References ## ========== ## sinclude ../conf.local sinclude ../../make.conf # all build:: $(mainunits) $(ADAMAKE) -p -Pgnade-sqlite-samples.gpr ## ## ## clean: gnatclean -Pgnade-sqlite-samples.gpr $(RM) $(wildcard b~*.* core *~ *~*~ *.log) distclean :: clean $(RM) -rf demo.db gnade-1.6.2.orig/samples/sqlite3/Makefile.sqlite0000644000175000017500000000617510637241242021377 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/samples/sqlite3/Makefile.sqlite,v $ ## Description : Makefile for the SQLite examples ## Author : ## Created On : 27-July-2003 ## Last Modified By: $Author: merdmann $ ## Last Modified On: $Date: 2007/06/23 15:56:18 $ ## Status : $State: Exp $ ## ## Copyright (C) 2000-2004 M.Erdmann ## ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNADE; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## This makefile builds the sample programs for the SQLite binding. ## ## all : builds all binaries ## clean : remove all binaries and objects ## newdb : builds a new data base ## distclean : clean up completely ## ## Restrictions ## ============ ## ## References ## ========== ## all build $(subs .adb,.o,$(wildcard *.adb)): $(MAKE) -C./ $@ gnade-1.6.2.orig/samples/sqlite3/README0000644000175000017500000000111110637241242017300 0ustar lbrentalbrenta** Added a sample directory for sqlite3 as well since i expect changes in the API. M.Erdmann This directory contains a demo program that uses the ada sqlite binding, GNU.DB.SQLite. I've only tested the code on Windows 2000 with GNAT 3.15p. To use it under windows, download the def and dll files from the website of sqlite. Then create a static import library file as stated in GNAT User's Guide section 25.7.2.2 Gnat-Style Import Library. This means to build the import library "libsqlite.a" as follows: $ gnatdll -e sqlite.def -d sqlite.dll Ching Bon Lam (cblam@gmx.net) gnade-1.6.2.orig/samples/sqlite3/demo.adb0000644000175000017500000000347010663646042020034 0ustar lbrentalbrentawith Ada.Text_IO; use Ada.Text_IO; with GNU.DB.SQLite3; use GNU.DB.SQLite3; procedure Demo is --Version : constant String := "$Id: demo.adb,v 1.2 2007/08/24 21:22:42 persan Exp $"; function List (Argc : Integer; Argv : String_Vectors.Vector; ColumnNames : String_Vectors.Vector) return Return_Value is begin for I in Natural'(0) .. Natural (Argc - 1) loop Put_Line (ColumnNames.Element (I) & ": " & Argv.Element (I)); end loop; return SQLITE_OK; end List; Db : aliased GNU.DB.SQLite3.Object; Table : Table_Reference := new String_Tables.Vector; Result : Return_Value; pragma Warnings (Off, Table); pragma Warnings (Off, Result); begin Put_Line ("Opening the file example.db"); Result := Db.Open ("demo.db"); Put_Line ("Create a table called DEMO with fields bla, ble and blo"); Db.Exec ("CREATE TABLE demo(bla INT, ble INT, blo INT);"); Db.Exec ("CREATE TABLE tare(Name String, Time Float, Data BLOB);"); New_Line; Put_Line ("Insert 10 rows with (100, 200, 300)"); for I in 1 .. 10 loop Db.Exec ("INSERT INTO demo VALUES(" & I'Img & ", 200, 300);"); end loop; New_Line; Put_Line ("Select everything in table DEMO"); New_Line; Put_Line ("1: Using get_table"); Result := Db.Get_Table ("SELECT * FROM demo;", Table); -- for I in Table.Table'Range loop -- for J in Table.Table (I)'Range loop -- Put (To_String (Table.Table (I) (J))); -- Put (" "); -- end loop; -- -- New_Line; -- end loop; New_Line; Put_Line ("2: Using exec_with_callback"); Db.Exec ("SELECT * FROM demo where bla > 4;", List'Unrestricted_Access); New_Line; Put_Line ("Drop table DEMO"); Result := Db.Exec ("DROP TABLE demo;"); Db.Close; end Demo; gnade-1.6.2.orig/samples/sqlite3/gnade-sqlite-samples.gpr0000644000175000017500000000163310663646005023167 0ustar lbrentalbrenta-- $Id: gnade-sqlite-samples.gpr,v 1.1 2007/08/24 21:22:13 persan Exp $ with "../../gnade"; with "../../dbi/sqlite3/gnade-sqlite.gpr"; project Gnade.SQLite.Samples is for Languages use ("Ada"); for Source_Dirs use ("."); for Object_Dir use Gnade'Object_Dir; for Exec_Dir use Gnade'Exec_Dir; for Main use ("demo.adb" ); for Exec_Dir use "."; package Builder is for Default_Switches ("Ada") use gnade.Builder'Default_Switches ("Ada"); end Builder; package Compiler is for Default_Switches ("Ada") use gnade.Compiler'Default_Switches ("Ada"); end Compiler; package Binder is for Default_Switches ("Ada") use gnade.Binder'Default_Switches ("Ada"); end Binder; package Linker is for Default_Switches ("Ada") use gnade.Linker'Default_Switches ("Ada"); end Linker; package Ide is for Vcs_Kind use "CVS"; end Ide; end Gnade.SQLite.Samples; gnade-1.6.2.orig/samples/standalone/0000755000175000017500000000000011040716254017171 5ustar lbrentalbrentagnade-1.6.2.orig/samples/standalone/Makefile0000644000175000017500000001132510056134017020630 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/samples/standalone/Makefile,v $ ## Description : Makefile for the embedded SQL samples ## Author : Juergen Pfeifer ## Created On : 03-Jan-2001 ## Last Modified By: $Author: merdmann $ ## Last Modified On: $Date: 2004/05/29 16:19:27 $ ## Status : $State: Exp $ ## ## Copyright (C) 2000-2004 ## ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## ## This is a sample makefile which can be used as a starting point when you -- ## start to setup a development environment for a application. -- ## ## ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## This makefile builds the sample programs for embedded SQL. ## ## Restrictions ## ============ ## None ## ## References ## ========== ## None ## ## ESQLFLAGS = $(DEBUG) -v -s -pedantic $(FLAGS) ## some oprtating dependent pathes and flags. ifneq ($(OS),Windows_NT) GNADEPATH="" application=nobel_co define compile-app gnatmake $@.adb -o $@ $q `gnade-config --cflags` -largs `gnade-config --libs` endef else GNADEPATH=/gnade/win32-bin/ application=nobel_co.exe define compile-app gnatmake -Pnobel.gpr nobel_co.adb -largs -L/gnat/lib/win32 -lodbc32 endef endif ESQL=$(subst /,\\, $(GNADEPATH)gesql) ## ## Rules for the execution of the preprocessoe GESQL ## .SUFFIXES: .adb .gpq # run the ebedded sql translator .gpq.adb: $(ESQL) $(ESQLFLAGS) $(DBAUTH) $*.gpq ## ## Application specific definitions # # all exported executable DBUSER=gnade DBPASSWD=gnade DBSOURCE=gnade DBAUTH= -DDBUSER=\"$(DBUSER)\" \ -DDBPASSWD=\"$(DBPASSWD)\" \ -DDBSOURCE=\"$(DBSOURCE)\" # ------------------------------------------------------------------------- # # E X E C U T A B L E S # # ------------------------------------------------------------------------- # all: @echo "standalone sample will not be compiled" #all build :: $(application) # # small company data base demonstration # nobel.adb: nobel.gpq $(application): nobel_co.adb nobel.adb nobel.ads $(compile-app) # ------------------------------------------------------------------------- # # C L E A N T H E D I R E C T O R Y # # ------------------------------------------------------------------------- # clean: $(RM) $(application) b~*.* *.o *.ali core *~ bb.out $(RM) nobel.adb distclean :: clean gnade-1.6.2.orig/samples/standalone/Makefile.nobel0000644000175000017500000000576010027125042021730 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/samples/standalone/Makefile.nobel,v $ ## Description : Makefile for the embedded SQL samples ## Author : Juergen Pfeifer ## Created On : 03-Jan-2001 ## Last Modified By: $Author: merdmann $ ## Last Modified On: $Date: 2004/03/20 20:31:30 $ ## Status : $State: Exp $ ## ## Copyright (C) 2000-2003 ## ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## This makefile builds the sample programs for embedded SQL. ## ## Restrictions ## ============ ## None ## ## References ## ========== ## None ## ## all build :: $(MAKE) -C./ $@ gnade-1.6.2.orig/samples/standalone/README0000644000175000017500000000043710027125042020046 0ustar lbrentalbrentaThis directory contains an expample for a standalone environment which might be used by every user on the system. This works only after the the system wide installation has been performed and the environment Variable export ADA_PROJECT_PATH=/usr/local/gnade/share has been set. gnade-1.6.2.orig/samples/standalone/nobel.ads0000644000175000017500000000025607454605224020774 0ustar lbrentalbrentapackage Nobel is procedure Print_Departement( Departement : Integer ); procedure Report_All_Departements; procedure Connect; procedure Disconnect; end Nobel; gnade-1.6.2.orig/samples/standalone/nobel.gpq0000644000175000017500000002026607454605224021017 0ustar lbrentalbrenta--| --| Filename : $Source: /cvsroot/gnade/gnade/samples/standalone/nobel.gpq,v $ --| Description : This is a sample program for esql. --| Author : Michael Erdmann --| Created On : 8.12.2000 --| Last Modified By: $Author: merdmann $ --| Last Modified On: $Date: 2002/04/09 15:36:52 $ --| Status : $State: Exp $ --| --| Copyright (C) 2000, 2001 Michael Erdmann --| --| This program is free software; you can redistribute it and/or --| modify it under the terms of the GNU General Public License --| as published by the Free Software Foundation; either version 2 --| of the License, or (at your option) any later version. --| --| This program/code is distributed in the hope that it will be useful, --| but WITHOUT ANY WARRANTY; without even the implied warranty of --| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --| GNU General Public License for more details. --| --| You should have received a copy of the GNU General Public License along --| with this program; if not, write to the Free Software Foundation, Inc., --| 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --| --| As a special exception, if other files instantiate generics from this --| unit, or you link this unit with other files to produce an executable, --| this unit does not by itself cause the resulting executable to be --| covered by the GNU General Public License. This exception does not --| however invalidate any other reasons why the executable file might be --| covered by the GNU Public License. --| --| Functional Description --| ====================== --| --| This is an example for embedded SQL. It demonstrates the ISO/92 --| features and addtional esql extensions. --| --| --| Restrictions --| ============ --| --| References --| ========== --| --| with Ada.Text_IO; use Ada.Text_IO; with SQL_STANDARD; use SQL_STANDARD; with Ada.Strings.Fixed; use Ada.Strings.Fixed; with Ada.Strings; use Ada.Strings; with Ada.Text_IO.Editing; use Ada.Text_IO.Editing; package body Nobel is Nothing_Found : exception; Some_Error : exception; type Euro is delta 0.01 digits 18; package Euro_IO is new Decimal_Output( Num => Euro, Default_Currency => "EU"); EXEC SQL DECLARE DB01 DATABASE ; procedure X( EXEC SQL DECLARE DB DATABASE ) is begin null; end X; ----------------------- -- Print_Departement -- ----------------------- procedure Print_Departement( departement : in Integer ) is -- -- Print all members of a departement -- EXEC SQL BEGIN DECLARE SECTION ; Name : CHAR(1..15); First_Name : CHAR(1..15); First_Name_Ind : INDICATOR_TYPE := 0; Job : CHAR(1..15); Job_Ind : INDICATOR_TYPE := 0; Depno : INT := INT( Departement ); Empno : INT; Manager : INT; Manager_Ind : INDICATOR_TYPE := 0; Manager_Name : CHAR(1..15); dep_location : CHAR(1..15); Salary : DOUBLE_PRECISION := 0.0; EXEC SQL END DECLARE SECTION ; Average_Salary : Euro := 0.0; N : Natural := 0; EXEC SQL INCLUDE SQLCA ; -- Make a private SQLCA package IIO is new Ada.Text_IO.Integer_IO (Integer); use IIO; begin EXEC SQL AT DB01 DECLARE emp_cursor LOCAL CURSOR FOR SELECT EMPNO, FIRSTNAME, NAME, JOB, MANAGER, SALARY FROM EMPLOYEES WHERE deptno = :Depno ORDER BY EMPNO, NAME; -- read out all data seleted by the query EXEC SQL AT DB01 OPEN emp_cursor; Put_Line("Empno Firstname Fam. Name Manager Salary "); Put_Line("===== ============ ============== ============== ==============="); loop EXEC SQL AT DB01 FETCH FROM emp_cursor INTO :Empno, :First_Name INDICATOR :First_Name_Ind, :Name, :Job INDICATOR :Job_Ind, :Manager INDICATOR :Manager_Ind, :SALary; exit when SQLCODE in SQL_STANDARD.NOT_FOUND; if not Is_Null( Manager_Ind ) then EXEC SQL AT DB01 SELECT NAME INTO :Manager_Name FROM EMPLOYEES WHERE EMPNO = :Manager ; if SQLCODE in SQL_STANDARD.NOT_FOUND then Put_Line("Manager not defined"); end if; end if; Put( Integer(Empno), width => 5 ); Put(" "); if not Is_Null( First_Name_Ind ) then Put( To_String(First_Name) ); else Put( "************** " ); end if; Put( To_String(Name) ); if not Is_Null( Manager_Ind ) then Put( To_String(Manager_Name) ); else Put( "************** " ); end if; Put( Euro'Image(Euro(Salary)) ); Average_Salary := Average_Salary + Euro(Salary); N := N + 1; Put_Line(""); end loop; EXEC SQL AT DB01 CLOSE emp_cursor; Put_Line(""); if N > 0 then Put_Line("Average salary : " & Euro'Image( Average_Salary / N ) ); Put_Line(""); end if; end Print_Departement; ----------------------------- -- Report_All_Departements -- ----------------------------- procedure Report_All_Departements is -- -- Report all departement of the company -- EXEC SQL BEGIN DECLARE SECTION END-EXEC Name : CHAR(1..15); Deptno : INT; Location : CHAR(1..15); EXEC SQL END DECLARE SECTION END-EXEC EXEC SQL INCLUDE SQLCA; -- Make a private SQLCA begin EXEC SQL AT DB01 DECLARE Dep_Cursor LOCAL CURSOR FOR SELECT DEPTNO,NAME,LOCATION FROM DEPARTMENTS; EXEC SQL AT DB01 OPEN Dep_Cursor; loop declare EXEC SQL BEGIN DECLARE SECTION END-EXEC street : GNADE.VARCHAR(50); city : GNADE.VARCHAR(50); NO : GNADE.VARCHAR(10); ZIPCODE : INT; loc2find : GNADE.VARCHAR(50); EXEC SQL END DECLARE SECTION END-EXEC begin EXEC SQL AT DB01 FETCH FROM Dep_Cursor INTO :Deptno, :Name, :Location ; exit when SQLCODE in SQL_STANDARD.NOT_FOUND; Put_Line( "Departement : " & INT'Image(Deptno) & " at location : " & To_String(location) ); To_VARCHAR( To_String(location), loc2find ); EXEC SQL AT DB01 SELECT STREET, CITY, NO, ZIPCODE INTO :street, :city, :no, :zipcode FROM locations WHERE NAME = :loc2find; if not ( SQLCODE in SQL_STANDARD.NOT_FOUND ) then Put_line("Address : " & To_String( street ) & " No. " & To_String( no ) & ", " & INT'Image(zipcode) & " " & To_String( city ) ); else Put_Line("*** Address not known ***"); end if; Put_Line(""); Print_Departement( Integer( Deptno ) ); end; end loop; EXEC SQL AT DB01 CLOSE Dep_Cursor; EXEC SQL AT DB01 SELECT DEPTNO INTO :Deptno FROM EMPLOYEES WHERE NAME = 'Erdmann' ; Put_Line("Mr. Erdmann works at department " & INT'Image(Deptno) ); end Report_All_Departements; ------------- -- Connect -- ------------- procedure Connect is connection_failed : exception; begin EXEC SQL CONNECT $DBUSER IDENTIFIED BY $DBPASSWD BY DB01 TO $DBSOURCE ON COMMUNICATION ERROR RAISE connection_failed; exception when connection_failed => Put_Line("*** Database not connected ***"); end Connect; --------------- -- Diconnect -- --------------- procedure Disconnect is begin EXEC SQL DISCONNECT DB01 COMMIT ; end Disconnect; end Nobel; gnade-1.6.2.orig/samples/standalone/nobel.gpr0000644000175000017500000000171410031741227021002 0ustar lbrentalbrenta-- $Id with "gnade"; project Nobel is for Languages use ("Ada", "Gesql", "Project File" ); for Source_Dirs use ("."); for Object_Dir use "."; for Main use ("nobel_co.adb"); for Exec_Dir use "."; package Ide is for Vcs_Kind use "CVS"; for Default_Switches ("GNADE") use ("-DDBSOURCE=GNADE", "-DDBUSER=GNADE", "-DDBPASSWD=GNADE"); for Default_Switches ("SQL") use ("-u", "GNADE", "-p", "GNADE", "GNADE", "-q"); end Ide; package Linker is for Default_Switches ("ada") use ( GNADE.LibOpt, "-lgnadeaux","-lgnadeesql","-lgnadeodbc", gnade.DMLINKEROPT ) ; end Linker; package Binder is for Default_Switches ("ada") use ("-static" ); end Binder; package Compiler is for Default_Switches ("ada") use ("-g", GNADE.IncludeOPT ); end Compiler; package Builder is for Default_Switches ("ada") use ("-g", "-gnatQ", GNADE.IncludeOPT ); end Builder; end Nobel; gnade-1.6.2.orig/samples/standalone/nobel_co.adb0000644000175000017500000000020107454605224021422 0ustar lbrentalbrentawith Nobel; use Nobel; procedure Nobel_Co is begin Connect; Report_All_Departements; Disconnect; end Nobel_Co; gnade-1.6.2.orig/support/0000755000175000017500000000000011040716276015115 5ustar lbrentalbrentagnade-1.6.2.orig/support/Makefile0000644000175000017500000000636310670461534016567 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/support/Makefile,v $ -- ## Description : Makefile for the support library -- ## Author : Michael Erdmann -- ## Created On : 22-Dec-2000 -- ## Last Modified By: $Author: persan $ -- ## Last Modified On: $Date: 2007/09/08 08:54:52 $ -- ## Status : $State: Exp $ -- ## -- ## Copyright (C) 2000-2004 Michael Erdmann -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## ## Restrictions ## ============ ## None ## ## References ## ========== ## None ## .PHONY: clean dist all include ../make.conf ## ## libary ## libname=libgnadeaux ## ## Default target ## all:build install build:: $(PREPROCESSED_SOURCES) $(ADAMAKE) -p -Pgnade-support.gpr ## ## ## install: $(MKDIR) -p $(prefix)/include/gnade/support $(MKDIR) -p $(prefix)/lib/gnade/support $(CP) lib-obj/lib/* $(prefix)/lib/gnade/support $(CP) $(wildcard gnu*.ad?) $(prefix)/include/gnade/support ## ## ## clean: ifeq ($(EXPORT),) $(RM) -rf $(prefix)/include/gnatde/support $(RM) -rf $(prefix)/lib/gnade/support endif $(RM) -rf lib-obj *~ *~*~ gnade-1.6.2.orig/support/Makefile.support0000644000175000017500000000541610027000434020260 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/support/Makefile.support,v $ -- ## Description : Makefile for the support library -- ## Author : Michael Erdmann -- ## Created On : 22-Dec-2000 -- ## Last Modified By: $Author: merdmann $ -- ## Last Modified On: $Date: 2004/03/20 08:30:20 $ -- ## Status : $State: Exp $ -- ## -- ## Copyright (C) 2000-2004 Michael Erdmann -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## ## Restrictions ## ============ ## None ## ## References ## ========== ## None ## all build: $(MAKE) -C./ $@ gnade-1.6.2.orig/support/README0000644000175000017500000000010407246173232015772 0ustar lbrentalbrentaThis directory contains all support packages of the GNU.DB domain. gnade-1.6.2.orig/support/gnade-support.gpr0000644000175000017500000000235110664223611020415 0ustar lbrentalbrentawith "../gnade"; project Gnade.Support is for Languages use ("Ada"); for Source_Dirs use ("."); for Object_Dir use "lib-obj"; for Library_Dir use project'Object_Dir & "/lib"; for Library_Src_Dir use Project'Object_Dir & "/src"; for Library_Name use "gnadeaux"; -- for Library_Interface use ("gnu", -- "gnu.db", -- "gnu.db.support", -- "gnu.db.support.list", -- "gnu.db.support.list.strings", -- "gnu.db.support.string_builder", -- "gnu.db.support.tables", -- "gnu.db.support.number_list"); package Compiler is for Default_Switches ("Ada") use gnade.Compiler'Default_Switches ("Ada"); end Compiler; package Builder is for Default_Switches ("Ada") use gnade.Builder'Default_Switches ("Ada"); end Builder; package Binder is for Default_Switches ("Ada") use gnade.Binder'Default_Switches ("Ada"); end Binder; package Linker is for Default_Switches ("Ada") use gnade.Linker'Default_Switches ("Ada"); end Linker; package IDE renames Gnade.Ide; end Gnade.Support; gnade-1.6.2.orig/support/gnu-db-support-list-strings.adb0000644000175000017500000001623610663647265023136 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/support/gnu-db-support-list-strings.adb,v $ -- Description : Handle simple string lists -- -- Author : Michael Erdmann -- -- Created On : 21-Mar-2002 -- -- Last Modified By: $Author: persan $ -- Last Modified On: $Date: 2007/08/24 21:33:41 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2000-2002 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- -- -- Functional Description -- -- ====================== -- -- -- -- -- -- -- -- Restrictions -- -- ============ -- -- R.1 - The handling of the tree nodes is currently not task save -- -- -- -- References -- -- ========== -- -- None -- -- -- ------------------------------------------------------------------------------- with Unchecked_Deallocation; package body GNU.DB.Support.List.Strings is Version : constant String := "$Id: gnu-db-support-list-strings.adb,v 1.3 2007/08/24 21:33:41 persan Exp $"; pragma Unreferenced (Version); --- ==================================================================== --- --- L O C A L S U P P O R T D A T A --- --- ==================================================================== --- type String_Element_Access is access all String_List_Element; --- ==================================================================== --- --- S U P P O R T P R O C E D U R E S --- --- ==================================================================== --- -------------- -- Iterator -- -------------- type List_Iterator is new List_Iterator_Type with record Result : Unbounded_String := Null_Unbounded_String; end record; ------------ -- Action -- ------------ procedure Action ( This : in out List_Iterator; P : in out List_Element_Access) is Item : String_List_Element renames String_List_Element (P.all); begin if This.Result /= Null_Unbounded_String then This.Result := This.Result & "," & Item.Value; else This.Result := Item.Value; end if; end Action; --- ==================================================================== --- --- P U B L I C M E T H O D S --- --- ==================================================================== --- ------------- -- Destroy -- ------------- procedure Destroy ( Element : in String_List_Element; Ptr : in out List_Element_Access) is pragma Unreferenced (Element); -- this function should return the memory of the table description procedure Free is new Unchecked_Deallocation (String_List_Element, String_Element_Access); begin Free (String_Element_Access (Ptr)); end Destroy; ----------------- -- Create_Copy -- ----------------- function Create_Copy ( Element : in String_List_Element) return List_Element_Access is Result : constant List_Element_Access := new String_List_Element; -- create a 1:1 copy of the table element. begin String_List_Element (Result.all) := Element; return Result; end Create_Copy; --------------- -- To_String -- --------------- function To_String ( Element : in List_Element_Access) return String is -- convert the list into a comma seperated string IC : List_Iterator; begin IC.Result := Null_Unbounded_String; Perform (Element, IC); return To_String (IC.Result); end To_String; -------------------- -- To_String_List -- -------------------- function To_String_List_Element ( S : in String) return List_Element_Access is Result : constant String_Element_Access := new String_List_Element; begin Result.Value := To_Unbounded_String (S); return List_Element_Access (Result); end To_String_List_Element; ------------ -- Append -- ------------ function "&"( Element : in List_Element_Access; S : in String) return List_Element_Access is begin return Element & To_String_List_Element (S); end "&"; end GNU.DB.Support.List.Strings; gnade-1.6.2.orig/support/gnu-db-support-list-strings.ads0000644000175000017500000001277110663647265023157 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNat Ada Database Environment -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/support/gnu-db-support-list-strings.ads,v $ -- Description : Simple list package -- -- Author : Michael Erdmann -- -- Created On : 16-Mar-2002 -- -- Last Modified By: $Author: persan $ -- Last Modified On: $Date: 2007/08/24 21:33:41 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2000-2002 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- -- -- Functional Description -- -- ====================== -- -- -- -- -- -- -- -- -- -- Restrictions -- -- ============ -- -- R.1 - The handling of the tree nodes is currently not task save -- -- -- -- References -- -- ========== -- -- None -- -- -- ------------------------------------------------------------------------------- with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; package GNU.DB.Support.List.Strings is type String_List_Element is new List_Element with private; --------------------------------------------------------------------------- -- Description: -- Preconditions: -- Postconditions: -- Exceptions: -- Notes: --------------------------------------------------------------------------- function To_String_List_Element ( S : in String) return List_Element_Access; --------------------------------------------------------------------------- -- Description: -- Preconditions: -- Postconditions: -- Exceptions: -- Notes: --------------------------------------------------------------------------- function "&"( Element : in List_Element_Access; S : in String) return List_Element_Access; --------------------------------------------------------------------------- -- Description: -- Preconditions: -- Postconditions: -- Exceptions: -- Notes: --------------------------------------------------------------------------- function To_String ( Element : in List_Element_Access) return String; --- =================================================================== --- private type String_List_Element is new List_Element with record Value : Unbounded_String := Null_Unbounded_String; end record; function Create_Copy ( Element : in String_List_Element) return List_Element_Access; procedure Destroy ( Element : in String_List_Element; Ptr : in out List_Element_Access); end GNU.DB.Support.List.Strings; gnade-1.6.2.orig/support/gnu-db-support-list.adb0000644000175000017500000002040210663647265021435 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/support/gnu-db-support-list.adb,v $ -- Description : Simple list package -- -- Author : Michael Erdmann -- -- Created On : 16-Mar-2002 -- -- Last Modified By: $Author: persan $ -- Last Modified On: $Date: 2007/08/24 21:33:41 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2000-2002 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- -- -- Functional Description -- -- ====================== -- -- -- -- -- -- -- -- Restrictions -- -- ============ -- -- R.1 - The handling of the tree nodes is currently not task save -- -- -- -- References -- -- ========== -- -- None -- -- -- ------------------------------------------------------------------------------- package body GNU.DB.Support.List is --- ==================================================================== --- --- L O C A L S U P P O R T D A T A --- --- ==================================================================== --- type Container_Data is record Head : List_Element_Access := null; Tail : List_Element_Access := null; end record; --- ==================================================================== --- --- S U P P O R T P R O C E D U R E S --- --- ==================================================================== --- ---------------- -- Initialize -- ---------------- procedure Initialize ( This : in out Secure) is pragma Unreferenced (This); begin null; end Initialize; -------------- -- Finalize -- -------------- procedure Finalize ( This : in out Secure) is pragma Unreferenced (This); begin null; end Finalize; ------------------- -- New_Container -- ------------------- function New_Container ( Element : in List_Element_Access) return Container_Data_Access is Result : constant Container_Data_Access := new Container_Data; begin Result.Head := Element; Result.Tail := Element; return Result; end New_Container; --- ==================================================================== --- --- P U B L I C M E T H O D S --- --- ==================================================================== --- ---------- -- Head -- ---------- function Head ( Element : in List_Element_Access) return List_Element_Access is begin if Element.Container /= null then return Element.Container.Head; else raise Not_In_Any_List; end if; end Head; ------------ -- Append -- ------------ procedure Append ( This : in Container_Data_Access; Element : in List_Element_Access) is begin Element.Container := This; Element.Next := null; This.Tail.Next := Element; Element.Previous := This.Tail; This.Tail := Element; end Append; ------------ -- Append -- ------------ procedure Append ( This : in Container_Data_Access; Element : in List_Element'Class) is begin Append (This, Create_Copy (Element)); end Append; ------------ -- Append -- ------------ function "&" ( First : in List_Element_Access; Next : in List_Element_Access) return List_Element_Access is begin if First.Container = null then First.Container := New_Container (First); end if; Append (First.Container, Next); return First; end "&"; ------------ -- Append -- ------------ function "&" ( First : in List_Element_Access; Next : in List_Element'Class) return List_Element_Access is begin if First.Container = null then First.Container := New_Container (First); end if; Append (First.Container, Next); return First; end "&"; ------------ -- Append -- ------------ function "&" ( First : in List_Element'Class; Next : in List_Element'Class) return List_Element_Access is Result : constant List_Element_Access := Create_Copy (First); begin if Result.Container = null then Result.Container := New_Container (Result); end if; Append (Result.Container, Next); return Result; end "&"; ------------- -- Destroy -- ------------- procedure Destroy ( Element : in List_Element_Access) is -- delete all list elements till the end of the list P, Q : List_Element_Access := Element; begin while P /= null loop Q := P.Next; Destroy (P.all, P); P := Q; end loop; end Destroy; ------------- -- Perform -- ------------- procedure Perform ( First : in List_Element_Access; IC : in out List_Iterator_Type'Class) is P : List_Element_Access := First; begin while P /= null loop Action (IC, P); P := P.Next; end loop; end Perform; end GNU.DB.Support.List; gnade-1.6.2.orig/support/gnu-db-support-list.ads0000644000175000017500000001734110663647265021466 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNat Ada Database Environment -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/support/gnu-db-support-list.ads,v $ -- Description : Simple list package -- -- Author : Michael Erdmann -- -- Created On : 16-Mar-2002 -- -- Last Modified By: $Author: persan $ -- Last Modified On: $Date: 2007/08/24 21:33:41 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2000-2002 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- -- -- Functional Description -- -- ====================== -- -- -- -- -- -- -- -- -- -- Restrictions -- -- ============ -- -- R.1 - The handling of the tree nodes is currently not task save -- -- -- -- References -- -- ========== -- -- None -- -- -- ------------------------------------------------------------------------------- with Ada.Finalization; use Ada.Finalization; package GNU.DB.Support.List is type List_Element is abstract tagged private; type List_Element_Access is access all List_Element'Class; type Secure (H : List_Element_Access) is private; --------------------------------------------------------------------------- -- Description: -- Preconditions: -- Postconditions: -- Exceptions: -- Notes: --------------------------------------------------------------------------- function "&" ( First : in List_Element_Access; Next : in List_Element_Access) return List_Element_Access; function "&" ( First : in List_Element_Access; Next : in List_Element'Class) return List_Element_Access; function "&" ( First : in List_Element'Class; Next : in List_Element'Class) return List_Element_Access; --------------------------------------------------------------------------- -- Description: -- Preconditions: -- Postconditions: -- Exceptions: -- Notes: --------------------------------------------------------------------------- procedure Destroy ( Element : in List_Element_Access); --------------------------------------------------------------------------- -- Description: -- Preconditions: -- Postconditions: -- Exceptions: -- Notes: --------------------------------------------------------------------------- function Head ( Element : in List_Element_Access) return List_Element_Access; --------------------------------------------------------------------------- -- Description: -- Preconditions: -- Postconditions: -- Exceptions: -- Notes: --------------------------------------------------------------------------- type List_Iterator_Type is abstract tagged null record; procedure Action ( IC : in out List_Iterator_Type; Element : in out List_Element_Access) is abstract; --------------------------------------------------------------------------- -- Description: -- Preconditions: -- Postconditions: -- Exceptions: -- Notes: --------------------------------------------------------------------------- procedure Perform ( First : in List_Element_Access; IC : in out List_Iterator_Type'Class); --------------------------------------------------------------------------- -- Description: -- Preconditions: -- Postconditions: -- Exceptions: -- Notes: --------------------------------------------------------------------------- procedure Destroy ( Element : in List_Element; Ptr : in out List_Element_Access) is abstract; --------------------------------------------------------------------------- -- Description: -- Preconditions: -- Postconditions: -- Exceptions: -- Notes: --------------------------------------------------------------------------- function Create_Copy ( Element : in List_Element) return List_Element_Access is abstract; Not_In_Any_List : exception; private -- ==================================================================== -- type Container_Data; type Container_Data_Access is access Container_Data; type Secure (H : List_Element_Access) is new Controlled with record null; end record; procedure Initialize ( This : in out Secure); procedure Finalize ( This : in out Secure); type List_Element is abstract tagged record Previous : List_Element_Access := null; Next : List_Element_Access := null; Container : Container_Data_Access := null; end record; end GNU.DB.Support.List; gnade-1.6.2.orig/support/gnu-db-support-number_list.adb0000644000175000017500000001270710663647420023007 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/support/gnu-db-support-number_list.adb,v $ -- Description : Testcode for the support packages -- -- Author : Michael Erdmann -- -- Created On : 16-Mar-2002 -- -- Last Modified By: $Author: persan $ -- Last Modified On: $Date: 2007/08/24 21:35:12 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2000-2002 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- -- -- Functional Description -- -- ====================== -- -- -- -- -- -- -- -- Restrictions -- -- ============ -- -- R.1 - The handling of the tree nodes is currently not task save -- -- -- -- References -- -- ========== -- -- None -- -- -- ------------------------------------------------------------------------------- with Ada.Text_IO; use Ada.Text_IO; package body GNU.DB.Support.Number_List is ------------- -- Destroy -- ------------- procedure Destroy (Element : in Number_List_Element; Ptr : in out List_Element_Access) is pragma Unreferenced (Element, Ptr); begin Put_Line ("*** Destroy element ***"); end Destroy; ----------------- -- Create_Copy -- ----------------- function Create_Copy (Element : in Number_List_Element) return List_Element_Access is Result : constant List_Element_Access := new Number_List_Element (Element.I); begin Number_List_Element (Result.all) := Element; return Result; end Create_Copy; -------------------- -- Print_Iterator -- -------------------- type Print_Iterator is new List_Iterator_Type with null record; ------------ -- Action -- ------------ procedure Action (IC : in out Print_Iterator; Element : in out List_Element_Access) is pragma Unreferenced (IC); This : Number_List_Element renames Number_List_Element (Element.all); begin Put_Line (Integer'Image (This.I)); end Action; ----------- -- Print -- ----------- procedure Print (This : in List_Element_Access) is Iterator : Print_Iterator; begin Perform (This, Iterator); end Print; ------------- -- Element -- ------------- function Element (Value : in Integer) return List_Element_Access is Result : constant List_Element_Access := new Number_List_Element (Value); begin return Result; end Element; end GNU.DB.Support.Number_List; gnade-1.6.2.orig/support/gnu-db-support-number_list.ads0000644000175000017500000001100510663647420023016 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/support/gnu-db-support-number_list.ads,v $ -- Description : Testcode for the support packages -- -- Author : Michael Erdmann -- -- Created On : 16-Mar-2002 -- -- Last Modified By: $Author: persan $ -- Last Modified On: $Date: 2007/08/24 21:35:12 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2000-2002 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- -- -- Functional Description -- -- ====================== -- -- -- -- -- -- -- -- Restrictions -- -- ============ -- -- R.1 - The handling of the tree nodes is currently not task save -- -- -- -- References -- -- ========== -- -- None -- -- -- ------------------------------------------------------------------------------- with GNU.DB.Support.List; use GNU.DB.Support.List; package GNU.DB.Support.Number_List is ------------------------- -- Number_List_Element -- ------------------------- type Number_List_Element (I : Integer) is new List_Element with private; procedure Print ( This : in List_Element_Access); function Element ( Value : in Integer) return List_Element_Access; private type Number_List_Element (I : Integer) is new List_Element with null record; function Create_Copy ( Element : in Number_List_Element) return List_Element_Access; procedure Destroy ( Element : in Number_List_Element; Ptr : in out List_Element_Access); end GNU.DB.Support.Number_List; gnade-1.6.2.orig/support/gnu-db-support-string_builder.adb0000644000175000017500000001460410663647265023505 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNat Ada Database Environment -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/support/gnu-db-support-string_builder.adb,v $ -- Description : Simple string builder package -- -- Author : Michael Erdmann -- -- Created On : 16-Mar-2002 -- -- Last Modified By: $Author: persan $ -- Last Modified On: $Date: 2007/08/24 21:33:41 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2000-2002 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- -- -- Functional Description -- -- ====================== -- -- -- -- -- -- Restrictions -- -- ============ -- -- R.1 - The handling of the tree nodes is currently not task save -- -- -- -- References -- -- ========== -- -- None -- -- -- ------------------------------------------------------------------------------- with Unchecked_Deallocation; package body GNU.DB.Support.String_Builder is type String_Access is access String; ---------------------- -- Object_Data_Type -- ---------------------- type Object_Data_Type is record Length : Natural := 0; Buffer : String_Access := null; end record; procedure Free is new Unchecked_Deallocation (String, String_Access); procedure Free is new Unchecked_Deallocation (Object_Data_Type, Object_Data_Access); ---------------- -- Initialize -- ---------------- function Initialize return Object_Data_Access is Result : constant Object_Data_Access := new Object_Data_Type; begin return Result; end Initialize; -------------- -- Finalize -- -------------- procedure Finalize ( This : in out Object) is begin if This.Data.Buffer /= null then Free (This.Data.Buffer); end if; Free (This.Data); end Finalize; --------------- -- To_String -- ---------------- function To_String ( This : in Object) return String is -- convert the contents of the string buffer into a string Data : Object_Data_Access renames This.Data; begin return Data.Buffer (1 .. Data.Length); end To_String; ----------- -- Clear -- ----------- procedure Clear ( This : in out Object) is Data : Object_Data_Access renames This.Data; begin Data.Length := 0; end Clear; ------------ -- Insert -- ------------ procedure Insert ( This : in out Object; Char : in Character) is -- Insert a character into the string buffer. -- R.1 - If the buffer does not exist create a buffer with 1000 chars -- R.2 - If the buffer get to low to store the character extend the -- buffer. Data : Object_Data_Access renames This.Data; begin if Data.Buffer = null then Data.Buffer := new String (1 .. 2000); Data.Length := 0; end if; if not (Data.Length + 1 > Data.Buffer'Length) then declare Tmp : constant String_Access := new String (1 .. (Data.Length + 1000)); begin Tmp (1 .. Data.Length) := Data.Buffer (1 .. Data.Length); Free (Data.Buffer); Data.Buffer := Tmp; end; Data.Length := Data.Length + 1; Data.Buffer (Data.Length) := Char; end if; end Insert; ------------ -- Insert -- ------------ procedure Insert ( This : in out Object; Str : in String) is begin for i in Str'Range loop Insert (This, Str (i)); end loop; end Insert; end GNU.DB.Support.String_Builder; gnade-1.6.2.orig/support/gnu-db-support-string_builder.ads0000644000175000017500000001056310663647265023526 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNat Ada Database Environment -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/support/gnu-db-support-string_builder.ads,v $ -- Description : Simple string builder package -- -- Author : Michael Erdmann -- -- Created On : 16-Mar-2002 -- -- Last Modified By: $Author: persan $ -- Last Modified On: $Date: 2007/08/24 21:33:41 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2000-2002 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- -- -- Functional Description -- -- ====================== -- -- -- -- -- -- Restrictions -- -- ============ -- -- R.1 - The handling of the tree nodes is currently not task save -- -- -- -- References -- -- ========== -- -- None -- -- -- ------------------------------------------------------------------------------- package GNU.DB.Support.String_Builder is type Object is private; function To_String ( This : in Object) return String; procedure Clear ( This : in out Object); procedure Insert ( This : in out Object; Char : in Character); procedure Insert ( This : in out Object; Str : in String); procedure Finalize ( This : in out Object); private type Object_Data_Type; type Object_Data_Access is access Object_Data_Type; function Initialize return Object_Data_Access; type Object is record Data : Object_Data_Access := Initialize; end record; end GNU.DB.Support.String_Builder; gnade-1.6.2.orig/support/gnu-db-support-string_tables.ads0000644000175000017500000001020610664457305023337 0ustar lbrentalbrenta-------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/support/gnu-db-support-string_tables.ads,v $ -- Description : String table -- -- Author : Per Sandberg -- -- Created On : 21-Mar-2002 -- -- Last Modified By : $Author: persan $ -- -- Last Modified On : $Date : 2007 / 08 / 24 21 : 33 : 41 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2007-2008 Per Sandberg -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- -- -- Functional Description -- -- ====================== -- -- -- -- -- -- -- -- Restrictions -- -- ============ -- -- -- -- -- -- References -- -- ========== -- -- None -- -- -- -------------------------------------------------------------------------------- with Ada.Containers.Vectors; with GNU.DB.Support.String_Vectors; package GNU.DB.Support.String_Tables is new Ada.Containers.Vectors (Natural, String_Vectors.Vector, String_Vectors."="); gnade-1.6.2.orig/support/gnu-db-support-string_vectors.ads0000644000175000017500000001010010664456410023537 0ustar lbrentalbrenta-------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/support/gnu-db-support-string_vectors.ads,v $ -- Description : String Vector -- -- Author : Per Sandberg -- -- Created On : 21-Mar-2002 -- -- Last Modified By : $Author: persan $ -- -- Last Modified On : $Date : 2007 / 08 / 24 21 : 33 : 41 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2007-2008 Per Sandberg -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- -- -- Functional Description -- -- ====================== -- -- -- -- -- -- -- -- Restrictions -- -- ============ -- -- -- -- -- -- References -- -- ========== -- -- None -- -- -- -------------------------------------------------------------------------------- with Ada.Containers.Indefinite_Vectors; package GNU.DB.Support.String_Vectors is new Ada.Containers.Indefinite_Vectors (Natural, String); gnade-1.6.2.orig/support/gnu-db-support-tables.adb0000644000175000017500000002143710670147767021745 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/support/gnu-db-support-tables.adb,v $ -- Description : Symbol Table Manager for the ESQL translator -- Author : Michael Erdmann -- Created On : 06-Jan-2001 -- Last Modified By: $Author: persan $ -- Last Modified On: $Date: 2007/09/07 04:13:43 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000-2003 Michael Erdmann -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- This package -- -- Restrictions -- -- ============ -- -- R.1 - The handling of the tree nodes is currently not task save -- -- -- -- References -- -- ========== -- -- None -- -- -- ------------------------------------------------------------------------------- package body GNU.DB.Support.Tables is Version : constant String := "$Id: gnu-db-support-tables.adb,v 1.7 2007/09/07 04:13:43 persan Exp $"; pragma Unreferenced (Version); --- ==================================================================== --- --- L O C A L S U P P O R T D A T A --- --- ==================================================================== --- subtype Index_Type is Character; -- this is the index type. It included all possbible characaters of the -- of the ASCII symbol set. Null_Leaf : constant Leaf_Access := null; type Leaf_Array is array (Index_Type) of Leaf_Access; -- This is the list of pointers per index and leaf. For each index value a -- pointer is stored which points to another leaf. type Leaf_Type is record Valid_Information : Boolean := False; Value : Index_Type; Next : Leaf_Array := (others => Null_Leaf); Information : Symbol_Information_Type; end record; --- ==================================================================== --- --- S U P P O R T P R O C E D U R E S --- --- ==================================================================== --- -------------- -- New_Leaf -- -------------- function New_Leaf ( T : Tree_Node_Access) return Leaf_Access is pragma Unreferenced (T); --- Result : Leaf_Access := new Leaf_Type; --- begin Result.Valid_Information := False; Result.Next := (others => null); return Result; end New_Leaf; ------------ -- Locate -- ------------ function Locate ( T : in Tree_Node_Access; Name : in String; Expand_Tree : in Boolean := False) return Leaf_Access is -- -- Locate a name in the index tree by walking trough till the -- end of the string. At the end of this process, the variable -- current points either to a leaf which carries information or -- or returns null. The user has to verify that the found leaf -- is not an enpty leaf. -- Is the nd_tree option not set, the search is stoped as soon -- as no next leaf pointer is defined. If the option is set an -- empty tree leaf is inserted. This feature is need to insert -- a tree element. -- Current : Leaf_Access := T.Root; Tmp : Leaf_Access; C : Index_Type; begin for I in Name'Range loop C := Name (I); Tmp := Current.Next (C); if Tmp = null then if not Expand_Tree then Current := null; exit; end if; Tmp := New_Leaf (T); Tmp.Value := C; Current.Next (C) := Tmp; end if; Current := Tmp; end loop; return Current; end Locate; --- ==================================================================== --- --- P U B L I C M E T H O D S --- --- ==================================================================== --- ----------------- -- Create_Tree -- ----------------- function Create_Tree return Tree_Node_Access is -- Create Tree. Result : Tree_Node_Access := new Tree_Node; --- begin Result.Root := New_Leaf (Result); return Result; end Create_Tree; ------------ -- Insert -- ------------ procedure Insert ( T : in Tree_Node_Access; Name : in String; Info : Symbol_Information_Type) is -- -- Insert the name into the index tree by walking trough till the -- end of the string. At the end of this process, the variable -- current points either to a leaf which carries information or -- not. Current : Leaf_Access; begin Current := Locate (T, Name, Expand_Tree => True); if not Current.Valid_Information then Current.Valid_Information := True; Current.Information := Info; else raise Already_Stored; end if; end Insert; ----------- -- Fetch -- ----------- procedure Fetch ( T : in Tree_Node_Access; Name : in String; Info : out Symbol_Information_Type) is -- Fetch the symbol table entry for a given name Current : constant Leaf_Access := Locate (T, Name); begin if Current = null then raise Entry_Not_Found; end if; if not Current.Valid_Information then raise Entry_Not_Found; else Info := Current.Information; end if; end Fetch; ------------ -- Update -- ------------ procedure Update ( T : in Tree_Node_Access; Name : in String; Info : in Symbol_Information_Type) is -- Modify a given entry by simply overwritin the data if -- it is already stored, Current : Leaf_Access := Locate (T, Name); begin if Current = null then raise Entry_Not_Found; end if; if Current.Valid_Information then Current.Information := Info; else raise Entry_Not_Found; end if; end Update; ------------ -- Delete -- ------------ procedure Delete ( T : in Tree_Node_Access; Name : in String) is -- Delete by marking the information as invalid Current : Leaf_Access := Locate (T, Name); begin if Current /= null then Current.Valid_Information := False; end if; end Delete; end GNU.DB.Support.Tables; gnade-1.6.2.orig/support/gnu-db-support-tables.ads0000644000175000017500000001515510670147621021753 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/support/gnu-db-support-tables.ads,v $ -- Description : Symbol Table Manager for the ESQL -- Author : Michael Erdmann -- Created On : 29-Oct-2000 -- Last Modified By: $Author: persan $ -- Last Modified On: $Date: 2007/09/07 04:12:01 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000-2002 Michael Erdmann -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- This package supports an index tree for symbol tables. The package is -- -- only inteded for use with the esql translator and the related support -- -- packages. -- -- -- -- Restrictions -- -- ============ -- -- R.1 - The handling of the tree nodes is currently not task save -- -- -- -- References -- -- ========== -- -- None -- -- -- ------------------------------------------------------------------------------- generic type Symbol_Information_Type is private; package GNU.DB.Support.Tables is type Tree_Node is private; type Tree_Node_Access is access Tree_Node; Usage_Error : exception; Already_Stored : exception; Entry_Not_Found : exception; --------------------------------------------------------------------------- -- Description: -- This function creates an instance of the index tree -- Preconditions: -- None -- Postconditions: -- The tree node instance is intialized -- Exceptions: -- None -- Notes: -- None --------------------------------------------------------------------------- function Create_Tree return Tree_Node_Access; --------------------------------------------------------------------------- -- Description: -- The information is stored in the symbol table under the -- given Name. -- -- Preconditions: -- P1 - The Tree_Node pointer has to be created by means -- of Create_Tree. -- P2 - The Name is not already stored in the tree -- Postconditions: -- C1 - The Name and the information are stored in the table. -- Exceptions: -- Usage_Error : Pre.cond. P1 violated -- Already_Stored : Pre.cond. P2 vialoated -- -- Notes: -- --------------------------------------------------------------------------- procedure Insert ( T : in Tree_Node_Access; Name : in String; Info : Symbol_Information_Type); --------------------------------------------------------------------------- -- Description: -- -- Preconditions: -- -- Postconditions: -- -- Exceptions: -- -- Notes: -- None --------------------------------------------------------------------------- procedure Fetch ( T : in Tree_Node_Access; Name : in String; Info : out Symbol_Information_Type); --------------------------------------------------------------------------- -- Description: -- -- Preconditions: -- -- Postconditions: -- -- Exceptions: -- -- Notes: -- None --------------------------------------------------------------------------- procedure Update ( T : in Tree_Node_Access; Name : in String; Info : in Symbol_Information_Type); --------------------------------------------------------------------------- -- Description: -- -- Preconditions: -- -- Postconditions: -- -- Exceptions: -- -- Notes: -- None --------------------------------------------------------------------------- procedure Delete ( T : in Tree_Node_Access; Name : in String); -- ===================================================================== -- private type Leaf_Type; type Leaf_Access is access Leaf_Type; type Tree_Node is record Root : Leaf_Access := null; -- root element of the index tree end record; -- this is the tree node, which contains all the data which -- is used to maintain and operate on the index tree. end GNU.DB.Support.Tables; gnade-1.6.2.orig/support/gnu-db-support-wide_string_tables.ads0000644000175000017500000001024410664457306024352 0ustar lbrentalbrenta-------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/support/gnu-db-support-wide_string_tables.ads,v $ -- Description : Wide_String table -- -- Author : Per Sandberg -- -- Created On : 21-Mar-2002 -- -- Last Modified By : $Author: persan $ -- -- Last Modified On : $Date : 2007 / 08 / 24 21 : 33 : 41 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2007-2008 Per Sandberg -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- -- -- Functional Description -- -- ====================== -- -- -- -- -- -- -- -- Restrictions -- -- ============ -- -- -- -- -- -- References -- -- ========== -- -- None -- -- -- -------------------------------------------------------------------------------- with Ada.Containers.Vectors; with GNU.DB.Support.Wide_String_Vectors; package GNU.DB.Support.Wide_String_Tables is new Ada.Containers.Vectors (Natural, Wide_String_Vectors.Vector, Wide_String_Vectors."="); gnade-1.6.2.orig/support/gnu-db-support-wide_string_vectors.ads0000644000175000017500000001013510664456411024560 0ustar lbrentalbrenta-------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/support/gnu-db-support-wide_string_vectors.ads,v $ -- Description : Wide_String Vector -- -- Author : Per Sandberg -- -- Created On : 21-Mar-2002 -- -- Last Modified By : $Author: persan $ -- -- Last Modified On : $Date : 2007 / 08 / 24 21 : 33 : 41 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2007-2008 Per Sandberg -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- -- -- Functional Description -- -- ====================== -- -- -- -- -- -- -- -- Restrictions -- -- ============ -- -- -- -- -- -- References -- -- ========== -- -- None -- -- -- -------------------------------------------------------------------------------- with Ada.Containers.Indefinite_Vectors; package GNU.DB.Support.Wide_String_Vectors is new Ada.Containers.Indefinite_Vectors (Natural, Wide_String); gnade-1.6.2.orig/support/gnu-db-support.ads0000644000175000017500000000562210663647265020514 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/support/gnu-db-support.ads,v $ -- Description : Root package for all support pack. of the GNU.DB domain -- Author : Michael Erdmann -- Created On : 24-2-2001 -- Last Modified By: $Author: persan $ -- Last Modified On: $Date: 2007/08/24 21:33:41 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000-2001 Michael Erdmann -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- This package supports an index tree for symbol tables. The package is -- -- only inteded for use with the esql translator. -- -- -- Restrictions -- ============ -- -- References -- ========== -- None -- ------------------------------------------------------------------------------- package GNU.DB.Support is end GNU.DB.Support; gnade-1.6.2.orig/support/gnu-db-version.ads0000644000175000017500000000030310670060305020432 0ustar lbrentalbrentapackage GNU.DB.Version is MAJOR : constant := 1; MINOR : constant := 6; PATCHLEVEL : constant := 0; VersionString : constant String := "1.6.0"; end GNU.DB.Version; gnade-1.6.2.orig/support/gnu-db.ads0000644000175000017500000000546707256452615017006 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNU Ada Database Tools -- -- -- -- GNU.DB -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------- -- Copyright (c) 2001 -- by Juergen Pfeifer -- -- GNU Ada Database Tools are free software; you can redistribute them -- -- and/or modify them under terms of the GNU General Public License as -- -- published by the Free Software Foundation; either version 2, or (at -- -- your option) any later version. GNU Ada Database tools are distributed -- -- in the hope that they will be useful, but WITHOUT ANY WARRANTY; without -- -- even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -- -- PURPOSE. See the GNU General Public License for more details. You should -- -- have received a copy of the GNU General Public License distributed with -- -- GNU Ada Database Tools; see file COPYING. If not, write to the -- -- Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- ------------------------------------------------------------------------------- -- Author: Juergen Pfeifer ------------------------------------------------------------------------------- -- -- This is the root of all the GNU Ada Datbase Tools. -- -- If you intend to put your own package under the GNU hierarchy, please -- contact us in advance. Our intention is to develop a coherent and -- comprehensive set of packages under this root package, so there is -- a need for some coordination. -- package GNU.DB is pragma Pure (GNU.DB); end GNU.DB; gnade-1.6.2.orig/support/gnu.ads0000644000175000017500000000561707661240524016412 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNU Ada tools Bindings -- -- -- -- GNU -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------- -- Copyright (c) 1999-2001 -- by Juergen Pfeifer -- -- GNU Ada tools are free software; you can redistribute them and/or modify -- -- them under terms of the GNU General Public License as published by the -- -- Free Software Foundation; either version 2, or (at your option) any -- -- later version. GNU Ada tools are distributed in the hope that they will -- -- be useful, but WITHOUT ANY WARRANTY; without even the implied warranty -- -- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- -- GNU General Public License for more details. You should have received -- -- a copy of the GNU General Public License distributed with GNAT Ada -- -- tools; see file COPYING. If not, write to the -- -- Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- ------------------------------------------------------------------------------- -- Author: Juergen Pfeifer ------------------------------------------------------------------------------- -- -- This is the root of all the GNU Ada tools Bindings. -- -- If you intend to put your own package under the GNU hierarchy, please -- contact us in advance. Our intention is to develop a coherent and -- comprehensive set of packages under this root package, so there is -- a need for some coordination. -- package GNU is pragma Pure (GNU); Version : constant String := "$Id: gnu.ads,v 1.2 2003/05/16 19:51:48 merdmann Exp $"; end GNU; gnade-1.6.2.orig/test/0000755000175000017500000000000011040716276014360 5ustar lbrentalbrentagnade-1.6.2.orig/test/README0000644000175000017500000000010407301504555015233 0ustar lbrentalbrentaThis directory contains different test code for the GNADE project. gnade-1.6.2.orig/test/gnade-tests.gpr0000644000175000017500000000153010664033502017302 0ustar lbrentalbrenta-- $Id: gnade-tests.gpr,v 1.1 2007/08/25 14:05:54 persan Exp $ with "../gnade"; with "../support/gnade-support" ; with "aunit";-- Aunit 2.0x project Gnade.Tests is for Languages use ("Ada"); for Source_Dirs use ("src"); for Object_Dir use Gnade'Object_Dir; for Exec_Dir use Gnade'Exec_Dir; package Builder is for Default_Switches ("Ada") use gnade.Builder'Default_Switches ("Ada"); end Builder; package Compiler is for Default_Switches ("Ada") use gnade.Compiler'Default_Switches ("Ada"); end Compiler; package Binder is for Default_Switches ("Ada") use gnade.Binder'Default_Switches ("Ada"); end Binder; package Linker is for Default_Switches ("Ada") use gnade.Linker'Default_Switches ("Ada"); end Linker; package Ide is for Vcs_Kind use "CVS"; end Ide; end Gnade.Tests; gnade-1.6.2.orig/test/Oracle/0000755000175000017500000000000011040716254015561 5ustar lbrentalbrentagnade-1.6.2.orig/test/Oracle/Cursvar.txt0000644000175000017500000001024407306755470017765 0ustar lbrentalbrentaA Sample Program The following sample code--a SQL script and a Pro*Ada program--demonstrate how you can use cursor variables in Pro*Ada. These sources are available on-line in your demo directory. cursvar.sql CREATE OR REPLACE PACKAGE emp_demo_pkg AS TYPE emp_cur_type IS REF CURSOR RETURN emp%ROWTYPE; PROCEDURE open_cur ( emp_cursor IN OUT emp_cur_type, dept_num IN number); END; / CREATE OR REPLACE PACKAGE BODY emp_demo_pkg AS PROCEDURE open_cur ( emp_cursor IN OUT emp_cur_type, dept_num IN number) IS BEGIN OPEN emp_cursor FOR SELECT * FROM emp WHERE deptno = dept_num ORDER BY ename ASC; END; END; / cursvar.pad with text_io, integer_text_io, float_io; procedure cursvar is use text_io, integer_text_io, float_io; -- TYPE declarations type emp_info_type is record emp_num : integer; emp_name : string(1..11); job : string(1..10); manager : integer; hire_date : string(1..10); salary : float; commission : float; dept_num : integer; end record; type emp_info_ind_type is record emp_num_ind : oracle.indicator; emp_name_ind : oracle.indicator; job_ind : oracle.indicator; manager_ind : oracle.indicator; hire_date_ind : oracle.indicator; salary_ind : oracle.indicator; commission_ind : oracle.indicator; dept_num_ind : oracle.indicator; end record; -- VARIABLE declarations SQL_ERROR : exception; EXEC SQL BEGIN DECLARE SECTION; uid : string(1..11) := "Scott/Tiger"; emp_cursor : oracle.cursor_def; dept_num : integer; emp_info : emp_info_type; emp_info_ind : emp_info_ind_type; EXEC SQL END DECLARE SECTION; begin -- Handle SQL errors. EXEC SQL WHENEVER SQLERROR raise SQL_ERROR; -- Connect to Oracle. EXEC SQL CONNECT :uid; -- Allocate the cursor variable. EXEC SQL ALLOCATE :emp_cursor; -- Exit the inner loop when NO DATA FOUND. EXEC SQL WHENEVER NOT FOUND DO exit; loop new_line; put("Enter department number (0 to exit): "); get(dept_num); if (dept_num <= 0) then exit; end if; EXEC SQL EXECUTE begin emp_demo_pkg.open_cur(:emp_cursor, :dept_num); end; END-EXEC; new_line; put("For department: "); put(dept_num, width=>4); put_line(" --"); new_line; put_line("ENAME SALARY COMMISSION"); put_line("----- ------ ----------"); new_line; -- Fetch each row in the EMP table into the emp_info record. -- Note the use of a parallel indicator record. loop EXEC SQL FETCH :emp_cursor INTO :emp_info.emp_num INDICATOR :emp_info_ind.emp_num_ind, :emp_info.emp_name INDICATOR :emp_info_ind.emp_name_ind, :emp_info.job INDICATOR :emp_info_ind.job_ind, :emp_info.manager INDICATOR :emp_info_ind.manager_ind, :emp_info.hire_date INDICATOR :emp_info_ind.hire_date_ind, :emp_info.salary INDICATOR :emp_info_ind.salary_ind, :emp_info.commission INDICATOR :emp_info_ind.commission_ind, :emp_info.dept_num INDICATOR :emp_info_ind.dept_num_ind; put(emp_info.emp_name); put(emp_info.salary, fore=>10, aft=>2, exp=>0); if (emp_info_ind.commission_ind /= 0) then put_line(" NULL"); else put(emp_info.commission, fore=>18, aft=>2, exp=>0); new_line; end if; end loop; --inner loop end loop; -- outer loop -- Close the cursor. EXEC SQL CLOSE :emp_cursor; -- Handle SQL errors. exception when SQL_ERROR => EXEC SQL WHENEVER SQLERROR CONTINUE; put_line("** ORACLE ERROR OCCURED **"); put_line(ORACLE.ERROR.MESSAGE); EXEC SQL ROLLBACK RELEASE; end cursvar; gnade-1.6.2.orig/test/Oracle/Makefile0000644000175000017500000001213607315413774017237 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/test/Oracle/Makefile,v $ ## Description : Makefile for the embedded SQL samples ## Author : Juergen Pfeifer ## Created On : 03-Jan-2001 ## Last Modified By: $Author: me $ ## Last Modified On: $Date: 2001/06/24 16:40:28 $ ## Status : $State: Exp $ ## ## Copyright (C) 2000-2001 ## ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## This makefile builds a modified version of the Oracle simple test ## code. ## ## Restrictions ## ============ ## ## References ## ========== ## sinclude ../conf.local sinclude ../../make.conf # ESQLFLAGS = -s -v -pedantic -debugcode -schema test.sql $(FLAGS) ESQL=$(bindir)/$(esql) PROGRAMS=simple # all :: $(PROGRAMS) # ------------------------------------------------------------------------- # # C O M P I L E R R U L E S # # ------------------------------------------------------------------------- # .SUFFIXES: .adb .adq .adq_p .adq.adb: $(ESQL) $(ESQLFLAGS) $*.adq .adq_p.adq: $(ADAPREP) -DDBUSER=\"$(DBUSER)\" \ -DDBPASSWD=\"$(DBPASSWD)\" \ -DDBSOURCE=\"$(DBSOURCE)\" \ $*.adq_p $*.adq # ------------------------------------------------------------------------- # # E X E C U T A B L E S # # ------------------------------------------------------------------------- # simple.adq: simple.adq_p simple: main.adb simple.adq simple.ads simple.adb $(ADAMAKE) main.adb -o simple $(ADAFLAGS) $(CFLAGS) \ $(APP_BIND_FLAGS) $(APP_LINK_FLAGS) -largs simpler.adq: simpler.adq_p $(ADAPREP) -DDBUSER=\"$(DBUSER)\" \ -DDBPASSWD=\"$(DBPASSWD)\" \ -DDBSOURCE=\"$(DBSOURCE)\" \ simpler.adq_p simpler.adq simpler: main.adb simpler.adq $(MAKE) ESQLFLAGS="-nosqlstate $(ESQLFLAGS)" simpler.adb $(ADAMAKE) simpler.adb -o simpler $(ADAFLAGS) $(CFLAGS) \ $(APP_BIND_FLAGS) $(APP_LINK_FLAGS) -largs # # # my_fetch.adq: my_fetch.adq_p my_fetch: my_fetch.adq $(MAKE) ESQLFLAGS="-noiso92 $(ESQLFLAGS)" my_fetch.adb $(ADAMAKE) my_fetch.adb -o my_fetch $(ADAFLAGS) $(CFLAGS) \ $(APP_BIND_FLAGS) $(APP_LINK_FLAGS) -largs cursorvar.adq: cursorvar.adq_p cursorvar: cursorvar.adq $(MAKE) ESQLFLAGS="-noiso92 $(ESQLFLAGS)" cursorvar.adb # ------------------------------------------------------------------------- # # C L E A N T H E D I R E C T O R Y # # ------------------------------------------------------------------------- # clean: rm -rf $(PROGRAMS) b~*.* *.o *.ali core test.adb nobel.adb *~ rm -rf test.sql simple.adb simple.adq rm -rf test.sql simpler.adb simpler.adq rm -rf test.sql my_fetch.adb my_fetch.adq distclean :: clean gnade-1.6.2.orig/test/Oracle/README0000644000175000017500000000060607303536003016442 0ustar lbrentalbrentaThis directory contains a translation of an orcale example program to gnu embedded sql for Ada. The following modifications have been done: - all host variables are moved into the declare section. - the SQLCA named oracle has been changed into the GNU default SQLCA. - The Connection paramters have to be changed - Conversion routines between strings and char have to be inserted. gnade-1.6.2.orig/test/Oracle/cursorvar.adq_p0000644000175000017500000000672707310210060020616 0ustar lbrentalbrentawith text_io, integer_text_io, float_io; procedure cursvar is use text_io, integer_text_io, float_io; -- TYPE declarations type emp_info_type is record emp_num : integer; emp_name : string(1..11); job : string(1..10); manager : integer; hire_date : string(1..10); salary : float; commission : float; dept_num : integer; end record; type emp_info_ind_type is record emp_num_ind : oracle.indicator; emp_name_ind : oracle.indicator; job_ind : oracle.indicator; manager_ind : oracle.indicator; hire_date_ind : oracle.indicator; salary_ind : oracle.indicator; commission_ind : oracle.indicator; dept_num_ind : oracle.indicator; end record; -- VARIABLE declarations SQL_ERROR : exception; EXEC SQL BEGIN DECLARE SECTION; uid : string(1..11) := "Scott/Tiger"; emp_cursor : oracle.cursor_def; dept_num : integer; emp_info : emp_info_type; emp_info_ind : emp_info_ind_type; EXEC SQL END DECLARE SECTION; begin -- Handle SQL errors. EXEC SQL WHENEVER SQLERROR raise SQL_ERROR; -- connect to data base EXEC SQL CONNECT $DBUSER IDENTIFIED BY $DBPASSWD TO $DBSOURCE ; -- Allocate the cursor variable. EXEC SQL ALLOCATE :emp_cursor; -- Exit the inner loop when NO DATA FOUND. EXEC SQL WHENEVER NOT FOUND DO exit; loop new_line; put("Enter department number (0 to exit): "); get(dept_num); if (dept_num <= 0) then exit; end if; EXEC SQL EXECUTE begin emp_demo_pkg.open_cur(:emp_cursor, :dept_num); end; END-EXEC; new_line; put("For department: "); put(dept_num, width=>4); put_line(" --"); new_line; put_line("ENAME SALARY COMMISSION"); put_line("----- ------ ----------"); new_line; -- Fetch each row in the EMP table into the emp_info record. -- Note the use of a parallel indicator record. loop EXEC SQL FETCH :emp_cursor INTO :emp_info.emp_num INDICATOR :emp_info_ind.emp_num_ind, :emp_info.emp_name INDICATOR :emp_info_ind.emp_name_ind, :emp_info.job INDICATOR :emp_info_ind.job_ind, :emp_info.manager INDICATOR :emp_info_ind.manager_ind, :emp_info.hire_date INDICATOR :emp_info_ind.hire_date_ind, :emp_info.salary INDICATOR :emp_info_ind.salary_ind, :emp_info.commission INDICATOR :emp_info_ind.commission_ind, :emp_info.dept_num INDICATOR :emp_info_ind.dept_num_ind; put(emp_info.emp_name); put(emp_info.salary, fore=>10, aft=>2, exp=>0); if (emp_info_ind.commission_ind /= 0) then put_line(" NULL"); else put(emp_info.commission, fore=>18, aft=>2, exp=>0); new_line; end if; end loop; --inner loop end loop; -- outer loop -- Close the cursor. EXEC SQL CLOSE :emp_cursor; -- Handle SQL errors. exception when SQL_ERROR => EXEC SQL WHENEVER SQLERROR CONTINUE; put_line("** ORACLE ERROR OCCURED **"); put_line(ORACLE.ERROR.MESSAGE); EXEC SQL ROLLBACK RELEASE; end cursvar; gnade-1.6.2.orig/test/Oracle/main.adb0000644000175000017500000000011607303536003017152 0ustar lbrentalbrentawith simple; use simple; procedure Main is begin Simple.Run; end Main; gnade-1.6.2.orig/test/Oracle/my_fetch.adq_p0000644000175000017500000000476207307463700020404 0ustar lbrentalbrenta-- FETCH : -- 1) Declare a statement to be executed in a -- cursor (Emp_Curs) -- 2) Connect to RDBMS -- 3) Open the cursor -- 4) Fetch the rows -- 5) Close the cursor and disconnect with Ada.Text_Io; use Ada.Text_Io; with Sql_Standard; use Sql_Standard; with Ada.Strings.Fixed; use Ada.Strings.Fixed; with Ada.Strings; use Ada.Strings; with Sql_Standard; use Sql_Standard; procedure My_Fetch is package Io is new Ada.Text_Io.Integer_Io (Integer); use Io; -- declare host and program variables=20 Exec Sql declare DB01 Database ; Exec Sql begin declare Section end-Exec Emp_Name : Char (1..20); Dates : Char (1..30); Exec Sql end declare Section end-Exec User : constant String := "$DBUSER"; Sql_Error : exception; begin Exec Sql Whenever Sqlerror raise Sql_Error; -- Logon as USER EXEC SQL AT DB01 CONNECT $DBUSER IDENTIFIED BY $DBPASSWD TO $DBSOURCE ; -- Execute the SELECT. Exec Sql AT DB01 declare Emp_Curs Cursor for select name, since --To_Char(Hiredate, 'Day Month Dd, Yyyy') From Employees Where Deptno > 20; Exec Sql AT DB01 Open Emp_Curs; New_Line; Put_Line("Name Hire Date"); Put_Line("---- ----------"); New_Line; -- Loop to FETCH all active rows that were -- obtained when the cursor's statement was -- executed. Once a row is FETCHed, it cannot -- be reFETCHed unless the cursor is re-opened. Fetch_Loop: loop declare Allfetched : exception; -- Turn on the automatic exception generation. Exec Sql Whenever not Found raise Allfetched; begin Exec Sql AT DB01 Fetch From Emp_Curs Into :Emp_Name, :Dates; Put_Line(To_String (Emp_Name) & " " & To_String(Dates)); exception when Allfetched => New_Line; Put("Rows fetched: "); Put(Sqlca.Affected_Rows, Width => 3); New_Line; exit; end; end loop Fetch_Loop; Exec Sql AT DB01 Close Emp_Curs; Exec Sql AT DB01 Commit; exception -- Turn off automatic exception handling, -- since we do not want an infinite loop if -- an error occurs on log out. Exec Sql Whenever Sqlerror Continue; when Sql_Error => Put(Trim( Sqlca.Message, Right )); Exec Sql AT DB01 Rollback Release; end My_Fetch; gnade-1.6.2.orig/test/Oracle/simple-oracle.src0000644000175000017500000000652307303536003021033 0ustar lbrentalbrenta-- Copyright (c) 1994 by Oracle Corporation -- SIMPLE : -- 1) Logon to the ORACLE database -- 2) Prompt user for a name that exists -- in the EMP table -- 3) Do a simple SQL join that finds the -- employee's department and location with text_io, integer_text_io, sql_standard; -- Note: the precompiler "with's" the other required ORACLE -- packages. procedure SIMPLE is use text_io, integer_text_io; -- declare host and program variables ORACLE_ID : constant string := "SCOTT/TIGER"; ENAME : string(1..20); ENAME_LEN : integer; DEPT_NAME : string(1..14); LOCATION : string(1..13); EXEC SQL BEGIN DECLARE SECTION; SQLCODE : sql_standard.sqlcode_type; -- for ANSI mode SQLSTATE : sql_standard.sqlstate_type; -- ANSI mode EXEC SQL END DECLARE SECTION; SQL_ERROR : exception; SQL_WARNING : exception; -- Check to see if the last database -- operation returned any rows. -- (See Chapter 5 on error handling.) function EMPLOYEE_EXISTS return boolean is begin return (not(ORACLE.ERROR.IF_NOT_FOUND)); end EMPLOYEE_EXISTS; begin -- Direct the precompiler to insert "if" logic that -- checks the ORACLE return code and raises an exception -- if needed. EXEC SQL WHENEVER SQLERROR raise SQL_ERROR; -- Check for warnings, such as data truncation, also. EXEC SQL WHENEVER SQLWARNING raise SQL_WARNING; -- Connect to ORACLE EXEC SQL CONNECT :ORACLE_ID; NEW_LINE; PUT_LINE("Connected to ORACLE as " & ORACLE_ID); NEW_LINE; PUT_LINE("*** ORACLE DEMO #1 ***"); NEW_LINE; loop PUT("Enter employee last name (CR to exit): "); GET_LINE(ENAME, ENAME_LEN); exit when ENAME_LEN = 0; -- SELECT statements that return one row can use a -- simple SELECT statement. Otherwise, a cursor must be -- declared for the SELECT, and a FETCH statement is used. EXEC SQL SELECT INITCAP(loc), INITCAP(dname) INTO :LOCATION, :DEPT_NAME FROM emp, dept WHERE dept.deptno = emp.deptno AND EMP.ENAME = upper(:ENAME(1..ENAME_LEN)); if EMPLOYEE_EXISTS then NEW_LINE; PUT("Employee "); PUT(ENAME(1..ENAME_LEN)); PUT(" works for department " & DEPT_NAME); PUT(" in " & LOCATION); else PUT_LINE("Sorry, no such employee (try ALLEN or JONES)"); NEW_LINE; -- The following lines illustrate the use of SQLSTATE and SQLCODE PUT("The SQLSTATE error code is: "); PUT_LINE(string(sqlstate)); PUT("The SQLCODE error code is: "); PUT(integer(sqlcode),1); end if; NEW_LINE; NEW_LINE; end loop; NEW_LINE; PUT_LINE("Good bye."); -- Disconnect from the database. EXEC SQL COMMIT RELEASE; exception -- Turn off error checking, since we do not want -- to raise an exception when logging out under -- any circumstance. EXEC SQL WHENEVER SQLERROR CONTINUE; EXEC SQL WHENEVER SQLWARNING CONTINUE; when SQL_ERROR => PUT_LINE(" ** ORACLE ERROR OCCURRED **"); NEW_LINE; PUT_LINE(ORACLE.ERROR.MESSAGE); EXEC SQL ROLLBACK RELEASE; when SQL_WARNING => PUT_LINE(" ** ORACLE WARNING OCCURRED **"); NEW_LINE; EXEC SQL ROLLBACK RELEASE; end SIMPLE; gnade-1.6.2.orig/test/Oracle/simple.adq_p0000644000175000017500000001036407315413774020077 0ustar lbrentalbrenta-- -*- Mode: Ada -*- -- Filename : simple.adb -- Description : a translation of the famous simple.adb from Oriacle -- Author : -- Created On : Sat May 19 09:36:15 2001 -- Last Modified By: . -- Last Modified On: . -- Update Count : 0 -- Status : Unknown, Use with caution! -- -- SIMPLE : -- 1) Logon to the ORACLE database -- 2) Prompt user for a name that exists -- in the EMP table -- 3) Do a simple SQL join that finds the -- employee's department and location with ada.text_io; use ada.text_io; with Ada.Strings.Fixed; use Ada.Strings.Fixed; with Ada.Strings; use Ada.Strings; with sql_standard; use sql_standard; with gnu.db.esql_Support; use gnu.db.esql_support; use gnu.db; -- Note: the precompiler "with's" the other required ORACLE -- packages. package body simple is procedure Run is name : String(1..20); NAME_LEN : Integer; -- declare host and program variables EXEC SQL BEGIN DECLARE SECTION; ENAME : char(1..20); DEPT_NAME : char(1..14); SQLCODE : sql_standard.sqlcode_type; -- for ANSI mode SQLSTATE : sql_standard.sqlstate_type; -- ANSI mode LOCATION : char(1..13); EXEC SQL END DECLARE SECTION; SQL_ERROR : exception; SQL_WARNING : exception; -- Check to see if the last database -- operation returned any rows. -- (See Chapter 5 on error handling.) function EMPLOYEE_EXISTS return boolean is begin return not (SQLCODE in SQL_STANDARD.NOT_FOUND); end EMPLOYEE_EXISTS; begin -- Direct the precompiler to insert "if" logic that -- checks the ORACLE return code and raises an exception -- if needed. EXEC SQL WHENEVER SQLERROR raise SQL_ERROR; -- Check for warnings, such as data truncation, also. EXEC SQL WHENEVER SQLWARNING raise SQL_WARNING; --- hellop -- Connect to ORACLE EXEC SQL CONNECT $DBUSER IDENTIFIED BY $DBPASSWD TO $DBSOURCE ; NEW_LINE; PUT_LINE("Connected to database $DBSOURCE as $DBUSER " ); NEW_LINE; PUT_LINE("*** ORACLE DEMO #1 ***"); NEW_LINE; loop PUT("Enter employee last name (CR to exit): "); GET_LINE(name, NAME_LEN); exit when NAME_LEN = 0; ESQL_Support.Move( name, ename ); -- SELECT statements that return one row can use a -- simple SELECT statement. Otherwise, a cursor must be -- declared for the SELECT, and a FETCH statement is used. EXEC SQL SELECT INITCAP(loc), INITCAP(dname) INTO :LOCATION, :DEPT_NAME FROM emp, dept WHERE dept.deptno = emp.deptno AND EMP.ENAME = upper(:ENAME(1..NAME_LEN)); if EMPLOYEE_EXISTS then NEW_LINE; PUT("Employee "); PUT(To_String(ENAME(1..NAME_LEN))); PUT(" works for department " & To_String(DEPT_NAME)); PUT(" in " & To_String( LOCATION )); else PUT_LINE("Sorry, no such employee (try ALLEN or JONES)"); NEW_LINE; -- The following lines illustrate the use of SQLSTATE and SQLCODE -- DEBUG("The SQLSTATE error code is: ", SQLCA'access ); end if; NEW_LINE; NEW_LINE; end loop; NEW_LINE; PUT_LINE("Good bye."); -- Disconnect from the database. EXEC SQL COMMIT RELEASE; exception -- Turn off error checking, since we do not want -- to raise an exception when logging out under -- any circumstance. EXEC SQL WHENEVER SQLERROR CONTINUE; EXEC SQL WHENEVER SQLWARNING CONTINUE; when SQL_ERROR => PUT_LINE(" ** DATABASE ERROR OCCURRED **"); NEW_LINE; PUT_LINE(Trim( SQLCA.Message, Right )); EXEC SQL ROLLBACK RELEASE; when SQL_WARNING => PUT_LINE(" ** ORACLE WARNING OCCURRED **"); NEW_LINE; EXEC SQL ROLLBACK RELEASE; end Run; end simple; gnade-1.6.2.orig/test/Oracle/simple.ads0000644000175000017500000000006307303536003017541 0ustar lbrentalbrentapackage simple is procedure Run; end simple; gnade-1.6.2.orig/test/Oracle/simpler.adb0000644000175000017500000002322407315413774017722 0ustar lbrentalbrenta--%ESQL at 0 : *************************************************** --%ESQL at 0 : !!! D O N O T E D I T !!! --%ESQL at 0 : This file is gnerated by GNADE ESQL translator --%ESQL at 0 : --%ESQL at 0 : ESQL VERSION : 1.1.4 --%ESQL at 0 : SOURCE FILE : simpler.adq --%ESQL at 0 : OPTIONS : --%ESQL at 0 : -nosqlstate --%ESQL at 0 : -s --%ESQL at 0 : -v --%ESQL at 0 : -pedantic --%ESQL at 0 : -debugcode --%ESQL at 0 : -schema --%ESQL at 0 : test.sql --%ESQL at 0 : simpler.adq --%ESQL at 0 : *************************************************** with ada.text_io; use ada.text_io; with Ada.Strings.Fixed; use Ada.Strings.Fixed; with Ada.Strings; use Ada.Strings; with sql_standard; use sql_standard; with gnu.db.esql_Support; use gnu.db.esql_support; use gnu.db; with Ada.Exceptions; use Ada.Exceptions; with Ada.Characters.Latin_1; use Ada.Characters; WITH GNU.DB.ESQL_SUPPORT; USE GNU.DB.ESQL_SUPPORT; WITH GNU.DB.ESQL_SUPPORT.ODBC; USE GNU.DB.ESQL_SUPPORT.ODBC; USE GNU.DB.ESQL_SUPPORT; USE GNU.DB; pragma Elaborate_All(GNU.DB.ESQL_SUPPORT.ODBC); procedure Simpler is name : String(1..20); NAME_LEN : Integer; -- declare host and program variables GNADE_L_CONTEXT : ODBC.CONTEXT_TYPE; ENAME : char(1..20); DEPT_NAME : char(1..14); SQLCODE : sql_standard.sqlcode_type; -- for ANSI mode SQLSTATE : sql_standard.sqlstate_type; -- ANSI mode LOCATION : char(1..13); SQLCA : aliased ESQL_SUPPORT.SQLCA_TYPE; GNADE_DB_DEFAULT : ODBC.CONNECTION_HANDLE := NULL; GNADE_G_CONTEXT : ODBC.CONTEXT_TYPE; SQL_ERROR : exception; SQL_WARNING : exception; -- Check to see if the last database -- operation returned any rows. -- (See Chapter 5 on error handling.) function EMPLOYEE_EXISTS return boolean is begin return not (SQLCODE in SQL_STANDARD.NOT_FOUND); end EMPLOYEE_EXISTS; begin -- Direct the precompiler to insert "if" logic that -- checks the ORACLE return code and raises an exception -- if needed. -- Check for warnings, such as data truncation, also. --- hellop -- Connect to ORACLE GNADE_DB_DEFAULT:=ODBC.Connect("DEMO_DB", "gnade", "gnade"); NEW_LINE; PUT_LINE("Connected to database $DBSOURCE as $DBUSER " ); NEW_LINE; PUT_LINE("*** ORACLE DEMO #1 ***"); NEW_LINE; loop PUT("Enter employee last name (CR to exit): "); GET_LINE(name, NAME_LEN); exit when NAME_LEN = 0; ESQL_Support.Move( name, ename ); -- SELECT statements that return one row can use a -- simple SELECT statement. Otherwise, a cursor must be -- declared for the SELECT, and a FETCH statement is used. --%ESQL at 77 : *** Query *** declare LOCATION_Indicator : aliased SQL_STANDARD.INDICATOR_TYPE := 0; DEPT_NAME_Indicator : aliased SQL_STANDARD.INDICATOR_TYPE := 0; ENAME_Indicator : aliased SQL_STANDARD.INDICATOR_TYPE := 0; begin -- Prepare ODBC.PREPARE(GNADE_DB_DEFAULT, GNADE_G_CONTEXT, "SELECT Location , Departments . Name FROM Employees , Depart" & "ments WHERE Departments . Deptno = Employees . deptno AND Em" & "ployees . Name = ? ", SQLCA'Address, Is_Reopenable =>FALSE); -- Evaluate_Result ESQL_SUPPORT.DEBUG( "Line 72 in package EMPLOYEE_EXISTS", "SELECT Location , Departments . Name FROM Employees , Depart" & "ments WHERE Departments . Deptno = Employees . deptno AND Em" & "ployees . Name = ? ", SQLCA'Address); SQLCODE := SQLCA.SQLCODE; SQLSTATE := SQLCA.STATE; IF ( SQLSTATE(1..2) /= ESQL_SUPPORT.SUCCESS_CLASS AND SQLSTATE(1..2) /= ESQL_SUPPORT.WARNING_CLASS AND SQLSTATE(1..2) /= ESQL_SUPPORT.NOTFOUND_CLASS) OR SQLCODE in SQL_STANDARD.SQL_ERROR THEN Raise_Exception(SQL_ERROR'Identity, "Line 72 in package EMPLOYEE_EXISTS failed " & Latin_1.LF & SQLCA.message); END IF; IF SQLSTATE(1..2) = ESQL_SUPPORT.WARNING_CLASS THEN Raise_Exception(SQL_WARNING'Identity, "Line 72 in package EMPLOYEE_EXISTS failed " & Latin_1.LF & SQLCA.message); END IF; -- Parameter Binding ENAME ODBC.BINDPARAMETER( GNADE_DB_DEFAULT, 1, ENAME'Address, ENAME'Size, ISO92_CHAR_TYPE, ENAME_Indicator'Access ); ODBC.BINDCOLUMN( GNADE_DB_DEFAULT, 1, LOCATION'Address, LOCATION'Size, ISO92_CHAR_TYPE, LOCATION_Indicator'Access ); ODBC.BINDCOLUMN( GNADE_DB_DEFAULT, 2, DEPT_NAME'Address, DEPT_NAME'Size, ISO92_CHAR_TYPE, DEPT_NAME_Indicator'Access ); -- Execute ODBC.EXECUTE(GNADE_DB_DEFAULT,SQLCA'Address); ODBC.FETCH(GNADE_DB_DEFAULT,SQLCA'Address); -- Evaluate_Result ESQL_SUPPORT.DEBUG( "Line 72 in package EMPLOYEE_EXISTS", "SELECT Location , Departments . Name FROM Employees , Depart" & "ments WHERE Departments . Deptno = Employees . deptno AND Em" & "ployees . Name = ? ", SQLCA'Address); SQLCODE := SQLCA.SQLCODE; SQLSTATE := SQLCA.STATE; IF ( SQLSTATE(1..2) /= ESQL_SUPPORT.SUCCESS_CLASS AND SQLSTATE(1..2) /= ESQL_SUPPORT.WARNING_CLASS AND SQLSTATE(1..2) /= ESQL_SUPPORT.NOTFOUND_CLASS) OR SQLCODE in SQL_STANDARD.SQL_ERROR THEN Raise_Exception(SQL_ERROR'Identity, "Line 72 in package EMPLOYEE_EXISTS failed " & Latin_1.LF & SQLCA.message); END IF; IF SQLSTATE(1..2) = ESQL_SUPPORT.WARNING_CLASS THEN Raise_Exception(SQL_WARNING'Identity, "Line 72 in package EMPLOYEE_EXISTS failed " & Latin_1.LF & SQLCA.message); END IF; end; if EMPLOYEE_EXISTS then NEW_LINE; PUT("Employee "); PUT(To_String(ENAME(1..NAME_LEN))); PUT(" works for department " & To_String(DEPT_NAME)); PUT(" in " & To_String( LOCATION )); else PUT_LINE("Sorry, no such employee (try ALLEN or JONES)"); NEW_LINE; -- The following lines illustrate the use of SQLSTATE and SQLCODE --DEBUG("The SQLSTATE error code is: ", SQLCA'Unchecked_Access ); end if; NEW_LINE; NEW_LINE; end loop; NEW_LINE; PUT_LINE("Good bye."); -- Disconnect from the database. --%ESQL at 100 : *** Query *** begin -- Prepare -- Execute ODBC.EXECUTE(GNADE_DB_DEFAULT,SQLCA'Address, Statement => "COMMIT RELEASE "); -- Evaluate_Result ESQL_SUPPORT.DEBUG( "Line 99 in package EMPLOYEE_EXISTS", "COMMIT RELEASE ", SQLCA'Address); SQLCODE := SQLCA.SQLCODE; SQLSTATE := SQLCA.STATE; IF ( SQLSTATE(1..2) /= ESQL_SUPPORT.SUCCESS_CLASS AND SQLSTATE(1..2) /= ESQL_SUPPORT.WARNING_CLASS AND SQLSTATE(1..2) /= ESQL_SUPPORT.NOTFOUND_CLASS) OR SQLCODE in SQL_STANDARD.SQL_ERROR THEN Raise_Exception(SQL_ERROR'Identity, "Line 99 in package EMPLOYEE_EXISTS failed " & Latin_1.LF & SQLCA.message); END IF; IF SQLSTATE(1..2) = ESQL_SUPPORT.WARNING_CLASS THEN Raise_Exception(SQL_WARNING'Identity, "Line 99 in package EMPLOYEE_EXISTS failed " & Latin_1.LF & SQLCA.message); END IF; end; exception -- Turn off error checking, since we do not want -- to raise an exception when logging out under -- any circumstance. when SQL_ERROR => PUT_LINE(" ** DATABASE ERROR OCCURRED **"); NEW_LINE; PUT_LINE(Trim( SQLCA.Message, Right )); --%ESQL at 115 : *** Query *** begin -- Prepare -- Execute ODBC.EXECUTE(GNADE_DB_DEFAULT,SQLCA'Address, Statement => "ROLLBACK RELEASE "); -- Evaluate_Result ESQL_SUPPORT.DEBUG( "Line 114 in package EMPLOYEE_EXISTS", "ROLLBACK RELEASE ", SQLCA'Address); SQLCODE := SQLCA.SQLCODE; SQLSTATE := SQLCA.STATE; end; when SQL_WARNING => PUT_LINE(" ** ORACLE WARNING OCCURRED **"); NEW_LINE; --%ESQL at 120 : *** Query *** begin -- Prepare -- Execute ODBC.EXECUTE(GNADE_DB_DEFAULT,SQLCA'Address, Statement => "ROLLBACK RELEASE "); -- Evaluate_Result ESQL_SUPPORT.DEBUG( "Line 119 in package EMPLOYEE_EXISTS", "ROLLBACK RELEASE ", SQLCA'Address); SQLCODE := SQLCA.SQLCODE; SQLSTATE := SQLCA.STATE; end; end Simpler; gnade-1.6.2.orig/test/Oracle/simpler.adq_p0000644000175000017500000000710407315413774020257 0ustar lbrentalbrenta with ada.text_io; use ada.text_io; with Ada.Strings.Fixed; use Ada.Strings.Fixed; with Ada.Strings; use Ada.Strings; with sql_standard; use sql_standard; with gnu.db.esql_Support; use gnu.db.esql_support; use gnu.db; procedure Simpler is name : String(1..20); NAME_LEN : Integer; -- declare host and program variables EXEC SQL BEGIN DECLARE SECTION; ENAME : char(1..20); DEPT_NAME : char(1..14); SQLCODE : sql_standard.sqlcode_type; -- for ANSI mode SQLSTATE : sql_standard.sqlstate_type; -- ANSI mode LOCATION : char(1..13); EXEC SQL END DECLARE SECTION; SQL_ERROR : exception; SQL_WARNING : exception; -- Check to see if the last database -- operation returned any rows. -- (See Chapter 5 on error handling.) function EMPLOYEE_EXISTS return boolean is begin return not (SQLCODE in SQL_STANDARD.NOT_FOUND); end EMPLOYEE_EXISTS; begin -- Direct the precompiler to insert "if" logic that -- checks the ORACLE return code and raises an exception -- if needed. EXEC SQL WHENEVER SQLERROR raise SQL_ERROR; -- Check for warnings, such as data truncation, also. EXEC SQL WHENEVER SQLWARNING raise SQL_WARNING; --- hellop -- Connect to ORACLE EXEC SQL CONNECT $DBUSER IDENTIFIED BY $DBPASSWD TO $DBSOURCE ; NEW_LINE; PUT_LINE("Connected to database $DBSOURCE as $DBUSER " ); NEW_LINE; PUT_LINE("*** ORACLE DEMO #1 ***"); NEW_LINE; loop PUT("Enter employee last name (CR to exit): "); GET_LINE(name, NAME_LEN); exit when NAME_LEN = 0; ESQL_Support.Move( name, ename ); -- SELECT statements that return one row can use a -- simple SELECT statement. Otherwise, a cursor must be -- declared for the SELECT, and a FETCH statement is used. EXEC SQL SELECT Location, Departments.Name INTO :LOCATION, :DEPT_NAME FROM Employees ,Departments WHERE Departments.Deptno = Employees.deptno AND Employees.Name = :ENAME(1..NAME_LEN); if EMPLOYEE_EXISTS then NEW_LINE; PUT("Employee "); PUT(To_String(ENAME(1..NAME_LEN))); PUT(" works for department " & To_String(DEPT_NAME)); PUT(" in " & To_String( LOCATION )); else PUT_LINE("Sorry, no such employee (try ALLEN or JONES)"); NEW_LINE; -- The following lines illustrate the use of SQLSTATE and SQLCODE --DEBUG("The SQLSTATE error code is: ", SQLCA'Unchecked_Access ); end if; NEW_LINE; NEW_LINE; end loop; NEW_LINE; PUT_LINE("Good bye."); -- Disconnect from the database. EXEC SQL COMMIT RELEASE; exception -- Turn off error checking, since we do not want -- to raise an exception when logging out under -- any circumstance. EXEC SQL WHENEVER SQLERROR CONTINUE; EXEC SQL WHENEVER SQLWARNING CONTINUE; when SQL_ERROR => PUT_LINE(" ** DATABASE ERROR OCCURRED **"); NEW_LINE; PUT_LINE(Trim( SQLCA.Message, Right )); EXEC SQL ROLLBACK RELEASE; when SQL_WARNING => PUT_LINE(" ** ORACLE WARNING OCCURRED **"); NEW_LINE; EXEC SQL ROLLBACK RELEASE; end Simpler; gnade-1.6.2.orig/test/Oracle/test.adq_p0000644000175000017500000001036107303536003017546 0ustar lbrentalbrenta-- -*- Mode: Ada -*- -- Filename : simple.adb -- Description : a translation of the famous simple.adb from Oriacle -- Author : -- Created On : Sat May 19 09:36:15 2001 -- Last Modified By: . -- Last Modified On: . -- Update Count : 0 -- Status : Unknown, Use with caution! -- -- SIMPLE : -- 1) Logon to the ORACLE database -- 2) Prompt user for a name that exists -- in the EMP table -- 3) Do a simple SQL join that finds the -- employee's department and location with ada.text_io; use ada.text_io; with Ada.Strings.Fixed; use Ada.Strings.Fixed; with Ada.Strings; use Ada.Strings; with sql_standard; use sql_standard; with gnu.db.esql_Support; use gnu.db.esql_support; use gnu.db; -- Note: the precompiler "with's" the other required ORACLE -- packages. package body simple is procedure Run is name : String(1..20); NAME_LEN : Integer; -- declare host and program variables EXEC SQL BEGIN DECLARE SECTION; ENAME : char(1..20); DEPT_NAME : char(1..14); SQLCODE : sql_standard.sqlcode_type; -- for ANSI mode SQLSTATE : sql_standard.sqlstate_type; -- ANSI mode LOCATION : char(1..13); EXEC SQL END DECLARE SECTION; SQL_ERROR : exception; SQL_WARNING : exception; -- Check to see if the last database -- operation returned any rows. -- (See Chapter 5 on error handling.) function EMPLOYEE_EXISTS return boolean is begin return not (SQLCODE in SQL_STANDARD.NOT_FOUND); end EMPLOYEE_EXISTS; begin -- Direct the precompiler to insert "if" logic that -- checks the ORACLE return code and raises an exception -- if needed. EXEC SQL WHENEVER SQLERROR raise SQL_ERROR; -- Check for warnings, such as data truncation, also. EXEC SQL WHENEVER SQLWARNING raise SQL_WARNING; --- hellop -- Connect to ORACLE EXEC SQL CONNECT $DBUSER IDENTIFIED BY $DBPASSWD TO $DBSOURCE ; NEW_LINE; PUT_LINE("Connected to database $DBSOURCE as $DBUSER " ); NEW_LINE; PUT_LINE("*** ORACLE DEMO #1 ***"); NEW_LINE; loop PUT("Enter employee last name (CR to exit): "); GET_LINE(name, NAME_LEN); exit when NAME_LEN = 0; ESQL_Support.Move( name, ename ); -- SELECT statements that return one row can use a -- simple SELECT statement. Otherwise, a cursor must be -- declared for the SELECT, and a FETCH statement is used. EXEC SQL SELECT INITCAP(loc), INITCAP(dname) INTO :LOCATION, :DEPT_NAME FROM emp, dept WHERE dept.deptno = emp.deptno AND EMP.ENAME = upper(:ENAME(1..NAME_LEN)); if EMPLOYEE_EXISTS then NEW_LINE; PUT("Employee "); PUT(To_String(ENAME(1..NAME_LEN))); PUT(" works for department " & To_String(DEPT_NAME)); PUT(" in " & To_String( LOCATION )); else PUT_LINE("Sorry, no such employee (try ALLEN or JONES)"); NEW_LINE; -- The following lines illustrate the use of SQLSTATE and SQLCODE DEBUG("The SQLSTATE error code is: ", SQLCA'access ); end if; NEW_LINE; NEW_LINE; end loop; NEW_LINE; PUT_LINE("Good bye."); -- Disconnect from the database. EXEC SQL COMMIT RELEASE; exception -- Turn off error checking, since we do not want -- to raise an exception when logging out under -- any circumstance. EXEC SQL WHENEVER SQLERROR CONTINUE; EXEC SQL WHENEVER SQLWARNING CONTINUE; when SQL_ERROR => PUT_LINE(" ** DATABASE ERROR OCCURRED **"); NEW_LINE; PUT_LINE(Trim( SQLCA.Message, Right )); EXEC SQL ROLLBACK RELEASE; when SQL_WARNING => PUT_LINE(" ** ORACLE WARNING OCCURRED **"); NEW_LINE; EXEC SQL ROLLBACK RELEASE; end Run; end simple; gnade-1.6.2.orig/test/oci/0000755000175000017500000000000011040716254015126 5ustar lbrentalbrentagnade-1.6.2.orig/test/oci/README0000644000175000017500000000000607421362401016001 0ustar lbrentalbrentadummy gnade-1.6.2.orig/test/odbc_vs_mysql/0000755000175000017500000000000011040716254017220 5ustar lbrentalbrentagnade-1.6.2.orig/test/odbc_vs_mysql/Makefile0000644000175000017500000001235207374032015020664 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/test/odbc_vs_mysql/Makefile,v $ ## Description : Makefile for the embedded SQL samples ## Author : Michael Erdmann ## Created On : 27-Jan-2001 ## Last Modified By: $Author: me $ ## Last Modified On: $Date: 2001/11/12 20:41:49 $ ## Status : $State: Exp $ ## ## Copyright (C) 2000-2001 ## ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## This makefile builds the sample programs for embedded SQL. ## ## all : builds all binaries ## clean : remove all binaries and objects ## newdb : builds a new data base ## distclean : clean up completely ## ## Restrictions ## ============ ## ## References ## ========== ## sinclude ../conf.local sinclude ../../make.conf .SUFFIXES: .adb .adq # # run the ebedded sql translator # .adq.adb: ESQLFLAGS = $(DEBUG) -v -s -pedantic -schema test.sql $(FLAGS) # use always the local esql translator ESQL=$(bindir)/$(esql) PROGRAMS=test_mysql test_odbc DBNAME=ottodb MYSQL_LIBS=-L/usr/lib/mysql -ladamysql -lmysqlclient # all :: newdb $(PROGRAMS) DBPASSWD="" # ------------------------------------------------------------------------- # # E X E C U T A B L E S # # ------------------------------------------------------------------------- # test_mysql.adb: test_mysql.gpb $(ADAPREP) -DDBNAME=\"$(DBNAME)\" \ -DDBUSER=\"$(DBUSER)\" \ -DDBPASSWD=\"$(DBPASSWD)\" \ test_mysql.gpb test_mysql.adb test_mysql: test_mysql.adb $(ADAMAKE) -o test_mysql $(ADAFLAGS) test_mysql.adb -cargs $(CFLAGS) \ $(APP_BIND_FLAGS) $(APP_LINK_FLAGS_NOLIB) -largs $(MYSQL_LIBS) # # simple test program implemented as package # test_odbc.adq: test_odbc.gpq test_odbc: test_odbc.gpq $(ADAPREP) -DDBUSER=\"$(DBUSER)\" \ -DDBPASSWD=\"$(DBPASSWD)\" \ -DDBSOURCE=\"$(DBNAME)\" \ test_odbc.gpq test_odbc.adq $(ESQL) $(ESQLFLAGS) test_odbc.adq $(ADAMAKE) test_odbc.adb -o test_odbc $(ADAFLAGS) -g $(CFLAGS) \ $(APP_BIND_FLAGS) $(APP_LINK_FLAGS) -largs # # ------------------------------------------------------------------------- # # D A T A B A S E # # ------------------------------------------------------------------------- # # Build the data base newdb: $(DBNAME).log # create the data base $(DBNAME).log: dbinstall.sql mysqladmin -u $(DBUSER) create $(DBNAME) mysql -u gnade $(DBNAME) < dbinstall.sql touch $(DBNAME).log # ------------------------------------------------------------------------- # # C L E A N T H E D I R E C T O R Y # # ------------------------------------------------------------------------- # clean: - mysqladmin -u $(DBUSER) -f drop $(DBNAME) rm -f $(DBNAME).log rm -rf $(PROGRAMS) b~*.* *.o *.ali core test_odbc.adb test_mysql.adb *~ *.log distclean :: clean gnade-1.6.2.orig/test/odbc_vs_mysql/README0000644000175000017500000000032507374032015020101 0ustar lbrentalbrentaThis directory contains two executables. Both program do the same thing but one is written for the mysql bindings and the other one uses embedded SQL. These programs are used to tune the data bases accesses. gnade-1.6.2.orig/test/odbc_vs_mysql/dbinstall.sql0000644000175000017500000057167207374032015021740 0ustar lbrentalbrenta--| --| Filename : $Source: /cvsroot/gnade/gnade/test/odbc_vs_mysql/dbinstall.sql,v $ --| Description : Build the test data base --| Author : Michael Erdmann --| Created On : 22.12.2000 --| Last Modified By: $Author: me $ --| Last Modified On: $Date: 2001/11/12 20:41:49 $ --| Status : $State: Exp $ --| --| Copyright (C) 2000 Michael Erdmann --| --| This program is free software; you can redistribute it and/or --| modify it under the terms of the GNU General Public License --| as published by the Free Software Foundation; either version 2 --| of the License, or (at your option) any later version. --| --| This program/code is distributed in the hope that it will be useful, --| but WITHOUT ANY WARRANTY; without even the implied warranty of --| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --| GNU General Public License for more details. --| --| You should have received a copy of the GNU General Public License along --| with this program; if not, write to the Free Software Foundation, Inc., --| 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --| --| As a special exception, if other files instantiate generics from this --| unit, or you link this unit with other files to produce an executable, --| this unit does not by itself cause the resulting executable to be --| covered by the GNU General Public License. This exception does not --| however invalidate any other reasons why the executable file might be --| covered by the GNU Public License. --| --| Functional Description --| ====================== --| This script generates the test data base for MySQL and allows --| the user gnade to do every thing on his data bases. --| --| Restrictions --| ============ --| None --| --| References --| ========== --| //1// - MySQL Manual --| use ottodb ; create table R_Otto ( id char(30), create_Time date, value float, data longblob ); insert into R_Otto (id, create_time, value, data ) values ( "Hallo", "1999-10-11", 10.3, BINARY "HHHHYYY" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value, data ) values ( "Otto", "1999-10-11", 10.3, BINARY "Das ist ein Test" ); insert into R_Otto (id, create_time, value ) values ( "Otto", "1999-11-11", 10.5 ); gnade-1.6.2.orig/test/odbc_vs_mysql/odbc.ini0000644000175000017500000000072007374032015020630 0ustar lbrentalbrenta[ottodb] Description = ODBC Testdatabase Driver = MySQL Database = ottodb Servername = localhost Port = 5432 ReadOnly = No RowVersioning = No ShowSystemTables = No ShowOidColumn = No FakeOidIndex = No ConnSettings = Trace = Yes TraceFile = sql.log gnade-1.6.2.orig/test/odbc_vs_mysql/test.sql0000644000175000017500000000015007374032015020715 0ustar lbrentalbrentaCREATE TABLE R_Otto ( id char ( 30 ) , create_Time date , value float , data Varblob ( 40000 ) ) ) gnade-1.6.2.orig/test/odbc_vs_mysql/test_mysql.gpb0000644000175000017500000001021707374032015022120 0ustar lbrentalbrenta--| --| Filename : $Source: /cvsroot/gnade/gnade/test/odbc_vs_mysql/test_mysql.gpb,v $ --| Description : Application example for the mysql bindings --| Author : Michael Erdmann --| Created On : 8.12.2000 --| Last Modified By: $Author: me $ --| Last Modified On: $Date: 2001/11/12 20:41:49 $ --| Status : $State: Exp $ --| --| Copyright (C) 2000, 2001 Michael Erdmann --| --| This program is free software; you can redistribute it and/or --| modify it under the terms of the GNU General Public License --| as published by the Free Software Foundation; either version 2 --| of the License, or (at your option) any later version. --| --| This program/code is distributed in the hope that it will be useful, --| but WITHOUT ANY WARRANTY; without even the implied warranty of --| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --| GNU General Public License for more details. --| --| You should have received a copy of the GNU General Public License along --| with this program; if not, write to the Free Software Foundation, Inc., --| 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --| --| As a special exception, if other files instantiate generics from this --| unit, or you link this unit with other files to produce an executable, --| this unit does not by itself cause the resulting executable to be --| covered by the GNU General Public License. This exception does not --| however invalidate any other reasons why the executable file might be --| covered by the GNU Public License. --| --| Functional Description --| ====================== --| This small example is used to compare the performance differences --| between native bindings and the ODBC interface. --| --| Restrictions --| ============ --| None --| --| References --| ========== --| //1// - MySQL Manual --| with Ada.Exceptions; use Ada.Exceptions; with Ada.Text_IO; use Ada.Text_IO; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Calendar; use Ada.Calendar; use Ada; with GNU.DB.MySQL; use GNU.DB.MySQL; with GNU.DB; use GNU.DB ; procedure Test_MySQL is Version : constant String := "$Id: test_mysql.gpb,v 1.1 2001/11/12 20:41:49 me Exp $"; dBase : MySQL.Object; qId : MySQL.Query_ID; Nbr_Tuples : Integer := 0; Start_Time : Time; End_Time : Time; begin Initialize( dBase ); User( dBase, $DBUSER ); Password( dBase, $DBPASSWD ); Connect( dBase, "localhost" ); Select_DB( dBase, $DBNAME ); ------------------------------------------------------------------------ begin Start_Time := Calendar.Clock; qID := Query( dBase, "select * from R_Otto where id='Otto'"); Put_Line( "Nbr of Rows:" & Integer'Image(Nbr_of_Rows(dBase, qID)) ); while true loop declare Insert_Time : Time; Data : Blob(1..40000); Length : Natural := 0; begin Nbr_Tuples := Nbr_Tuples + 1; -- Put_Line( "'" & To_String( String_Field( dBase, qId, "id" ) ) & "'" ); Insert_Time := Date_Field( dBase, qID, 2); Blob_Field( DBase, QID, 4, Data, Length ); --if Length = 0 then -- Put_Line("** Blob empty **"); --end if; Next( dBase, qID ); exception when Field_Parse_Error => Put_Line("Field parse error"); Next( dBase, qID ); when Others => raise; end; end loop; exception when Field_Type_Error => Put_Line("Field type error"); when No_Query_Result => Put_Line("Query Failed"); when No_More_Rows => Put_Line( "End of Query Tuples:" & Integer'Image( Nbr_Tuples ) ); when The_Error : Others => Put_Line( "An error has occured at record " & Integer'Image( Nbr_Tuples ) ); Put_Line( "Fatal error, uncatched exception " & Exception_Name( The_Error )); end; End_Time := Calendar.Clock; Put_Line ( "Execution time: " & Duration'Image(End_Time-Start_Time)); Drop_Query( dBase, qID ); Finalize( dBase ); end Test_MySQL; gnade-1.6.2.orig/test/odbc_vs_mysql/test_odbc.adq0000644000175000017500000000674307374032015021670 0ustar lbrentalbrenta--| --| Filename : $Source: /cvsroot/gnade/gnade/test/odbc_vs_mysql/test_odbc.adq,v $ --| Description : This is the main driver for the embedded SQL translator --| Author : Michael Erdmann --| Created On : 8.12.2000 --| Last Modified By: $Author: me $ --| Last Modified On: $Date: 2001/11/12 20:41:49 $ --| Status : $State: Exp $ --| --| Copyright (C) 2000 Michael Erdmann --| --| This program is free software; you can redistribute it and/or --| modify it under the terms of the GNU General Public License --| as published by the Free Software Foundation; either version 2 --| of the License, or (at your option) any later version. --| --| This program/code is distributed in the hope that it will be useful, --| but WITHOUT ANY WARRANTY; without even the implied warranty of --| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --| GNU General Public License for more details. --| --| You should have received a copy of the GNU General Public License along --| with this program; if not, write to the Free Software Foundation, Inc., --| 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --| --| As a special exception, if other files instantiate generics from this --| unit, or you link this unit with other files to produce an executable, --| this unit does not by itself cause the resulting executable to be --| covered by the GNU General Public License. This exception does not --| however invalidate any other reasons why the executable file might be --| covered by the GNU Public License. --| --| Functional Description --| ====================== --| --| This is an example for embedded SQL. It demonstrates the ISO/92 --| features and addtional esql extensions. --| --| --| Restrictions --| ============ --| --| References --| ========== --| --| with Ada.Text_IO; use Ada.Text_IO; with SQL_STANDARD; use SQL_STANDARD; with Ada.Calendar; use Ada.Calendar; use Ada; with GNU.DB.SQLCLI; use GNU.DB.SQLCLI; procedure Test_Odbc is Nbr_Count : Natural := 0; Start_Time : Time; End_Time : Time; EXEC SQL DECLARE DB01 DATABASE ; -- **************************************************************** -- EXEC SQL DECLARE R_Otto TABLE ( id char(30), create_Time date, value float, data Varblob( 40000 ) ) ; -- ***************************************************************** -- EXEC SQL BEGIN DECLARE SECTION END-EXEC Id : CHAR(1..30); Value : REAL; Data : GNADE.VARBINARY( 40000 ); EXEC SQL END DECLARE SECTION END-EXEC begin EXEC SQL CONNECT "gnade" IDENTIFIED BY "" BY DB01 TO "ottodb" ; EXEC SQL AT DB01 DECLARE Otto_Table CURSOR FOR SELECT ID, VALUE, DATA FROM R_Otto WHERE ID = 'Otto'; EXEC SQL AT DB01 OPEN Otto_Table ; -- read out all data seleted by the query Put_Line("Executing"); Start_Time := Calendar.Clock; loop EXEC SQL AT DB01 FETCH FROM Otto_Table INTO :Id, :Value, :Data ; exit when SQLCODE in SQL_STANDARD.NOT_FOUND; exit when SQLCODE in SQL_STANDARD.SQL_ERROR; Nbr_Count := Nbr_Count + 1; end loop; End_Time := Calendar.Clock; Put_Line ( "Execution time : " & Duration'Image(End_Time-Start_Time)); Put_Line( " Tuples processed : " & Natural'Image(Nbr_Count) ); EXEC SQL AT DB01 CLOSE Otto_Table; end Test_odbc; gnade-1.6.2.orig/test/odbc_vs_mysql/test_odbc.gpq0000644000175000017500000000675407374032015021714 0ustar lbrentalbrenta--| --| Filename : $Source: /cvsroot/gnade/gnade/test/odbc_vs_mysql/test_odbc.gpq,v $ --| Description : This is the main driver for the embedded SQL translator --| Author : Michael Erdmann --| Created On : 8.12.2000 --| Last Modified By: $Author: me $ --| Last Modified On: $Date: 2001/11/12 20:41:49 $ --| Status : $State: Exp $ --| --| Copyright (C) 2000 Michael Erdmann --| --| This program is free software; you can redistribute it and/or --| modify it under the terms of the GNU General Public License --| as published by the Free Software Foundation; either version 2 --| of the License, or (at your option) any later version. --| --| This program/code is distributed in the hope that it will be useful, --| but WITHOUT ANY WARRANTY; without even the implied warranty of --| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --| GNU General Public License for more details. --| --| You should have received a copy of the GNU General Public License along --| with this program; if not, write to the Free Software Foundation, Inc., --| 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --| --| As a special exception, if other files instantiate generics from this --| unit, or you link this unit with other files to produce an executable, --| this unit does not by itself cause the resulting executable to be --| covered by the GNU General Public License. This exception does not --| however invalidate any other reasons why the executable file might be --| covered by the GNU Public License. --| --| Functional Description --| ====================== --| --| This is an example for embedded SQL. It demonstrates the ISO/92 --| features and addtional esql extensions. --| --| --| Restrictions --| ============ --| --| References --| ========== --| --| with Ada.Text_IO; use Ada.Text_IO; with SQL_STANDARD; use SQL_STANDARD; with Ada.Calendar; use Ada.Calendar; use Ada; with GNU.DB.SQLCLI; use GNU.DB.SQLCLI; procedure Test_Odbc is Nbr_Count : Natural := 0; Start_Time : Time; End_Time : Time; EXEC SQL DECLARE DB01 DATABASE ; -- **************************************************************** -- EXEC SQL DECLARE R_Otto TABLE ( id char(30), create_Time date, value float, data Varblob( 40000 ) ) ; -- ***************************************************************** -- EXEC SQL BEGIN DECLARE SECTION END-EXEC Id : CHAR(1..30); Value : REAL; Data : GNADE.VARBINARY( 40000 ); EXEC SQL END DECLARE SECTION END-EXEC begin EXEC SQL CONNECT $DBUSER IDENTIFIED BY $DBPASSWD BY DB01 TO $DBSOURCE ; EXEC SQL AT DB01 DECLARE Otto_Table CURSOR FOR SELECT ID, VALUE, DATA FROM R_Otto WHERE ID = 'Otto'; EXEC SQL AT DB01 OPEN Otto_Table ; -- read out all data seleted by the query Put_Line("Executing"); Start_Time := Calendar.Clock; loop EXEC SQL AT DB01 FETCH FROM Otto_Table INTO :Id, :Value, :Data ; exit when SQLCODE in SQL_STANDARD.NOT_FOUND; exit when SQLCODE in SQL_STANDARD.SQL_ERROR; Nbr_Count := Nbr_Count + 1; end loop; End_Time := Calendar.Clock; Put_Line ( "Execution time : " & Duration'Image(End_Time-Start_Time)); Put_Line( " Tuples processed : " & Natural'Image(Nbr_Count) ); EXEC SQL AT DB01 CLOSE Otto_Table; end Test_odbc; gnade-1.6.2.orig/test/sqlite3/0000755000175000017500000000000011040716276015744 5ustar lbrentalbrentagnade-1.6.2.orig/test/sqlite3/gnade-sqlite-tests.gpr0000644000175000017500000000174210664033716022201 0ustar lbrentalbrenta-- $Id: gnade-sqlite-tests.gpr,v 1.1 2007/08/25 14:08:14 persan Exp $ with "../../gnade"; with "../../dbi/sqlite3/gnade-sqlite.gpr"; with "../gnade-tests.gpr"; project Gnade.SQLite.Tests is for Languages use ("Ada"); for Source_Dirs use (".","testcases"); for Object_Dir use Gnade'Object_Dir; for Exec_Dir use Gnade'Exec_Dir; for Main use ("gnu-db-sqlite3-tests-testharneses-test_all.adb" ); for Exec_Dir use "."; package Builder is for Default_Switches ("Ada") use gnade.Builder'Default_Switches ("Ada"); end Builder; package Compiler is for Default_Switches ("Ada") use gnade.Compiler'Default_Switches ("Ada"); end Compiler; package Binder is for Default_Switches ("Ada") use gnade.Binder'Default_Switches ("Ada"); end Binder; package Linker is for Default_Switches ("Ada") use gnade.Linker'Default_Switches ("Ada"); end Linker; package Ide is for Vcs_Kind use "CVS"; end Ide; end Gnade.SQLite.Tests; gnade-1.6.2.orig/test/sqlite3/gnu-db-sqlite3-tests-testharneses-test_all.adb0000644000175000017500000000107010664033716026625 0ustar lbrentalbrentawith GNU.DB.SQLite3.Tests.Testsuits.Test_All; ------------------------------------------------ -- Gnu.Db.Sqlite3.Tests.Testharneses.Test_All -- ------------------------------------------------ with Ada.Directories; with Ada.Command_Line; procedure GNU.Db.Sqlite3.Tests.Testharneses.Test_All is procedure Run is new AUnit.Test_Runner (GNU.DB.SQLite3.Tests.Testsuits.Test_All.Suite); begin Ada.Directories.Set_Directory (Ada.Directories.Containing_Directory (Ada.Command_Line.Command_Name)); Run; end GNU.DB.SQLite3.Tests.Testharneses.Test_All; gnade-1.6.2.orig/test/sqlite3/gnu-db-sqlite3-tests-testharneses.ads0000644000175000017500000000012710664033716025043 0ustar lbrentalbrentapackage GNU.Db.Sqlite3.Tests.Testharneses is end GNU.DB.SQLite3.Tests.Testharneses; gnade-1.6.2.orig/test/sqlite3/gnu-db-sqlite3-tests-testsuits-test_all.adb0000644000175000017500000000120610664033722026162 0ustar lbrentalbrentawith GNU.DB.SQLite3.Tests.Testcases.Tc_000_Basic; with GNU.DB.SQLite3.Tests.Testcases.Tc_001_Bind; package body GNU.Db.Sqlite3.Tests.Testsuits.Test_All is use AUnit.Test_Suites; Result : aliased Test_Suite; Test_1 : aliased GNU.DB.SQLite3.Tests.Testcases.Tc_000_Basic.Test_Case; Test_2 : aliased GNU.DB.SQLite3.Tests.Testcases.Tc_001_Bind.Test_Case; ----------- -- Suite -- ----------- function Suite return Access_Test_Suite is begin Add_Test (Result'Access, Test_1'Access); Add_Test (Result'Access, Test_2'Access); return Result'Access; end Suite; end GNU.DB.SQLite3.Tests.Testsuits.Test_All; gnade-1.6.2.orig/test/sqlite3/gnu-db-sqlite3-tests-testsuits-test_all.ads0000644000175000017500000000030410664033722026201 0ustar lbrentalbrentapackage GNU.Db.Sqlite3.Tests.Testsuits.Test_All is use AUnit; function Suite return Test_Suites.Access_Test_Suite; -- Return the test suite end GNU.DB.SQLite3.Tests.Testsuits.Test_All; gnade-1.6.2.orig/test/sqlite3/gnu-db-sqlite3-tests-testsuits.ads0000644000175000017500000000012110664033722024371 0ustar lbrentalbrentapackage GNU.Db.Sqlite3.Tests.Testsuits is end GNU.DB.SQLite3.Tests.Testsuits; gnade-1.6.2.orig/test/sqlite3/gnu-db-sqlite3-tests.ads0000644000175000017500000000022310664033722022327 0ustar lbrentalbrentawith GNU.DB.Tests.AUnit; use GNU.DB.Tests; pragma Warnings (OFF, GNU.DB.Tests.AUnit); package GNU.Db.Sqlite3.Tests is end GNU.DB.SQLite3.Tests; gnade-1.6.2.orig/test/sqlite3/testcases/0000755000175000017500000000000011040716254017736 5ustar lbrentalbrentagnade-1.6.2.orig/test/sqlite3/testcases/gnu-db-sqlite3-tests-testcases-tc_000_basic.adb0000644000175000017500000000657010664033722030437 0ustar lbrentalbrentawith GNAT.Source_Info; with Ada.Text_IO; use Ada.Text_IO; with Ada.Directories; use Ada.Directories; package body GNU.Db.Sqlite3.Tests.Testcases.Tc_000_Basic is use AUnit.Test_Cases.Registration; use AUnit.Assertions; ---------- -- Name -- ---------- Db_Name : constant String := Base_Name (GNAT.Source_Info.File) & ".db"; TxT_Name : constant String := Base_Name (GNAT.Source_Info.File) & ".txt"; function Name (T : Test_Case) return Message_String is pragma Unreferenced (T); begin return Format (GNAT.Source_Info.File); end Name; ------------------------- -- t_open ------------------------- procedure T_Open (Test : in out AUnit.Test_Cases.Test_Case'Class) is T : Test_Case renames Test_Case (Test); begin T.Db.Open (Db_Name); end T_Open; ------------------------- -- t_create ------------------------- procedure T_Create (Test : in out AUnit.Test_Cases.Test_Case'Class) is T : Test_Case renames Test_Case (Test); begin T.Db.Exec ("CREATE TABLE demo(bla INT, ble INT, blo INT);"); end T_Create; ------------------------- -- t_fill ------------------------- procedure T_Fill (Test : in out AUnit.Test_Cases.Test_Case'Class) is T : Test_Case renames Test_Case (Test); begin for I in 1 .. 10 loop T.Db.Exec ("INSERT INTO demo VALUES(" & I'Img & ", 200, 300);"); end loop; end T_Fill; ------------------------- -- t_dump ------------------------- procedure T_Dump (Test : in out AUnit.Test_Cases.Test_Case'Class) is T : Test_Case renames Test_Case (Test); F : Ada.Text_IO.File_Type; function List (Argc : Integer; Argv : String_Vectors.Vector; ColumnNames : String_Vectors.Vector) return Return_Value is begin for I in 0 .. Argc loop Put_Line (F, ColumnNames.Element (I) & ": " & Argv.Element (I)); end loop; return SQLITE_OK; end List; begin Create (F, Out_File, TxT_Name); T.Db.Exec ("SELECT * FROM demo where bla > 4;", List'Unrestricted_Access); Close (F); end T_Dump; ------------------------- -- t_drop ------------------------- procedure T_Drop (Test : in out AUnit.Test_Cases.Test_Case'Class) is T : Test_Case renames Test_Case (Test); begin T.Db.Exec ("DROP TABLE demo;"); end T_Drop; ------------------------- -- t_close ------------------------- procedure T_Close (Test : in out AUnit.Test_Cases.Test_Case'Class) is T : Test_Case renames Test_Case (Test); begin T.Db.Close; end T_Close; -------------------- -- Register_Tests -- -------------------- procedure Register_Tests (T : in out Test_Case) is begin Register_Routine (T, T_Open'Access, "T_Open"); Register_Routine (T, T_Create'Access, "T_Create"); Register_Routine (T, T_Fill'Access, "T_Fill"); Register_Routine (T, T_Dump'Access, "T_Dump"); Register_Routine (T, T_Drop'Access, "T_Drop"); Register_Routine (T, T_Close'Access, "T_Close"); end Register_Tests; procedure Set_Up_Case (Test : in out Test_Case) is pragma Unreferenced (Test); begin if Ada.Directories.Exists (Db_Name) then Ada.Directories.Delete_File (Db_Name); end if; end Set_Up_Case; end GNU.DB.SQLite3.Tests.Testcases.Tc_000_Basic; gnade-1.6.2.orig/test/sqlite3/testcases/gnu-db-sqlite3-tests-testcases-tc_000_basic.ads0000644000175000017500000000117610664033722030455 0ustar lbrentalbrenta package GNU.Db.Sqlite3.Tests.Testcases.Tc_000_Basic is use AUnit.Test_Cases; use AUnit.Test_Results; use AUnit.Message_Strings; type Test_Case is new AUnit.Test_Cases.Test_Case with record Db : aliased GNU.DB.SQLite3.Object; Table : Table_Reference := new String_Tables.Vector; end record; procedure Register_Tests (T : in out Test_Case); -- Register routines to be run function Name (T : Test_Case) return Message_String; -- Returns name identifying the test case procedure Set_Up_Case (Test : in out Test_Case); end GNU.DB.SQLite3.Tests.Testcases.Tc_000_Basic; gnade-1.6.2.orig/test/sqlite3/testcases/gnu-db-sqlite3-tests-testcases-tc_001_bind.adb0000644000175000017500000001302410670337274030271 0ustar lbrentalbrentawith GNAT.Source_Info; with Ada.Directories; use Ada.Directories; package body GNU.Db.Sqlite3.Tests.Testcases.Tc_001_Bind is use AUnit.Test_Cases.Registration; use AUnit.Assertions; ---------- -- Name -- ---------- Db_Name : constant String := Base_Name (GNAT.Source_Info.File) & ".db"; -- TxT_Name : constant String := Base_Name (GNAT.Source_Info.File) & ".txt"; function Name (T : Test_Case) return Message_String is pragma Unreferenced (T); begin return Format (GNAT.Source_Info.File); end Name; ------------------------- -- t_column_count ------------------------- procedure T_Column_Count (Test : in out AUnit.Test_Cases.Test_Case'Class) is T : Test_Case renames Test_Case (Test); begin Assert (T.Stmt.Column_Count = 4, "Incorrcet columncount returned"); Assert (T.Stmt.Column_Name (0) = "bla", "Column 0 not 'bla'"); end T_Column_Count; ------------------------- -- t_column_name ------------------------- procedure T_Column_Name (Test : in out AUnit.Test_Cases.Test_Case'Class) is T : Test_Case renames Test_Case (Test); begin Assert (T.Stmt.Column_Name (3) = "x", "Column 3 not 'x'"); end T_Column_Name; ------------------------- -- T_Column_Decltype_INT ------------------------- procedure T_Column_Decltype_INT (Test : in out AUnit.Test_Cases.Test_Case'Class) is T : Test_Case renames Test_Case (Test); begin Assert (T.Stmt.Column_Decltype (0) = "INT", "Column 0 not 'INT'"); end T_Column_Decltype_INT; ------------------------- -- T_Column_Decltype_TEXT ------------------------- procedure T_Column_Decltype_TEXT (Test : in out AUnit.Test_Cases.Test_Case'Class) is T : Test_Case renames Test_Case (Test); begin Assert (T.Stmt.Column_Decltype (3) = "TEXT", "Column 3 not 'TEXT'"); end T_Column_Decltype_TEXT; ------------------------- -- T_Column_Type_SQLITE_INTEGER ------------------------- procedure T_Column_Type_SQLITE_INTEGER (Test : in out AUnit.Test_Cases.Test_Case'Class) is T : Test_Case renames Test_Case (Test); begin T.Ret := T.Stmt.Step; Assert (T.Stmt.Column_Type (0) = SQLITE_INTEGER, "Expected " & SQLITE_INTEGER'Img & " Got " & T.Stmt.Column_Type (0)'Img); end T_Column_Type_SQLITE_INTEGER; ------------------------- -- T_Column_Type_SQLITE_TEXT ------------------------- procedure T_Column_Type_SQLITE_TEXT (Test : in out AUnit.Test_Cases.Test_Case'Class) is T : Test_Case renames Test_Case (Test); begin T.Ret := T.Stmt.Step; Assert (T.Stmt.Column_Type (3) = SQLITE_TEXT, "Expected " & SQLITE_TEXT'Img & " Got " & T.Stmt.Column_Type (0)'Img); end T_Column_Type_SQLITE_TEXT; ------------------------- -- t_Data_Count ------------------------- procedure T_Data_Count (Test : in out AUnit.Test_Cases.Test_Case'Class) is T : Test_Case renames Test_Case (Test); begin T.Ret := T.Stmt.Step; Assert (T.Stmt.Data_Count = 4, "Expected 4 rows got:" & T.Stmt.Data_Count'Img); end T_Data_Count; ------------------------- -- t_step ------------------------- procedure T_Step (Test : in out AUnit.Test_Cases.Test_Case'Class) is T : Test_Case renames Test_Case (Test); begin T.Ret := T.Stmt.Step; Assert (T.Stmt.Column_Int (0) = 5, "Expected 5 Got " & T.Stmt.Column_Int (0)'Img); end T_Step; ------------------------- -- t_bind ------------------------- procedure t_bind (Test : in out AUnit.Test_Cases.Test_Case'Class) is T : Test_Case renames Test_Case (Test); pragma Unreferenced (T); St : aliased Statement; begin Test.Db.Prepare ("SELECT * FROM demo_I where bla > 4;", Test.Stmt'Unrestricted_Access); end t_bind; -------------------- -- Register_Tests -- -------------------- procedure Register_Tests (T : in out Test_Case) is begin Register_Routine (T, T_Column_Count'Access, "T_Column_Count"); Register_Routine (T, T_Column_Name'Access, "T_Column_Name"); Register_Routine (T, T_Column_Decltype_INT'Access, "T_Column_Decltype_INT"); Register_Routine (T, T_Column_Decltype_TEXT'Access, "T_Column_Decltype_TEXT"); Register_Routine (T, T_Column_Type_SQLITE_INTEGER'Access, "T_Column_Type_SQLITE_INTEGER"); Register_Routine (T, T_Column_Type_SQLITE_TEXT'Access, "T_Column_Type_SQLITE_TEXT"); Register_Routine (T, T_Data_Count'Access, "T_Data_Count"); Register_Routine (T, T_Step'Access, "T_Step"); end Register_Tests; procedure Set_Up_Case (Test : in out Test_Case) is Ret : Return_Value; pragma Unreferenced (Ret); begin Test.Db.Open (Db_Name); Ret := Test.Db.Exec ("DROP TABLE demo_I;"); Test.Db.Exec ("CREATE TABLE demo_I(bla INT, ble INT, blo INT, x TEXT);"); begin for I in 1 .. 10 loop Test.Db.Exec ("INSERT INTO demo_I VALUES(" & I'Img & ", 200, 300, 'Miko');"); end loop; exception when others => null; end; end Set_Up_Case; procedure Tear_Down_Case (Test : in out Test_Case) is pragma Unreferenced (Test); begin --Test.Db.Close; --Ada.Directories.Delete_File (Db_Name); null; end Tear_Down_Case; procedure Set_Up (Test : in out Test_Case) is begin Test.Db.Prepare ("SELECT * FROM demo_I where bla > 4;", Test.Stmt'Unrestricted_Access); end Set_Up; procedure Tear_Down (Test : in out Test_Case) is begin Test.Stmt.Finalize; end Tear_Down; end GNU.DB.SQLite3.Tests.Testcases.Tc_001_Bind; gnade-1.6.2.orig/test/sqlite3/testcases/gnu-db-sqlite3-tests-testcases-tc_001_bind.ads0000644000175000017500000000152710670337274030317 0ustar lbrentalbrenta package GNU.Db.Sqlite3.Tests.Testcases.Tc_001_Bind is use AUnit.Test_Cases; use AUnit.Test_Results; use AUnit.Message_Strings; type Test_Case is new AUnit.Test_Cases.Test_Case with record Db : aliased GNU.DB.SQLite3.Object; Stmt : aliased Statement; Table : Table_Reference := new String_Tables.Vector; Ret : Return_Value; end record; procedure Register_Tests (T : in out Test_Case); -- Register routines to be run function Name (T : Test_Case) return Message_String; -- Returns name identifying the test case procedure Set_Up_Case (Test : in out Test_Case); procedure Tear_Down_Case (Test : in out Test_Case); procedure Set_Up (Test : in out Test_Case); procedure Tear_Down (Test : in out Test_Case); end GNU.DB.SQLite3.Tests.Testcases.Tc_001_Bind; gnade-1.6.2.orig/test/sqlite3/testcases/gnu-db-sqlite3-tests-testcases.ads0000644000175000017500000000012110664033723026317 0ustar lbrentalbrentapackage GNU.Db.Sqlite3.Tests.Testcases is end GNU.DB.SQLite3.Tests.Testcases; gnade-1.6.2.orig/test/src/0000755000175000017500000000000011040716254015143 5ustar lbrentalbrentagnade-1.6.2.orig/test/src/gnu-db-tests-aunit.ads0000644000175000017500000000020010664033502021255 0ustar lbrentalbrentawith AUnit_Framework.Framework; package GNU.Db.Tests.AUnit is new AUnit_Framework.Framework (1000, 1000, 60, 1000); gnade-1.6.2.orig/test/src/gnu-db-tests.ads0000644000175000017500000000005310664033503020146 0ustar lbrentalbrentapackage GNU.Db.Tests is end GNU.DB.Tests; gnade-1.6.2.orig/test/varchar/0000755000175000017500000000000011040716254016002 5ustar lbrentalbrentagnade-1.6.2.orig/test/varchar/Makefile0000644000175000017500000001043007364262772017457 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/test/varchar/Makefile,v $ ## Description : Makefile for the embedded SQL samples ## Author : Juergen Pfeifer ## Created On : 03-Jan-2001 ## Last Modified By: $Author: me $ ## Last Modified On: $Date: 2001/10/20 11:54:34 $ ## Status : $State: Exp $ ## ## Copyright (C) 2000-2001 ## ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## This makefile builds a modified version of the Oracle simple test ## code. ## ## Restrictions ## ============ ## ## References ## ========== ## sinclude ../conf.local sinclude ../../make.conf # ESQLFLAGS = -iso92 -s -v -pedantic -nosqlstate -schema test.sql $(FLAGS) ESQL=$(bindir)/$(esql) PROGRAMS=simple # all :: $(PROGRAMS) # ------------------------------------------------------------------------- # # C O M P I L E R R U L E S # # ------------------------------------------------------------------------- # .SUFFIXES: .adb .adq .adq_p .adq.adb: $(ESQL) $(ESQLFLAGS) $*.adq .adq_p.adq: $(ADAPREP) -DDBUSER=\"$(DBUSER)\" \ -DDBPASSWD=\"$(DBPASSWD)\" \ -DDBSOURCE=\"$(DBSOURCE)\" \ $*.adq_p $*.adq # ------------------------------------------------------------------------- # # E X E C U T A B L E S # # ------------------------------------------------------------------------- # simple.adq: simple.adq_p simple: test.adb $(ADAMAKE) test.adb -o testc $(ADAFLAGS) $(CFLAGS) \ $(APP_BIND_FLAGS) $(APP_LINK_FLAGS) -largs # ------------------------------------------------------------------------- # # C L E A N T H E D I R E C T O R Y # # ------------------------------------------------------------------------- # clean: rm -rf $(PROGRAMS) b~*.* *.o *.ali core test.adb *~ rm -rf test.sql test.adq testc distclean :: clean gnade-1.6.2.orig/test/varchar/README0000644000175000017500000000067307364262772016707 0ustar lbrentalbrentaThis file is used to test the VARCHAR data type [gnade@boavista chars]$ ./testc Line 41 in package Test : Prepare Query SELECT empno , name FROM employees WHERE FIRSTNAME = ? SQL State : 00000 SQL Code : 0 --------------- Line 41 in package Test : Query SELECT empno , name FROM employees WHERE FIRSTNAME = ? SQL State : 00000 SQL Code : 0 --------------- empno : 1 found name : Erdmann [gnade@boavista chars]$ gnade-1.6.2.orig/test/varchar/test.adq_p0000644000175000017500000000237707364262772020017 0ustar lbrentalbrenta with ada.text_io; use ada.text_io; with Ada.Strings.Fixed; use Ada.Strings.Fixed; with Ada.Strings; use Ada.Strings; with sql_standard; use sql_standard; with gnu.db.esql_Support; use gnu.db.esql_support; use gnu.db; procedure Test is val : String := "FIRSTNAME"; -- declare host and program variables EXEC SQL BEGIN DECLARE SECTION; ENAME : GNADE.VARCHAR(50); EMPNO : sql_standard.int; SQLCODE : sql_standard.sqlcode_type; -- for ANSI mode SQLSTATE : sql_standard.sqlstate_type; -- ANSI mode tt : GNADE.VARCHAR ( 50 ); EXEC SQL END DECLARE SECTION; SQL_ERROR : exception; SQL_WARNING : exception; begin -- Connect to ORACLE EXEC SQL CONNECT $DBUSER IDENTIFIED BY $DBPASSWD TO $DBSOURCE ; To_varchar( "Michael", tt ); EXEC SQL WHENEVER NOT FOUND raise SQL_ERROR; EXEC SQL SELECT empno, name INTO :EMPNO, :ENAME FROM employees WHERE FIRSTNAME = :tt ; Put_Line( "empno : " & Integer'Image(Integer(empno)) ); Put_Line( "found name : " & To_String( ename ) ); end Test; gnade-1.6.2.orig/tools/0000755000175000017500000000000011040716276014541 5ustar lbrentalbrentagnade-1.6.2.orig/tools/Makefile0000644000175000017500000001035410664457436016217 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/tools/Makefile,v $ ## Description : Build some helpfull tools based on odbc -- ## Author : Michael Erdmann -- ## Created On : 22-Dec-2003 -- ## Last Modified By: $Author: persan $ -- ## Last Modified On: $Date: 2007/08/27 05:20:30 $ -- ## Status : $State: Exp $ -- ## -- ## Copyright (C) 2003,2004 Michael Erdmann -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## This make file builds all tool binaries of the gnade package. ## ## Restrictions ## ============ ## None ## ## References ## ========== ## None ## include ../make.conf mainunits=exp.adb imp.adb sql.adb lsodbc.adb binaries=$(subst .adb,$(bin),$(mainunits)) source=$(firstword $(binaries)) ${OutDirs}: (MKDIR) -p ${@) ## ## build all components in this directory and install it if requested. ## all build: tools.ads ${OutDirs} $(ADAMAKE) -XARCH="$(BUILDARCH)" -Ptools.gpr exp.adb -largs -L/usr/lib/unixODBC $(DMLINKEROPT) $(ADAMAKE) -XARCH="$(BUILDARCH)" -Ptools.gpr imp.adb -largs $(DMLINKEROPT) $(ADAMAKE) -XARCH="$(BUILDARCH)" -Ptools.gpr sql.adb -largs $(DMLINKEROPT) $(ADAMAKE) -XARCH="$(BUILDARCH)" -Ptools.gpr lsodbc.adb -largs $(DMLINKEROPT) ifneq ($(EXPORT),) $(MAKE) install endif tools.ads: tools.gps $(ADAPREP) -DVersion=\"$(VERSION)\" tools.gps tools.ads ## ## ## dist: all install ## ## install the binaries in the distribution directory of GNADE ## install: $(CP) exp$(bin) $(subst /,$(PATHSEP),$(bindir)) $(CP) imp$(bin) $(subst /,$(PATHSEP),$(bindir)) $(CP) sql$(bin) $(subst /,$(PATHSEP),$(bindir)) $(CP) lsodbc$(bin) $(subst /,$(PATHSEP),$(bindir)) ## ## clean out the local directory ## clean: $(RM) b~*.* *.o *.ali *~ *~*~ *.bak $(RM) tools.ads $(binaries) ## ## ## distclean :: clean $(RM) $(subst /,$(PATHSEP),$(foreach f,$(binaries), $(bindir)/$(f) )) gnade-1.6.2.orig/tools/Makefile.tools0000644000175000017500000000614410027000435017330 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/tools/Makefile.tools,v $ ## Description : Build some helpfull tools based on odbc -- ## Author : Michael Erdmann -- ## Created On : 22-Dec-2003 -- ## Last Modified By: $Author: merdmann $ -- ## Last Modified On: $Date: 2004/03/20 08:30:21 $ -- ## Status : $State: Exp $ -- ## -- ## Copyright (C) 2003,2004 Michael Erdmann -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## This make file builds all tool binaries of the gnade package. ## ## Restrictions ## ============ ## None ## ## References ## ========== ## None ## all build: $(MAKE) -C./ $@ gnade-1.6.2.orig/tools/README0000644000175000017500000000041707646070525015432 0ustar lbrentalbrentaThis directory contains command line tools based upon the ODBC interface. lsodbc - Display information about a data source sql - run an sql command imp - Import into a table of a data base exp - export data from a table of a data base gnade-1.6.2.orig/tools/exp.adb0000644000175000017500000002162510664021767016020 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/tools/exp.adb,v $ -- Description : Export the contents of a data base -- -- Author : Michael Erdmann -- -- Created : 5.4.2003 -- -- Last Modified By: $Author: persan $ -- -- Last Modified On: $Date: 2007/08/25 12:43:35 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2000 - 2003 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- -- -- Export the contents of a table into a simple file format. This file -- -- format i intended for importing or processing by other gnade tools -- -- -- -- -- -- Restrictions -- -- ============ -- -- None -- -- -- -- References -- -- ========== -- -- None -- -- -- ------------------------------------------------------------------------------- with Ada.Text_IO; use Ada.Text_IO; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Command_Line; use Ada.Command_Line; with Files; use Files; with ODBC; use ODBC; with Tools; use Tools; with Util; use Util; procedure Exp is Version : constant String := "$Id: exp.adb,v 1.6 2007/08/25 12:43:35 persan Exp $"; pragma Unreferenced (Version); DB : ODBC.Object; Login : Unbounded_String; Pwd : Unbounded_String; Source : Unbounded_String; Argc : Natural := 1; Export_File : Files.Object; --------------------------- -- Export_Arguments_Type -- --------------------------- type Export_Arguments_Type is record Name : Unbounded_String := Null_Unbounded_String; File_Name : Unbounded_String := Null_Unbounded_String; end record; Null_Argument : constant Export_Arguments_Type := ( Name => Null_Unbounded_String, File_Name => Null_Unbounded_String); Export_Args : Export_Arguments_Type; ------------ -- Tables -- ------------ package Tables is new Bucket (Bucket_Type => Export_Arguments_Type); ---------- -- Help -- ---------- procedure Help is begin Put_Line ("usage : "); Put_Line (" exp -u [ -l ] table [-f name] ... "); Put_Line (""); end Help; ------------ -- Export -- ------------ function Export ( Name : in Unbounded_String; T : in Unbounded_String) return Natural is -- export the contents of a table into the given output stream R : Result_Record := null; N : Natural := 0; begin Query (DB, "select * from " & To_String (T)); R := Fetch (DB); -- prepare the header information from the query declare F : constant String_Array_Access := new String_Array (1 .. R'Length); begin for I in R'Range loop F (I) := To_Unbounded_String (Field_Name (DB, I)); end loop; Fields (Export_File, F); end; Create (Export_File, To_String (Name), Contents => Database_Export); while R /= null loop N := N + 1; Write (Export_File, R); Free (R); R := Fetch (DB); end loop; Close (Export_File); return N; end Export; begin Initialize (DB); -- Handle the command line arguments while Argc in 1 .. Argument_Count loop declare Arg : constant String := Argument (Argc); begin if Arg = "-u" then Argc := Argc + 1; Login := To_Unbounded_String (Argument (Argc)); elsif Arg = "-p" then Argc := Argc + 1; Pwd := To_Unbounded_String (Argument (Argc)); elsif Arg = "-f" then Argc := Argc + 1; Export_Args.File_Name := To_Unbounded_String (Argument (Argc)); elsif Arg = "-h" then Help; return; elsif Arg = "-v" then Opt_Verbose := True; elsif Arg = "-q" then Util.Quiet := True; Opt_Verbose := False; else if Source = Null_Unbounded_String then Source := To_Unbounded_String (Arg); else Export_Args.Name := To_Unbounded_String (Arg); Tables.Add (Export_Args); Export_Args := Null_Argument; end if; end if; Argc := Argc + 1; end; end loop; if not Quiet then Report ("GNADE Table Export, Version " & Tools.Version); Report ("Copyright (C) 2003, Michael Erdmann (michael.erdmann@snafu.de)"); Report (""); end if; if Source = Null_Unbounded_String then Error ("source not specified"); Error (""); Help; Set_Exit_Status (Failure); return; end if; -- connect to the data base Authorization (DB, To_String (Login), To_String (Pwd)); Data_Source (DB, To_String (Source)); Connect (DB); Export_Args := Tables.Get (First => True); loop declare File_Name : Unbounded_String renames Export_Args.File_Name; Tab_Name : Unbounded_String renames Export_Args.Name; Records : Natural := 0; begin Initialize (Export_File); if File_Name = Null_Unbounded_String then File_Name := Export_Args.Name & ".exp"; end if; Records := Export (File_Name, Tab_Name); Report ("Table " & To_String (Tab_Name) & ", " & "exported " & Natural'Image (Records) & " record(s)."); Finalize (Export_File); exception when others => Error ("Exception when exporting " & To_String (Tab_Name)); Report_DB_Error (DB); Close (Export_File); Finalize (Export_File); end; exit when Tables.End_Of_Bucket; Export_Args := Tables.Get; end loop; --Finalize( DB ); Set_Exit_Status (Success); exception when others => Report_DB_Error (DB); Set_Exit_Status (Failure); end Exp; gnade-1.6.2.orig/tools/files.adb0000644000175000017500000002577610664021767016341 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/tools/files.adb,v $ -- Description : Export the contents of a data base -- -- Author : Michael Erdmann -- -- Created : 5.4.2003 -- -- Last Modified By: $Author: persan $ -- -- Last Modified On: $Date: 2007/08/25 12:43:35 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2000 - 2003 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- -- -- Export the contents of a table into a simple file format. This file -- -- format i intended for importing or processing by other gnade tools -- -- -- -- -- -- Restrictions -- -- ============ -- -- None -- -- -- -- References -- -- ========== -- -- None -- -- -- ------------------------------------------------------------------------------- with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Streams; use Ada.Streams; with Ada.Streams.Stream_IO; use Ada.Streams.Stream_IO; with Util; use Util; package body Files is ----------------- -- Header_Type -- ----------------- type Header_Type is record Contents : Contents_Type := Null_Contents_Type; Major_Version : Integer := 1; Minor_Version : Integer := 0; Patch_Level : Integer := 0; Length : Integer := 0; end record; ----------------- -- Object_Data -- ----------------- type Object_Data_Type is record Contents : Contents_Type := Null_Contents_Type; Stream : Stream_Access; File : File_Type; Header : Header_Type; Vector : String_Array_Access; Field : String_Array_Access; end record; --********************************************************************-- -- I N T E R N A L M E T H O D S -- --********************************************************************-- ---------- -- Info -- ---------- procedure Info ( S : in String) is begin if Opt_Verbose then Report (S); end if; end Info; ----------------- -- Read_Header -- ----------------- procedure Read_Header ( This : in out Object) is -- Read in the header information of an import/export file Data : Object_Data_Access renames This.Data; H : Header_Type renames Data.Header; begin H := Header_Type'Input (Data.Stream); Info ("Contents: " & Contents_Type'Image (H.Contents)); case H.Contents is when Database_Export => Data.Vector := new String_Array (1 .. H.Length); Data.Field := new String_Array (1 .. H.Length); for I in 1 .. H.Length loop Data.Field (I) := Unbounded_String'Input (Data.Stream); end loop; when others => null; end case; end Read_Header; ------------------ -- Write_Header -- ------------------ procedure Write_Header ( This : in out Object) is -- this procedure write the correct header layout based on the -- document type. This procedure has allays be in line with the -- Read_Header procedure, Data : Object_Data_Access renames This.Data; H : Header_Type renames Data.Header; begin H.Contents := Data.Contents; Header_Type'Output (Data.Stream, H); case H.Contents is when Database_Export => for I in 1 .. H.Length loop Unbounded_String'Output (Data.Stream, Data.Field (I)); end loop; when others => null; end case; end Write_Header; --********************************************************************-- -- -- --********************************************************************-- ---------------- -- Initialize -- ---------------- procedure Initialize ( This : in out Object) is -- Initialize the object begin This.Data := new Object_Data_Type; end Initialize; -------------- -- Finalize -- -------------- procedure Finalize ( This : in out Object) is -- finalize the object and all related resources. Data : Object_Data_Access renames This.Data; begin if Data /= null then null; end if; Data := null; end Finalize; ------------ -- Fields -- ------------ procedure Fields ( This : in out Object; Info : in String_Array_Access) is -- set the fields Data : Object_Data_Access renames This.Data; H : Header_Type renames Data.Header; begin H.Length := Info.all'Length; Data.Field := new String_Array (1 .. H.Length); Data.Vector := new String_Array (1 .. H.Length); for I in Info.all'Range loop Data.Field (I) := Info (I); Data.Vector (I) := Null_Unbounded_String; end loop; end Fields; ------------ -- Fields -- ------------ function Fields ( This : in Object) return String_Array_Access is Data : Object_Data_Access renames This.Data; begin return Data.Field; end Fields; ----------------- -- End_of_File -- ----------------- function End_Of_File ( This : in Object) return Boolean is Data : Object_Data_Access renames This.Data; begin return Stream_IO.End_Of_File (Data.File); end End_Of_File; ---------- -- Open -- ---------- procedure Open ( This : in out Object; Name : in String; Contents : Contents_Type := Database_Export) is -- Open the file to be imported. The file has to exist, otherwise -- an exception is raised. Data : Object_Data_Access renames This.Data; begin Open (File => Data.File, Name => Name, Mode => In_File); Data.Stream := Stream_IO.Stream (Data.File); Read_Header (This); Data.Contents := Data.Header.Contents; if Data.Contents /= Contents then raise Unexpected_File_Type; end if; exception when others => raise File_Not_Existing; end Open; ------------ -- Create -- ------------ procedure Create ( This : in out Object; Name : in String := ""; Contents : in Contents_Type := Database_Export) is -- create a new file based on the file object Data : Object_Data_Access renames This.Data; begin Stream_IO.Create (File => Data.File, Name => Name, Mode => Stream_IO.Out_File); Data.Stream := Stream_IO.Stream (Data.File); Data.Contents := Contents; Write_Header (This); end Create; ----------- -- Close -- ----------- procedure Close ( This : in out Object) is -- close the file Data : Object_Data_Access renames This.Data; begin Stream_IO.Close (Data.File); end Close; ---------- -- Read -- ---------- function Read ( This : in Object) return String_Array_Access is -- Read a record from the import file and return the associated vector Data : Object_Data_Access renames This.Data; H : Header_Type renames Data.Header; begin for I in 1 .. H.Length loop Data.Vector (I) := Unbounded_String'Input (Data.Stream); end loop; return Data.Vector; exception when others => return Null_String_Array; end Read; ----------- -- Write -- ----------- procedure Write ( This : in out Object; Items : in String_Array_Access) is Data : Object_Data_Access renames This.Data; H : Header_Type renames Data.Header; begin for I in 1 .. H.Length loop Unbounded_String'Output (Data.Stream, Items (I)); end loop; end Write; end Files; gnade-1.6.2.orig/tools/files.ads0000644000175000017500000001353210664021767016345 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/tools/files.ads,v $ -- Description : Export the contents of a data base -- -- Author : Michael Erdmann -- -- Created : 5.4.2003 -- -- Last Modified By: $Author: persan $ -- -- Last Modified On: $Date: 2007/08/25 12:43:35 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2000 - 2003 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- -- -- Export the contents of a table into a simple file format. This file -- -- format i intended for importing or processing by other gnade tools -- -- -- -- -- -- Restrictions -- -- ============ -- -- None -- -- -- -- References -- -- ========== -- -- None -- -- -- ------------------------------------------------------------------------------- with Tools; use Tools; package Files is Opt_Verbose : Boolean := False; type Object is private; ------------------- -- Contents_Type -- ------------------- type Contents_Type is ( Database_Export, Null_Contents_Type ); ---------------- -- Initialize -- ---------------- procedure Initialize ( This : in out Object); -------------- -- Finalize -- -------------- procedure Finalize ( This : in out Object); ------------ -- Fields -- ------------ procedure Fields ( This : in out Object; Info : in String_Array_Access); ------------ -- Fields -- ------------ function Fields ( This : in Object) return String_Array_Access; ----------------- -- End_of_File -- ----------------- function End_Of_File ( This : in Object) return Boolean; ---------- -- Open -- ---------- procedure Open ( This : in out Object; Name : in String; Contents : in Contents_Type := Database_Export); ------------ -- Create -- ------------ procedure Create ( This : in out Object; Name : in String := ""; Contents : in Contents_Type := Database_Export); ----------- -- Close -- ----------- procedure Close ( This : in out Object); ---------- -- Read -- ---------- function Read ( This : in Object) return String_Array_Access; ----------- -- Write -- ----------- procedure Write ( This : in out Object; Items : in String_Array_Access); File_Not_Existing : exception; Unexpected_File_Type : exception; private type Object_Data_Type; type Object_Data_Access is access Object_Data_Type; type Object is record Data : Object_Data_Access := null; end record; end Files; gnade-1.6.2.orig/tools/gnade-tools.gpr0000644000175000017500000000147510664033134017472 0ustar lbrentalbrentawith "../gnade"; with "../support/gnade-support.gpr"; with "../dbi/odbc/gnade-odbc.gpr"; Project Gnade.Tools is for Languages use ("Ada", "SQL", "Project File" ); for Main use ("exp.adb", "imp.adb", "lsodbc.adb", "sql.adb"); for Source_Dirs use ("."); for Object_Dir use Gnade'Object_Dir; for Exec_Dir use "." ; package Binder is for Default_Switches ("ada") use ("-static" ); end Binder; package Compiler is for Default_Switches ("ada") use GNADE.Compiler'Default_Switches ("ada"); end Compiler; package Builder is for Default_Switches ("ada") use GNADE.Compiler'Default_Switches ("ada"); end Builder; package Linker is for Default_Switches ("ada") use GNADE.Linker'Default_Switches ("ada"); end Linker; package IDE renames Gnade.Ide; end Gnade.Tools; gnade-1.6.2.orig/tools/imp.adb0000644000175000017500000002021110664021767015777 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/tools/imp.adb,v $ -- Description : Import a file into the data base -- -- Author : Michael Erdmann -- -- Created : 5.4.2003 -- -- Last Modified By: $Author: persan $ -- -- Last Modified On: $Date: 2007/08/25 12:43:35 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2000 - 2003 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- This program allows to fill a table with data stored in an export file -- -- created by the exp program. -- -- Since this programm touches only the named field in the export file, it -- -- is possible to insert the contents of multiple fields in different steps.-- -- -- -- -- -- Restrictions -- -- ============ -- -- None -- -- -- -- References -- -- ========== -- -- None -- -- -- ------------------------------------------------------------------------------- with Ada.Command_Line; use Ada.Command_Line; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Import; use Import; with Util; use Util; with Tools; use Tools; with Files; use Files; procedure Imp is Version : constant String := "$Id: imp.adb,v 1.8 2007/08/25 12:43:35 persan Exp $"; pragma Unreferenced (Version); Login : Unbounded_String; Pwd : Unbounded_String; Source : Unbounded_String; Argc : Natural := 1; Table : Unbounded_String; File_Name : Unbounded_String; Nbr_Of_Records : Natural := 0; Import_File : Files.Object; package Files is new Util.Bucket (Bucket_Type => Unbounded_String); ---------- -- Help -- ---------- procedure Help is begin Error ("usage : "); Error (" imp [-u [ -l ]] source table file(s)"); Error (""); Error (" -u - Login to be used to access the data source."); Error (" -l - Password to bu used for login."); Error (" source - Name of an ODBC data source."); Error (" table - SQL Table Name (upper/lower case are relevant."); Error (" file(s) - A list of files created by the exp tool."); Error (""); end Help; ------------ -- Import -- ------------ procedure Execute_Import ( Name : in Unbounded_String; T : in Unbounded_String) is pragma Unreferenced (T); -- export the contents of a table into the given output stream Data : String_Array_Access := null; Row : Natural := 1; begin Open (Import_File, To_String (Name)); Import.Prepare (To_String (Table), Fields (Import_File).all); Data := Read (Import_File); while Data /= Null_String_Array loop Nbr_Of_Records := Nbr_Of_Records + 1; Import.Execute (Data.all); Data := Read (Import_File); Row := Row + 1; end loop; exception when File_Not_Existing => raise; when others => Error ("Exception in row : " & Natural'Image (Row)); raise; end Execute_Import; begin -- Handle the command line arguments while Argc in 1 .. Argument_Count loop declare Arg : constant String := Argument (Argc); begin if Arg = "-u" then Argc := Argc + 1; Login := To_Unbounded_String (Argument (Argc)); elsif Arg = "-p" then Argc := Argc + 1; Pwd := To_Unbounded_String (Argument (Argc)); elsif Arg = "-h" then Help; return; elsif Arg = "-v" then Opt_Verbose := True; elsif Arg = "-q" then Util.Quiet := True; Opt_Verbose := False; else if Source = Null_Unbounded_String then Source := To_Unbounded_String (Arg); elsif Table = Null_Unbounded_String then Table := To_Unbounded_String (Arg); else Files.Add (To_Unbounded_String (Arg)); end if; end if; Argc := Argc + 1; end; end loop; Report ("GNADE Table import, Version " & Tools.Version); Report ("Copyright (C) 2003, Michael Erdmann (michael.erdmann@snafu.de)"); Report (""); if Source = Null_Unbounded_String then Error ("no data source has been specified"); Error (""); Help; Set_Exit_Status (Failure); return; end if; Import.Initialize (To_String (Source), To_String (Login), To_String (Pwd)); if Files.End_Of_Bucket then File_Name := Table & ".exp"; else File_Name := Files.Get (First => True); end if; loop Initialize (Import_File); Report ("Importing file " & To_String (File_Name)); Execute_Import (File_Name, Table); Finalize (Import_File); exit when Files.End_Of_Bucket; File_Name := Files.Get; end loop; Import.Finalize; Report ("Number of imported record(s): " & Natural'Image (Nbr_Of_Records)); Set_Exit_Status (Success); end Imp; gnade-1.6.2.orig/tools/import.adb0000644000175000017500000002012410664021767016527 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/tools/import.adb,v $ -- Description : Import a file into the data base -- -- Author : Michael Erdmann -- -- Created : 5.4.2003 -- -- Last Modified By: $Author: persan $ -- -- Last Modified On: $Date: 2007/08/25 12:43:35 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2000 - 2003 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- This is a support module which allows you to insert data elements into -- -- the database. -- -- -- -- -- -- Restrictions -- -- ============ -- -- None -- -- -- -- References -- -- ========== -- -- None -- -- -- ------------------------------------------------------------------------------- with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with System; use System; with Ada.Unchecked_Conversion; with GNU.DB.SQLCLI; use GNU.DB.SQLCLI; with GNU.DB.SQLCLI.Info; use GNU.DB.SQLCLI.Info; with GNU.DB.SQLCLI.Environment_Attribute; use GNU.DB.SQLCLI.Environment_Attribute; with GNU.DB.SQLCLI.Connection_Attribute; use GNU.DB.SQLCLI.Connection_Attribute; package body Import is Version : constant String := "$Id: import.adb,v 1.6 2007/08/25 12:43:35 persan Exp $"; pragma Unreferenced (Version); EnvironmentHandle : SQLHENV; ConnectionHandle : SQLHDBC; StatementHandle : SQLHSTMT; package CLI renames GNU.DB.SQLCLI; ------------------- -- Buffer_Record -- ------------------- type Buffer_Record is record Data : aliased String (1 .. 4096); Indicator : aliased CLI.SQLINTEGER; end record; Buffer : array (1 .. 100) of Buffer_Record; ---------- -- Move -- ---------- procedure Move ( S : in String; Nbr : in Natural) is begin if S = "" then Buffer (Nbr).Indicator := SQL_NULL_DATA; else Buffer (Nbr).Indicator := S'Length; for I in S'Range loop Buffer (Nbr).Data (I) := S (I); end loop; end if; end Move; ------------- -- Prepare -- ------------- procedure Prepare ( Table : in String; Field_Names : in String_Array) is Q : Unbounded_String := Null_Unbounded_String; V : Unbounded_String := Null_Unbounded_String; Len : constant Natural := 4095; RC : CLI.SQLRETURN := SQL_SUCCESS; pragma Unreferenced (RC); function To_SQLPOINTER is new Ada.Unchecked_Conversion ( Source => Address, Target => SQLPOINTER); begin Q := To_Unbounded_String ("insert into " & Table & " ( "); V := To_Unbounded_String ("values ( "); for I in Field_Names'Range loop Q := Q & Field_Names (I); V := V & "?"; if I < Field_Names'Length then Q := Q & ","; V := V & ","; end if; end loop; Q := Q & ")"; V := V & ")"; Q := Q & " " & V; -- Put_Line(To_String( Q ) ); -- Put_Line(To_String( V ) ); SQLAllocHandle (SQL_HANDLE_STMT, ConnectionHandle, StatementHandle); SQLPrepare (StatementHandle, To_String (Q)); for I in Field_Names'Range loop RC := SQLBindParameter (StatementHandle, SQL_Parameter_Number (I), SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, SQLUINTEGER (Len), 0, To_SQLPOINTER (Buffer (I).Data'Address), 4095, Buffer (I).Indicator'Access); end loop; end Prepare; ------------- -- Execute -- ------------- procedure Execute ( Data : in String_Array) is begin for I in Data'Range loop Buffer (I).Data := (others => ' '); Move (To_String (Data (I)), I); end loop; SQLExecute (StatementHandle); end Execute; -------------- -- Finalize -- -------------- procedure Finalize is begin SQLDisconnect (ConnectionHandle); SQLFreeHandle (SQL_HANDLE_DBC, ConnectionHandle); SQLFreeHandle (SQL_HANDLE_ENV, EnvironmentHandle); end Finalize; ---------------- -- Initialize -- ---------------- procedure Initialize ( ServerName : in String; UserName : in String; Authentification : in String) is begin SQLAllocHandle (SQL_HANDLE_ENV, SQL_NULL_HANDLE, EnvironmentHandle); SQLSetEnvAttr ( EnvironmentHandle, Environment_Attribute_ODBC_Version' --' (Attribute => SQL_ATTR_ODBC_VERSION, Value => SQL_OV_ODBC3) ); SQLAllocHandle (SQL_HANDLE_DBC, EnvironmentHandle, ConnectionHandle); SQLConnect (ConnectionHandle => ConnectionHandle, ServerName => ServerName, UserName => UserName, Authentication => Authentification); end Initialize; end Import; gnade-1.6.2.orig/tools/import.ads0000644000175000017500000000625110664021767016555 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Demo -- -- -- -- B o d y -- -- -- -- $Rev$ -- -- Copyright (C) 2000-2002 Juergen Pfeifer -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Juergen Pfeifer -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- with Tools; use Tools; package Import is ------------- -- Prepare -- ------------- procedure Prepare ( Table : in String; Field_Names : in String_Array); ------------- -- Execute -- ------------- procedure Execute ( Data : in String_Array); -------------- -- Finalize -- -------------- procedure Finalize; ---------------- -- Initialize -- ---------------- procedure Initialize ( ServerName : in String; UserName : in String; Authentification : in String); end Import; gnade-1.6.2.orig/tools/lsodbc.adb0000644000175000017500000001541210664021767016467 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- Filename : $Source: /cvsroot/gnade/gnade/tools/lsodbc.adb,v $ -- Description : ls command to explore an odbc command -- -- Author : Michael Erdmann -- -- Created : 5.4.2003 -- -- Last Modified By: $Author: persan $ -- Last Modified On: $Date: 2007/08/25 12:43:35 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 - 2003 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- -- -- This programm allows to explore an odbc interface -- -- -- -- lsodbc [ source login passwd { -t | -a } ] -- -- -- -- Restrictions -- -- ============ -- -- None -- -- -- -- References -- -- ========== -- -- None -- -- -- ------------------------------------------------------------------------------- with Ada.Text_IO; use Ada.Text_IO; with Ada.Command_Line; use Ada.Command_Line; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Tools; use Tools; with ODBC; use ODBC; procedure lsodbc is Version : constant String := "$Id"; pragma Unreferenced (Version); SI : Source_Information; DB : ODBC.Object; Login : Unbounded_String; Pwd : Unbounded_String; Argc : Natural := 1; Info : Boolean := False; Quiet : Boolean := False; Error, Message : Unbounded_String; ---------- -- Help -- ---------- procedure Help is begin Put_Line ("usage : "); Put_Line (" lsodbc [ [-u [ -l ]] [ ] ] "); Put_Line (""); end Help; ------------------------ -- Source_Information -- ------------------------ procedure Source_Information ( S : in String) is -- get all information from a source we can get. Tabs : String_Array_Access; begin Info := True; Put_Line ("Data Source: " & S); Authorization (DB, To_String (Login), To_String (Pwd)); Data_Source (DB, S); Connect (DB); Put_Line (" Tables: "); Tabs := Tables (DB, "%", "%"); for i in Tabs'Range loop Put_Line (" " & To_String (Tabs (i))); end loop; Disconnect (DB); end Source_Information; begin Initialize (DB); -- Handle the command line arguments while Argc in 1 .. Argument_Count loop declare Arg : constant String := Argument (Argc); begin if Arg = "-u" then Argc := Argc + 1; Login := To_Unbounded_String (Argument (Argc)); elsif Arg = "-p" then Argc := Argc + 1; Pwd := To_Unbounded_String (Argument (Argc)); elsif Arg = "-h" then Help; return; elsif Arg (1) /= '-' then Source_Information (Arg); elsif Arg = "-q" then Quiet := True; else Help; return; end if; Argc := Argc + 1; end; end loop; if not Quiet then Put_Line ("GNADE ODBC information programm, Version " & Tools.Version); Put_Line ("Copyright (C) 2003, Michael Erdmann (michael.erdmann@snafu.de)"); end if; -- if no information has been given so far list the information for all -- data source known to the ODBC driver. if not Info then SI := Data_Source (DB, First => True); while SI.Server /= Null_Unbounded_String loop declare Server : constant String := To_String (SI.Server); begin Source_Information (Server); exception when others => Put_Line (" *** No information available *** "); end; SI := Data_Source (DB); end loop; end if; Finalize (DB); Set_Exit_Status (Success); exception when others => Get_Error (DB, Error, Message); Put_Line (To_String (Error) & ":" & To_String (Message)); Set_Exit_Status (Failure); Set_Exit_Status (Failure); end lsodbc; gnade-1.6.2.orig/tools/odbc.adb0000644000175000017500000005162710664021767016140 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- Filename : $Source: /cvsroot/gnade/gnade/tools/odbc.adb,v $ -- Description : ODBC functions for ODBC explorer -- -- Author : Michael Erdmann -- -- Created : 8.8.2001 -- -- Last Modified By: $Author: persan $ -- Last Modified On: $Date: 2007/08/25 12:43:35 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 - 2003 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- -- -- In contains the following sections: -- -- -- -- Section 1. General support procedures -- -- Section 2. Connection Management -- -- Section 3. Query Management -- -- -- -- Restrictions -- -- ============ -- -- None -- -- -- -- References -- -- ========== -- -- None -- -- -- ------------------------------------------------------------------------------- --* Ada with Ada.Strings.Fixed; use Ada.Strings.Fixed; with Ada.Strings; use Ada.Strings; with Ada.Text_IO; use Ada.Text_IO; with Ada.Exceptions; use Ada.Exceptions; with Unchecked_Deallocation; with GNU.DB.SQLCLI; use GNU.DB.SQLCLI; with GNU.DB.SQLCLI.Info; use GNU.DB.SQLCLI.Info; with GNU.DB.SQLCLI.Environment_Attribute; use GNU.DB.SQLCLI.Environment_Attribute; with GNU.DB.SQLCLI.Connection_Attribute; use GNU.DB.SQLCLI.Connection_Attribute; pragma Warnings (Off); with GNU.DB.SQLCLI.Desc; with GNU.DB.SQLCLI.Generic_Attr.Integer_Attribute; pragma Warnings (On); package body ODBC is type Object_Data is record EnvironmentHandle : SQLHENV; ConnectionHandle : SQLHDBC; StatementHandle : SQLHSTMT; ServerName : Unbounded_String := To_Unbounded_String (""); UserName : Unbounded_String := To_Unbounded_String (""); Authentication : Unbounded_String := To_Unbounded_String (""); -- data realted to the last query Cols : Integer := 0; Rows : Integer := 0; Field_Name : String_Array_Access := null; Last_Error : Unbounded_String := Null_Unbounded_String; Last_Message : Unbounded_String := Null_Unbounded_String; end record; --- ********************************************************************* --- --- ** SECTION 1. S U P P O R T P R O C E D U R E S *** --- --- ** ==================================== *** --- --- ** *** --- --- ********************************************************************* --- ---------------- -- Initialize -- ---------------- procedure Initialize ( This : in out Object) is Data : Object_Data_Access := null; begin This.Data := new Object_Data; Data := This.Data; SQLAllocHandle ( SQL_HANDLE_ENV, SQL_NULL_HANDLE, Data.EnvironmentHandle ); SQLSetEnvAttr ( Data.EnvironmentHandle, Environment_Attribute_ODBC_Version' --' (Attribute => SQL_ATTR_ODBC_VERSION, Value => SQL_OV_ODBC3) ); end Initialize; -------------- -- Finalize -- -------------- procedure Finalize ( This : in out Object) is Data : constant Object_Data_Access := This.Data; begin SQLFreeHandle (SQL_HANDLE_ENV, Data.EnvironmentHandle); end Finalize; ------------- -- Columns -- ------------- function Columns ( This : in Object) return Integer is Data : constant Object_Data_Access := This.Data; begin return Data.Cols; end Columns; ------------------- -- Affected_Rows -- ------------------- function Affected_Rows ( This : in Object) return Integer is Data : constant Object_Data_Access := This.Data; begin return Data.Rows; end Affected_Rows; --------------- -- To_String -- --------------- function To_String ( Result : in Result_Record; Pos : in Integer) return String is begin return To_String (Result (Pos)); end To_String; ----------------- -- Data_Source -- ----------------- procedure Data_Source ( This : in out Object; Name : in String) is Data : constant Object_Data_Access := This.Data; begin Data.ServerName := To_Unbounded_String (Name); end Data_Source; ------------------- -- Authorization -- ------------------- procedure Authorization ( This : in out Object; Login : in String; Password : in String) is Data : constant Object_Data_Access := This.Data; begin Data.UserName := To_Unbounded_String (Login); Data.Authentication := To_Unbounded_String (Password); end Authorization; --------------- -- Get_Error -- --------------- procedure Get_Error ( This : in out Object; Error : out Unbounded_String; Message : out Unbounded_String) is Data : constant Object_Data_Access := This.Data; begin Error := Data.Last_Error; Message := Data.Last_Message; end Get_Error; ---------------- -- Field_Name -- ---------------- function Field_Name ( This : in Object; Pos : in Positive) return String is Data : constant Object_Data_Access := This.Data; begin if Pos in Data.Field_Name'Range then return To_String (Data.Field_Name (Pos)); else return ""; end if; end Field_Name; ---------- -- Free -- ---------- procedure Free ( S : in out String_Array_Access) is procedure XFree is new Unchecked_Deallocation (String_Array, String_Array_Access); begin XFree (S); S := null; end Free; --- ********************************************************************* --- --- ** *** --- --- ** SECTION 2. C O N N E C T I O N M A N A G E M E N T *** --- --- ** *** --- --- ********************************************************************* --- ------------- -- Connect -- ------------- procedure Connect ( This : in out Object; Source : in String := "") is -- connect to the data source and set all connection related -- attributes. Data : constant Object_Data_Access := This.Data; begin if Source /= "" then Data.ServerName := To_Unbounded_String (Source); end if; SQLAllocHandle ( SQL_HANDLE_DBC, Data.EnvironmentHandle, Data.ConnectionHandle); --SQLSetEnvAttr ( -- Data.EnvironmentHandle, -- Environment_Attribute_ODBC_Version' -- (Attribute => SQL_ATTR_ODBC_VERSION, -- Value => SQL_OV_ODBC3) --' --); SQLConnect ( ConnectionHandle => Data.ConnectionHandle, ServerName => To_String (Data.ServerName), UserName => To_String (Data.UserName), Authentication => To_String (Data.Authentication) ); end Connect; ---------------- -- Disconnect -- ---------------- procedure Disconnect ( This : in out Object) is -- diconnect ffrom the data source Data : constant Object_Data_Access := This.Data; begin SQLDisconnect (Data.ConnectionHandle); SQLFreeHandle (SQL_HANDLE_DBC, Data.ConnectionHandle); end Disconnect; --- ********************************************************************* --- --- ** *** --- --- ** SECTION 3. Q U E R Y M A N A G E M E N T *** --- --- ** *** --- --- ********************************************************************* --- ----------- -- Query -- ----------- procedure Query ( This : in out Object; -- execute the query and evaluate the number of columns and -- rows. Query_String : in String) is Data : constant Object_Data_Access := This.Data; DataType : aliased SQL_DATA_TYPE; ColumnSize : aliased SQLUINTEGER; DecimalDigits : aliased SQLSMALLINT; Nullable : aliased SQL_NULLABLE_INFO; RC : aliased SQLRETURN; begin Data.Last_Error := Null_Unbounded_String; Data.Last_Message := Null_Unbounded_String; SQLAllocHandle ( SQL_HANDLE_STMT, Data.ConnectionHandle, Data.StatementHandle ); SQLExecDirect (Data.StatementHandle, Query_String); Data.Rows := Integer (SQLRowCount (Data.StatementHandle)); Data.Cols := Integer (SQLNumResultCols (Data.StatementHandle)); -- Put_Line("Data.cols =" & Integer'Image(Data.Cols)); -- Put_Line("Data.rows =" & Integer'Image(Data.Rows)); Data.Field_Name := new String_Array (1 .. Integer (Data.Cols)); for Col in 1 .. Data.Cols loop Data.Field_Name (Col) := To_Unbounded_String ( SQLDescribeCol ( Data.StatementHandle, SQL_Column_Number (Col), SQLSMALLINT (1024), DataType'Access, ColumnSize'Access, DecimalDigits'Access, Nullable'Access, RC'Access) ); end loop; exception when Error : others => Data.Last_Error := To_Unbounded_String (Exception_Name (Error)); Data.Last_Message := To_Unbounded_String (Exception_Message (Error)); raise; end Query; ----------- -- Fetch -- ----------- function Fetch ( This : in Object) return Result_Record is -- fetch the next record from the result set and return a record Data : constant Object_Data_Access := This.Data; Result : String_Array_Access := null; RC : SQLRETURN; pragma Unreferenced (RC); Buffer : aliased String (1 .. 512) := (others => ' '); Buffer_Length : aliased SQLINTEGER; begin Data.Last_Error := Null_Unbounded_String; Data.Last_Message := Null_Unbounded_String; SQLFetch (Data.StatementHandle); Result := new String_Array (1 .. Data.Cols); for Col in 1 .. Data.Cols loop RC := SQLGetData ( Data.StatementHandle, ColumnNumber => SQL_Column_Number (Col), TargetType => SQL_C_CHAR, TargetValue => To_SQLPOINTER (Buffer'Address), BufferLength => Buffer'Length, StrLen_Or_Ind => Buffer_Length'Access ); Result (Col) := To_Unbounded_String (Buffer (1 .. Integer (Buffer_Length))); end loop; return Result_Record (Result); exception when No_Data => SQLFreeHandle (SQL_HANDLE_STMT, Data.StatementHandle); return null; when Error : others => Data.Last_Error := To_Unbounded_String (Exception_Name (Error)); Data.Last_Message := To_Unbounded_String (Exception_Message (Error)); SQLFreeHandle (SQL_HANDLE_STMT, Data.StatementHandle); return null; end Fetch; --- ********************************************************************* --- --- ** *** --- --- ** SECTION 4. D A T A B A S E M A N A G E M E N T *** --- --- ** *** --- --- ********************************************************************* --- ---------------- -- Procedures -- ---------------- function Procedures ( This : in Object; Catalog_Name : in String; Schema_Name : in String) return String_Array_Access is -- get a list of all table names Data : constant Object_Data_Access := This.Data; StatementHandle : SQLHSTMT; Result : String_Array_Access := null; Rows : Integer; RC : SQLRETURN; Catalog : aliased String := 40 * ' '; Catalog_Len : aliased SQLINTEGER; Schema : aliased String := 40 * ' '; Schema_Len : aliased SQLINTEGER; Name : aliased String := 40 * ' '; Name_Len : aliased SQLINTEGER; Remarks : aliased String := 40 * ' '; Remarks_Len : aliased SQLINTEGER; begin Data.Last_Error := Null_Unbounded_String; Data.Last_Message := Null_Unbounded_String; SQLAllocHandle ( SQL_HANDLE_STMT, Data.ConnectionHandle, StatementHandle ); SQLProcedures ( StatementHandle, CatalogName => Catalog_Name, SchemaName => Schema_Name ); Rows := Integer (SQLRowCount (StatementHandle)); Put_Line ("Rows:" & Integer'Image (Rows)); Result := new String_Array (1 .. Rows); Put_Line ("Number of Procedures: " & Integer'Image (Rows)); SQLBindCol (StatementHandle, 1, Catalog'Access, Catalog_Len'Access); SQLBindCol (StatementHandle, 2, Schema'Access, Schema_Len'Access); SQLBindCol (StatementHandle, 3, Name'Access, Name_Len'Access); SQLBindCol (StatementHandle, 7, Remarks'Access, Remarks_Len'Access); loop RC := SQLFetch (Data.StatementHandle); exit when RC /= SQL_SUCCESS; Put_Line ("Procedure: " & Name (1 .. Integer (Name_Len))); end loop; SQLFreeHandle (SQL_HANDLE_STMT, StatementHandle); return Result; exception when Error : others => Put_Line ("Exception in Precedures"); Data.Last_Error := To_Unbounded_String (Exception_Name (Error)); Data.Last_Message := To_Unbounded_String (Exception_Message (Error)); SQLFreeHandle (SQL_HANDLE_STMT, StatementHandle); raise; end Procedures; ------------ -- Tables -- ------------ function Tables ( This : in Object; Catalog_Name : in String; Schema_Name : in String) return String_Array_Access is -- get a list of all table names Data : constant Object_Data_Access := This.Data; StatementHandle : SQLHSTMT; Result : String_Array_Access := null; Rows : Integer; RC : SQLRETURN; Pattern : constant String := SQL_ALL_PATTERN; Catalog : aliased String := 40 * ' '; Catalog_Len : aliased SQLINTEGER; Schema : aliased String := 40 * ' '; Schema_Len : aliased SQLINTEGER; Name : aliased String := 40 * ' '; Name_Len : aliased SQLINTEGER; begin Data.Last_Error := Null_Unbounded_String; Data.Last_Message := Null_Unbounded_String; SQLAllocHandle ( SQL_HANDLE_STMT, Data.ConnectionHandle, StatementHandle ); SQLTables (StatementHandle, CatalogName => Catalog_Name, SchemaName => Schema_Name, TableName => Pattern ); Rows := Integer (SQLRowCount (StatementHandle)); Put_Line ("Number of Tables: " & Integer'Image (Rows)); Result := new String_Array (1 .. Rows); SQLBindCol (StatementHandle, 1, Catalog'Access, Catalog_Len'Access); SQLBindCol (StatementHandle, 2, Schema'Access, Schema_Len'Access); SQLBindCol (StatementHandle, 3, Name'Access, Name_Len'Access); loop RC := SQLFetch (Data.StatementHandle); exit when RC /= SQL_SUCCESS; Put_Line ("Table: " & Name (1 .. Integer (Name_Len))); end loop; SQLFreeHandle (SQL_HANDLE_STMT, StatementHandle); return Result; exception when Error : others => Data.Last_Error := To_Unbounded_String (Exception_Name (Error)); Data.Last_Message := To_Unbounded_String (Exception_Message (Error)); SQLFreeHandle (SQL_HANDLE_STMT, StatementHandle); raise; end Tables; ------------------ -- Data_Source -- ------------------ function Data_Source ( This : in Object; First : in Boolean := False) return Source_Information is -- return the data source available in this data base object Data : constant Object_Data_Access := This.Data; Direction : SQL_EXTENDED_FETCH_DIRECTION := SQL_FETCH_NEXT; ServerName : String (1 .. 256); Description : String (1 .. 256); RC : SQLRETURN; Result : Source_Information := Null_Source_Information; begin if First then Direction := SQL_FETCH_FIRST; end if; SQLDataSources ( Data.EnvironmentHandle, Direction, ServerName, Description, RC); if RC = SQL_SUCCESS then Result.Server := To_Unbounded_String (Trim (ServerName, Right)); Result.Description := To_Unbounded_String (Trim (Description, Right)); end if; return Result; end Data_Source; end ODBC; gnade-1.6.2.orig/tools/odbc.ads0000644000175000017500000001526110664021767016153 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- Filename : $Source: /cvsroot/gnade/gnade/tools/odbc.ads,v $ -- Description : Query Module based upon ODBC -- -- Author : Michael Erdmann -- -- Created : 8.8.2001 -- -- Last Modified By: $Author: persan $ -- Last Modified On: $Date: 2007/08/25 12:43:35 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- -- -- In contains the following sections: -- -- -- -- Section 1. General support procedures -- -- Section 2. Connection Management -- -- Section 3. Query Management -- -- -- -- Restrictions -- -- ============ -- -- None -- -- -- -- References -- -- ========== -- -- None -- -- -- ------------------------------------------------------------------------------- --* Ada with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Tools; use Tools; package ODBC is ------------ -- Object -- ------------ type Object is private; ------------------- -- Result_Record -- ------------------- subtype Result_Record is String_Array_Access; Null_Result_Record : constant Result_Record := null; ------------------------ -- Source_Information -- ------------------------ type Source_Information is record Server : Unbounded_String := Null_Unbounded_String; Description : Unbounded_String := Null_Unbounded_String; end record; Null_Source_Information : constant Source_Information := (Null_Unbounded_String, Null_Unbounded_String); ---------------- -- Initialize -- ---------------- procedure Initialize ( This : in out Object); procedure Finalize ( This : in out Object); procedure Authorization ( This : in out Object; Login : in String; Password : in String); procedure Data_Source ( This : in out Object; Name : in String); function Data_Source ( This : in Object; First : in Boolean := False) return Source_Information; procedure Connect ( This : in out Object; Source : in String := ""); procedure Disconnect ( This : in out Object); procedure Query ( This : in out Object; Query_String : in String); function Field_Name ( This : in Object; Pos : in Positive) return String; function Fetch ( This : in Object) return Result_Record; function Columns ( This : in Object) return Integer; function Affected_Rows ( This : in Object) return Integer; function To_String ( Result : in Result_Record; Pos : in Integer) return String; procedure Free (S : in out String_Array_Access); function Tables ( This : in Object; Catalog_Name : in String; Schema_Name : in String) return String_Array_Access; function Procedures ( This : in Object; Catalog_Name : in String; Schema_Name : in String) return String_Array_Access; procedure Get_Error ( This : in out Object; Error : out Unbounded_String; Message : out Unbounded_String); private type Object_Data; type Object_Data_Access is access Object_Data; type Object is record Data : Object_Data_Access := null; end record; end ODBC; gnade-1.6.2.orig/tools/sql.adb0000644000175000017500000002032410664021767016016 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- Filename : $Source: /cvsroot/gnade/gnade/tools/sql.adb,v $ -- Description : Execute an sql command -- -- Author : Michael Erdmann -- -- Created : 5.4.2003 -- -- Last Modified By: $Author: persan $ -- Last Modified On: $Date: 2007/08/25 12:43:35 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000 - 2003 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- -- -- This programm allows to explore an odbc interface -- -- -- -- -- -- Restrictions -- -- ============ -- -- None -- -- -- -- References -- -- ========== -- -- None -- -- -- ------------------------------------------------------------------------------- with Ada.Text_IO; use Ada.Text_IO; with Ada.Command_Line; use Ada.Command_Line; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with ODBC; use ODBC; with Tools; use Tools; procedure SQL is Version : constant String := "$Id: sql.adb,v 1.9 2007/08/25 12:43:35 persan Exp $"; pragma Unreferenced (Version); Q : Unbounded_String := Null_Unbounded_String; DB : ODBC.Object; Login : Unbounded_String; Pwd : Unbounded_String; Source : Unbounded_String; Argc : Natural := 1; Quiet : Boolean := False; Error, Message : Unbounded_String; QFile : Unbounded_String := Null_Unbounded_String; ---------- -- Help -- ---------- procedure Help is begin Put_Line ("usage : "); Put_Line (" sql -u [ -p ] [ | -f "); Put_Line (""); end Help; ------------ -- Header -- ------------ procedure Print_Header ( R : in Result_Record) is -- Display the column name of a given result set begin if Quiet then return; end if; for I in R'Range loop Put (Field_Name (DB, I) & " "); end loop; Put_Line (""); end Print_Header; --------- -- Row -- --------- procedure Print_Row ( R : in Result_Record) is begin for I in R'Range loop Put (To_String (R (I)) & ";"); end loop; Put_Line (""); end Print_Row; ------------- -- Execute -- ------------- procedure Execute ( Q : in Unbounded_String) is R : Result_Record := null; begin Query (DB, To_String (Q)); R := Fetch (DB); Print_Header (R); while R /= null loop Print_Row (R); Free (R); R := Fetch (DB); end loop; exception when others => Get_Error (DB, Error, Message); Put_Line (To_String (Error) & ":" & To_String (Message)); Set_Exit_Status (Failure); end Execute; begin Initialize (DB); -- Handle the command line arguments while Argc in 1 .. Argument_Count loop declare Arg : constant String := Argument (Argc); begin if Arg = "-u" then Argc := Argc + 1; Login := To_Unbounded_String (Argument (Argc)); elsif Arg = "-p" then Argc := Argc + 1; Pwd := To_Unbounded_String (Argument (Argc)); elsif Arg = "-h" then Help; return; elsif Arg = "-q" then Quiet := True; elsif Arg = "-f" then Argc := Argc + 1; QFile := To_Unbounded_String (Argument (Argc)); else if Source = Null_Unbounded_String then Source := To_Unbounded_String (Arg); else Q := Q & To_Unbounded_String (Arg & " "); end if; end if; Argc := Argc + 1; end; end loop; if not Quiet then Put_Line ("GNADE SQL Executor, Version " & Tools.Version); Put_Line ("Copyright (C) 2003, Michael Erdmann (michael.erdmann@snafu.de)"); Put_Line (""); end if; if Source = Null_Unbounded_String then Put_Line ("source not specified"); Put_Line (""); Help; Set_Exit_Status (Failure); return; end if; -- connect to the data base begin Authorization (DB, To_String (Login), To_String (Pwd)); Data_Source (DB, To_String (Source)); Connect (DB); exception when others => Get_Error (DB, Error, Message); Put_Line ("Could not connect to " & To_String (Source) & "Reason: " & To_String (Error) & ", " & To_String (Message) ); Set_Exit_Status (Failure); return; end; -- if a query is available execute it make the result visible if QFile /= Null_Unbounded_String then declare F : File_Type; Line : String (1 .. 255); Length : Integer := 0; begin Open (File => F, Name => To_String (QFile), Mode => In_File); while not End_Of_File (F) loop Get_Line (F, Line, Length); if Line (1) /= ';' and Line (1) /= '#' then Q := Q & To_Unbounded_String (Line (1 .. Length) & " "); end if; end loop; Close (F); end; end if; Execute (Q); --Finalize( DB ); Set_Exit_Status (Success); exception when others => Get_Error (DB, Error, Message); Put_Line (To_String (Error) & ":" & To_String (Message)); Set_Exit_Status (Failure); end SQL; gnade-1.6.2.orig/tools/tools.gpr0000644000175000017500000000136010027000435016376 0ustar lbrentalbrentawith "../gnade"; project Tools is for Languages use ("Ada", "SQL", "Project File" ); for Source_Dirs use ("."); for Object_Dir use "."; for Main use ("exp.adb", "imp.adb", "lsodbc.adb", "sql.adb"); for Exec_Dir use "." ; package Linker is for Default_Switches ("ada") use ( GNADE.LibOpt, "-lgnadeaux", "-lgnadeodbc", gnade.DMLINKEROPT ) ; end Linker; package Binder is for Default_Switches ("ada") use ("-static" ); end Binder; package Compiler is for Default_Switches ("ada") use ("-g", GNADE.IncludeOPT ); end Compiler; package Builder is for Default_Switches ("ada") use ("-g", "-gnatQ", GNADE.IncludeOPT ); end Builder; end Tools; gnade-1.6.2.orig/tools/tools.gps0000644000175000017500000001044507657223644016433 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/tools/tools.gps,v $ -- Description : Common definitions for all tools -- -- Author : Michael Erdmann -- -- Created : 5.4.2003 -- -- Last Modified By: $Author: merdmann $ -- -- Last Modified On: $Date: 2003/05/10 16:24:04 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2000 - 2003 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- -- -- Export the contents of a table into a simple file format. This file -- -- format i intended for importing or processing by other gnade tools -- -- -- -- -- -- Restrictions -- -- ============ -- -- None -- -- -- -- References -- -- ========== -- -- None -- -- -- ------------------------------------------------------------------------------- with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; package Tools is Version : constant String := $Version ; ------------------ -- String_Array -- ------------------ type String_Array is array( Natural range <> ) of Unbounded_String ; type String_Array_Access is access String_Array; Null_String_Array : constant String_Array_Access := null; end Tools; gnade-1.6.2.orig/tools/util.adb0000644000175000017500000001434210664021767016177 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/tools/util.adb,v $ -- Description : Export the contents of a data base -- -- Author : Michael Erdmann -- -- Created : 5.4.2003 -- -- Last Modified By: $Author: persan $ -- -- Last Modified On: $Date: 2007/08/25 12:43:35 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2000 - 2003 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- -- -- Export the contents of a table into a simple file format. This file -- -- format i intended for importing or processing by other gnade tools -- -- -- -- -- -- Restrictions -- -- ============ -- -- None -- -- -- -- References -- -- ========== -- -- None -- -- -- ------------------------------------------------------------------------------- with Ada.Text_IO; use Ada.Text_IO; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; package body Util is Version : constant String := "$Id: util.adb,v 1.2 2007/08/25 12:43:35 persan Exp $"; pragma Unreferenced (Version); ------------ -- Report -- ------------ procedure Report ( T : in String) is begin if not Quiet then Put_Line (T); end if; end Report; ----------- -- Error -- ----------- procedure Error ( T : in String) is begin Put_Line (T); end Error; --------------------- -- Report_DB_Error -- --------------------- procedure Report_DB_Error ( DB : in out ODBC.Object) is -- report the odbc error information Err : Unbounded_String; Message : Unbounded_String; begin Get_Error (DB, Err, Message); Error (To_String (Err) & ":" & To_String (Message)); end Report_DB_Error; ------------ -- Bucket -- ------------ package body Bucket is type Element_Type; type Element_Type_Access is access Element_Type; type Element_Type is record Next : Element_Type_Access := null; Item : Bucket_Type; end record; Head : Element_Type_Access := null; Tail : Element_Type_Access := null; Next : Element_Type_Access := null; --------- -- Add -- --------- procedure Add ( Item : in Bucket_Type) is -- Add an element to the bucket. E : constant Element_Type_Access := new Element_Type; begin E.Item := Item; if Head /= null then Tail.Next := E; else Head := E; end if; Tail := E; end Add; --------- -- Get -- --------- function Get ( First : in Boolean := False) return Bucket_Type is -- Retrive an element from the bucket R : Bucket_Type; begin if First then Next := Head; end if; R := Next.Item; Next := Next.Next; return R; end Get; ------------------- -- End_Of_Bucket -- ------------------- function End_Of_Bucket return Boolean is begin return Next = null; end End_Of_Bucket; ------------- -- Destroy -- ------------- procedure Destroy is E : Element_Type_Access := Head; begin while E /= null loop E := E.Next; end loop; end Destroy; end Bucket; end Util; gnade-1.6.2.orig/tools/util.ads0000644000175000017500000001123610664021767016217 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/tools/util.ads,v $ -- Description : This is a utility package for all gnade tools -- -- Author : Michael Erdmann -- -- Created : 5.4.2003 -- -- Last Modified By: $Author: persan $ -- -- Last Modified On: $Date: 2007/08/25 12:43:35 $ -- -- Status : $State: Exp $ -- -- -- -- Copyright (C) 2000 - 2003 Michael Erdmann -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Author: Michael Erdmann -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- Functional Description -- -- ====================== -- -- -- -- Export the contents of a table into a simple file format. This file -- -- format i intended for importing or processing by other gnade tools -- -- -- -- -- -- Restrictions -- -- ============ -- -- None -- -- -- -- References -- -- ========== -- -- None -- -- -- ------------------------------------------------------------------------------- with ODBC; use ODBC; package Util is Quiet : Boolean := False; ------------ -- Report -- ------------ procedure Report ( T : in String); ----------- -- Error -- ----------- procedure Error ( T : in String); --------------------- -- Report_DB_Error -- --------------------- procedure Report_DB_Error ( DB : in out ODBC.Object); ----------------- -- Bucket_Type -- ----------------- generic type Bucket_Type is private; package Bucket is procedure Add ( Item : in Bucket_Type); function Get ( First : in Boolean := False) return Bucket_Type; function End_Of_Bucket return Boolean; procedure Destroy; end Bucket; end Util; gnade-1.6.2.orig/win32/0000755000175000017500000000000011040716276014343 5ustar lbrentalbrentagnade-1.6.2.orig/win32/COPYING.txt0000644000175000017500000003542710025412551016216 0ustar lbrentalbrenta GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS gnade-1.6.2.orig/win32/GNUmakefile0000644000175000017500000002022510025734200016403 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Description : The top level Windows makefile for GNADE ## Maintainer : Stephen Leake ## -- ## Copyright (C) 2000-2004 Stephen Leake ## ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## ## Makefile for gnade for Windows using native tools and GNU Make from ## the GNAT distribution. It does the following: ## ## - Copies all library source to ../adaodbc ## - Preprocesses some files to ../adaodbc ## - Compiles the sources and creates a library libadaodbc.a. ## - Builds gesql.exe in the current directory ## - Build simple.exe, dynamic.exe and demo.exe in the current directory ## ## ########################################################################## ## ## Targets: all (default) create directory ../adaodbc and build gesql ## mysql build mysql stuff (not in 'all') ## clean removes created files and directories ## mssqldb Install test database in MS Sql Server ## unsinstall_mssqldb Uninstall test database in MS Sql Server ## ## Command line variables: ## ## DEBUG : [True | False] default False. ## ########################################################################## #### User customizable settings #### ## MySQL config ## version: MYSQL4 | MYSQL3 MYSQL_VERSION := MYSQL4 ## library location (for -L link option) MYSQL_LIB := c:/Apps/MySQL/lib/debug #### end user customizable settings #### all: prep build gesql.exe simple.exe dynamic.exe demo.exe .PHONY: all clean mysql mssqldb uninstall_mssqldb build FORCE include ../VERSION VERSION=$(GNADE_MAJOR).$(GNADE_MINOR).$(GNADE_PATCHLEVEL) DEBUG=False # # Directory to where to place all gnade/adaodbc files # ADAODBC_TARGETDIR = ../adaodbc # # Login information for gesql test programs # DBUSER = gnade DBPASSWD = gnade DBSOURCE = DEMO_DB # # Source directories # SUPPORT = ../support ODBC = ../dbi/odbc ESQL = ../esql SAMPLES = ../samples # Figure out which flavor of Windows we're on. ifneq ($(PROCESSOR_ARCHITECTURE),) # NT Commands CMD = cmd.exe /c COPY = $(CMD) copy DEL = $(CMD) del /q RMDIR = $(CMD) rmdir /q /s TO_NUL= > NUL: else # Windows 9X Commands CMD = command.com /c COPY = $(CMD) copy /y DEL = $(CMD) del RMDIR = $(CMD) deltree /y TO_NUL= endif MKDIR = $(CMD) mkdir # # Compiler options etc # ADAPREP := gnatprep -r -b ifeq ($(DEBUG),True) AMFLAGS=-g -gnata -gnato -gnatf -gnatwa -gnatwL else AMFLAGS = -O2 -gnatf endif # # Rules # define do-copy $(COPY) $(subst /,\\,$<) $(subst /,\\,$@) $(TO_NUL) endef $(ADAODBC_TARGETDIR)/%: $(SUPPORT)/% $(do-copy) $(ADAODBC_TARGETDIR)/%: $(ODBC)/% $(do-copy) $(ADAODBC_TARGETDIR)/%.adb: $(ODBC)/%.gpb $(ADAPREP) -DCALLCONVENTION=Stdcall -DLINKOPT=\"-lodbc32\" \ -DDEBUG=$(DEBUG) -DUNICODE=True $< $@ $(ADAODBC_TARGETDIR)/%: $(ESQL)/% $(do-copy) $(ADAODBC_TARGETDIR)/%.adb: %.adb $(do-copy) %.adb: %.adq .\\gesql -v $< %.adq: %.gpq gnatprep -DDBUSER=\"$(DBUSER)\" -DDBPASSWD=\"$(DBPASSWD)\" \ -DDBSOURCE=\"$(DBSOURCE)\" $< $@ %.exe: ../samples/esql/%.adb gnatmake $(AMFLAGS) -I$(ADAODBC_TARGETDIR) -o $@ $< # # SQL and ODBC stuff # SRC := $(notdir $(wildcard $(SUPPORT)/*.ad?)) SRC += $(notdir $(wildcard $(ODBC)/*.ad?)) SRC += $(notdir $(wildcard $(ODBC)/*.gp?)) SRC := $(subst .gpb,.adb,$(SRC)) SRC += $(notdir $(wildcard $(ESQL)/gnu-db-*.ad?)) SRC += sql_standard.ads SRC := $(addprefix $(ADAODBC_TARGETDIR)/,$(SRC)) prep: $(ADAODBC_TARGETDIR) $(SRC) $(ADAODBC_TARGETDIR)/gnade.gpr $(ADAODBC_TARGETDIR): $(MKDIR) $(subst /,\\,$(ADAODBC_TARGETDIR)) $(ADAODBC_TARGETDIR)/gnade.gpr: $(ODBC)/gnade.gpr.gp gnatprep -DDEBUG=$(DEBUG) $< $@ build: FORCE gnatmake -k -c -P$(ADAODBC_TARGETDIR)/gnade.gpr ## MySQL stuff mysql: prep ../dbi/mysql/gnu-db-mysql.adb testdb.out # calling convention documented as __cdecl in c:/Apps/MySQL/lib/Readme # GNAT doesn't support cdecl, so just use C ../dbi/mysql/gnu-db-mysql.adb: ../dbi/mysql/gnu-db-mysql.gpb $(ADAPREP) -D$(MYSQL_VERSION) -DCALLCONVENTION=C $< $@ ../samples/mysql/testdb.adb: ../samples/mysql/testdb.gpb $(ADAPREP) -DDBUSER=\"$(DBUSER)\" -DDBPASSWD=\"$(DBPASSWD)\" -DDBNAME=\"$(DBSOURCE)\" $< $@ testdb.exe: ../samples/mysql/testdb.adb ../dbi/mysql/gnu-db-mysql.adb gnatmake $(AMFLAGS) -I$(ADAODBC_TARGETDIR) -I../dbi/mysql -o $@ $< -largs -L$(MYSQL_LIB) -lmySQL testdb.out : testdb.exe ./testdb.exe > testdb.out ## gesql stuff gesql.exe: FORCE gesql.adb gnatmake -o gesql -I$(ADAODBC_TARGETDIR) -I../esql gesql.adb gesql.adb: $(ESQL)/gesql.gpb ../VERSION $(ADAPREP) -DVersion=\"$(VERSION)\" $< $@ # # Some sample programs # ../samples/esql/simple.adq: ../samples/esql/simple.gpq simple.exe: ../samples/esql/simple.adb gesql.exe FORCE ../samples/esql/dynamic.adq: ../samples/esql/dynamic.gpq dynamic.exe: ../samples/esql/dynamic.adb gesql.exe FORCE ../samples/odbc/demo.adb: ../samples/odbc/demo.gpb $(ADAPREP) -DDBUSER=\"$(DBUSER)\" -DDBPASSWD=\"$(DBPASSWD)\" -DDBSOURCE=\"$(DBSOURCE)\" $< $@ demo.exe: ../samples/odbc/demo.adb FORCE gnatmake -I$(ADAODBC_TARGETDIR) -o $@ $< # # Install/uninstall test database in MS Sql Server # mssqldb: cscript //NoLogo //JOB:install gensql.wsf uninstall_mssqldb: -$(DEL) mssql.qry -cscript //NoLogo //JOB:uninstall gensql.wsf # # Remove all # clean: clean-mysql -$(DEL) *.o -$(DEL) *.ali -$(DEL) b~*.ad? -$(DEL) gesql.adb -$(DEL) gesql.exe -$(DEL) simple.exe -$(DEL) dynamic.exe -$(DEL) demo.exe -$(DEL) $(subst /,\\,../samples/esql/simple.adq) -$(DEL) $(subst /,\\,../samples/esql/simple.adb) -$(DEL) $(subst /,\\,../samples/esql/dynamic.adq) -$(DEL) $(subst /,\\,../samples/esql/dynamic.adb) -$(DEL) $(subst /,\\,../samples/odbc/demo.adb) -$(RMDIR) $(subst /,\\,$(ADAODBC_TARGETDIR)) clean-mysql : -$(DEL) testdb.exe -$(DEL) testdb.out -$(DEL) $(subst /,\\,../dbi/mysql/gnu-db-mysql.adb) -$(DEL) $(subst /,\\,../samples/mysql/testdb.adb) #Local Variables: #eval: (ada-parse-prj-file "../gnade.adp") #mode: makefile #End: gnade-1.6.2.orig/win32/README0000644000175000017500000001623110042523044015214 0ustar lbrentalbrenta GNat Ada Database Environment (GNADE) ==================================== Revision : $Revision: 1.13 $ Contents ======== 1. Introduction 2. License/Authors 3. Other supported Platforms 4. Software requirements 5. Integration with GPS 6. Compiling the release 7. Documentation 8. Contact 9. TODO 1. Introduction =============== This is the Windows Release of GNADE. The GNADE projects provides tools and support packages in order to allow easy access to different data base systems using Ada 95 (specially the GNU Ada 95 compiler GNAT). The integration of SQL into Ada 95 is supported by an embedded SQL translator which generates code working on top of the GNADE ODBC bindings. The GNADE ODBC bindings are a thin Ada 95 binding to ODBC 2.0. The projects provides additionaly native bindings to PostgreSQL, MySQL, Oracle and SQLite. GNADE is delivered as an installer program or can be build from sources using DOS or Cygwin (http://www.cygwin.com) The windows installerd which provides the following installation components: (1) Software Development Kit (2) ODBC Tools (3) Samples & Sample Database (4) Source code (5) Source code addons The SDK contains everything to develop OBC and embedded SQL based application. The SDK contents located in the subdirectories: win32-bin : Binaries win32-lib : Static libs of gnade win32-include : Package specifications win32-libexec : Tools localy used only from within GNADE win32-export : Contains the installation targets (eg. the setup.exe) The ODBC tools, located in win32-bin, are a set of small tools based on ODBC to import/export database contents. The samples and sample database is a single standalone example how to use ODBC and embedded SQL. This component includes also the scripts to create a test database. The source code package contains the source code for this release. If you have Cygwin installed you can compile and install the release either from CVS or downloading a source distribution from the project site. For building and installing GNADE with Cygwin please refere to the README related to Linux/Unix platforms. 2. License/Authors ================== Generally speaking GNADE is an open source project. For details please refer to the ./COPYING and ./AUTHORS files in this directory. 3. Other supported Platforms ============================ Beside of Windows, this software is known to work on: - Linux SuSe, Redhat and Debian distribution - Solaris for more information please refere to the release note of this release. 4. Software Requirements ======================== GNADE is expected to be used in combination with GNAT 3.15p. Note that the Windows distribution of GNAT is in two parts; the standard GNAT tools in gnat-3.15p-nt.exe and the extra Windows tools and libraries in gnatwin-3.15p.exe. Both must be installed. If GNADE is to be used as a development environment for applications no additional tools are required. If GNADE is to be rebuild and packaged for windows, the following tools are required: - GNAT 3.15p (ftp://cs.nyu.edu) - Inno Setup 4 (http://www.innosetup.com) If you like to use the test database you need to install Mimer SQL 9.2 from http://www.mimer.com/. 5. Integration with GPS ======================= If you are developing Ada 95 data base applications with GNAT you may wish to use the GPS from http://www.act-europe.com which provides a resonable IDE for Ada 95 and the GNAT complier. In order to do so, include always the project GNADE which provides the environment variables for the project file. Your project file needs to include the following line: with gnade ..... Then you can use the environment variables as they are defined in the gnade.gpr file. The installer will provide a variable called GNADE_PATH where gnade is installed. Add or extend in your environment the following Variable as shown below: ADA_PROJECT_PATH = ADA_PROJECT_PATH;%GNADE_BASEPATH% Path = ....;%GNADE_BASEPATH%/bin How to build an structure an poroject file please refere to the example located in %GNADE_BASEPATH%/standalone. 6. Compiling the release ======================== There are two possible way of building the windows release. Either you install cywin and build GNADE or you use the dos emnvironment as it is delivered with Windows (XP). After running the installer for windows, the source code will be installed under: c:\gnat\sources There are two possible way of building the windows release. Either you install cywin and build GNADE or you use the dos emnvironment as it is delivered with Windows (XP). In both cases change into the installation directory of the sources where the following steps have to be followed. In case you are using DOS you need to edit the configuration file make.conf.win32. If you are using cygwin, this step needs not to be done since confiugre does it automatically. The source code may be recompiled at this place by performing the to steps: $ configure $ make The compilation result will be stored in the same directory in the subdirectories: win32-bin win32-lib win32-include If you have retrieved the software from the CVS the same procedure has to be followed: cd /gnade configure make The samples are not automaticall compiled and the test database is also not installed automatically. This has to be done manually by means of the scripts located in gnade/samples/*. The installation of the package is completly different for DOS and for Cygwin. In case of DOS a setup.exe is build which installs on window. If you you use Cygwin as a build environment then the installation needs to be done manually. 7. Documentation ================ Currently the documentation is only available for Linux but it contains the Windows relevant parts as well (see http://gnade.sourceforge.net/) 8. Contact ========== If you find an error or you need support, please use the facilities at: http://sourceforge.net/projects/gnade PLEASE FEEL FREE TO CONTRIBUTE TO THE PROJECT BY TESTING AGAINST LEGACY CODE. PLEASE PROVIDE ME THE RESULTS OF YOUR TESTS THAT I AM ABLE TO ADOPT THE ESQL TRANSLATOR TO YOUR REQUIREMENTS. All official distributions will be stored here as well. In case you port the software to a different platform, please keep me informed either by sending me a mail Michael.Erdmann@snafu.de or use the bug reporting facilities at: http://sourceforge.net/projects/gnade A mailing list for GNADE related discussion has been established. In order do subscribe to the list goto: http://sourceforge.net/projects/gnade 9. TODO ======= 1. Configuration has to be made mutch simpler 2. Setup.exe has to check for SW dependencies, e.g. compiler installed. 3. Installation of the test database should be part of the setup.exe installer. 4. Documentation should be made available 5. Support components for GPS e.g. aliases etc are available but not installed for GPS. gnade-1.6.2.orig/win32/all_modules.adb0000644000175000017500000000773110026445461017321 0ustar lbrentalbrenta------------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Author : Sune Falck -- -- Copyright (C) 2003 Stephe Leake -- Copyright (C) 2000-2001 Sune Falck -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- ------------------------------------------------------------------------------- -- -- Dummy main for building all packages in the current directory -- -- -- Created by all_modules.awk 2001-03-28 20:42 pragma Warnings (Off); with GNU; with GNU.DB; with GNU.DB.ESQL_Support; with GNU.DB.ESQL_Support.ODBC; with GNU.DB.SQLCLI; with GNU.DB.SQLCLI.Bind; with GNU.DB.SQLCLI.Connection_Attribute; with GNU.DB.SQLCLI.Connection_Attribute.Debug; with GNU.DB.SQLCLI.Desc; with GNU.DB.SQLCLI.Diag; with GNU.DB.SQLCLI.Dispatch; with GNU.DB.SQLCLI.Dispatch.A_Bitmap; with GNU.DB.SQLCLI.Dispatch.A_Boolean; with GNU.DB.SQLCLI.Dispatch.A_Boolean_String; with GNU.DB.SQLCLI.Dispatch.A_Context; with GNU.DB.SQLCLI.Dispatch.A_Enumerated; with GNU.DB.SQLCLI.Dispatch.A_Integer; with GNU.DB.SQLCLI.Dispatch.A_Pointer; with GNU.DB.SQLCLI.Dispatch.A_String; with GNU.DB.SQLCLI.Dispatch.A_Wide_String; with GNU.DB.SQLCLI.Dispatch.A_Unsigned; with GNU.DB.SQLCLI.Environment_Attribute; with GNU.DB.SQLCLI.Environment_Attribute.Debug; with GNU.DB.SQLCLI.Generic_Attr; with GNU.DB.SQLCLI.Generic_Attr.Bitmap_Attribute; with GNU.DB.SQLCLI.Generic_Attr.Boolean_Attribute; with GNU.DB.SQLCLI.Generic_Attr.Boolean_String_Attribute; with GNU.DB.SQLCLI.Generic_Attr.Context_Attribute; with GNU.DB.SQLCLI.Generic_Attr.Enumerated_Attribute; with GNU.DB.SQLCLI.Generic_Attr.Integer_Attribute; with GNU.DB.SQLCLI.Generic_Attr.Pointer_Attribute; with GNU.DB.SQLCLI.Generic_Attr.String_Attribute; with GNU.DB.SQLCLI.Generic_Attr.Wide_String_Attribute; with GNU.DB.SQLCLI.Generic_Attr.Unsigned_Attribute; with GNU.DB.SQLCLI.Info; with GNU.DB.SQLCLI.Info.Debug; with GNU.DB.SQLCLI.Statement_Attribute; with GNU.DB.SQLCLI.Statement_Attribute.Debug; with GNU.DB.Support; with GNU.DB.Support.Tables; with SQL_STANDARD; -- procedure All_Modules is begin null; end All_Modules; gnade-1.6.2.orig/win32/gensql.wsf0000644000175000017500000001124507333740020016352 0ustar lbrentalbrenta gnade-1.6.2.orig/win32/gnade.iss0000644000175000017500000001270410050453231016132 0ustar lbrentalbrenta;; ;; $Id: gnade.iss,v 1.19 2004/05/12 16:53:45 merdmann Exp $ ;; ;; [Setup] AppName=GNU Ada Database Development Environment (GNADE) AppVerName=GNADE Version 1.5.3 AppPublisher=Michael Erdmann AppPublisherURL=http://gnade.sourceforge.net/ AppSupportURL=http://sourceforge.net/projects/gnade AppUpdatesURL=http://sourceforge.net/projects/gnade AppVersion=1.5.3 DefaultDirName={sd}\GNADE DisableProgramGroupPage=yes UninstallDisplayIcon={app}\GNADE.exe AppCopyright=Copyright © 2004 Michael Erdmann SourceDir=../ WindowVisible=yes LicenseFile=COPYING [Components] Name: SDK; Description: Software Development Kit; Types: full compact Name: odbctools; Description: ODBC Database Tools; Types: full compact Name: src; Description: GNADE Sourcecode; Types: full Name: src/mysql; Description: Native bindings for MySQL 4; Types: full Name: src/sqlite; Description: Native bindings for SQLite; Types: full Name: src/postgres; Description: Native bindings for PostgreSQL; Types: full Name: src/oracle; Description: Native bindings for Oracle; Types: full Name: src/addon; Description: Addons (ADBC etc); Types: full Name: mimer; Description: Mimer SQL Installation scripts; Types: full [Dirs] Name: {app}\win32-include Name: {app}\win32-lib Name: {app}\win32-bin Name: {app}\shared Name: {app}\var [Registry] Root: HKLM; Subkey: SYSTEM\CurrentControlSet\Control\Session Manager\Environment; ValueType: string; ValueName: GNADE_BASEPATH; ValueData: {app} [Files] Source: gnade.gpp; DestDir: {app}\shared; Attribs: readonly; Components: SDK Source: win32-bin\gesql.exe; DestDir: {app}\win32-bin; Attribs: readonly; Components: SDK Source: win32-include\*; DestDir: {app}\win32-include; Attribs: readonly; Components: SDK Source: win32-lib\*; DestDir: {app}\win32-lib; Attribs: readonly; Components: SDK odbctools Source: win32-bin\imp.exe; DestDir: {app}\win32-bin; Attribs: readonly; Components: odbctools Source: win32-bin\exp.exe; DestDir: {app}\win32-bin; Attribs: readonly; Components: odbctools Source: win32-bin\sql.exe; DestDir: {app}\win32-bin; Attribs: readonly; Components: odbctools Source: win32-bin\lsodbc.exe; DestDir: {app}\win32-bin; Attribs: readonly; Components: odbctools Source: win32\README; DestDir: {app}; DestName: README.txt; Attribs: readonly; Flags: isreadme Source: win32-libexec\*.exe; DestDir: {app}\win32-libexec; Attribs: readonly; Components: SDK Source: version.ads; DestDir: {app}; Attribs: readonly; Components: SDK Source: samples\standalone\*; Destdir: {app}\standalone; Components: SDK Source: ide\gps\*; Destdir: {app}\shared; Attribs: readonly; Components: SDK ;; ;; Source: *; DestDir: {app}\source; Components: src Source: win32\*; DestDir: {app}\source\win32; Components: src Source: support\*; DestDir: {app}\source\support; Components: src Source: cfg\*; DestDir: {app}\source\cfg; Components: src Source: cfg\scripts-gnu\*; DestDir: {app}\source\cfg\scripts-gnu; Components: src Source: cfg\scripts-win32\*; DestDir: {app}\source\cfg\scripts-win32; Components: src Source: esql\*; DestDir: {app}\source\esql; Components: src Source: dbi\*; DestDir: {app}\source\dbi; Components: src Source: dbi\odbc\*; DestDir: {app}\source\dbi\odbc; Components: src Source: dbi\mysql\*; DestDir: {app}\source\dbi\mysql; Components: src Source: dbi\postgres\*; DestDir: {app}\source\dbi\postgres; Components: src Source: dbi\sqlite\*; DestDir: {app}\source\dbi\sqlite; Components: src Source: dbi\oci\*; DestDir: {app}\source\dbi\oci; Components: src Source: tools\*; DestDir: {app}\source\tools; Components: src Source: bin\*; DestDir: {app}\source\bin; Components: src Source: doc\*; DestDir: {app}\source\doc; Components: src Source: doc\build\*; DestDir: {app}\source\build; Components: src Source: doc\releasenotes\*; DestDir: {app}\source\doc\releasenotes; Components: src Source: rpm\*; DestDir: {app}\source\rpm; Components: src Source: pkg-config\*; DestDir: {app}\source\pkg-config; Components: src Source: etc\*; DestDir: {app}\source\etc; Components: src Source: etc\profile.d\*; DestDir: {app}\source\etc\profile.d; Components: src Source: autoconf\*; DestDir: {app}\source\autoconf; Components: src Source: samples\*; DestDir: {app}\source\samples; Components: src ;; ;; Source: dbi\adbc\*; DestDir: {app}\source\dbi\adbc; Components: src/addon ;; ;; Source: samples\sample_db\*; DestDir: {app}\source\samples\sample_db; Components: mimer Source: samples\mysql\*; DestDir: {app}\source\samples\mysql; Components: src/mysql Source: samples\sqlite\*; DestDir: {app}\source\samples\sqlite; Components: src/sqlite Source: samples\postgres\*; DestDir: {app}\source\samples\postgres; Components: src/postgres Source: samples\oci\*; DestDir: {app}\source\samples\oci; Components: src/oracle Source: samples\odbc\*; DestDir: {app}\source\samples\odbc; Components: src Source: samples\esql\*; DestDir: {app}\source\samples\esql; Components: src [Run] Filename: {app}\win32-libexec\prep.exe; Description: Configuring GNADE project; Parameters: "DMLINKEROPT=""-L/gnat/lib/win32 -lodbc32"" NALINKEROPT="" "" BUILDARCH=""win32"" ROOT=""{app}"" {app}\shared\gnade.gpp {app}\gnade.gpr"; WorkingDir: {app}; StatusMsg: Configuring gnade.gpr [UninstallRun] Filename: {win}\system32\cmd.exe; Parameters: /c attrib/s -r *; WorkingDir: {app}; StatusMsg: Preparing GNADE deinstallation Filename: {win}\system32\cmd.exe; Parameters: /c del gnade.gpr; WorkingDir: {app}; StatusMsg: Deleting GNADE project file gnade-1.6.2.orig/win32/mssql.qry.in0000644000175000017500000002052707276621437016664 0ustar lbrentalbrenta-- ---------------------------------------------------------------------------- -- -- -- GNADE : GNu Ada Database Environment -- -- -- -- Filename : $Source: /cvsroot/gnade/gnade/win32/mssql.qry.in,v $ -- Description : Makefile for the MS SQL Server sample database -- Author : Juergen Pfeifer -- Created On : 10-May-2001 -- Last Modified By: $Author: jp $ -- Last Modified On: $Date: 2001/05/10 23:24:15 $ -- Status : $State: Exp $ -- -- Copyright (C) 2000-2001 -- -- GNADE is copyrighted by the persons and institutions enumerated in the -- -- AUTHORS file. This file is located in the root directory of the -- -- GNADE distribution. -- -- -- -- GNADE is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- GNADE Ada units, or you link GNADE Ada units or libraries with other -- -- files to produce an executable, these units or libraries do not by -- -- itself cause the resulting executable to be covered by the GNU -- -- General Public License. This exception does not however invalidate -- -- any other reasons why the executable file might be covered by the -- -- GNU Public License. -- -- -- -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- ---------------------------------------------------------------------------- -- Functional Description -- ====================== -- This SQL Script generates the test data base as it is used by -- the code in the ./samples directory. -- IF EXISTS (SELECT name FROM master.dbo.sysdatabases WHERE name = N'GNADE') DROP DATABASE [GNADE] GO CREATE DATABASE [GNADE] ON (NAME = N'GNADE_Data', FILENAME = N'@CWD@\GNADE_Data.MDF' , SIZE = 1, FILEGROWTH = 10%) LOG ON (NAME = N'GNADE_Log', FILENAME = N'@CWD@\GNADE_Log.LDF' , SIZE = 1, FILEGROWTH = 10%) COLLATE SQL_Latin1_General_CP1_CI_AS GO exec sp_dboption N'GNADE', N'autoclose', N'false' GO exec sp_dboption N'GNADE', N'bulkcopy', N'false' GO exec sp_dboption N'GNADE', N'trunc. log', N'false' GO exec sp_dboption N'GNADE', N'torn page detection', N'true' GO exec sp_dboption N'GNADE', N'read only', N'false' GO exec sp_dboption N'GNADE', N'dbo use', N'false' GO exec sp_dboption N'GNADE', N'single', N'false' GO exec sp_dboption N'GNADE', N'autoshrink', N'false' GO exec sp_dboption N'GNADE', N'ANSI null default', N'false' GO exec sp_dboption N'GNADE', N'recursive triggers', N'false' GO exec sp_dboption N'GNADE', N'ANSI nulls', N'false' GO exec sp_dboption N'GNADE', N'concat null yields null', N'false' GO exec sp_dboption N'GNADE', N'cursor close on commit', N'false' GO exec sp_dboption N'GNADE', N'default to local cursor', N'false' GO exec sp_dboption N'GNADE', N'quoted identifier', N'false' GO exec sp_dboption N'GNADE', N'ANSI warnings', N'false' GO exec sp_dboption N'GNADE', N'auto create statistics', N'true' GO exec sp_dboption N'GNADE', N'auto update statistics', N'true' GO use [GNADE] GO /****** Object: Table [dbo].[departments] Script Date: 5/10/2001 1:32:01 PM ******/ if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[departments]') and OBJECTPROPERTY(id, N'IsUserTable') = 1) drop table [dbo].[departments] GO /****** Object: Table [dbo].[employees] Script Date: 5/10/2001 1:32:01 PM ******/ if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[employees]') and OBJECTPROPERTY(id, N'IsUserTable') = 1) drop table [dbo].[employees] GO /****** Object: Table [dbo].[departments] Script Date: 5/10/2001 1:32:01 PM ******/ CREATE TABLE [dbo].[departments] ( [deptno] [int] NOT NULL , [name] [char] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [location] [char] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ) ON [PRIMARY] GO /****** Object: Table [dbo].[employees] Script Date: 5/10/2001 1:32:01 PM ******/ CREATE TABLE [dbo].[employees] ( [empno] [int] NOT NULL , [name] [char] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [firstname] [char] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [deptno] [int] NOT NULL , [since] [datetime] NULL , [manager] [int] NULL , [job] [char] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [promotion] [bit] NULL , [salary] [money] NULL ) ON [PRIMARY] GO ALTER TABLE [dbo].[departments] WITH NOCHECK ADD CONSTRAINT [PK_departments] PRIMARY KEY CLUSTERED ( [deptno] ) ON [PRIMARY] GO ALTER TABLE [dbo].[employees] WITH NOCHECK ADD CONSTRAINT [PK_employees] PRIMARY KEY CLUSTERED ( [empno] ) ON [PRIMARY] GO -- Testdata insert into [dbo].[employees] values ( 1, 'Erdmann', 'Michael', 1001, '1999-12-31', 2, 'Coding Monkey', 1, 200.1234 ); insert into [dbo].[employees] values ( 2, 'Massalski', 'Marina', 1000, '2000-01-09', null, 'Supervisor', 0, 200.00 ); insert into [dbo].[employees] values ( 3, 'Tully', 'Noel', 1001, '1959-01-23', 2, 'Supervisor', 1, 200.00 ); insert into [dbo].[employees] values ( 4, 'Pfeifer', 'Jürgen', 1001, '2001-01-01', 2, 'Designer', 1, 200.00 ); insert into [dbo].[employees] values ( 5, 'Smith', 'John', 1000, '1980-06-11', 3, 'Coding Monkey', 1, 250.00 ); insert into [dbo].[employees] values ( 6, 'Smith', 'John', 1001, '1972-06-11', 3, 'Designer', 1, 820.00 ); insert into [dbo].[employees] values ( 50, 'Simpson', 'Bud', 1003, '1980-06-11', 3, 'Clerk', 0, 20.00 ); insert into [dbo].[employees] values ( 51, 'Bundy', 'Al', 1003, '1980-06-11', 3, 'Clerk', 0, 10.00 ); insert into [dbo].[employees] values ( 52, 'Bundy', 'Peggy', 1003, '1988-06-15', 3, null, 0, -10.00 ); insert into [dbo].[employees] values ( 53, 'Simpson', 'Kelly', 1003, '1995-09-11', 3, 'Secretary', 0, 20.00 ); insert into [dbo].[employees] values (500, 'Rutherford', 'Ernest', 2000, '1930-05-30', 3, 'Genius', 1,1200.00 ); insert into [dbo].[employees] values (501, 'Fermi', null, 2000, '1940-07-29', 3, 'Genius', 1,1200.00 ); insert into [dbo].[employees] values (502, 'Einstein', 'Albert', 2000, '1941-04-30', 2, 'Genius', 1,1200.00 ); insert into [dbo].[employees] values (503, 'Fermi', null, 2000, '1920-08-15', 2, 'Genius', 1,1200.00 ); insert into [dbo].[departments] values( 1001, 'Sales', 'Berlin' ); insert into [dbo].[departments] values( 1000, 'Developement', 'Stuttgart' ); insert into [dbo].[departments] values( 1002, 'CM and Production', 'Bonn' ); insert into [dbo].[departments] values( 1003, 'Support', 'Chicago' ); insert into [dbo].[departments] values( 2000, 'Masterminds', null ); REVOKE ALL on [dbo].[employees] from PUBLIC; REVOKE ALL on [dbo].[departments] from PUBLIC; GRANT ALL on [dbo].[employees] to PUBLIC; GRANT ALL on [dbo].[departments] to PUBLIC; GO gnade-1.6.2.orig/win32/release_process.text0000644000175000017500000000067307735620242020440 0ustar lbrentalbrentaProcess to build and release a binary distribution for Windows change version current version in ../VERSION setup/gnade.iss "version" "OutputBaseFileName" "releasenotes" "Release Notes" setup/info_before.txt Version setup/readme.txt Version GNUMakefile make maintainer-clean make make documentation!? ignore for now setup/Makefile make gnade-1.6.2.orig/win32/setup/0000755000175000017500000000000011040716254015477 5ustar lbrentalbrentagnade-1.6.2.orig/win32/setup/readme_setup.txt0000644000175000017500000000123207301751412020713 0ustar lbrentalbrentaMaking a windows setup program for gnade ---------------------------------------- - Get Inno Setup from http://www.innosetup.com/ - Do a normal windows build of gnade - Add pragma Linker_Options ("-ladadobc");" to gnu-db-sqlcli.adb in the adaodbc directory. Example: package body GNU.DB.SQLCLI is pragma Linker_Options ("-ladadobc"); pragma Linker_Options ("-lodbc32"); - Rebuild gnatmake -c -O2 all_modules - Make an object library in the adaodbc library del all_modules.o del all_modules.ali ar rc libadaodbc.a *.o - Create a setup program with the install script gnade.iss 2001-05-19 Sune Falck gnade-1.6.2.orig/win32/setup/Output/0000755000175000017500000000000011040716276017003 5ustar lbrentalbrentagnade-1.6.2.orig/win32/support/0000755000175000017500000000000011040716254016053 5ustar lbrentalbrentagnade-1.6.2.orig/win32/support/all_modules.awk0000644000175000017500000000750207261706643021076 0ustar lbrentalbrenta## ---------------------------------------------------------------------------- ## -- ## GNADE : GNu Ada Database Environment -- ## -- ## Filename : $Source: /cvsroot/gnade/gnade/win32/support/all_modules.awk,v $ ## Description : The top level makefile of GNADE ## Author : Sune Falk ## Created On : 28-3-2001 ## Last Modified By: $Author: me $ ## Last Modified On: $Date: 2001/04/01 20:20:51 $ ## Status : $State: Exp $ ## -- ## Copyright (C) 2000-2001 Sune Falk ## ## GNADE is copyrighted by the persons and institutions enumerated in the -- ## AUTHORS file. This file is located in the root directory of the -- ## GNADE distribution. -- ## -- ## GNADE is free software; you can redistribute it and/or modify it under -- ## terms of the GNU General Public License as published by the Free Soft- -- ## ware Foundation; either version 2, or (at your option) any later ver- -- ## sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ## OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ## for more details. You should have received a copy of the GNU General -- ## Public License distributed with GNAT; see file COPYING. If not, write -- ## to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ## MA 02111-1307, USA. -- ## -- ## As a special exception, if other files instantiate generics from -- ## GNADE Ada units, or you link GNADE Ada units or libraries with other -- ## files to produce an executable, these units or libraries do not by -- ## itself cause the resulting executable to be covered by the GNU -- ## General Public License. This exception does not however invalidate -- ## any other reasons why the executable file might be covered by the -- ## GNU Public License. -- ## -- ## GNADE is implemented to work with GNAT, the GNU Ada compiler. -- ## -- ## ---------------------------------------------------------------------------- ## ## Functional Description ## ====================== ## ## Generate a dummy program including all specifications in the ## current directory ## ## produces a new file all_modules.adb ## BEGIN { fn = "all_modules.adb"; grep_cmd = "grep -hi \"^package \" *.ads | sort" n_lines = 0; print "--" >fn print "-- Dummy main for building all packages in the current directory" >fn print "--" >fn print "-- Created by all_modules.awk " strftime("%Y-%m-%d %H:%M") >fn; print "--" >fn; print "\npragma Warnings (Off);\n" >fn; while (grep_cmd | getline) { print "with " $2 ";" >fn; n_lines++; } close (grep_cmd); if (!n_lines) { close(fn); system ("rm " fn); print "No file all_modules.adb created"; exit(1); } print "--" >fn; print "procedure All_Modules is" >fn; print "begin" >fn; print " null;" >fn; print "end All_Modules;" >fn; print "Created all_modules.adb"; exit (0); } gnade-1.6.2.orig/win32/support/make_all.cmd0000755000175000017500000000011107261442435020310 0ustar lbrentalbrenta@echo off gawk -f all_modules.awk