readme.txt 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. /***************************************************************************
  2. * Licensed Materials - Property of IBM and/or HCL
  3. *
  4. * IBM Informix Client-SDK
  5. *
  6. * (C) Copyright IBM Corporation 2010 All rights reserved.
  7. * (c) Copyright HCL Technologies Ltd. 2017. All Rights Reserved.
  8. *
  9. *
  10. *
  11. *
  12. *
  13. * Title: readme.txt
  14. *
  15. * Description: readme file describing the ODBC 3.81 demo programs and
  16. * containing instructions on setting up and running the
  17. * demos
  18. *
  19. *
  20. ***************************************************************************
  21. */
  22. The ODBC 3.81 demo programs
  23. --------------------------
  24. This release of the Client-SDK contains a number of ODBC demo programs.
  25. This release also includes unicode enabled versions of all ODBC demo
  26. programs.
  27. These demo programs are located in -
  28. %INFORMIXDIR%/demo/odbcdemo for NT, and
  29. $INFORMIXDIR/demo/cli for Unix
  30. The following files are included -
  31. (I) Files for creating and dropping the sample database (3 files)
  32. -----------------------------------------------------------------
  33. 1. dbcreate.h
  34. 2. dbcreate.c
  35. -- Creates and populates the demo database - 'odbc_demodb'. The actual
  36. database created depends on the version of the Informix server being
  37. connected to. If the database version is greater then 9, the demo
  38. database created is UDO-enabled, otherwise not.
  39. This example must be run before running any of the other examples.
  40. 3. dbdrop.c - Drops the sample database created using db_create.c.
  41. (II) General ODBC examples (7 files)
  42. ------------------------------------
  43. 1. blkinsrt.c
  44. -- Inserts multiple rows of data into a database table using
  45. SQLBulkOperations.
  46. 2. catalog.c
  47. -- Shows the use of catalog functions. Displays a list of tables in
  48. the current database, and for each table, lists its columns and
  49. identifies the primary key columns.
  50. 3. desc.c
  51. -- Uses a single descriptor as an ARD for a select statement and
  52. an APD for an insert statement.
  53. 4. rsetinfo.c
  54. -- Uses SQLNumResultCols & SQLDescribeCol to obtain information about
  55. the result set returned by the query & display additional information
  56. about the data returned (number of columns in the result set, and
  57. the name, datatype and nullability of each column)
  58. 5. posupdt.c
  59. -- Uses SQLSetPos for making positional updates to a result set
  60. 6. proc.c
  61. -- Demonstrates calling a stored procedure from an ODBC program and
  62. returning multiple values from the procedure to the ODBC application
  63. 7. transact.c
  64. -- Uses SQLEndTran to commit or rollback operations on the connection
  65. (III) Informix specific examples -- for UDO-enabled databases only (8 files)
  66. ----------------------------------------------------------------------------
  67. 1. locreate.c
  68. -- Creates a large object on the client (from a local file) and inserts
  69. it into the database table.
  70. 2. loselect.c
  71. -- Retrieves CLOB data from the database and displays it
  72. 3. loinfo.c
  73. -- Gets information about a smart large object stored in the database
  74. (it's size and the name of the sbspace where it is stored)
  75. 4. rccreate.c
  76. -- Create a row & list, populate them & insert them into the database table
  77. 5. rcselect.c
  78. -- Demonstrates retrieving data from a row and a collection.
  79. 2 queries are executed in this example - the first to retrieve a row and
  80. the second to retrieve a collection. A common function is used to do the
  81. actual retrieval & display of the data, with the appropriate handle
  82. (row or collection) passed in as an argument.
  83. 6. rcupdate.c
  84. -- Updates row and collection columns.
  85. To update the row, we update one of the elements of the row and then
  86. update the entire row on the database.
  87. To update the list, we add an element to the list and then update the
  88. list on the database
  89. 7. distsel.c
  90. -- Retrieves rows containing a distinct type. Distinct types are retrieved
  91. as their underlying base type
  92. 8. OutInOutParamBlob.c
  93. -- Demonstrates Out, In and InOut Parameters in BLOB data.
  94. (IV) ODBC XA Examples (1 file)
  95. ------------------------------
  96. 1. OnePhaseCommitRollback.c
  97. -- exhibits the XA support in ODBC through a simple One Phase Commit-Rollback
  98. example
  99. (V) Miscellaneous files (8 files)
  100. ----------------------------------
  101. 1. readme.txt
  102. -- this file containing an explanation of what each demo
  103. does and how to set up & run the demmos
  104. 2. makefile (for NT) or makefile.<platform> (for other platforms)
  105. -- to compile the demo programs and create the executables
  106. 3. advert.txt
  107. -- File containing CLOB data. Used for inserting the new row containing
  108. CLOB data in locreate.c
  109. 4. item_1.txt
  110. 5. item_2.txt
  111. 6. item_3.txt
  112. 7. item_4 txt
  113. -- files conatining CLOB data to be inserted as the 'advert' column in
  114. the 'item' table. Used by debcreate.c
  115. 8. insert.txt
  116. -- File containing data. Used for inserting the new row containing
  117. CLOB data in OutInOutParamBlob.c
  118. Setting up and running the demos
  119. ---------------------------------
  120. 1. Running the makefile
  121. -----------------------
  122. You can use the makefile to compile each demo program individually
  123. or compile them all at one time. To compile only a single demo, pass
  124. its name as a command-line argument to make. Not passing any
  125. command-line argument will cause all the demo programs to be
  126. compiled.
  127. To compile each unicode demo program individually
  128. pass its name as a command-line argument to make.
  129. Unicode demo programs carry the same name as their ASCII
  130. counterparts but with a W suffix.
  131. To compile all unicode demo programs at one time pass UnicodeDemo
  132. as a command line argument.
  133. To compile the ODBC XA demo just use the following command at the
  134. command prompt -
  135. $make unixxa (for any unix platform)/
  136. nmake ntxa (for NT platforms)
  137. To successfully run the makefile, you have the INFORMIXDIR
  138. environment variable set to the directory where the Client-SDK
  139. is installed.
  140. 2. DSN and Environment settings
  141. -------------------------------
  142. The demo programs are designed to run with a default DSN called
  143. 'odbc_demo', which should be setup for connecting to the
  144. demonstration database 'odbc_demodb' created using the program
  145. 'dbcreate'.
  146. If the user chooses, they can use another DSN in 2 ways -
  147. (i) Pass the name of the DSN as a command-line argument to the
  148. demo. (RECOMMENDED)
  149. For e.g. you would run the catalog example using a DSN called
  150. 'myDSN' as
  151. >> catalog myDSN
  152. (ii) Change the value of the 'defDsn' variable in the source code and
  153. re-compile the demo
  154. To run the ODBC XA Demo using your DSN just use the following command -
  155. OnePhaseCommitRollback.exe DSN_NAME
  156. NOTE
  157. ----
  158. 1. In order to run dbcreate.c, the 'DELIMIDENT' environment variable
  159. must be set to 'n'. This is the default setting for this variable.
  160. If the value of the 'DELIMIDENT' variable is not set to 'n', then
  161. you will get an error message saying "Syntax Error" when running
  162. dbcreate.c
  163. 2. In order to run unicode enabled demo programs ,
  164. UNICODE must be set to UCS-4 in data source configuration information
  165. file.This is done by adding following line in [ODBC] section of
  166. configuration file.
  167. UNICODE=UCS-4
  168. This is applicable only on UNIX platforms .
  169. 3. Prior running the "catalog" demo against 8.40 servers, ensure that the
  170. server ONCONFIG file has the following settings:
  171. PHYSFILE 8000
  172. PHYSBUFF 64
  173. LOGBUFF 64
  174. SHMVIRTSIZE 32768
  175. SHMADD 32768
  176. DS_MAX_QUERIES 10
  177. DS_TOTAL_MEMORY 16000
  178. Without these settings, the demo might fail with the following error:
  179. ERROR: -959: HY000 : [Informix][Informix ODBC Driver][Informix]The
  180. current transaction has been rolled back due to an internal error.