OTL 4.0, Examples for Oracle 7 / OCI

The examples below work with Oracle 7 / OCI7. In general, all of these examples should work with any Oracle version higher than Oracle 7, when OCI 7 is enabled in OTL by setting #define OTL_ORA7. OCI 7 is considered to be a classic Oracle API for plain C, and it is present in all OCI libraries up to Oracle 11.1 on all known platforms.

  1. Example 1 (Simple Insert/Select)
  2. Example 2 ("Incompatible datatypes in stream operation" exception)
  3. Example 3 (PL/SQL block)
  4. Example 4 (Insert and Select via referenced cursor)
  5. Example 5 (Simple Insert/Select with the LONG datatype)
  6. Example 6 (Simple Insert/Select with the LONG RAW datatype)
  7. Example 7 (otl_stream::describe_select() with a simple Select)
  8. Example 8 (otl_stream:: describe_select() with a referenced cursor)
  9. Example 9 (otl_stream and NULLs)
  10. Example 35 (otl_nocommit_stream in Oracle 7)
  11. Examle 38 (otl_datetime in Oracle 7)
  12. Example 43 (Get Rows Processed Count in Oracle 7)
  13. Example 46 ("Auto-commit every SQL statement / commit-on-success" mode in Oracle 7)
  14. Example 49 (PL/SQL tables as parameters, Oracle 7)
  15. Example 53 (Datatype override in SELECT, Oracle 7)
  16. Example 58 (Using OTL/OCI7 in Pro*C/C++ environment)
  17. Example 65 (Simple Insert/Select and otl_stream::clean() function for Oracle 7)
  18. Example 68 (Dynamically allocated PL/SQL tables as parameters, Oracle 7)
  19. Example 70 (Dynamically allocated PL/SQL table of DATEs as parameter, Oracle 7)
  20. Example 72 (STL std::strings, ANSI C++ typecasts, Oracle 7)
  21. Example 75 (STL-compliant OTL stream iterators, Oracle 7)
  22. Example 85 (STL vector based PL/SQL tables as parameters, Oracle 7)
  23. Example 87 (STL vector based PL/SQL table of DATEs as parameter, Oracle 7)
  24. Example 97 (otl_value<T>, Oracle 7)
  25. Example 101 (#define OTL_UNCAUGHT_EXCEPTION_ON, Oracle 7)
  26. Example 110 (Group data type override in SELECT, Oracle 7)
  27. Example 113 (OTL stream pooling, Oracle 7/8/8i)
  28. Example 116 (otl_stream::set_flush(), Oracle 7/8/8i)
  29. Example 119 (OTL_VALUE_TEMPLATE_ON, OTL_USER_DEFINED_STRING_CLASS_ON, Oracle 7/8/8i/9i)
  30. Example 130 (Describe otl_stream's bind variables for Oracle 7/8/8i/9i)
  31. Example 159 (otl_stream::clean(), cancelling SELECT's fetch sequence, Oracle 7/8/8i/9i )
  32. Example 162 (otl_stream::clean(), cancelling REF CURSOR's fetch sequence, Oracle 7/8/8i/9i)
  33. Example 164 (otl_stream::clean(), cleaning the SELECT stream's error flags, Oracle 7/8/8i/9i )
  34. Example 167 (otl_stream::clean(), cleaning the REF CURSOR otl_stream's error flags, Oracle 7/8/8i/9i )
  35. Example 169 (#define's OTL_DEFAULT_XXX_NULL_TO_VAL, Oracle 7/8/8i/9i)
  36. Example 172 (#define OTL_ORA_TEXT_ON, Oracle 8/8i/9i)
  37. Example 173 (#define OTL_ORA_TEXT_ON, Oracle 8/8i/9i)
  38. Example 205 (otl_exception, derived from a base class, Oracle)
  39. Example 210 (Oracle and RAW column)
  40. Example 211 (OTL_ADD_NULL_TERMINATOR_STRING_SIZE,Oracle)
  41. Example 220 (std::string and LONGs, Oracle 7)
  42. Example 234 (SQL statement label, Oracle 8,8i,9i)
  43. Example 244 (user defined string class and LONGs, Oracle 7)
  44. Example 249 (OTL tracing, Oracle 7)
  45. Example 253 (Explicit bind variables in SELECT statement column definitions, Oracle 7)
  46. Example 257 (64-bit signed integers, Oracle 7)
  47. Example 260 (OTL stream read iterator, simple SELECT, Oracle)
  48. Example 261 (OTL stream read iterator, reference cursor, Oracle)
  49. Example 288 (Strict numeric type checking on SELECTs)
  50. Example 307 (Stream buffer size as int, simple Insert/Select)
  51. Example 311 (Large PL/SQL tables as parameters)
  52. Example 313 (PL/SQL tables of CHAR and VARCHAR2 together as parameters, Oracle 7)
  53. Example 371 (Simple Insert/Select, otl_connect::operator<<, <<=, >>)
  54. Example 447 (Simple Insert/Select with Oracle RAW data type)
  55. Example 458 (Simple Insert/Select with Oracle RAW data type and otl_stream_read_iterator)
  56. Example 473 (OCI7, otl_datetime and Oracle 9i TIMESTAMP type)
  57. Example 690 (Customizing the date format in OTL tracing via #define OTL_TRACE_FORMAT_DATETIME)
  58. Example 691 (Skipping to the end of the row with otl_stream::skip_to_end_of_row())
  59. Example 710 (END-OF_ROW check)
  60. Example 720 (Oracle 10.2 and higher,  raw[XXX] and LONG RAWs combined with the bulk interface (stream buffer size >1 ))
  61. Example 721 (Oracle 10.2 and higher,  char[XXX] and LONGs  combined with the bulk interface (stream buffer size >1 ))
  62. Example 737 (get_dirty_buf_len() with INSERT and SELECT)
  63. Example 742 (Extended / customized numeric data type support)
  64. Example 747 (VARCHAR column bound as RAW[XXX] for reading/writing std::strings that have null terminators ('\0') in the middle)
  65. Example 754 (otl_read_from_stream() / otl_write_to_stream() and STL containers)


Prev NextContentsGo Home

Copyright 1996-2017, Sergei Kuchin, email: skuchin@gmail.com, skuchin@gmail.com .

Permission to use, copy, modify and redistribute this document for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.