home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / odbc_hlp.zip / odbc_doc.zip / ivdrv08.inf (.txt) < prev    next >
OS/2 Help File  |  1996-01-09  |  137KB  |  5,071 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. About INTERSOLV DataDirect Database Drivers ΓòÉΓòÉΓòÉ
  3.  
  4. The INTERSOLV DataDirect ODBC drivers are compliant with the Microsoft Open 
  5. Database Connectivity (ODBC) specification.  ODBC is a specification for an 
  6. application program interface (API) that enables applications to access 
  7. multiple database management systems using Structured Query Language (SQL). 
  8.  
  9. ODBC permits maximum interoperability--a single application can access many 
  10. different database management systems.  This enables an ODBC developer to 
  11. develop, compile, and ship an application without targeting a specific type of 
  12. data source.  Users can then add the database drivers, which link the 
  13. application to the database management systems of their choice. 
  14.  
  15.  
  16. ΓòÉΓòÉΓòÉ 1.1. Environment-Specific Information ΓòÉΓòÉΓòÉ
  17.  
  18. On OS/2 systems, the ODBC drivers are 32-bit drivers.  The required network 
  19. software supplied by your database system vendors must be 32-bit compliant. 
  20. Consult the System Requirements topic for specific requirements for each 
  21. relational database driver. 
  22.  
  23. OS/2 version 2.x is required to use the ODBC drivers. 
  24.  
  25. ODBC.INI 
  26.  
  27. OBDC.INI is an operating system binary INI file located in the OS/2 system 
  28. directory.  The structure of this file is described in the OBDC.INI topic. 
  29. Since this file is binary, you cannot edit it with a text editor. 
  30.  
  31. Starting the ODBC Administrator 
  32.  
  33. The Configuring Data Sources topic in each driver section instructs you to 
  34. start the ODBC Administrator.  To start the ODBC Administrator under OS/2, 
  35. double-click the ODBC Administrator icon. If you are using ODBC Pack, this icon 
  36. is in the ODBC Pack folder.  If you are using the INTERSOLV DataDirect 
  37. Developers Toolkit, this icon is in the folder for that product. 
  38.  
  39. Driver Names 
  40.  
  41. The file extension for the ODBC drivers is .DLL.  This indicates that they are 
  42. dynamic link libraries.  You must modify the CONFIG.SYS file to add the fully 
  43. qualified path to the environment variable LIBPATH. For example, if you install 
  44. the ODBC drivers in the directory C:\ODBC, then the fully qualified path is 
  45. C:\ODBC. This enables your applications to dynamically load the ODBC drivers at 
  46. runtime. 
  47.  
  48.  
  49. ΓòÉΓòÉΓòÉ 1.2. Supported ODBC Functions ΓòÉΓòÉΓòÉ
  50.  
  51. This topic lists the ODBC API functions that the database drivers support. 
  52.  
  53. All database drivers are ODBC Level 1-compliant--they support all ODBC Core and 
  54. Level 1 functions.  A limited set of Level 2 functions is also supported. The 
  55. drivers support the functions listed in the following table.  Any additions to 
  56. these supported functions or differences in the support of specific functions 
  57. are listed in the "ODBC Conformance Level" topic for each individual driver. 
  58.  
  59. Core Functions 
  60. SQLAllocConnect 
  61. SQLAllocEnv 
  62. SQLAllocStmt 
  63. SQLBindCol 
  64. SQLBindParameter* 
  65. SQLCancel 
  66. SQLColAttributes 
  67. SQLConnect 
  68. SQLDescribeCol 
  69. SQLDisconnect 
  70. SQLDrivers* 
  71. SQLError 
  72. SQLExecDirect 
  73. SQLExecute 
  74. SQLFetch 
  75. SQLFreeConnect 
  76. SQLFreeEnv 
  77. SQLFreeStmt 
  78. SQLGetCursorName 
  79. SQLNumResultCols 
  80. SQLPrepare 
  81. SQLRowCount 
  82. SQLSetCursorName 
  83. SQLTransact 
  84.  
  85. Level 1 Functions 
  86. SQLColumns 
  87. SQLDriverConnect 
  88. SQLGetConnectOption 
  89. SQLGetData 
  90. SQLGetFunctions 
  91. SQLGetInfo 
  92. SQLGetStmtOption 
  93. SQLGetTypeInfo 
  94. SQLParamData 
  95. SQLPutData 
  96. SQLSetConnectOption 
  97. SQLSetStmtOption 
  98. SQLSpecialColumns 
  99. SQLStatistics 
  100. SQLTables 
  101.  
  102. Level 2 Functions 
  103. SQLDataSources 
  104. SQLExtendedFetch (forward scrolling only) 
  105. SQLMoreResults 
  106. SQLNativeSql 
  107. SQLNumParams 
  108. SQLParamOptions* 
  109. SQLSetScrollOptions 
  110.  
  111.  
  112. ΓòÉΓòÉΓòÉ 1.3. ODBC.INI ΓòÉΓòÉΓòÉ
  113.  
  114. ODBC.INI Examples 
  115.  
  116. On OS/2 systems, ODBC.INI resides in the same directory that is pointed to by 
  117. the USER_INI environment variable in your CONFIG.SYS file. ODBC.INI a binary 
  118. file that you can maintain by the ODBC Administrator or an INI editor. 
  119.  
  120. An INI file contains a [section_name] heading followed by optional 
  121. attribute=value pairs, called entries. The section name and attributes are case 
  122. sensitive on OS/2. You cannot put comments in the ODBC.INI file. 
  123.  
  124. The ODBC.INI format, as specified by the Microsoft Open Database Connectivity 
  125. (ODBC) specification, is as follows: 
  126.  
  127. [ODBC Data Sources]
  128.  
  129. Lists data sources available to ODBC. 
  130.  
  131. ds_name1=driver_desc1
  132.  
  133. ds_name2=driver_desc2
  134.  
  135.  . . 
  136.  
  137. Lists each data source name followed by a description. 
  138.  
  139. [ds_name1]
  140.  
  141. Defines the actual ODBC Driver source for example, Oracle. 
  142.  
  143. Driver=path\dll
  144.  
  145. Defines the path to the driver DLL. 
  146.  
  147. Description=desc
  148.  
  149. Briefly describes the data source 
  150.  
  151.  . . . 
  152.  
  153. [ds_name2]
  154.  
  155. Driver=path\dll
  156.  
  157. Description=desc
  158.  
  159.  . . .
  160.  
  161. The [ODBC Data Sources] section is mandatory.  It provides the driver manager 
  162. with a list of data sources that are supported for your connection requests. 
  163. You can change the names in this list, but each entry must match its 
  164. corresponding [ds_name] section in ODBC.INI. 
  165.  
  166. The [ds_name] sections contain a Driver= specification, which points to the 
  167. location of the installed driver, as well as a Description= specification that 
  168. describes the driver.  If you change the location of a driver, you can change 
  169. the Driver= specification to match the new location.  You can also use just the 
  170. name of the driver, and the driver manager will attempt to locate the driver 
  171. based on information obtained from your environment. 
  172.  
  173. You might need to assign other entries depending on the data source you are 
  174. configuring.  The "Connecting to a Data Source Using a Connection String" topic 
  175. for each individual driver lists the attributes that you can set.  Use the ODBC 
  176. Administrator program to modify ODBC.INI in all environments that provide this 
  177. interface. This protects the file from becoming corrupted or nonfunctional. 
  178.  
  179.  
  180. ΓòÉΓòÉΓòÉ 1.4. ODBC.INI Examples ΓòÉΓòÉΓòÉ
  181.  
  182. The following example shows an ODBC.INI file as defined by the ODBC 
  183. specification: 
  184.  
  185. ;---------------------------------------------------
  186.  
  187. ; ODBC.INI - INTERSOLV ODBC Driver Manager INI File
  188.  
  189. ;---------------------------------------------------
  190.  
  191. [ODBC Data Sources]
  192.  
  193. ivss=INTERSOLV SQL Server
  194.  
  195. ivor7=INTERSOLV Oracle
  196.  
  197. [SQL Server]
  198.  
  199. Driver=ivss08.dll
  200.  
  201. Description=INTERSOLV SQL Server driver
  202.  
  203. ServerName=alice
  204.  
  205. LogonID=test
  206.  
  207. [Oracle]
  208.  
  209. Driver=ivor708.dll
  210.  
  211. Description=INTERSOLV Oracle driver
  212.  
  213. ServerName=t:magna:V7
  214.  
  215. LogonID=test
  216.  
  217.  
  218. ΓòÉΓòÉΓòÉ 1.5. Error Messages ΓòÉΓòÉΓòÉ
  219.  
  220. Error messages may come from 
  221.  
  222. Γûá An ODBC driver 
  223. Γûá The database system 
  224. Γûá The driver manager 
  225.  
  226. An error reported on an ODBC driver has the following format: 
  227.  
  228. [vendor] [ODBC_component] message 
  229.  
  230. ODBC_component is the component in which the error occurred.  For example, an 
  231. error message from INTERSOLV's SQL Server driver would look like this: 
  232.  
  233. [INTERSOLV] [ODBC SQL Server driver] Login incorrect. 
  234.  
  235. If you get this type of error, check the last ODBC call your application made 
  236. for possible problems or contact your ODBC application vendor. 
  237.  
  238. An error that occurs in the data source includes the data source name, in the 
  239. following format: 
  240.  
  241. [vendor] [ODBC_component] [data_source] message 
  242.  
  243. With this type of message, ODBC_component is the component that received the 
  244. error from the data source indicated.  For example, you may get the following 
  245. message from an Oracle data source: 
  246.  
  247. [INTERSOLV] [ODBC Oracle driver] [Oracle] ORA-0919: specified length too long 
  248. for CHAR column 
  249.  
  250. If you get this type of error, you did something incorrectly with the database 
  251. system.  Check your database system documentation for more information or 
  252. consult your database administrator.  In this example, you would check your 
  253. Oracle documentation. 
  254.  
  255. The driver manager is a DLL that establishes connections with drivers, submits 
  256. requests to drivers, and returns results to applications.  An error that occurs 
  257. in the driver manager has the following format: 
  258.  
  259. [vendor] [ODBC DLL] message 
  260.  
  261. vendor can be Microsoft or INTERSOLV.  For example, an error from the Microsoft 
  262. driver manager might look like this: 
  263.  
  264. [Microsoft] [ODBC DLL] Driver does not support this function 
  265.  
  266.  
  267. ΓòÉΓòÉΓòÉ 2. SQL for Flat-File Drivers ΓòÉΓòÉΓòÉ
  268.  
  269. To enable your application to be portable across other databases, you can use 
  270. SQL statements with the flat-file drivers (dBASE and Text).  The database 
  271. drivers parse SQL statements and translate them into a form that the database 
  272. can understand. 
  273.  
  274. The following SQL statements let you read, insert, update, and delete records 
  275. from a database, create new tables, and drop existing tables: 
  276.  
  277. Γûá  Select Statement 
  278. Γûá  Create Table Statement 
  279. Γûá  Drop Table Statement 
  280. Γûá  Insert Statement 
  281. Γûá  Update Statement 
  282. Γûá  Delete Statement 
  283.  
  284. The following topics describe specific elements of the SQL statements 
  285. supported: 
  286.  
  287. Γûá  Aggregate Functions 
  288. Γûá  SQL Expressions 
  289. Γûá  Reserved Keywords 
  290.  
  291.  
  292. ΓòÉΓòÉΓòÉ 2.1. Select Statement ΓòÉΓòÉΓòÉ
  293.  
  294. The form of the Select statement supported by the flat-file drivers is 
  295.  
  296. SELECT [DISTINCT] {* | column_expression, ...}
  297. FROM table_names [table_alias] ...
  298. [ WHERE expr1 rel_operator expr2 ]
  299. [ GROUP BY {column_expression, ...} ][ HAVING expr1 rel_operator expr2 ]
  300. [ UNION [ALL] (SELECT...) ]
  301. [ ORDER BY {sort_expression [DESC | ASC]}, ... ]
  302. [ FOR UPDATE [OF {column_expression, ...}] ]
  303.  
  304. Click any keyword to see a description of its statement clause. 
  305.  
  306.  
  307. ΓòÉΓòÉΓòÉ 2.2. Select Clause ΓòÉΓòÉΓòÉ
  308.  
  309. Follow Select with a list of column expressions you want to retrieve or an 
  310. asterisk (*) to retrieve all fields. 
  311.  
  312. SELECT [DISTINCT] {* | column_expression, ...}
  313.  
  314. column_expression can be simply a field name (for example, LAST_NAME).  More 
  315. complex expressions may include mathematical operations or string manipulation 
  316. (for example, SALARY * 1.05).  See SQL Expressions for more information. 
  317.  
  318. Separate multiple column expressions with commas (for example, LAST_NAME, 
  319. FIRST_NAME, HIRE_DATE). 
  320.  
  321. Field names can be prefixed with the table name or alias.  For example, 
  322. EMP.LAST_NAME or E.LAST_NAME, where E is the alias for the table EMP. 
  323.  
  324. The Distinct operator can precede the first column expression.  This operator 
  325. eliminates duplicate rows from the result of a query.  For example, 
  326.  
  327. SELECT DISTINCT dep FROM emp
  328.  
  329. Select statements can also include aggregate functions. 
  330.  
  331.  
  332. ΓòÉΓòÉΓòÉ 2.2.1. Aggregate Functions ΓòÉΓòÉΓòÉ
  333.  
  334. Aggregate functions can also be a part of a Select clause.  Aggregate functions 
  335. return a single value from a set of records. An aggregate can be used with a 
  336. field name (for example, AVG(SALARY)) or in combination with a more complex 
  337. column expression (for example, AVG(SALARY * 1.07)).  The column expression can 
  338. be preceded by the Distinct operator.  The Distinct operator eliminates 
  339. duplicate values from an aggregate expression. For example, 
  340.  
  341. COUNT (DISTINCT last_name)
  342.  
  343. In this example, only distinct last name values are counted. 
  344.  
  345. The following are valid aggregates: 
  346.  
  347. Aggregate Returns 
  348.  
  349. SUM       The total of the values in a numeric field expression.  For example, 
  350.           SUM(SALARY) returns the sum of all salary field values. 
  351.  
  352. AVG       The average of the values in a numeric field expression.  For 
  353.           example, AVG(SALARY) returns the average of all salary field values. 
  354.  
  355. COUNT     The number of values in any field expression.  For example, 
  356.           COUNT(NAME) returns the number of name values.  When using COUNT with 
  357.           a field name, COUNT returns the number of non-null field values.  A 
  358.           special example is COUNT(*), which returns the number of records in 
  359.           the set, including records with null values. 
  360.  
  361. MAX       The maximum value in any field expression.  For example, MAX(SALARY) 
  362.           returns the maximum salary field value. 
  363.  
  364. MIN       The minimum value in any field expression.  For example, MIN(SALARY) 
  365.           returns the minimum salary field value. 
  366.  
  367.  
  368. ΓòÉΓòÉΓòÉ 2.2.2. From Clause ΓòÉΓòÉΓòÉ
  369.  
  370. The From clause indicates the tables that will be used in the Select statement. 
  371. The format of the From clause is 
  372.  
  373. FROM table_names [table_alias]
  374.  
  375. table_names can be one or more simple table names in the current working 
  376. directory or complete pathnames. 
  377.  
  378. table_alias is a name used to refer to this table in the rest of the Select 
  379. statement.  Database field names may be prefixed by the table alias. Given the 
  380. table specification 
  381.  
  382. FROM emp E
  383.  
  384. you may refer to the LAST_NAME field as E.LAST_NAME.  Table aliases must be 
  385. used if the Select statement joins a table to itself.  For example, 
  386.  
  387. SELECT * FROM emp E, emp F WHERE E.mgr_id = F.emp_id
  388.  
  389. The equal sign (=) includes only matching rows in the results.  If you are 
  390. joining more than one table, you may use LEFT OUTER JOIN, which includes 
  391. nonmatching rows in the first table you name. For example, 
  392.  
  393. SELECT * FROM T1 LEFT OUTER JOIN T2 on T1.key = T2.key
  394.  
  395.  
  396. ΓòÉΓòÉΓòÉ 2.2.3. Where Clause ΓòÉΓòÉΓòÉ
  397.  
  398. The Where clause specifies the conditions that records must meet to be 
  399. retrieved.  The Where clause contains conditions in the form: 
  400.  
  401. WHERE expr1 rel_operator expr2
  402.  
  403. expr1 and expr2 may be field names, constant values, or expressions. 
  404.  
  405. rel_operator is the relational operator that links the two expressions.  See 
  406. SQL Expressions for more information. 
  407.  
  408. For example, the following Select statement retrieves the names of employees 
  409. that make at least $20,000. 
  410.  
  411. SELECT last_name,first_name FROM emp WHERE salary >= 20000
  412.  
  413.  
  414. ΓòÉΓòÉΓòÉ 2.2.4. Group By Clause ΓòÉΓòÉΓòÉ
  415.  
  416. The Group By clause specifies the names of one or more fields by which the 
  417. returned values should be grouped.  This clause is used to return a set of 
  418. aggregate values. 
  419.  
  420. It has the following form: 
  421.  
  422. GROUP BY column_expressions
  423.  
  424. column_expressions must match the column expression used in the Select clause. 
  425. A column expression can be one or more field names of the database table, 
  426. separated by a comma (,) or one or more expressions, separated by a comma (,). 
  427. See SQL Expressions for more information. 
  428.  
  429. The following example sums the salaries in each department. 
  430.  
  431. SELECT dept_id, sum(salary) FROM emp GROUP BY dept_id
  432.  
  433. This statement returns one row for each distinct department ID.  Each row 
  434. contains the department ID and the sum of the salaries of the employees in the 
  435. department. 
  436.  
  437.  
  438. ΓòÉΓòÉΓòÉ 2.2.5. Having Clause ΓòÉΓòÉΓòÉ
  439.  
  440. The Having clause enables you to specify conditions for groups of records ( for 
  441. example, display only the departments that have salaries totaling more than 
  442. $200,000).  This clause is valid only if you have already defined a Group By 
  443. clause. 
  444.  
  445. It has the following form: 
  446.  
  447. HAVING expr1 rel_operator expr2
  448.  
  449. expr1 and expr2 can be field names, constant values, or expressions. These 
  450. expressions do not have to match a column expression in the Select clause. 
  451.  
  452. rel_operator is the relational operator that links the two expressions.  See 
  453. SQL Expressions for more information. 
  454.  
  455. The following example returns only the departments whose sums of salaries are 
  456. greater than $200,000: 
  457.  
  458. SELECT dept_id, sum(salary) FROM emp
  459. GROUP BY dept_id HAVING sum(salary) > 200000
  460.  
  461.  
  462. ΓòÉΓòÉΓòÉ 2.2.6. Union Operator ΓòÉΓòÉΓòÉ
  463.  
  464. The Union operator combines the results of two Select statements into a single 
  465. result.  The single result is all of the returned records from both Select 
  466. statements.  By default, duplicate records are not returned.  To return 
  467. duplicate records, use the All keyword (UNION ALL).  The form is 
  468.  
  469. SELECT statement
  470. UNION [ALL]
  471. SELECT statement
  472.  
  473. When using the Union operator, the select lists for each Select statement must 
  474. have the same number of column expressions with the same data types and must be 
  475. specified in the same order.  For example, 
  476.  
  477. SELECT last_name, salary, hire_date FROM emp
  478. UNION
  479. SELECT name, pay, birth_date FROM person
  480.  
  481. This example has the same number of column expressions, and each column 
  482. expression, in order, has the same data type. 
  483.  
  484. The following example is not valid because the data types of the column 
  485. expressions are different (SALARY from EMP has a different data type than 
  486. LAST_NAME from RAISES).  This example does have the same number of column 
  487. expressions in each Select statement but the expressions are not in the same 
  488. order by data type. 
  489.  
  490. SELECT last_name, salary FROM emp
  491. UNION
  492. SELECT salary, last_name FROM raises
  493.  
  494.  
  495. ΓòÉΓòÉΓòÉ 2.2.7. Order By Clause ΓòÉΓòÉΓòÉ
  496.  
  497. The Order By clause indicates how the records are to be sorted.  The form is 
  498.  
  499. ORDER BY {sort_expression [DESC | ASC]}, ...
  500.  
  501. sort_expression can be field names, expressions, or the positional number of 
  502. the column expression to use. 
  503.  
  504. The default is to perform an ascending (ASC) sort. 
  505.  
  506. For example, to sort by LAST_NAME you could use either of the following Select 
  507. statements: 
  508.  
  509. SELECT emp_id, last_name, first_name FROM emp
  510. ORDER BY last_name
  511.  
  512. or 
  513.  
  514. SELECT emp_id, last_name, first_name FROM emp
  515. ORDER BY 2
  516.  
  517. In the second example, LAST_NAME is the second column expression following 
  518. Select, so Order By 2 sorts by LAST_NAME. 
  519.  
  520.  
  521. ΓòÉΓòÉΓòÉ 2.2.8. For Update Of Clause ΓòÉΓòÉΓòÉ
  522.  
  523. The For Update Of clause locks the records of the database table selected by 
  524. the Select statement.  The form is 
  525.  
  526. FOR UPDATE [OF column_expressions]
  527.  
  528. column_expressions is a list of field names in the database table that you 
  529. intend to update, separated by a comma (,). Note that column_expressions is 
  530. optional. 
  531.  
  532. The following example returns all records in the employee database that have a 
  533. SALARY field value of more than $20,000.  When each record is fetched, it is 
  534. locked.  If the record is updated or deleted, the lock is held until you commit 
  535. the change.  Otherwise, the lock is released when you fetch the next record. 
  536.  
  537. SELECT * FROM emp WHERE salary > 20000
  538. FOR UPDATE OF last_name, first_name, salary
  539.  
  540.  
  541. ΓòÉΓòÉΓòÉ 2.3. SQL Expressions ΓòÉΓòÉΓòÉ
  542.  
  543. Expressions are used in the Where clauses, Having clauses, Order By clauses, 
  544. Select statements. 
  545.  
  546. Expressions enable you to use mathematical operations as well as character 
  547. string and date manipulation operators to form complex database queries. 
  548.  
  549. The most common expression is a simple field name. You can combine a field name 
  550. with other expression elements. 
  551.  
  552. Other valid expression elements are as follows: 
  553.  
  554. ΓûáField names 
  555.  
  556. ΓûáConstants 
  557.  
  558. ΓûáExponential notation 
  559.  
  560. ΓûáNumeric operators 
  561.  
  562. ΓûáCharacter operators 
  563.  
  564. ΓûáDate operators 
  565.  
  566. ΓûáRelational operators 
  567.  
  568. ΓûáLogical operators 
  569.  
  570. ΓûáFunctions 
  571.  
  572. The order in which these elements are evaluated is described in Operator 
  573. Precedence. 
  574.  
  575.  
  576. ΓòÉΓòÉΓòÉ 2.3.1. Constants ΓòÉΓòÉΓòÉ
  577.  
  578. Constants are values that do not change.  For example, in the expression PRICE 
  579. * 1.05, the value 1.05 is a constant. 
  580.  
  581. You must enclose character constants in pairs of single (') or double quotation 
  582. marks (").  To include a single quotation mark in a character constant enclosed 
  583. by single quotation marks, use two single quotation marks together (for 
  584. example, 'Don''t').  Similarly, if the constant is enclosed by double quotation 
  585. marks, use two double quotation marks to include one. 
  586.  
  587. You must enclose date and time constants in braces ({}), for example, 
  588. {01/30/89} and {12:35:10}.  The form for date constants is MM/DD/YY or 
  589. MM/DD/YYYY.  The form for time constants is HH:MM:SS. 
  590.  
  591. The logical constants are .T. and 1 for True and .F. and 0 for False.  For 
  592. portability, use 1 and 0. 
  593.  
  594.  
  595. ΓòÉΓòÉΓòÉ 2.3.2. Exponential Notation ΓòÉΓòÉΓòÉ
  596.  
  597. You may include exponential notation. For example, 
  598.  
  599. SELECT col1, 3.4E+& FROM table1 WHERE calc < 3.4E-6 * col2
  600.  
  601.  
  602. ΓòÉΓòÉΓòÉ 2.3.3. Numeric Operators ΓòÉΓòÉΓòÉ
  603.  
  604. You may include the following operators in numeric expressions: 
  605.  
  606. Operator  Meaning 
  607.  +        Addition 
  608.  -        Subtraction 
  609.  *        Multiplication 
  610.  /        Division 
  611.  **       Exponeniation 
  612.  ^        Exponentiation 
  613.  
  614. The following table shows examples of numeric expressions.  For these examples, 
  615. assume SALARY is 20000. 
  616.  
  617. Example             Resulting value 
  618. salary + 10000      30000 
  619. salary * 1.1        22000 
  620. 2 ** 3              8 
  621.  
  622. You can precede numeric expressions with a unary plus (+) or minus (-). For 
  623. example, 
  624.  
  625. -(salary * 1.1) is -22000.
  626.  
  627.  
  628. ΓòÉΓòÉΓòÉ 2.3.4. Character Operators ΓòÉΓòÉΓòÉ
  629.  
  630. Character expressions may include the following operators: 
  631.  
  632. Operator  Meaning 
  633.  +        Concatenation keeping trailing blanks. 
  634.  -        Concatenation moving trailing blanks to the end. 
  635.  
  636. The following table shows examples of character expressions.  In the examples, 
  637. LAST_NAME is 'JONES  ' and FIRST_NAME is 'ROBERT   '. 
  638.  
  639. Example                       Resulting value 
  640. first_name + last_name        'ROBERT   JONES' 
  641. first_name - last_name        'ROBERTJONES    ' 
  642.  
  643. Note:   Some flat-file drivers return character data with trailing blanks as 
  644. shown in the table.  However, you cannot rely on the driver to return blanks. 
  645. Therefore, if you want an expression that works with drivers that do and do not 
  646. return trailing blanks, use the TRIM function before concatenating strings to 
  647. make the expression portable.  For example: 
  648.  
  649. TRIM(first_name) + '' + TRIM(last_name)
  650.  
  651.  
  652. ΓòÉΓòÉΓòÉ 2.3.5. Date Operators ΓòÉΓòÉΓòÉ
  653.  
  654. You may include the following operators in date expressions: 
  655.  
  656. Operator  Meaning 
  657. +         Add a number of days to a date to produce a new date. 
  658. -         The number of days between two dates, or subtract a number of days 
  659.           from a date to produce a new date. 
  660.  
  661. The following chart shows examples of date expressions.  In these examples, 
  662. hire_date is {01/30/90}. 
  663.  
  664. Example             Resulting value 
  665. hire_date + 5       {02/04/90} 
  666. hire_date - {01/01/90} 29 
  667. hire_date - 10      {01/20/90} 
  668.  
  669.  
  670. ΓòÉΓòÉΓòÉ 2.3.6. Relational Operators ΓòÉΓòÉΓòÉ
  671.  
  672. The relational operators separating the two expressions may be any one of the 
  673. following: 
  674.  
  675. Operator  Meaning 
  676.  
  677. =         Equal 
  678.  
  679. <>        Not Equal 
  680.  
  681. >         Greater Than 
  682.  
  683. >=        Greater Than or Equal 
  684.  
  685. <         Less Than 
  686.  
  687. <=        Less Than or Equal 
  688.  
  689. Like      Matching a pattern 
  690.  
  691. Not Like  Not matching a pattern 
  692.  
  693. Is Null   Equal to Null 
  694.  
  695. Is Not Null Not Equal to Null 
  696.  
  697. Between   Range of values between a lower and upper bound. 
  698.  
  699. In        A member of a set of specified values or a member of a subquery. 
  700.  
  701. Exists    True if a subquery returned at least one record. 
  702.  
  703. Any       Compares a value to each value returned by a subquery.  Any must be 
  704.           prefaced by =, <>, >, >=, <, or <=. =Any is equivalent to In. 
  705.  
  706. All       Compares a value to each value returned by a subquery. All must be 
  707.           prefaced by =, <>, >, >=, <, or <=. 
  708.  
  709. The following list shows some examples of relational operators: 
  710.  
  711. salary <= 40000
  712. dept = 'D101'
  713. hire_date > {01/30/89}
  714. salary + commission >= 50000
  715. last_name LIKE 'Jo%'
  716. salary IS NULL
  717. salary BETWEEN 10000 AND 20000
  718. WHERE salary = ANY (SELECT salary FROM emp WHERE dept = 'D101')
  719. WHERE salary > ALL (SELECT salary FROM emp WHERE dept = 'D101')
  720.  
  721.  
  722. ΓòÉΓòÉΓòÉ 2.3.7. Logical Operators ΓòÉΓòÉΓòÉ
  723.  
  724. Two or more conditions may be combined to form more complex criteria.  When two 
  725. or more conditions are present, they must be related by AND or OR. For example, 
  726.  
  727. salary = 40000 AND exempt = 1
  728.  
  729. The logical NOT operator is used to reverse the meaning. For example, 
  730.  
  731. NOT (salary = 40000 AND exempt = 1)
  732.  
  733.  
  734. ΓòÉΓòÉΓòÉ 2.3.8. Operator Precedence ΓòÉΓòÉΓòÉ
  735.  
  736. As expressions become more complex, the order in which the expressions are 
  737. evaluated becomes important.  The following table shows the order in which the 
  738. operators are evaluated.  The operators in the first line are evaluated first, 
  739. then those in the second line, and so on.  Operators in the same line are 
  740. evaluated left to right in the expression. 
  741.  
  742. Order     Operator 
  743. 1         Unary -, Unary + 
  744. 2         ** 
  745. 3         *, / 
  746. 4         +, - 
  747. 5         =, <>, <, <=, >, >=, Like, Not Like, Is Null, Is Not Null, Between, 
  748.           In, Exists, Any, All 
  749. 6         Not 
  750. 7         AND 
  751. 8         OR 
  752.  
  753. The following example shows the importance of precedence: 
  754.  
  755. WHERE salary > 40000 OR
  756. hire_date > {01/30/89} AND
  757. dept = 'D101'
  758.  
  759. Because AND is evaluated first, this query retrieves employees in department 
  760. D101 hired after January 30, 1989, as well as every employee making more than 
  761. $40,000, no matter what department or hire date. 
  762.  
  763. To force the clause to be evaluated in a different order, use parentheses to 
  764. enclose the conditions to be evaluated first.  For example, 
  765.  
  766. WHERE (salary > 40000 OR hire_date > {01/30/89})
  767. AND dept = 'D101'
  768.  
  769. retrieves employees in department D101 that either make more than $40,000 or 
  770. were hired after January 30, 1989. 
  771.  
  772.  
  773. ΓòÉΓòÉΓòÉ 2.3.9. Functions ΓòÉΓòÉΓòÉ
  774.  
  775. The flat-file drivers support a number of functions that you may use in 
  776. expressions.  In the following topics, the functions are grouped according to 
  777. the type of result they return. 
  778.  
  779. Functions that Return Character Strings 
  780.  
  781. Functions that Return Numbers 
  782.  
  783. Functions that Return Dates 
  784.  
  785.  
  786. ΓòÉΓòÉΓòÉ 2.3.10. Functions that Return Character Strings ΓòÉΓòÉΓòÉ
  787.  
  788. The following functions return character string values: 
  789.  
  790. Function  Description 
  791.  
  792. CHR       Converts an ASCII code into a one-character string. For example, 
  793.           CHR(67) returns C. 
  794.  
  795. RTRIM     Removes trailing blanks from a string For example, RTRIM('ABC  ') 
  796.           returns ABC. 
  797.  
  798. TRIM      Removes trailing blanks from a string. For example, TRIM('ABC  ') 
  799.           returns ABC. 
  800.  
  801. LTRIM     Removes leading blanks from a string. For example, LTRIM('  ABC') 
  802.           returns ABC. 
  803.  
  804. UPPER     Changes each letter of a string to uppercase.  For example, 
  805.           UPPER('Allen') returns ALLEN. 
  806.  
  807. LOWER     Changes each letter of a string to lowercase.  For example, 
  808.           LOWER('Allen') returns allen. 
  809.  
  810. LEFT      Returns leftmost characters of a string.  For example, 
  811.           LEFT('Mattson',3) returns Mat. 
  812.  
  813. RIGHT     Returns rightmost characters of a string.  For example, 
  814.           RIGHT('Mattson',4) returns tson. 
  815.  
  816. SUBSTR    Returns a substring of a string.  Parameters are the string, the 
  817.           first character to extract, and the number of characters to extract 
  818.           (optional).  For example, SUBSTR('Conrad',2,3) returns onr. Also, 
  819.           SUBSTR('Conrad',2) returns onrad. 
  820.  
  821. SPACE     Generates a string of blanks. For example, SPACE(5) returns '    '. 
  822.  
  823. DTOC      Converts a date to a character string. An optional second parameter 
  824.           determines the format of the result: For example: 
  825.  
  826.           0 (the default) returns MM/DD/YY 
  827.  
  828.           1 returns DD/MM/YY 
  829.  
  830.           2 returns YY/MM/DD 
  831.  
  832.           10 returns MM/DD/YYYY 
  833.  
  834.           11 returns DD/MM/YYYY 
  835.  
  836.           12 returns YYYY/MM/DD 
  837.  
  838.           An optional third parameter specifies the date separator character. 
  839.           If not specified, a slash (/) is used. For example: 
  840.  
  841.           DTOC({01/30/89}) returns 01/30/89 
  842.  
  843.           DTOC({01/30/89}, 0) returns 01/30/89 
  844.  
  845.           DTOC({01/30/89}, 1) returns 30/01/89 
  846.  
  847.           DTOC({01/30/89}, 2,'-') returns 89-01-30 
  848.  
  849. DTOS      Converts a date to a character string using the format YYYYMMDD. 
  850.  
  851.           DTOS({01/23/90}) returns 19900123. 
  852.  
  853. IIF       Returns one of two values. Parameters are a logical expression, the 
  854.           true value, and the false value.  If the logical expression evaluates 
  855.           to True, the function returns the true value. Otherwise, it returns 
  856.           the false value. For example, IIF(salary>20000,'BIG','SMALL') returns 
  857.           BIG if  SALARY is greater than 20000.  If not, it returns SMALL. 
  858.  
  859. STR       Converts a number to a character string.  Parameters are the number, 
  860.           the total number of output characters (including the decimal point), 
  861.           and optionally the number of digits to the right of the decimal 
  862.           point. 
  863.  
  864.           STR(12.34567,4) returns 12 
  865.  
  866.           STR(12.34567,4,1) returns 12.3 
  867.  
  868.           STR(12.34567,6,3) returns 12.346 
  869.  
  870. STRVAL    Converts a value of any type to a character string. 
  871.  
  872.           STRVAL('Woltman') returns Woltman 
  873.  
  874.           STRVAL({12/25/53}) returns 12/25/53 
  875.  
  876.           STRVAL (5 * 3) returns 15 
  877.  
  878.           STRVAL (4 = 5) returns 'False' 
  879.  
  880. TIME      Returns the time of day as a string. For example, at 9:49 PM, TIME() 
  881.           returns 21:49:00 
  882.  
  883. USERNAME  Returns the name in the UID attribute as a character string.  If 
  884.           UID=Allen, USERNAME() returns Allen. 
  885.  
  886.  
  887. ΓòÉΓòÉΓòÉ 2.3.11. Functions that Return Numbers ΓòÉΓòÉΓòÉ
  888.  
  889. The following functions return number values: 
  890.  
  891. Function  Description 
  892.  
  893. MOD       Divides two numbers and returns the remainder of the division.  For 
  894.           example, MOD(10,3) returns 1 
  895.  
  896. LEN       Returns the length of a string. For example, LEN('ABC') returns 3 
  897.  
  898. MONTH     Returns the month part of a date. For example, MONTH({01/30/89}) 
  899.           returns 1 
  900.  
  901. DAY       Returns the day part of a date. For example, DAY({01/30/89}) returns 
  902.           30 
  903.  
  904. YEAR      Returns the year part of a date. For example, YEAR({01/30/89}) 
  905.           returns 1989 
  906.  
  907. MAX       Returns the larger of two numbers. For example, MAX(66,89) returns 89 
  908.  
  909. MIN       Returns the smaller of two numbers. For example, MIN(66,89) returns 
  910.           66 
  911.  
  912. POW       Raises a number to a power. For example, POW(7,2) returns 49 
  913.  
  914. INT       Returns the integer part of a number. For example, INT(6.4321) 
  915.           returns 6 
  916.  
  917. ROUND     Rounds a number. For example, ROUND(123.456, 0) returns 123. 
  918.           ROUND(123.456, 2) returns 123.46. ROUND(123.456, -2) returns 100. 
  919.  
  920. NUMVAL    Converts a character string to a number.  If the character string is 
  921.           not a valid number, a zero is returned.  For example, NUMVAL('123') 
  922.           returns the number 123 
  923.  
  924. VAL       Converts a character string to a number.  If the character string is 
  925.           not a valid number, a zero is returned.  For example, VAL('123') 
  926.           returns the number 123. 
  927.  
  928.  
  929. ΓòÉΓòÉΓòÉ 2.3.12. Functions that Return Dates ΓòÉΓòÉΓòÉ
  930.  
  931. The following functions return date values: 
  932.  
  933. Function  Description 
  934.  
  935. DATE      Returns today's date. If today is 12/25/79, DATE() returns {12/25/79} 
  936.  
  937. TODAY     Returns today's date. If today is 12/25/79, TODAY() returns 
  938.           {12/25/79} 
  939.  
  940. DATEVAL   Converts a character string to a date. DATEVAL('01/30/89') returns 
  941.           {01/30/89} 
  942.  
  943. CTOD      Converts a character string to a date.  An optional second parameter 
  944.           specifies the format of the character string:  0 (the default) 
  945.           returns MM/DD/YY, 1 returns DD/MM/YY, and 2 returns YY/MM/DD. 
  946.           CTOD('01/30/89') returns {01/30/89}  CTOD('01 /30/89',1) returns 
  947.           {30/01/89} 
  948.  
  949. The following examples use some of the number and date functions. 
  950.  
  951. Retrieve all employees that have been with the company at least 90 days: 
  952.  
  953. SELECT first_name, last_name FROM emp
  954. WHERE DATE() - hire_date >= 90
  955.  
  956. Retrieve all employees hired in January of this year or last year: 
  957.  
  958. SELECT first_name, last_name FROM emp
  959. WHERE MONTH(hire_date) = 1 AND (YEAR(hire_date) = YEAR(DATE())
  960. OR YEAR(hire_date) = YEAR(DATE()) - 1)
  961.  
  962.  
  963. ΓòÉΓòÉΓòÉ 2.4. Create Table Statement ΓòÉΓòÉΓòÉ
  964.  
  965. The Create Table statement is used to create database files.  The form of the 
  966. Create Table statement is 
  967.  
  968. CREATE TABLE filename (col_definition[,col_definition, ...])
  969.  
  970. filename can be a simple filename or a full pathname.  A simple filename is 
  971. preferred for portability to other SQL data sources.  If it is a simple 
  972. filename, the file is created in the directory you specified as the database 
  973. directory in the connection string.  If you did not specify a database 
  974. directory in the connection string, the file is created in the directory you 
  975. specified as the database directory in ODBC.INI.  If you did not specify a 
  976. database directory in either place, the file is created in the current working 
  977. directory at the time you connected to the driver. 
  978.  
  979. col_definition is the column name, followed by the data type, followed by an 
  980. optional column constraint definition.  Values for column names are database 
  981. specific.  The data type specifies a column's data type. 
  982.  
  983. The only column constraint definition currently supported by some flat-file 
  984. drivers is "not null."  Not all flat-file tables support "not null" columns. 
  985. In the cases where not null is not supported, this restriction is ignored and 
  986. the driver returns a warning if "not null" is specified for a column.  The "not 
  987. null" column constraint definition is allowed in the driver so that you can 
  988. write a database-independent application (and not be concerned about the driver 
  989. raising an error on a Create Table statement with a "not null" restriction). 
  990.  
  991. A sample Create Table statement to create an employee database table is 
  992.  
  993. CREATE TABLE emp (last_name CHAR(20) NOT NULL,
  994. first_name CHAR(12) NOT NULL,
  995. salary NUMERIC (10,2) NOT NULL,
  996. hire_date DATE NOT NULL)
  997.  
  998.  
  999. ΓòÉΓòÉΓòÉ 2.5. Drop Table Statement ΓòÉΓòÉΓòÉ
  1000.  
  1001. The Drop Table statement is used to delete database files.  The form of the 
  1002. Drop Table statement is 
  1003.  
  1004. DROP TABLE filename
  1005.  
  1006. filename may be a simple filename (EMP) or a full pathname.  A simple filename 
  1007. is preferred for portability to other SQL data sources.  If it is a simple 
  1008. filename, the file is dropped from the directory you specified as the database 
  1009. directory in the connection string.  If you did not specify a database 
  1010. directory in the connection string, the file is deleted from the directory you 
  1011. specified as the database directory in ODBC.INI.  If you did not specify a 
  1012. database directory in either of these places, the file is dropped from the 
  1013. current working directory at the time you connected to the driver. 
  1014.  
  1015. A sample Drop Table statement to delete the employee database table is 
  1016.  
  1017. DROP TABLE emp
  1018.  
  1019.  
  1020. ΓòÉΓòÉΓòÉ 2.6. Insert Statement ΓòÉΓòÉΓòÉ
  1021.  
  1022. The SQL Insert statement is used to add new records to a database table. With 
  1023. it, you can specify either of the following: 
  1024.  
  1025. Γûá  A list of values to be inserted as a new record. 
  1026.  
  1027. Γûá  A Select statement that copies data from another table to be inserted as a 
  1028. set of new records. 
  1029.  
  1030. The form of the Insert statement is 
  1031.  
  1032. INSERT INTO table_name [(col_name, ...)]
  1033. {VALUES (expr, ...) | select_statement}
  1034.  
  1035. table_name may be a simple filename or a full pathname.  A simple filename is 
  1036. preferred for portability to other SQL data sources. 
  1037.  
  1038. col_name is an optional list of column names giving the name and order of the 
  1039. columns whose values are specified in the Values clause.  If you omit col_name, 
  1040. the value expressions (expr) must provide values for all columns defined in the 
  1041. file and must be in the same order that the columns are defined for the file. 
  1042.  
  1043. expr is the list of expressions giving the values for the columns of the new 
  1044. record.  Usually, the expressions are constant values for the columns. 
  1045. Character string values must be enclosed in single or double quotation marks, 
  1046. date values must be enclosed in braces {}, and logical values that are 
  1047. characters must be enclosed in periods (for example, .T. or .F.). 
  1048.  
  1049. An example of an Insert statement that uses a list of expressions is 
  1050.  
  1051. INSERT INTO emp (last_name, first_name, emp_id, salary, hire_date)
  1052. VALUES ('Smith', 'John', 'E22345', 27500, {4/6/91})
  1053.  
  1054. Each Insert statement adds one record to the database table.  In this case, a 
  1055. record has been added to the employee database table, EMP. Values are specified 
  1056. for five columns.  The remaining columns in the table are assigned a blank 
  1057. value, meaning Null. 
  1058.  
  1059. In addition, this statement supports subqueries, which allows applications to 
  1060. select rows from one table and insert them into another. The form of an Insert 
  1061. statement that supports subqueries is: 
  1062.  
  1063. INSERT INTO table_name [(col_name, ...)] query_expression
  1064.  
  1065. table_name may be a simple filename or a full pathname.  A simple filename is 
  1066. preferred for portability to other SQL data sources. 
  1067.  
  1068. col_name is an optional list of column names giving the name and order of the 
  1069. columns whose values are specified in the Values clause.  If you omit 
  1070.  
  1071. col_name, the value expressions (expr) must provide values for all columns 
  1072. defined in the file and must be in the same order that the columns are defined 
  1073. for the file. 
  1074.  
  1075. expr is the list of expressions giving the values for the columns of the new 
  1076. record.  Usually, the expressions are constant values for the columns. 
  1077. Character string values must be enclosed in single or double quotation marks, 
  1078. date values must be enclosed in braces {}, and logical values that are 
  1079. characters must be enclosed in periods (for example, .T. or .F.). 
  1080.  
  1081. An example of an Insert statement that uses a list of expressions is 
  1082.  
  1083. INSERT INTO emp (last_name, first_name, emp_id, salary, hire_date)
  1084. VALUES ('Smith', 'John', 'E22345', 27500, {4/6/91})
  1085.  
  1086. Each Insert statement adds one record to the database table.  In this case a 
  1087. record has been added to the employee database table, EMP.  Values are 
  1088. specified for five columns. The remaining columns in the table are assigned a 
  1089. blank value, meaning Null. 
  1090.  
  1091. select_statement is a query that returns values for each col_name value 
  1092. specified in the column name list. Using a Select statement instead of a list 
  1093. of value expressions lets you select a set of rows from one table and insert it 
  1094. into another table using a single Insert statement. 
  1095.  
  1096. An example of an Insert statement that uses a Select statement is: 
  1097.  
  1098. INSERT INTO emp1 (first_name, last_name, emp_id, dept, salary)
  1099. SELECT first_name, last_name, emp_id, dept, salary from emp
  1100.     WHERE dept = 'D050'
  1101.  
  1102. In this type of Insert statement, the number of columns to be inserted must 
  1103. match the number of columns in the Select statement. The list of columns to be 
  1104. inserted must corresond to the columns in the Select statement just as it would 
  1105. to a list of value expressions in the other type of Insert statement. That is, 
  1106. the first column inserted corresponds to the first column selected; the second 
  1107. inserted to the second, etc. 
  1108.  
  1109. The size and data type of these corresponding columns must be compatible. Each 
  1110. column in the Select list should have a data type that the ODBC driver accepts 
  1111. on a regular Insert/Update of the corresponding column in the Insert list. 
  1112. Values are truncated when the size of the value in the Select list column is 
  1113. greater than the size of the corresponding Insert list column. 
  1114.  
  1115. The select_statement is evaluated before any values are inserted. This query 
  1116. cannot be made on the table into which values are inserted. 
  1117.  
  1118.  
  1119. ΓòÉΓòÉΓòÉ 2.7. Update Statement ΓòÉΓòÉΓòÉ
  1120.  
  1121. The SQL Update statement is used to change records in a database file.  The 
  1122. form of the Update statement supported for flat-file drivers is 
  1123.  
  1124. UPDATE filename SET col_name = expr, ...
  1125. [ WHERE { conditions | CURRENT OF cursor_name } ]
  1126.  
  1127. filename may be a simple filename or a full pathname.  A simple filename is 
  1128. preferred for portability to other SQL data sources. 
  1129.  
  1130. col_name is the name of a column whose value is to be changed. Several columns 
  1131. can be changed in one statement. 
  1132.  
  1133. expr is the new value for the column.  The expression can be a constant value 
  1134. or a subquery.  Character string values must be enclosed with single or double 
  1135. quotation marks, date values must be enclosed by braces {}, and logical values 
  1136. that are letters must be enclosed by periods (for example, .T. or .F.). 
  1137. Subqueries must be enclosed in parentheses. 
  1138.  
  1139. The Where clause is any valid clause.  It determines which records are to be 
  1140. updated. 
  1141.  
  1142. The Where Current Of cursor_name clause can be used only by developers coding 
  1143. directly to the ODBC API.  It causes the row at which cursor_name is positioned 
  1144. to be updated.  This is called a "positioned update."  You must first execute a 
  1145. Select...For Update statement with a named cursor and fetch the row to be 
  1146. updated. 
  1147.  
  1148. An example of an Update statement on the employee table is 
  1149.  
  1150. UPDATE emp SET salary=32000, exempt=1
  1151. WHERE emp_id = 'E10001'
  1152.  
  1153. The Update statement changes every record that meets the conditions in the 
  1154. Where clause.  In this case the salary and exempt status is changed for all 
  1155. employees having the employee ID E10001.  Since employee IDs are unique in the 
  1156. employee table, only one record is updated. 
  1157.  
  1158. An example using a subquery is 
  1159.  
  1160. UPDATE emp SET salary = (SELECT avg(salary) from emp)
  1161. WHERE emp_id = 'E10001'
  1162.  
  1163. In this case, the salary is changed to the average salary in the company for 
  1164. the employee having employee ID E10001. 
  1165.  
  1166.  
  1167. ΓòÉΓòÉΓòÉ 2.8. Delete Statement ΓòÉΓòÉΓòÉ
  1168.  
  1169. The SQL Delete statement is used to delete records from a database table. The 
  1170. form of the Delete statement supported for flat-file drivers is 
  1171.  
  1172. DELETE FROM filename
  1173. [ WHERE { conditions | CURRENT OF cursor_name } ]
  1174.  
  1175. filename may be a simple filename or a full pathname.  A simple filename is 
  1176. preferred for portability to other SQL data sources. 
  1177.  
  1178. The Where clause is any valid clause.  It determines which records are to be 
  1179. deleted.  If you include only the keyword Where, all records in the table are 
  1180. deleted but the file is left intact. 
  1181.  
  1182. The Where Current Of cursor_name clause can be used only by developers coding 
  1183. directly to the ODBC API.  It causes the row at which cursor_name is positioned 
  1184. to be deleted.  This is called a "positioned delete."  You must first execute a 
  1185. Select...For Update statement with a named cursor and fetch the row to be 
  1186. deleted. 
  1187.  
  1188. An example of a Delete statement on the employee table is 
  1189.  
  1190. DELETE FROM emp WHERE emp_id = 'E10001'
  1191.  
  1192. Each Delete statement removes every record that meets the conditions in the 
  1193. Where clause.  In this case every record having the employee ID E10001 is 
  1194. deleted.  Since employee IDs are unique in the employee table, at most one 
  1195. record is deleted. 
  1196.  
  1197.  
  1198. ΓòÉΓòÉΓòÉ 2.9. Reserved Keywords ΓòÉΓòÉΓòÉ
  1199.  
  1200. The following words are reserved for use in SQL statements. If they are used 
  1201. for file or column names in a database that you use, you must enclose them in 
  1202. quotation marks in any SQL statement where they appear as file or column names. 
  1203.  
  1204. Γûá ALL 
  1205. Γûá AND 
  1206. Γûá BETWEEN 
  1207. Γûá COMPUTE 
  1208. Γûá CROSS 
  1209. Γûá DISTINCT 
  1210. Γûá FOR 
  1211. Γûá FROM 
  1212. Γûá FULL 
  1213. Γûá GROUP 
  1214. Γûá HAVING 
  1215. Γûá HERE 
  1216. Γûá INNER 
  1217. Γûá INTO 
  1218. Γûá LEFT 
  1219. Γûá LIKE 
  1220. Γûá NATURAL 
  1221. Γûá NOT 
  1222. Γûá NULL 
  1223. Γûá ON 
  1224. Γûá OPTIONS 
  1225. Γûá OR 
  1226. Γûá ORDER 
  1227. Γûá RIGHT 
  1228.  
  1229.  
  1230. ΓòÉΓòÉΓòÉ 3. DB2/2 Driver ΓòÉΓòÉΓòÉ
  1231.  
  1232. The DB2/2 driver supports the use of the Client Application Enabler (CAE) 1.2 
  1233. interfaces. Note that the previous DB2/2 driver, QEDBMnn.DLL, is not supported 
  1234. in this release of INTERSOLV ODBC drivers. 
  1235.  
  1236. The DB2/2 driver supports the following database systems: 
  1237.  
  1238. Γûá  DB2/2 for OS/2 (formerly Database Manager for OS/2) 
  1239. Γûá  DB2/6000 
  1240. Γûá  SQL/400 (through the DDCS/2 or DDCS/6000 gateway) 
  1241. Γûá  MVS DB2 (through the DDCS/2 or DDCS/6000 gateway) 
  1242. Γûá  SQL/DS (through the DDCS/2 or DDCS/6000 gateway) 
  1243.  
  1244. Note:  The driver filename has changed from QEDBMnn.DLL to IVDB2nn.DLL. The 
  1245. previous version of this driver does not support all of these database systems 
  1246. on OS/2. 
  1247.  
  1248.  
  1249. ΓòÉΓòÉΓòÉ 3.1. DB2/2 System Requirements ΓòÉΓòÉΓòÉ
  1250.  
  1251. System requirements are as follows: 
  1252.  
  1253. Γûá  The DB2/2 Server must be installed as the Server Version for remote clients 
  1254. to use it. The Local Version supports only OS/2 applications running on the 
  1255. server. 
  1256.  
  1257. Γûá  To use the DDCS/2 gateway, you must install the DDCS/2 Multi-User Edition 
  1258. for remote clients to use it. The Single-User Version supports only OS/2 
  1259. applications running on the server. 
  1260.  
  1261. Γûá  For remote database access, DB2/2 requires either Communications Manager 
  1262. from Extended Services version 1.0 (or higher), Communications Manager/2 
  1263. version 1.0 (or higher), Network Transport Services/2 version 1.0 (or higher), 
  1264. or LAN Services. 
  1265.  
  1266.  
  1267. ΓòÉΓòÉΓòÉ 3.2. Configuring DB2/2 Data Sources ΓòÉΓòÉΓòÉ
  1268.  
  1269. To configure a DB2/2 data source, do the following: 
  1270.  
  1271.  1. Start the ODBC Administrator by double-clicking the ODBC icon in the the 
  1272.     Windows Control Panel.  A list of data sources appears. 
  1273.  
  1274.  2. If you are configuring a new data source, click Add.  A list of installed 
  1275.     drivers appears.  Select INTERSOLV DB2/2 and click OK. 
  1276.  
  1277.  3. If you are configuring an existing data source, select the data source name 
  1278.     and click Setup. 
  1279.  
  1280.     The setup dialog box appears. 
  1281.  
  1282.  4. Specify values as follows: 
  1283.  
  1284.    Data Source Name: 
  1285.              A string that identifies this DB2/2 data source configuration in 
  1286.              ODBC.INI. Examples include "Accounting" or "DB2/2-Serv1." 
  1287.  
  1288.    Description: 
  1289.              An optional long description of a data source name. For example, 
  1290.              "My Accounting Database" or "DB2/2 on Server #1." 
  1291.  
  1292.    Database Name: 
  1293.              The name of the database to which you want to connect by default. 
  1294.  
  1295.              The following values are optional: 
  1296.  
  1297.    Owner of Catalog Tables: 
  1298.              On most DB2/2 systems, SYSIBM is the owner of the catalog system 
  1299.              tables.  If you have read access to the system tables, you do not 
  1300.              need to change this option. 
  1301.  
  1302.              If you do not have read access, the system administrator must 
  1303.              create a view of the system tables in another account and give you 
  1304.              permission to use that view.  In this case, specify the 
  1305.              Authorization ID for the account that owns the views of the system 
  1306.              tables. 
  1307.  
  1308.              If you are using DDCS/2 to connect to a SQL/400 database, specify 
  1309.              a comma-separated list of the Collection IDs to which you want to 
  1310.              have access in your ODBC application. 
  1311.  
  1312.              If you are using DDCS/2 to connect to a SQL/DS database, specify 
  1313.              SYSTEM as the owner. 
  1314.  
  1315.    Groups: 
  1316.              A value to determine which tables you can access.  Your system 
  1317.              administrator may have placed you in a "group" of users and 
  1318.              granted table access to the entire group.  If this is the case, 
  1319.              specify the names of any groups to which you belong; separate each 
  1320.              name with a comma.  Alternatively, specify the word ALL so that 
  1321.              you see all table names even if you cannot access the table. 
  1322.  
  1323.    Default Authorization ID: 
  1324.              The default Logon ID used to connect to your DB2/2 database.  A 
  1325.              Logon ID is required only if security is enabled on your database. 
  1326.              Your ODBC application may override this value or you may change 
  1327.              this value in the logon dialog box. 
  1328.  
  1329.    Cursor Behavior: 
  1330.              Select Preserve if you want cursors to be held at the current 
  1331.              position when the transaction ends.  Otherwise, leave this set to 
  1332.              Close.  Selecting Preserve may impact the performance of your 
  1333.              database operations.  This setting does not apply to SQL/DS. 
  1334.  
  1335.              When you select Preserve, the driver returns SQL_CB_PRESERVE from 
  1336.              SQLGetInfo (SQL_CURSOR_COMMIT_BEHAVIOR). But only Select 
  1337.              statements and prepared Update or Delete . . . Where Current of 
  1338.              Cursor statements are preserved when the transaction ends. All 
  1339.              other prepared statements are closed and deleted. 
  1340.  
  1341.  5. You must catalog any database you want to access.  To do so, click the 
  1342.     Catalog Db button.  The Catalog Remote Database dialog box appears. 
  1343.  
  1344.     In this dialog box, type an alias name, the name of the database, and the 
  1345.     name of the remote node (like an alias for the remote node where the server 
  1346.     is installed and the protocol used to access it).  Click Add.  The alias 
  1347.     name you added will be listed in the Database Name drop-down list in the 
  1348.     logon dialog box when you exit this dialog box. 
  1349.  
  1350.     This dialog box also lets you uncatalog remote databases.  To do this, 
  1351.     select the alias you want to delete from the Alias Name drop-down list and 
  1352.     click Delete. 
  1353.  
  1354.  6. Click Catalog Node to provide information about the remote site for the 
  1355.     DB2/2 databases. In the Catalog Node dialog box, select a node name (only 
  1356.     names of previously cataloged nodes are available, the name of the server 
  1357.     or number of the adapter (for NetBIOS nodes), the name of the remote node 
  1358.     where the DB2 server is installed, and the type of communication protocol 
  1359.     to use to access the node. Optionally, enter a comment. Click Add. 
  1360.  
  1361.  7. Click Translate to perform a translation of your data from one character 
  1362.     set to another. The Select Translator dialog box appears in which you can 
  1363.     select a translator to peform the translation. INTERSOLV provides a 
  1364.     translator named INTERSOLV OEM ANSI that translates your data from the IBM 
  1365.     PC character set to the ANSI character set. Click OK to leave this dialog 
  1366.     box and perform the translation. 
  1367.  
  1368.     The translators that are listed in this dialog box are determined by the 
  1369.     values listed in the ODBC Translators section of your ODBCINST.INI file. 
  1370.  
  1371.  8. Click OK to write these values to ODBC.INI.  These values are now the 
  1372.     defaults when you connect to the data source.  You can change the defaults 
  1373.     by configuring your data source again.  You can override the defaults by 
  1374.     connecting to the data source using a connection string with alternate 
  1375.     values. 
  1376.  
  1377.  
  1378. ΓòÉΓòÉΓòÉ 3.3. DB2/2 and DDCS/2 Gateway ΓòÉΓòÉΓòÉ
  1379.  
  1380. Access to DB2/2 databases, or other databases via the DDCS/2 gateway, requires 
  1381. that you bind to tables and grant privileges to all users. These processes are 
  1382. described in the following topics. 
  1383.  
  1384. Binding 
  1385.  
  1386. Before you can access a table, you must bind to the database.  You must bind to 
  1387. every database you intend to access.  To do this, enter the following commands 
  1388. on the server: 
  1389.  
  1390. SQLBIND QECSV1.BND database_name
  1391. SQLBIND QERRV1.BND database_name
  1392. SQLBIND QEURV1.BND database_name
  1393. SQLBIND QECSWHV1.BND database_name
  1394. SQLBIND QERRWHV1.BND database_name
  1395. SQLBIND QEURWHV1.BND database_name
  1396.  
  1397. You may need to copy the bind files from the installation directory to the 
  1398. server. 
  1399.  
  1400. database_name is the name of the database you want to access. 
  1401.  
  1402. Note for SQL/DS Users:  For binding to SQL/DS databases , enter only the first 
  1403. three of these commands.  The files QECSWHV1.BND, QERRWHV1.BND, and 
  1404. QEURWHV1.BND will not work with SQL/DS. 
  1405.  
  1406. For SQL/400 Users 
  1407.  
  1408. If you receive the error 
  1409.  
  1410. `QSYS.QE' is an undefined name
  1411.  
  1412. you must create a collection named QE.  To do this, enter the following command 
  1413. on the host AS/400: 
  1414.  
  1415. CREATE COLLECTION QE
  1416.  
  1417. Then issue the SQLBIND commands again. 
  1418.  
  1419. Granting Privileges 
  1420.  
  1421. Users must be granted the necessary privileges before they can access a 
  1422. database or table through a gateway. 
  1423.  
  1424. DB2/2 users are assigned an Authorization ID.  There are three categories of 
  1425. Authorization IDs:  administrator, local administrator, and user.  The third 
  1426. category, user, must be granted the privilege to access DB2/2 tables. 
  1427.  
  1428. To grant the necessary privileges, an administrator must run Query Manager or 
  1429. the DBM Command Line Interface and execute the appropriate GRANT statement. 
  1430.  
  1431. For DB2/2 databases and databases that reside on DDCS/2 connecting to DB2: 
  1432.  
  1433. GRANT EXECUTE, BIND ON PROGRAM QE.QECSV1 TO authorization_list
  1434. GRANT EXECUTE, BIND ON PROGRAM QE.QERRV1 TO authorization_list
  1435. GRANT EXECUTE, BIND ON PROGRAM QE.QEURV1 TO authorization_list
  1436. GRANT EXECUTE, BIND ON PROGRAM QE.QECSWHV1 TO authorization_list
  1437. GRANT EXECUTE, BIND ON PROGRAM QE.QERRWHV1 TO authorization_list
  1438. GRANT EXECUTE, BIND ON PROGRAM QE.QEURWHV1 TO authorization_list
  1439.  
  1440. For databases that reside on the DDCS/2 gateway connecting to SQL/DS: 
  1441.  
  1442. GRANT RUN ON QE.QECSV1 TO authorization_list
  1443. GRANT RUN ON QE.QERRV1 TO authorization_list
  1444. GRANT RUN ON QE.QEURV1 TO authorization_list
  1445. GRANT RUN ON QE.QECSWHV1 TO authorization_list
  1446. GRANT RUN ON QE.QERRWHV1 TO authorization_list
  1447. GRANT RUN ON QE.QEURWHV1 TO authorization_list
  1448.  
  1449. For databases that reside on the DDCS/2 gateway connecting to SQL/400: 
  1450.  
  1451. GRANT RUN ON PROGRAM QE.QECSV1 TO authorization_list
  1452. GRANT RUN ON PROGRAM QE.QERRV1 TO authorization_list
  1453. GRANT RUN ON PROGRAM QE.QEURV1 TO authorization_list
  1454. GRANT RUN ON PROGRAM QE.QECSWHV1 TO authorization_list
  1455. GRANT RUN ON PROGRAM QE.QERRWHV1 TO authorization_list
  1456. GRANT RUN ON PROGRAM QE.QEURWHV1 TO authorization_list
  1457.  
  1458. authorization_list is a list of comma-separated Authorization IDs or Group IDs, 
  1459. or PUBLIC if you want to grant access to all users. 
  1460.  
  1461.  
  1462. ΓòÉΓòÉΓòÉ 3.4. DB2/6000 and DDCS/6000 Gateway ΓòÉΓòÉΓòÉ
  1463.  
  1464. Before you can access a table via DB2/6000 or the DDCS/6000 gateway, you must 
  1465. bind to the database and grant each user access to it.  To do this, enter the 
  1466. following commands on the client computer from the DBM Command Line Interface: 
  1467.  
  1468. BIND QECSV1.BND BLOCKING ALL GRANT authorization_list
  1469. BIND QERRV1.BND BLOCKING ALL GRANT authorization_list
  1470. BIND QEURV1.BND BLOCKING ALL GRANT authorization_list
  1471. BIND QECSWHV1.BND BLOCKING ALL GRANT authorization_list
  1472. BIND QERRWHV1.BND BLOCKING ALL GRANT authorization_list
  1473. BIND QEURWHV1.BND BLOCKING ALL GRANT authorization_list
  1474.  
  1475. authorization_list is a list of comma-separated Authorization IDs or Group IDs, 
  1476. or PUBLIC if you want to grant access to all users. 
  1477.  
  1478. Note for SQL/DS Users:  For binding to SQL/DS databases , enter only the first 
  1479. three of these commands.  The files QECSWHV1.BND, QERRWHV1.BND, and 
  1480. QEURWHV1.BND will not work with SQL/DS. 
  1481.  
  1482. For SQL/400 Users 
  1483.  
  1484. If you receive the error 
  1485.  
  1486. `QSYS.QE' is an undefined name
  1487.  
  1488. you must create a collection named QE.  To do this, enter the following command 
  1489. on the host AS/400: 
  1490.  
  1491. CREATE COLLECTION QE
  1492.  
  1493. Then issue the BIND commands again. 
  1494.  
  1495.  
  1496. ΓòÉΓòÉΓòÉ 3.5. Connecting to DB2/2 Using a Logon Dialog Box ΓòÉΓòÉΓòÉ
  1497.  
  1498. Some ODBC applications display a logon dialog box when you are connecting to a 
  1499. data source.  In these cases, the data source name has already been specified. 
  1500.  
  1501. In the logon dialog box, do the following: 
  1502.  
  1503.  1. Type the name of the remote database or select the name of the remote 
  1504.     database from the Database Name drop-down list. 
  1505.  
  1506.     You must have cataloged any database you want to access from the client. 
  1507.     (See the topic Configuring Data Sources for information on how to do this.) 
  1508.  
  1509.  2. If required, type your user name (authorization ID). 
  1510.  
  1511.  3. If required, type your password. 
  1512.  
  1513.     If you leave your user name and password blank, the ODBC application 
  1514.     assumes you have already logged on using SQLLOGN2 (under DOS) or using User 
  1515.     Profile Management (under OS/2).  If you have not, the application returns 
  1516.     an error. You must either type your user name and password in the dialog 
  1517.     box or log on using SQLLOGN2 and STARTDRQ (under DOS) or using User Profile 
  1518.     Management (under OS/2).  See the IBM Extended Services for OS/2 Guide to 
  1519.     DB2/2 Clients for more information. 
  1520.  
  1521.  4. Click OK to complete the logon and to update the values in ODBC.INI. 
  1522.  
  1523.  
  1524. ΓòÉΓòÉΓòÉ 3.6. Connecting to DB2/2 Using a Connection String ΓòÉΓòÉΓòÉ
  1525.  
  1526. If your application requires a connection string to connect to a data source, 
  1527. you must specify the data source name that tells the driver which ODBC.INI 
  1528. section to use for the default connection information.  Optionally, you may 
  1529. specify attribute=value pairs in the connection string to override the default 
  1530. values stored in ODBC.INI.  These values are not written to ODBC.INI. 
  1531.  
  1532. You can specify either long or short names in the connection string. The 
  1533. connection string has the form: 
  1534.  
  1535. DSN=data_source_name[;attribute=value[;attribute=value]...]
  1536.  
  1537. An example of a connection string for DB2/2 is 
  1538.  
  1539. DSN=DB22 TABLES;DB=PAYROLL;UID=JOHN;PWD=XYZZY;GRP=ACCTNG
  1540.  
  1541. The following list gives the long and short names for each attribute, as well 
  1542. as a description. 
  1543.  
  1544. The defaults listed in the table are initial defaults that apply when no value 
  1545. is specified in either the connection string or in the data source definition 
  1546. in ODBC.INI.  If you specified a value for the attribute when configuring the 
  1547. data source, that value is your default. 
  1548.  
  1549. Attribute 
  1550.           Description 
  1551.  
  1552. DataSourceName (DSN) 
  1553.           Identifies a DB2/2 data source configuration in ODBC.INI.  Examples 
  1554.           include "Accounting" or "DB2/2-Serv1." 
  1555.  
  1556. Database (DB) 
  1557.           Name of the database to which you want to connect. 
  1558.  
  1559. Sysibm (SI) 
  1560.           On most DB2/2 systems, SYSIBM is the owner of the catalog system 
  1561.           tables.  If you have read access to the system tables, you do not 
  1562.           need to change this option. 
  1563.  
  1564.           If  you do not have read access, the database administrator must 
  1565.           create a view of the system tables in another account and give you 
  1566.           permission to use that view.  In this case, specify the Authorization 
  1567.           ID for the account that owns the views of the system tables. If you 
  1568.           are using DDCS/2 to connect to a SQL/400 database, specify a 
  1569.           comma-separated list of the Collection IDs to which you want to have 
  1570.           access in your ODBC application. If you are using DDCS/2 to connect 
  1571.           to a SQL/DS database, specify SYSTEM as the owner. 
  1572.  
  1573. Groups (GRP) 
  1574.           Determines which tables you can access.  Your system administrator 
  1575.           may have placed you in a "group" of users and granted table access to 
  1576.           the entire group. If this is the case, set Groups to the names of any 
  1577.           groups to which you belong; separate each name with a comma. 
  1578.           Alternatively, Groups=ALL lets your application see all table names 
  1579.           even if you cannot access the table. 
  1580.  
  1581. LogonID (UID) 
  1582.           Default logon ID used to connect to your DB2/2 database.  A logon ID 
  1583.           is required only if security is enabled on your database.  If so, 
  1584.           contact your system administrator to get your logon ID. 
  1585.  
  1586. Password (PWD) 
  1587.           Password. 
  1588.  
  1589. CursorBehavior (CB) 
  1590.           CursorBehavior={0 | 1}. Determines whether cursors are preserved or 
  1591.           closed at the end of each transaction.  Valid values are 1 (preserve) 
  1592.           and 0 (close, the initial default).  Set this attribute to 1 if you 
  1593.           want cursors to be held at the current position when the transaction 
  1594.           ends.  Doing so may impact the performance of your database 
  1595.           operations. This attribute is not valid for SQL/DS. 
  1596.  
  1597.           When you select Preserve, the driver returns SQL_CB_PRESERVE from 
  1598.           SQLGetInfo (SQL_CURSOR_COMMIT_BEHAVIOR). But only Select statements 
  1599.           and prepared Update or Delete . . . Where Current of Cursor 
  1600.           statements are preserved when the transaction ends. All other 
  1601.           prepared statements are closed and deleted. 
  1602.  
  1603.  
  1604. ΓòÉΓòÉΓòÉ 3.7. DB2/2 Data Types ΓòÉΓòÉΓòÉ
  1605.  
  1606. The DB2/2 data types map to the standard ODBC data types as follows: 
  1607.  
  1608. DB2/2                  ODBC 
  1609.  
  1610. Char                   SQL_CHAR 
  1611.  
  1612. Char() for Bit Data    SQL_BINARY 
  1613.  
  1614. Date                   SQL_DATE 
  1615.  
  1616. Decimal                SQL_DECIMAL 
  1617.  
  1618. Float                  SQL_DOUBLE 
  1619.  
  1620. Integer                SQL INTEGER 
  1621.  
  1622. Long Varchar (1)       SQL_LONGVARCHAR 
  1623.  
  1624. Long Varchar for Bit Data (1) SQL_LONGVARBINARY 
  1625.  
  1626. Smallint               SQL_SMALLINT 
  1627.  
  1628. Time                   SQL_TIME 
  1629.  
  1630. Timestamp              SQL_TIMESTAMP 
  1631.  
  1632. Varchar (2)            SQL_VARCHAR 
  1633.  
  1634. Varchar (3)            SQL_LONGVARCHAR 
  1635.  
  1636. Varchar() for Bit Data (2) SQL_VARBINARY 
  1637.  
  1638. Varchar() for Bit Data (3) SQL_LONGVARBINARY 
  1639.  
  1640. (1) Not supported for SQL/400 
  1641.  
  1642. (2) For DB2/2, DB2/6000, and SQL/400; SQL/DS and MVS DB2 up to 254 
  1643.  
  1644. (3) For SQL/DS and MVS DB2 over 254 
  1645.  
  1646. Note:   The Graphic, Vargraphic, and Long Vargraphic data types are not 
  1647. supported. 
  1648.  
  1649.  
  1650. ΓòÉΓòÉΓòÉ 3.8. Isolation and Lock Levels Supported by DB2/2 ΓòÉΓòÉΓòÉ
  1651.  
  1652. DB2/2 supports isolation levels 0 (read uncommitted), 1 (read committed), and 2 
  1653. (repeatable read).  It supports record-level locking. 
  1654.  
  1655.  
  1656. ΓòÉΓòÉΓòÉ 3.9. DB2/2 ODBC Conformance Level ΓòÉΓòÉΓòÉ
  1657.  
  1658. The DB2/2 driver supports the Core, Level 1, and Level 2 API functions listed 
  1659. in Supported ODBC Functions.  The driver supports the minimum SQL grammar. 
  1660.  
  1661.  
  1662. ΓòÉΓòÉΓòÉ 3.10. Number of Connections and Statements Supported by DB2/2 ΓòÉΓòÉΓòÉ
  1663.  
  1664. The DB2/2 family of database systems supports a single connection and multiple 
  1665. statements per connection. 
  1666.  
  1667.  
  1668. ΓòÉΓòÉΓòÉ 4. dBASE Driver ΓòÉΓòÉΓòÉ
  1669.  
  1670. The dBASE driver supports 
  1671.  
  1672. Γûá  dBASE III, dBASE IV and dBASE V files 
  1673. Γûá  Clipper files 
  1674. Γûá  FoxPro and FoxBASE tables and indexes 
  1675.  
  1676. Note:  The dBASE driver for OS/2 does not support dBASE II. 
  1677.  
  1678. The dBASE driver executes the SQL statements directly on dBASE-compatible 
  1679. files.  You do not need to own the dBASE product to access these files. 
  1680.  
  1681. The driver filename is IVDBFnn.DLL. 
  1682.  
  1683.  
  1684. ΓòÉΓòÉΓòÉ 4.1. Configuring dBASE Data Sources ΓòÉΓòÉΓòÉ
  1685.  
  1686. To configure a dBASE data source, do the following: 
  1687.  
  1688.  1. Start the ODBC Administrator.  A list of data sources appears. 
  1689.  
  1690.  2. If you are configuring a new data source, click Add.  A list of installed 
  1691.     drivers appears.  Select INTERSOLV dBASEFile and click OK. 
  1692.  
  1693.     If you are configuring an existing data source, select the data source name 
  1694.     and click Setup. 
  1695.  
  1696.     The setup dialog box appears. 
  1697.  
  1698.  3. Specify values as follows: 
  1699.  
  1700.    Data Source Name: 
  1701.              A string that identifies this dBASE data source configuration in 
  1702.              ODBC.INI. Examples include "Accounting" or "dBASE Files." 
  1703.  
  1704.    Description: 
  1705.              An optional long description of a data source name. For example, 
  1706.              "My Accounting Database" or "dBASE files in C:\ACCOUNTS." 
  1707.  
  1708.    Database Directory: 
  1709.              A path specification to the directory that contains the database 
  1710.              files.  If none is specified, the current working directory is 
  1711.              used. 
  1712.  
  1713.              The following values are optional: 
  1714.  
  1715.    Create Type: 
  1716.              The type of table or index to be created on a Create Table or 
  1717.              Create Index statement.  Select dBASE III, dBASE IV, dBASE V, 
  1718.              Clipper, FoxBASE, FoxPro1, or FoxPro25.  The default is dBASE V. 
  1719.  
  1720.    Lock Compatibility: 
  1721.              The locking scheme the driver uses when locking records.  Select 
  1722.              dBASE, Q+E, Q+EVirtual, Clipper, or Fox.  The default is dBASE. 
  1723.              These values determine locking support as follows: 
  1724.  
  1725.              Γûá  dBASE specifies Borland-compatible locking. 
  1726.  
  1727.              Γûá  Q+E specifies that locks be placed on the actual bytes occupied 
  1728.              by the record.  Only applications that use the dBASE driver can 
  1729.              read and write to the database.  Other applications are locked out 
  1730.              of the table completely (they cannot even read other records). 
  1731.              This locking is compatible with earlier versions of Q+E products. 
  1732.  
  1733.              Γûá  Q+EVirtual specifies that locks be placed on bytes beyond the 
  1734.              physical end-of-file.  Q+EVirtual is the same as Q+E except that 
  1735.              other applications can open the table and read the data. The 
  1736.              advantage of using a Q+E locking scheme over dBASE locking is 
  1737.              that, on Inserts and Updates, Q+E locks only individual index 
  1738.              tags, while dBASE locks the entire index. 
  1739.  
  1740.              Γûá  Clipper specifies Clipper-compatible locking. 
  1741.  
  1742.              Γûá  Fox specifies FoxPro- and FoxBASE-compatible locking. 
  1743.  
  1744.              If you are accessing a table with an application that uses the 
  1745.              dBASE driver, your locking scheme does not have to match the 
  1746.              Create Type. However, if you are accessing a table with two 
  1747.              applications, and only one uses the dBASE driver, set your locking 
  1748.              scheme to match the other application.  For example, you do not 
  1749.              have to set this value to Fox to work with a FoxPro table.  But if 
  1750.              you are using a FoxPro application simultaneously with an 
  1751.              application using the dBASE driver on the same set of tables, set 
  1752.              this value to Fox to ensure that your data does not get corrupted. 
  1753.  
  1754.    Locking: 
  1755.              The level of locking for the database file (FILE, RECORD, or 
  1756.              NONE).  FILE locks all of the records in the table.  RECORD (the 
  1757.              default) locks only the records affected by the statement.  NONE 
  1758.              offers the best performance but is intended only for single-user 
  1759.              environments. 
  1760.  
  1761.    File Open Cache: 
  1762.              A numeric value to specify the maximum number of unused file opens 
  1763.              to cache. For example, the value 4 specifies that when a user 
  1764.              opens and closes four tables, the tables are not actually closed. 
  1765.              The driver keeps them open so that if another query uses one of 
  1766.              these tables, the driver does not have to perform another open, 
  1767.              which is expensive.  The advantage of file open caching is 
  1768.              increased performance.  The disadvantage is that a user who 
  1769.              specifies file locking on open may get a locking conflict even 
  1770.              though no one appears to have the file open.  The default is 0, 
  1771.              which means no file open caching. 
  1772.  
  1773.    Cache Size: 
  1774.              The number of 64K blocks the driver uses to cache database 
  1775.              records.  The higher the number, the better the performance.  The 
  1776.              maximum number of blocks you can set depends on the system memory 
  1777.              available.  If the cache size is greater than 0, when browsing 
  1778.              backwards, you will not be able to see updates made by other users 
  1779.              until you reexecute the Select statement. The default is 4. 
  1780.  
  1781.    International Sort: 
  1782.              A setting to indicate the order in which records are retrieved 
  1783.              when you issue a Select statement with an Order By clause.  Select 
  1784.              this check box to use the international sort order as defined by 
  1785.              your operating system.  International sort order is 
  1786.              case-insensitive (a precedes B); the sorting of accented 
  1787.              characters is also affected (see your operating system 
  1788.              documentation).  Leave this box blank to use the ASCII sort order. 
  1789.              ASCII sort order is case-sensitive, where uppercase letters 
  1790.              precede lowercase letters (B precedes a). 
  1791.  
  1792.    Use Long Names: 
  1793.              A setting that enables the driver to use long filenames as table 
  1794.              names. If you select this check box, the maximum table name length 
  1795.              is 128 characters. 
  1796.  
  1797.    Use Long Qualifiers: 
  1798.              A setting that enables the driver to use long pathnames as table 
  1799.              qualifiers. When you set this check box, pathnames can be up to 
  1800.              249 characters. The default length for pathnames is 128 
  1801.              characters. 
  1802.  
  1803.  4. Click Define to define the index attributes for your data files. See 
  1804.     Defining Index Attributes for step-by-step instructions. 
  1805.  
  1806.  5. Click Translate to perform a translation of your data from one character 
  1807.     set to another. The Select Translator dialog box appears in which you can 
  1808.     select a translator to peform the translation. INTERSOLV provides a 
  1809.     translator named INTERSOLV OEM ANSI that translates your data from the IBM 
  1810.     PC character set to the ANSI character set. Click OK to leave this dialog 
  1811.     box and perform the translation. 
  1812.  
  1813.     The translators that are listed in this dialog box are determined by the 
  1814.     values listed in the ODBC Translators section of your ODBCINST.INI file. 
  1815.  
  1816.  6. Click OK to write these values to ODBC.INI.  These values are now the 
  1817.     defaults when you connect to the data source.  You can change the defaults 
  1818.     by configuring your data source again.  You can override the defaults by 
  1819.     connecting to the data source using a connection string with alternate 
  1820.     values. 
  1821.  
  1822.  
  1823. ΓòÉΓòÉΓòÉ 4.2. Defining Index Attributes for dBASE ΓòÉΓòÉΓòÉ
  1824.  
  1825. Since dBASE lets you create index files that have different names than their 
  1826. corresponding data files, you must tell the driver what index files are 
  1827. associated with the dBASE file.  The driver updates the indexes for you, which 
  1828. ensures that they match the records in the dBASE file.  The driver also makes 
  1829. indexes available for optimizing queries.  It is not necessary to mark 
  1830. production .MDX files or structured .CDX files as maintained, as the driver 
  1831. maintains them for you.  However, you may wish to use this method to mark a tag 
  1832. as unique. 
  1833.  
  1834. To define the index files that are associated with a dBASE file, take the 
  1835. following steps: 
  1836.  
  1837.  1. Click Define in the dBASE setup dialog box, which you can access through 
  1838.     the ODBC Administrator.  The Define File dialog box appears. 
  1839.  
  1840.  2. Select a dBASE file and click OK to define the special indexes using the 
  1841.     Define Table dialog box. 
  1842.  
  1843.  3. The upper section of the dialog box displays the directory name and 
  1844.     filename that contains the data file.  Under Windows, if this file is 
  1845.     stored in the IBM PC character set, select the OEM to ANSI Translation box. 
  1846.  
  1847.  4. The lower section of the dialog box displays the index information for the 
  1848.     data file.  The Index File drop-down list lets you select any index file in 
  1849.     the database directory.  If the index file is in a different directory, you 
  1850.     must provide the full pathname. 
  1851.  
  1852.    Select the Maintain check box to associate this index file with your dBASE 
  1853.    file. 
  1854.  
  1855.    To specify that an index file is unique, select the Unique check box that 
  1856.    appears at the right of the index filename. 
  1857.  
  1858.  5. If the selected index has an .MDX or .CDX extension, you cannot mark the 
  1859.     index file as unique.  Instead, you may mark the tags within the index as 
  1860.     unique.  To do so, select the tag name in the Tag drop-down list and select 
  1861.     the Unique check box that appears at the right of the tag name. 
  1862.  
  1863.  6. Click OK to save this information, or press Cancel. 
  1864.  
  1865.  
  1866. ΓòÉΓòÉΓòÉ 4.3. Connecting to dBASE Using a Connection String ΓòÉΓòÉΓòÉ
  1867.  
  1868. If your application requires a connection string to connect to a data source, 
  1869. you must specify the data source name that tells the driver which ODBC.INI 
  1870. section to use for the default connection information.  Optionally, you may 
  1871. specify attribute=value pairs in the connection string to override the default 
  1872. values stored in ODBC.INI.  These values are not written to the ODBC.INI file. 
  1873.  
  1874. You can specify either long or short names in the connection string. The 
  1875. connection string has the form: 
  1876.  
  1877. DSN=data_source_name[;attribute=value[;attribute=value]...]
  1878.  
  1879. An example of a connection string for dBASE is 
  1880.  
  1881. DSN=DBASE FILES;LCK=NONE;IS=0
  1882.  
  1883. The following table gives the long and short names for each attribute, as well 
  1884. as a description. 
  1885.  
  1886. The defaults listed in the table are initial defaults that apply when no value 
  1887. is specified in either the connection string or in the data source definition 
  1888. in ODBC.INI.  If you specified a value for the attribute when configuring the 
  1889. data source, that value is your default. 
  1890.  
  1891. Attribute 
  1892.           Description 
  1893.  
  1894. DataSourceName (DSN) 
  1895.           String that identifies a dBASE data source configuration in ODBC.INI. 
  1896.           Examples include "Accounting" or "dBASE Files." 
  1897.  
  1898. Database (DB) 
  1899.           Directory in which the dBASE files are stored. 
  1900.  
  1901. CreateType (CT) 
  1902.           CreateType={dBASE3 | dBASE4 | dBASE5 | Clipper | FoxBASE | FoxPro1 | 
  1903.           FoxPro25}.Type of table or index to be created on a Create Table or 
  1904.           Create Index statement.  Options are dBASE2, dBASE3, dBASE4, dBASE5 
  1905.           (the initial default), Clipper, FoxBASE, FoxPro1, and FoxPro25. 
  1906.  
  1907. LockCompatibility (LCOMP) 
  1908.           LockCompatibility= {Q+E | Q+EVirtual | dBASE | Clipper | Fox}.Locking 
  1909.           schemes to be used in your dBASE tables.  Options are Q+E, 
  1910.           Q+EVirtual, dBASE, Clipper, and Fox. 
  1911.  
  1912.           Γûá  LockCompatibility=Q+E specifies that locks be placed on the actual 
  1913.           bytes occupied by the record.  Only applications that use the dBASE 
  1914.           driver can read and write to the database.  Other applications are 
  1915.           locked out of the table completely (they cannot even read other 
  1916.           records).  This locking is compatible with earlier versions of Q+E 
  1917.           products. 
  1918.  
  1919.           Γûá  LockCompatibility=Q+EVirtual specifies that locks be placed on 
  1920.           bytes beyond the physical end-of-file.  Q+EVirtual is the same as Q+E 
  1921.           except that other applications can open the table and read the data. 
  1922.  
  1923.           The advantage of using a Q+E locking scheme over dBASE locking is 
  1924.           that, on Inserts and Updates, Q+E locks only individual index tags, 
  1925.           while dBASE locks the entire index. 
  1926.  
  1927.           Γûá  LockCompatibility=dBASE specifies Borland-compatible locking. 
  1928.           This is the initial default. 
  1929.  
  1930.           Γûá  LockCompatibility=Clipper specifies Clipper-compatible locking. 
  1931.  
  1932.           Γûá  LockCompatibility=Fox specifies FoxPro- and FoxBASE-compatible 
  1933.           locking. 
  1934.  
  1935.           If you are accessing a table with an application that uses the dBASE 
  1936.           driver, your locking scheme does not have to match the Create Type. 
  1937.           However, if you are accessing a table with two applications, and only 
  1938.           one uses the dBASE driver, set your locking scheme to match the other 
  1939.           application.  For example, you don't have to set LCOMP=Fox to work 
  1940.           with a FoxPro table.  But if you are using a FoxPro application 
  1941.           simultaneously with an application using the dBASE driver on the same 
  1942.           set of tables, set LCOMP=Fox to ensure that your data does not get 
  1943.           corrupted. 
  1944.  
  1945. Locking (LCK) 
  1946.           Locking={NONE | RECORD | FILE}. Level of locking for the database 
  1947.           tables. Options are NONE, RECORD, and FILE. 
  1948.  
  1949.           Locking=NONE offers the best performance but is intended only for 
  1950.           single-user environments. 
  1951.  
  1952.           Locking=RECORD locks only the records affected by the statement. This 
  1953.           is the initial default. 
  1954.  
  1955.           Locking=FILE locks all of the records in the table.FileOpenCache 
  1956.           (FOC)The maximum number of unused file opens to cache.  For example, 
  1957.           when FileOpenCache=4, and a user opens and closes four files, the 
  1958.           files are not actually closed.  The driver keeps them open so that if 
  1959.           another query uses one of these files, the driver does not have to 
  1960.           perform another open, which is expensive.  The advantage of using 
  1961.           file open caching is increased performance. The disadvantage is that 
  1962.           a user who tries to open the file exclusively may get a locking 
  1963.           conflict even though no one appears to have the file open.  The 
  1964.           initial default is 0. 
  1965.  
  1966. CacheSize (CSZ) 
  1967.           Number of 64K blocks the driver uses to cache database records.  The 
  1968.           higher the number, the better the performance.  The maximum number of 
  1969.           blocks you can set depends on the system memory available.  If the 
  1970.           cache size is greater than 0, when browsing backwards, you will not 
  1971.           be able to see updates made by other users until you reexecute the 
  1972.           Select statement. The default is 4. 
  1973.  
  1974. IntlSort (IS) 
  1975.           IntlSort={0 | 1}. Number that specifies the order that records are 
  1976.           retrieved when you issue a Select statement with an Order By clause. 
  1977.           If IntlSort=1, the driver uses the international sort order as 
  1978.           defined by your operating system. The sort is case-insensitive (a 
  1979.           precedes B); the sorting of accented characters is also affected (see 
  1980.           your operating system documentation).  If IntlSort=0 (the initial 
  1981.           default), the driver uses the ASCII sort order, where uppercase 
  1982.           letters precede lowercase letters (B precedes a). 
  1983.  
  1984. ModifySQL (MS) 
  1985.           ModifySQL={0 | 1}. Provided for backward compatibility with earlier 
  1986.           versions of Q+E products.  It determines whether the driver modifies 
  1987.           SQL statements to conform to ODBC specifications or passes the SQL 
  1988.           statement directly to dBASE. Specify ModifySQL=1 to have the driver 
  1989.           modify the SQL statement to conform to ODBC specifications.  Specify 
  1990.           ModifySQL=0 to have the driver understand SQL dialects found in 
  1991.           earlier drivers. The default is 1. 
  1992.  
  1993. Compatibility (COMP) 
  1994.           Compatibility={0 | 1}. Provided for backward compatibility with 
  1995.           earlier versions of Q+E products.  Use Compatibility=DBASE for 
  1996.           backward compatibility; use Compatibility=ANSI for portability.  The 
  1997.           default is ANSI. 
  1998.  
  1999. UltraSafeCommit (USF) 
  2000.           UltraSafeCommit={0 | 1}. Specifies when the driver flushes the file 
  2001.           cache. If UltraSafeCommit=1, the driver updates directory entries 
  2002.           after each Commit. This decreases performance.  If UltraSafeCommit=0 
  2003.           (the default) the driver updates the directory entry when the file is 
  2004.           closed.  In this case, a machine "crash" before closing the file 
  2005.           causes newly inserted records to be lost. 
  2006.  
  2007. UseLongNames (ULN): 
  2008.           UseLongNames={0 | 1}. Enables the driver to use long filenames as 
  2009.           table names. The default is 0, do not use long filenames. When 
  2010.           UseLongNames=1, the driver uses long filenames, and the maximum table 
  2011.           name length is 128 characters. 
  2012.  
  2013. UseLongQualifiers (ULQ): 
  2014.           UseLongQualifiers={0 | 1}. Enables the driver to use long pathnames 
  2015.           as table qualifiers. The default is 0, do not use long pathnames. The 
  2016.           default length for pathnames is 128 characters. When 
  2017.           UseLongQualifiers=1, pathnames can be up to 249 characters. 
  2018.  
  2019.  
  2020. ΓòÉΓòÉΓòÉ 4.4. dBASE Data Types ΓòÉΓòÉΓòÉ
  2021.  
  2022. The following table shows how dBASE data types map to the standard ODBC data 
  2023. types.  These dBASE data types can be used in a Create Table statement. 
  2024.  
  2025. Note:   A few products can create dBASE files with numbers that do not conform 
  2026. to the precision and scale of the Number column.  For example, these products 
  2027. can store 100000 in a column declared as NUMBER(5,2).  When this occurs, the 
  2028. dBASE driver displays error 1244, "Unsupported decimal format."  To remedy this 
  2029. situation, multiply the nonconforming column by 1, which converts it to the 
  2030. Float data type. For example, 
  2031.  
  2032. SELECT BADCOL * 1 FROM BADFILE
  2033.  
  2034. BADCOL * 1 is evaluated as an expression and is returned as a float value. 
  2035.  
  2036. dBASE          ODBC 
  2037. Binary (1)     SQL_LONGVARBINARY 
  2038. Char (2)       SQL_CHAR 
  2039. Date (3)       SQL_DATE 
  2040. Float (4)      SQL_DECIMAL 
  2041. General (5)    SQL_LONGVARBINARY 
  2042. Logical        SQL_BIT 
  2043. Memo (3)       SQL_LONGVARCHAR 
  2044. Numeric        SQL_DECIMAL 
  2045. Picture (6)    SQL_LONGVARBINARY 
  2046.  
  2047.  1. dBASE V only 
  2048.  
  2049.  2. 254 characters maximum (1024 for Clipper) 
  2050.  
  2051.  3. dBASE III, IV, FoxPro, FoxBASE, and Clipper 
  2052.  
  2053.  4. dBASE IV only 
  2054.  
  2055.  5. FoxPro 2.5 and dBASE V only 
  2056.  
  2057.  6. FoxPro, FoxBASE, and Clipper 
  2058. h2 res=26100.Column Names 
  2059.  
  2060. The maximum length of a column name is 10 characters.  A column name can 
  2061. contain alphanumeric characters and the hyphen character (-). The first 
  2062. character must be a letter (a through z). 
  2063.  
  2064.  
  2065. ΓòÉΓòÉΓòÉ 4.5. Select Statement for dBASE ΓòÉΓòÉΓòÉ
  2066.  
  2067. You use a SQL Select statement to specify the columns and records to be read. 
  2068. dBASE Select statements support all of the Select statement clauses.  This 
  2069. topic describes the information that is specific to dBASE, which is ROWID. 
  2070.  
  2071. ROWID Pseudo-Column 
  2072.  
  2073. Each dBASE record contains a special column named ROWID.  This field contains a 
  2074. unique number that indicates the record's sequence in the database.  For 
  2075. example, a table that contains 50 records has ROWID values from 1 to 50 (if no 
  2076. records are marked deleted).  You can use ROWID in Where and Select clauses. 
  2077.  
  2078. ROWID is particularly useful when you are updating records.  You can retrieve 
  2079. the ROWID of the records in the database along with the other field values. 
  2080. For example, 
  2081.  
  2082. SELECT last_name, first_name, salary, rowid FROM emp
  2083.  
  2084. Then you can use the ROWID of the record that you want to update to ensure that 
  2085. you are updating the correct record and no other.  For example, 
  2086.  
  2087. UPDATE emp set salary = 40000 FROM emp WHERE rowid=21
  2088.  
  2089. The fastest way of updating a single row is to use a Where clause with the 
  2090. ROWID.  You cannot update the ROWID column. 
  2091.  
  2092.  
  2093. ΓòÉΓòÉΓòÉ 4.6. Create Index Statement for dBASE ΓòÉΓòÉΓòÉ
  2094.  
  2095. The type of index you create is determined by the value of the CreateType 
  2096. attribute, which you set in the setup dialog box or as a connection string 
  2097. option.  The index can be 
  2098.  
  2099. Γûá  dBASE II or III (.NDX) 
  2100. Γûá  dBASE IV (.MDX) 
  2101. Γûá  Clipper (.NTX) 
  2102. Γûá  FoxBASE (.IDX) 
  2103. Γûá  FoxPro (.CDX) 
  2104.  
  2105. The syntax for creating an index is 
  2106.  
  2107. CREATE [UNIQUE] INDEX index_name ON base_table_name (field_name [ASC
  2108. | DESC] [,field_name [ASC | DESC]] ...)
  2109.  
  2110. index_name is the name of the index file.  For FoxPro 2.5 and dBASE IV, this is 
  2111. a tag, which is required to identify the indexes in an index file.  Each index 
  2112. for a table must have a unique name. 
  2113.  
  2114. UNIQUE means that the driver creates an ANSI-style unique index over the column 
  2115. and ensures uniqueness of the keys.  Use of unique indexes improves 
  2116. performance.  ANSI-style unique indexes are different from dBASE-style unique 
  2117. indexes.  With ANSI-style unique indexes, you receive an error message when you 
  2118. try to insert a duplicate value into an indexed field.  With dBASE-style unique 
  2119. indexes, you do not see an error message when you insert a duplicate value into 
  2120. an indexed field.  This is because only one key is inserted in the index file. 
  2121.  
  2122. base_table_name is the name of the database file whose index is to be created. 
  2123. The .DBF extension is not required, the driver automatically adds it if it is 
  2124. not present.  By default, dBASE IV index files are named base_table_name.MDX 
  2125. and FoxPro 2.5 indexes are named base_table_name.CDX. 
  2126.  
  2127. field_name is a name of a column in the dBASE table.  You can substitute a 
  2128. valid dBASE-style index expression for the list of field names. 
  2129.  
  2130. ASC tells dBASE to create the index in ascending order.  DESC tells dBASE to 
  2131. create the index in descending order.  By default, indexes are created in 
  2132. ascending order.  You cannot specify both ASC and DESC orders within a single 
  2133. Create Index statement.  For example, the following statement is invalid: 
  2134.  
  2135. CREATE INDEX emp_i ON emp (last_name ASC, emp_id DESC)
  2136.  
  2137. The following table shows the attributes of the different index files supported 
  2138. by the dBASE driver.  For each type supported, it provides the following 
  2139. details: 
  2140.  
  2141. Γûá  Whether dBASE-style unique indexes are supported 
  2142. Γûá  Whether descending order is supported 
  2143. Γûá  The maximum size supported for key columns 
  2144. Γûá  The maximum size supported for the column specification in the Create Index 
  2145. statement 
  2146. Γûá  Whether production/structural indexes are supported 
  2147.  
  2148. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  2149. ΓöéCreate         dBASE      DESC     Max Size of  Max Size of  Production/    Γöé
  2150. ΓöéType/Ext.      UNIQUE              Key Column   Column Spec. Structural     Γöé
  2151. Γöé                                                             Indexes        Γöé
  2152. Γöé                                                                            Γöé
  2153. ΓöédBASE II       No         No       100          99           No             Γöé
  2154. Γöé.NDX                                                                        Γöé
  2155. Γöé                                                                            Γöé
  2156. ΓöédBASE III      Yes        No       100          219          No             Γöé
  2157. Γöé.NDX                                                                        Γöé
  2158. Γöé                                                                            Γöé
  2159. ΓöéClipper        Yes        Yes      250          255          No             Γöé
  2160. Γöé.NTX                                                                        Γöé
  2161. Γöé                                                                            Γöé
  2162. ΓöéFoxBASE        Yes        No       100          219          No             Γöé
  2163. Γöé.IDX*                                                                       Γöé
  2164. Γöé                                                                            Γöé
  2165. ΓöédBASE IV and V Yes        Yes      100          220          Yes            Γöé
  2166. Γöé.MDX                                                                        Γöé
  2167. Γöé                                                                            Γöé
  2168. ΓöéFoxPro         Yes        Yes      240          255          No             Γöé
  2169. Γöé2.5 .IDX**                                                                  Γöé
  2170. Γöé                                                                            Γöé
  2171. ΓöéFoxPro         Yes        Yes      240          255          Yes            Γöé
  2172. Γöé2.5 .CDX                                                                    Γöé
  2173. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  2174.  
  2175. *These IDX indexes are also created as the default for FoxPro 1.0. 
  2176.  
  2177. **Compact IDX indexes have the same internal structure as a tag in a CDX file. 
  2178. These indexes can be created if the IDX extension is included with the index 
  2179. name in the Create Index statement. 
  2180.  
  2181.  
  2182. ΓòÉΓòÉΓòÉ 4.7. Drop Index Statement for dBASE ΓòÉΓòÉΓòÉ
  2183.  
  2184. The syntax for dropping a dBASE index is as follows: 
  2185.  
  2186. DROP INDEX table_name.index_name
  2187.  
  2188. table_name is the name of the dBASE file without the extension. 
  2189.  
  2190. For FoxPro 2.5 and dBASE IV, index_name is the tag.  Otherwise, index_name is 
  2191. the name of the index file without the extension. 
  2192.  
  2193. To drop the index EMPHIRE.NDX, issue the following statement: 
  2194.  
  2195. DROP INDEX emp.emphire
  2196.  
  2197.  
  2198. ΓòÉΓòÉΓòÉ 4.8. Pack Statement for dBASE ΓòÉΓòÉΓòÉ
  2199.  
  2200. When records are deleted from a dBASE file, they are not removed from the file. 
  2201. Instead, they are marked as having been deleted.  Also, when memo fields are 
  2202. updated, space may be wasted in the files.  To remove the deleted records and 
  2203. free the unused space from updated memo fields, you must use the Pack 
  2204. statement.  It has the following form: 
  2205.  
  2206. PACK filename
  2207.  
  2208. filename is the name of the dBASE file to be packed.  The .DBF extension is not 
  2209. required; the driver automatically adds the extension if it is not present. 
  2210. For example, 
  2211.  
  2212. PACK emp
  2213.  
  2214. You cannot pack a file that is opened by another user, and you cannot use the 
  2215. Pack statement in manual commit mode. 
  2216.  
  2217. For the specified file, the Pack statement does the following: 
  2218.  
  2219. Γûá  Removes all deleted records from the file 
  2220.  
  2221. Γûá  Removes the entries for all deleted records from .CDX and .MDX files having 
  2222. the same name as the file 
  2223.  
  2224. Γûá  Compresses unused space in the memo (.DBT or .FPT) file 
  2225.  
  2226.  
  2227. ΓòÉΓòÉΓòÉ 4.9. dBASE Locking ΓòÉΓòÉΓòÉ
  2228.  
  2229. With the dBASE driver, you can build and run applications that share dBASE 
  2230. database files on a network.  Whenever more than one user is running an 
  2231. application that accesses a shared database file, the applications should lock 
  2232. the records that are being changed.  Locking a record prevents other users from 
  2233. locking, updating, or deleting the record. 
  2234.  
  2235. Levels of Database Locking 
  2236.  
  2237. The dBASE driver supports three levels of database locking:  NONE , RECORD, and 
  2238. FILE.  You can set these levels in 
  2239.  
  2240. Γûá  The connection string (LCK=) 
  2241. Γûá  The setup dialog box 
  2242.  
  2243. No locking offers the best performance but is intended only for single-user 
  2244. environments. 
  2245.  
  2246. With record or file locking, the system locks the database tables during 
  2247. Insert, Update, Delete, or Select...For Update statements. The locks are 
  2248. released when the user commits the transaction.  The locks prevent other users 
  2249. from modifying the locked objects, but they do not lock out readers. 
  2250.  
  2251. With record locking, only records affected by the statement are locked. Record 
  2252. locking provides better concurrency with other users who also want to modify 
  2253. the table. 
  2254.  
  2255. With file locking, all the records in the table are locked.  File locking has 
  2256. lower overhead and may work better if records are modified infrequently, if 
  2257. records are modified primarily by one user, or if a large number of records are 
  2258. modified. 
  2259.  
  2260. Using Locks on Local Files 
  2261.  
  2262. If you use database locking and are accessing files locally (not on a network), 
  2263. run the DOS utility SHARE.EXE before running Windows.  If you add SHARE.EXE to 
  2264. your AUTOEXEC.BAT file, it runs automatically each time you boot your computer. 
  2265.  
  2266. Limit on Number of Locks 
  2267.  
  2268. There is a limit on the number of locks that can be placed on a file.  If you 
  2269. are accessing a dBASE file from a server, the limit depends on the server (see 
  2270. your server documentation).  If you are accessing a dBASE file locally, the 
  2271. limit depends on the buffer space allocated when SHARE.EXE was loaded (see your 
  2272. DOS documentation).  If you are exceeding the number of locks available, you 
  2273. may want to switch to file locking. 
  2274.  
  2275. How Transactions Affect Record Locks 
  2276.  
  2277. When an Update or Delete statement is executed, the driver locks the records 
  2278. affected by that statement.  The locks are released after the driver commits 
  2279. the changes.  Under manual commit mode, the locks are held until the 
  2280. application commits the transaction.  Under autocommit mode, the locks are held 
  2281. until the statement is executed. 
  2282.  
  2283. When a Select...For Update statement is executed, the driver locks a record 
  2284. only when the record is fetched.  If the record is updated, the driver holds 
  2285. the lock until the changes are committed. Otherwise, the lock is released when 
  2286. the next record is fetched. 
  2287.  
  2288.  
  2289. ΓòÉΓòÉΓòÉ 4.10. Isolation and Lock Levels Supported by dBASE ΓòÉΓòÉΓòÉ
  2290.  
  2291. dBASE supports isolation level 1.  It supports both file- and record-level 
  2292. locking. 
  2293.  
  2294.  
  2295. ΓòÉΓòÉΓòÉ 4.11. dBASE ODBC Conformance Level ΓòÉΓòÉΓòÉ
  2296.  
  2297. The dBASE driver supports the Core, Level 1, and Level 2 API functions listed 
  2298. in Supported ODBC Functions.  The dBASE driver also supports backward and 
  2299. random fetching in SQLExtendedFetch. 
  2300.  
  2301. The driver supports the minimum SQL grammar. 
  2302.  
  2303.  
  2304. ΓòÉΓòÉΓòÉ 4.12. Number of Connections and Statements Supported by dBASE ΓòÉΓòÉΓòÉ
  2305.  
  2306. dBASE supports multiple connections and multiple statements per connection. 
  2307.  
  2308.  
  2309. ΓòÉΓòÉΓòÉ 5. INFORMIX 5 Driver ΓòÉΓòÉΓòÉ
  2310.  
  2311. The INFORMIX 5 driver supports multiple connections to the INFORMIX 5 database. 
  2312.  
  2313. The driver filename is IVINF5nn.DLL. 
  2314.  
  2315.  
  2316. ΓòÉΓòÉΓòÉ 5.1. INFORMIX 5 System Requirements ΓòÉΓòÉΓòÉ
  2317.  
  2318. You need the following software: 
  2319.  
  2320. Γûá  INFORMIX-ESQL/C for OS/2 Version 5.01.SC1B1 or higher 
  2321.  
  2322. Γûá  INFORMIX-INET for OS/2 Version 5.01.SC1B1 or higher (if you are running on a 
  2323. client/server environment). 
  2324.  
  2325. Γûá  INFORMIX-SE Version 5.0x, 6.0 or INFORMIX-OnLine Version 5.0x, 6.0 
  2326.  
  2327. ISQLI501.DLL along with other required DLLs must be in directories listed in 
  2328. the LIBPATH specification in your CONFIG.SYS file. 
  2329.  
  2330. The environment variable INFORMIXDIR must be set to the directory where you 
  2331. have installed the INFORMIX client. For example: 
  2332.  
  2333. SET INFORMIXDIR=C:\INFORMIX
  2334.  
  2335. This line can be added to your CONFIG.SYS file. 
  2336.  
  2337.  
  2338. ΓòÉΓòÉΓòÉ 5.2. Configuring INFORMIX Data Sources ΓòÉΓòÉΓòÉ
  2339.  
  2340. To configure an INFORMIX 5 data source, do the following: 
  2341.  
  2342.  1. Start the ODBC Administrator.  A list of data sources appears. 
  2343.  
  2344.  2. If you are configuring a new data source, click Add.  A list of installed 
  2345.     drivers appears.  Select INTERSOLV INFORMIX5 and click OK. 
  2346.  
  2347.  3. If you are configuring an existing data source, select the data source name 
  2348.     and click Setup. 
  2349.  
  2350.  4. The setup dialog box appears. 
  2351.  
  2352.  5. Specify values as follows: 
  2353.  
  2354.    Data Source Name: 
  2355.              A string that identifies this INFORMIX data source configuration 
  2356.              in ODBC.INI.  Examples include "Accounting" or "INFORMIX-Serv1." 
  2357.  
  2358.    Description: 
  2359.              An optional long description of a data source name. For example, 
  2360.              "My Accounting Database" or "INFORMIX 5 files on Server number 1." 
  2361.  
  2362.    Database Name: 
  2363.              The name of the database to which you want to connect by default. 
  2364.  
  2365.              The following values are optional: 
  2366.  
  2367.    Database List: 
  2368.              The list of databases that will be displayed in the logon dialog 
  2369.              box. If Get DB List From Informix is set to 1, the l ist of 
  2370.              databases that will be displayed in the logon dialog box is 
  2371.              created from the database list returned for INFORMIX at logon 
  2372.              time. When you specify databases, separate the names with commas. 
  2373.  
  2374.    Default User Name: 
  2375.              The name of the user as specified on the INFORMIX 5 server. 
  2376.  
  2377.    Host Name: 
  2378.              The name of the machine on which the INFORMIX 5 server resides. 
  2379.  
  2380.    Service Name: 
  2381.              The name of the service as it appears on the host machine.  This 
  2382.              service is assigned by the system administrator.  The name you 
  2383.              specify is displayed in the INFORMIX Server Options dialog box. 
  2384.  
  2385.    Protocol Type: 
  2386.              The protocol used to communicate with the server. Specify one or 
  2387.              more values; separate the names with commas.  Values can be FTP, 
  2388.              IPX, LANMAN, TCP-IP. This list is displayed in the Logon Options 
  2389.              dialog box. 
  2390.  
  2391.    Yield Proc: 
  2392.               (This attribute is not available in OS/2.) A numeric value that 
  2393.              determines whether you can work in other applications when 
  2394.              INFORMIX 5 is busy. 
  2395.  
  2396.    Cursor Behavior: 
  2397.              Select Preserve if you want cursors to be held at the current 
  2398.              position when the transaction ends.  Otherwise, leave this set to 
  2399.              Close.  Selecting Preserve may impact the performance of your 
  2400.              database operations. 
  2401.  
  2402.    Enable Scrollable Cursors: 
  2403.              A value that determines whether the driver can use scrollable 
  2404.              cursors. The initial default value is 0 (no use of scrollable 
  2405.              cursors). The INFORMIX driver can use scollable cursors only if 
  2406.              there are no long columns (SQL_LONGVARCHAR or SQL_LONGVARBINARY) 
  2407.              in a Select list. If you set this option to use scrollable cursors 
  2408.              (EnableScrollableCursors=1), you must not include long columns in 
  2409.              the Select list. 
  2410.  
  2411.    Get DB List from Informix: 
  2412.              A value that determines whether the driver requests the database 
  2413.              list to be returned from the INFORMIX server or from the database 
  2414.              list that the user entered at driver setup. 
  2415.  
  2416.              When set to 1, the default, the driver requests the database list 
  2417.              from the INFORMIX server. When set to 0, it uses the list entered 
  2418.              by the user at driver setup. 
  2419.  
  2420.  6. Click Translate to perform a translation of your data from one character 
  2421.     set to another. The Select Translator dialog box appears in which you can 
  2422.     select a translator to peform the translation. INTERSOLV provides a 
  2423.     translator named INTERSOLV OEM ANSI that translates your data from the IBM 
  2424.     PC character set to the ANSI character set. Click OK to leave this dialog 
  2425.     box and perform the translation. 
  2426.  
  2427.  7. Click OK to write these values to ODBC.INI.  These values are now the 
  2428.     defaults when you connect to the data source.  You can change the defaults 
  2429.     by configuring your data source again.  You can override the defaults by 
  2430.     connecting to the data source using a connection string with alternate 
  2431.     values. 
  2432.  
  2433.  
  2434. ΓòÉΓòÉΓòÉ 5.3. Connecting to INFORMIX Using a Logon Dialog Box ΓòÉΓòÉΓòÉ
  2435.  
  2436. Some ODBC applications display a logon dialog box when you are connecting to a 
  2437. data source.  In these cases, the data source name has already been specified. 
  2438.  
  2439. In the logon dialog box, do the following: 
  2440.  
  2441.  1. Type the name of the database you want to access or select the name from 
  2442.     the Database Name drop-down list. This list displays names returned from 
  2443.     the INFORMIX server. Or, if you set the Get DB List from Informix option to 
  2444.     0 in the Setup dialog box, this list displays the names you specified. 
  2445.  
  2446.  2. Type the name of the server (host name) on which INFORMIX 5 resides. 
  2447.  
  2448.  3. If required, type your user name as specified on the INFORMIX 5 server. 
  2449.  
  2450.  4. If required, type your password. 
  2451.  
  2452.  5. Optionally, click Options to display the INFORMIX Server Options dialog 
  2453.     box. This dialog box enables you to change the Service Name and Protocol 
  2454.     Type that you specified in the setup dialog box.  Click OK to accept any 
  2455.     changes you make. 
  2456.  
  2457.  6. Click OK to complete the logon and to update these values in ODBC.INI. 
  2458.  
  2459.  
  2460. ΓòÉΓòÉΓòÉ 5.4. Connecting to INFORMIX Using a Connection String ΓòÉΓòÉΓòÉ
  2461.  
  2462. If your application requires a connection string to connect to a data source, 
  2463. you must specify the data source name that tells the driver which ODBC.INI 
  2464. section to use for the default connection information. Optionally, you may 
  2465. specify attribute=value pairs in the connection string to override the default 
  2466. values stored in ODBC.INI.  These values are not written to ODBC.INI. 
  2467.  
  2468. You can specify either long or short names in the connection string. The 
  2469. connection string has the form: 
  2470.  
  2471. DSN=data_source_name[;attribute=value[;attribute=value]...] 
  2472.  
  2473. An example of a connection string for INFORMIX 5 is 
  2474.  
  2475. DSN=INFORMIX TABLES;DB=PAYROLL
  2476.  
  2477. The following table gives the long and short names for each attribute, as well 
  2478. as a description. 
  2479.  
  2480. The defaults listed in the table are initial defaults that apply when no value 
  2481. is specified in either the connection string or in the data source definition 
  2482. in ODBC.INI.  If you specified a value for the attribute when configuring the 
  2483. data source, that value is your default. 
  2484.  
  2485. Attribute 
  2486.           Description 
  2487.  
  2488. DataSourceName (DSN) 
  2489.           String that identifies an INFORMIX data source configuration in 
  2490.           ODBC.INI. Examples include "Accounting" or "INFORMIX-Serv1." 
  2491.  
  2492. Database (DB) 
  2493.           Name of the database to which you want to connect. 
  2494.  
  2495. HostName (HOST) 
  2496.           Name of the machine on which the INFORMIX 5 server resides. 
  2497.  
  2498. LogonID (UID) 
  2499.           Your user name as specified on the INFORMIX 5 server. 
  2500.  
  2501. Password (PWD) 
  2502.           A password. 
  2503.  
  2504. Service (SERV) 
  2505.           Name of the service as it appears on the host machine.  This service 
  2506.           is assigned by the system administrator. 
  2507.  
  2508. Protocol (PRO) 
  2509.           Protocol={FTP | IPX | LANMAN | TCP-IP}. Protocol used to communicate 
  2510.           with the server.  Values can be FTP, IPX, LANMAN, or TCP-IP.  You can 
  2511.           specify one or more values; separate the names with commas. 
  2512.  
  2513. YieldProc (YLD) 
  2514.           (This attribute is not available in OS/2.) A value that determines if 
  2515.           you can work in other applications when INFORMIX 5 is busy. 
  2516.  
  2517. CursorBehavior (CB) 
  2518.           CursorBehavior={0 | 1}. Determines whether cursors will be preserved 
  2519.           or closed at the end of each transaction.  Valid values are 1 
  2520.           (preserve) and 0 (close, the initial default).  Set this attribute to 
  2521.           1 if you want cursors to be held at the current position when the 
  2522.           transaction ends.  The value CursorBehavior=1 may impact the 
  2523.           performance of your database operations. 
  2524.  
  2525. EnableScrollableCursors (ESC). 
  2526.           EnableScrollable Cursors={0 | 1}. Determines whether the driver can 
  2527.           use scrollable cursors. The initial default value is 0 (no use of 
  2528.           scrollable cursors). The INFORMIX driver can use scollable cursors 
  2529.           only if there are no long columns (SQL_LONGVARCHAR or 
  2530.           SQL_LONGVARBINARY) in a Select list. If you set this option to use 
  2531.           scrollable cursors (EnableScrollableCursors=1), you must not include 
  2532.           long columns in the Select list. 
  2533.  
  2534. GetDBListfromInformix (GDBLFI) 
  2535.           GetDBListFromInformix={0 | 1}. Determines whether the driver requests 
  2536.           the database list to be returned from the INFORMIX server or from the 
  2537.           database list that the user entered at driver setup. 
  2538.  
  2539.           When set to 1, the default, the driver requests the database list 
  2540.           from the INFORMIX server. When set to 0, it uses the list entered by 
  2541.           the user at driver setup. 
  2542.  
  2543.  
  2544. ΓòÉΓòÉΓòÉ 5.5. INFORMIX Data Types ΓòÉΓòÉΓòÉ
  2545.  
  2546. The INFORMIX 5 data types map to the standard ODBC data types as follows: 
  2547.  
  2548. INFORMIX 5 ODBC 
  2549. Byte*     SQL_LONGVARBINARY 
  2550. Char      SQL_CHAR 
  2551. Date      SQL_DATE 
  2552. Datetime year to fraction(5) SQL_TIMESTAMP 
  2553. Decimal   SQL_DECIMAL 
  2554. Float     SQL_DOUBLE 
  2555. Integer   SQL_INTEGER 
  2556. Money     SQL_DECIMAL 
  2557. Serial    SQL_INTEGER 
  2558. Smallfloat SQL_REAL 
  2559. Smallint  SQL_SMALLINT 
  2560. Text*     SQL_LONGVARCHAR 
  2561. Varchar*  SQL_VARCHAR 
  2562.  
  2563. * Not supported for Standard Engine Databases. 
  2564.  
  2565. Note:  The Interval data type is not supported.  Existing columns of this type 
  2566. are mapped to the ODBC SQL_CHAR data type. 
  2567.  
  2568.  
  2569. ΓòÉΓòÉΓòÉ 5.6. Isolation and Lock Levels Supported by INFORMIX ΓòÉΓòÉΓòÉ
  2570.  
  2571. INFORMIX 5 supports isolation levels 0 (read uncommitted), 1 (read committed), 
  2572. and 3 (serializable).  The default is 1. 
  2573.  
  2574. INFORMIX 5 also supports an alternative isolation level 1, called cursor 
  2575. stability.  Your ODBC application can use this isolation level by calling 
  2576. SQLSetConnectOption (1040,1). 
  2577.  
  2578. Additionally, if transaction logging has not been enabled for your database, 
  2579. then transactions are not supported by the driver (the driver is always in 
  2580. auto-commit mode). 
  2581.  
  2582. INFORMIX 5 supports page-level locking. 
  2583.  
  2584.  
  2585. ΓòÉΓòÉΓòÉ 5.7. INFORMIX ODBC Conformance Level ΓòÉΓòÉΓòÉ
  2586.  
  2587. The INFORMIX 5 driver supports the Core, Level 1, and Level 2 API functions 
  2588. listed in Supported ODBC Functions.  In addition, the following Level 2 
  2589. functions are supported: 
  2590.  
  2591. Γûá  SQLBrowseConnect 
  2592. Γûá  SQLProcedures 
  2593.  
  2594. The driver supports the core SQL grammar. 
  2595.  
  2596.  
  2597. ΓòÉΓòÉΓòÉ 5.8. Number of Connections and Statements Supported ΓòÉΓòÉΓòÉ
  2598.  
  2599. The INFORMIX 5 database system supports multiple connections and multiple 
  2600. statements per connection. 
  2601.  
  2602.  
  2603. ΓòÉΓòÉΓòÉ 6. INGRES 6.4/04 Driver ΓòÉΓòÉΓòÉ
  2604.  
  2605. The INGRES driver supports INGRES Release 6.4/04 and higher. The driver 
  2606. filename is IVING4nn.DLL. 
  2607.  
  2608.  
  2609. ΓòÉΓòÉΓòÉ 6.1. INGRES System Requirements ΓòÉΓòÉΓòÉ
  2610.  
  2611. To access INGRES databases from your client workstation you must have the 
  2612. INGRES/Net or INGRES/Star product installed on both your client and server 
  2613. nodes. 
  2614.  
  2615. To access INGRES, you must have Networking for OS/2 Release 6.4/04 
  2616. (net.os2/02). All required DLLs must reside in directories that are listed  in 
  2617. the LIBPATH specification in your CONFIG.SYS file. 
  2618.  
  2619.  
  2620. ΓòÉΓòÉΓòÉ 6.2. Configuring INGRES Data Sources ΓòÉΓòÉΓòÉ
  2621.  
  2622. To configure an INGRES data source, do the following: 
  2623.  
  2624.  1. Start the ODBC Administrator.  A list of data sources appears. 
  2625.  
  2626.  2. If you are configuring a new data source, click Add.  A list of installed 
  2627.     drivers appears.  Select INTERSOLV INGRES 6.4/04 and click OK. 
  2628.  
  2629.     If you are configuring an existing data source, select the data source name 
  2630.     and click Setup. 
  2631.  
  2632.     The setup dialog box appears. 
  2633.  
  2634.  3. Specify values as follows: 
  2635.  
  2636.    Data Source Name: 
  2637.              A string that identifies this INGRES data source configuration in 
  2638.              ODBC.INI. Examples include "Accounting" or "INGRES-Serv1." 
  2639.  
  2640.    Description: 
  2641.              An optional long description of a data source name. For example, 
  2642.              "My Accounting Database" or "INGRES on Server number 1." 
  2643.  
  2644.    Server Name: 
  2645.              The name of the virtual node that you defined using the INGRES 
  2646.              NETU utility. This virtual node tells INGRES which system to call, 
  2647.              how to call it, and the user's name and password. 
  2648.  
  2649.    Database Name: 
  2650.              The name of the database to which you want to connect by default. 
  2651.  
  2652.              The following values are optional: 
  2653.  
  2654.    Server List: 
  2655.              The list of servers (virtual nodes) that will be available in the 
  2656.              Logon dialog box.  Separate the server names with commas. 
  2657.  
  2658.    Database List: 
  2659.              The list of databases that will be available in the logon dialog 
  2660.              box. Separate the names with commas. 
  2661.  
  2662.    Default User Name: 
  2663.              The default user name used to connect to your INGRES database.  A 
  2664.              user name is required only if security is enabled on your 
  2665.              database.  Your ODBC application may override this value or you 
  2666.              may override this value in the logon dialog box. 
  2667.  
  2668.    Options: 
  2669.              Any flag allowed on the INGRES SQL command line.  Some examples 
  2670.              are 
  2671.  
  2672.              Γûá  -l (locks the database exclusively) 
  2673.  
  2674.              Γûá  -u (logs on as username) 
  2675.  
  2676.              Γûá  +w or -w (waits/doesn't wait for the database if a user has 
  2677.              already opened it exclusively) 
  2678.  
  2679.              Γûá  +U or -U (enables/disables user updating of the system tables 
  2680.              and locks the database exclusively) 
  2681.  
  2682.              Γûá  +Y or -Y (enables/disables user updating of the system tables 
  2683.              but does not lock the database exclusively) 
  2684.  
  2685.    Yield Proc: 
  2686.              This attribute is not available under OS/2.  A numeric value that 
  2687.              determines whether you can work in other applications when INGRES 
  2688.              is busy. 
  2689.  
  2690.    Repeated Cache Size 
  2691.              A number that determines whether all Update and Insert statements 
  2692.              are to be executed as repeated statements. This attribute improves 
  2693.              the performance of applications that repeat the same SQL 
  2694.              statement. When set to 0, the initial default, no statements are 
  2695.              repeated. The recommended setting for this attribute is 100 
  2696.              (RepeatedCacheSize=100). 
  2697.  
  2698.              To repeat a single statement rather than all statements, use the 
  2699.              INGRES REPEATED syntax. 
  2700.  
  2701.    Repeated Selects 
  2702.              A number that determines whether the driver optimizes Select 
  2703.              statements or executes them as repeated queries. When set to 0, 
  2704.              the initial default, the driver executes all Select statements as 
  2705.              it did in previous versions of the product. When set to 1, the 
  2706.              driver optimizes Select statements that return only one result 
  2707.              row. When set to 2, the driver executes all Select statements as 
  2708.              repeated queries. If this attribute is set to 1 or 2, the 
  2709.              RepeatedCacheSize attribute must be set to greater than zero. 
  2710.              Setting this option to 1 or 2 has no effect on Select statements 
  2711.              containing a For Update clause. These settings also limit the 
  2712.              driver to one active statement and one active connection. 
  2713.  
  2714.    Value Replacement for Repeated Selects 
  2715.              A number that determines whether the driver substitutes parameters 
  2716.              for hardcoded values in repeated statements. This option is 
  2717.              convenient in applications that do not use dynamic parameters. 
  2718.  
  2719.              When set to 0, the initial default, the driver does not substitute 
  2720.              parameters. When set to 1, the driver substitutes parameters for 
  2721.              hardcoded values and the RepeatedCacheSize attribute must be 
  2722.              greater than zero or the REPEATED INGRES keyword must be used. 
  2723.  
  2724.              This option has no effect upon Select statements that contain a 
  2725.              For Update clause that requires a cursor or upon statements that 
  2726.              already use parameter markers. 
  2727.  
  2728.              This attribute supports only a subset of standard ODBC SQL 
  2729.              grammer. It is intended for performance and does not utilize a 
  2730.              full SQL parser. For example, subselects are not supported and use 
  2731.              of "is NULL" for columns other than character columns is not 
  2732.              supported. Click Translate to perform a translation of your data 
  2733.              from one character set to another. The Select Translator dialog 
  2734.              box appears in which you can select a translator to peform the 
  2735.              translation. INTERSOLV provides a translator named INTERSOLV OEM 
  2736.              ANSI that translates your data from the IBM PC character set to 
  2737.              the ANSI character set. Click OK to leave this dialog box and 
  2738.              perform the translation. Click OK to write these values to 
  2739.              ODBC.INI.  These values are now the defaults when you connect to 
  2740.              the data source.  You can change the defaults by configuring your 
  2741.              data source again.  You can override the defaults by connecting to 
  2742.              the data source using a connection string with alternate values. 
  2743.  
  2744.  
  2745. ΓòÉΓòÉΓòÉ 6.3. Connecting to INGRES Using a Logon Dialog Box ΓòÉΓòÉΓòÉ
  2746.  
  2747. Some ODBC applications display a logon dialog box when you are connecting to a 
  2748. data source.  In these cases, the data source name has already been specified. 
  2749.  
  2750. In the logon dialog box, do the following: 
  2751.  
  2752.  1. Type the server name of the computer containing the INGRES database you 
  2753.     want to access or select the name from the Server Name drop-down list, 
  2754.     which displays the server names you specified in the setup dialog box. 
  2755.     Server Name must be a valid virtual node that has been added using the 
  2756.     INGRES NETU utility. 
  2757.  
  2758.  2. Type the name of the database to which you want to connect or select the 
  2759.     name from the Database Name drop-down list, which displays the names you 
  2760.     specified in the setup dialog box. 
  2761.  
  2762.  3. If required, type your user name. 
  2763.  
  2764.  4. Type any options for the connection.  The options can be any flags allowed 
  2765.     on the INGRES SQL command line. 
  2766.  
  2767.  5. Click OK to log on to INGRES and to update the values in ODBC.INI. 
  2768.  
  2769.  
  2770. ΓòÉΓòÉΓòÉ 6.4. Connecting to INGRES Using a Connection String ΓòÉΓòÉΓòÉ
  2771.  
  2772. If your application requires a connection string to connect to a data source, 
  2773. you must specify the data source name that tells the driver which ODBC.INI 
  2774. section to use for the default connection information.  Optionally, you may 
  2775. specify attribute=value pairs in the connection string to override the default 
  2776. values stored in ODBC.INI.  These values are not written to ODBC.INI. 
  2777.  
  2778. You can specify either long or short names in the connection string. The 
  2779. connection string has the form: 
  2780.  
  2781. DSN=data_source_name[;attribute=value[;attribute=value]...]
  2782.  
  2783. An example of a connection string for INGRES is 
  2784.  
  2785. DSN=INGRES TABLES;SRVR=IVSERV;DB=PAYROLL;UID=JOHN
  2786.  
  2787. The following list gives the long and short names for each attribute, as well 
  2788. as a description. 
  2789.  
  2790. The defaults listed are initial defaults that apply when no value is specified 
  2791. in either the connection string or in the data source definition in ODBC.INI. 
  2792. If you specified a value for the attribute when configuring the data source, 
  2793. that value is your default. 
  2794.  
  2795. Attribute 
  2796.           Description 
  2797.  
  2798. DataSourceName (DSN)A string that identifies an INGRES data source 
  2799. configuration in ODBC.INI.  Examples include "Accounting" or "INGRES-Serv1." 
  2800.  
  2801. ServerName (SRVR) 
  2802.           The name of the virtual node that you defined using the INGRES NETU 
  2803.           utility. This virtual node tells INGRES which system to call, how to 
  2804.           call it, and the user's name and password. 
  2805.  
  2806. Database (DB) 
  2807.           The name of the database to which you want to connect. 
  2808.  
  2809. LogonID (UID) 
  2810.           The default logon ID (user name) used to connect to your INGRES 
  2811.           database.  A logon ID is required only if security is enabled on your 
  2812.           database.  If so, contact your system administrator to get your logon 
  2813.           ID. 
  2814.  
  2815. Options (OPTS) 
  2816.           The flags allowed on the INGRES SQL command line.  Some examples are 
  2817.  
  2818.           Γûá  -l (locks the database exclusively) 
  2819.  
  2820.           Γûá  -u (logs on as username) 
  2821.  
  2822.           Γûá  -w or -w (waits/doesn't wait for the database if someone has 
  2823.           already opened it exclusively) 
  2824.  
  2825.           Γûá  +U or -U (enables/disables user updating system tables and locks 
  2826.           the database exclusively) 
  2827.  
  2828.           Γûá  +Y or -Y (enables/disables user updating system tables but does 
  2829.           not lock the database exclusively) 
  2830.  
  2831. YieldProc (YLD) 
  2832.           A value that determines if you can work in other applications when 
  2833.           INGRES is busy.  This attribute is not available under OS/2. 
  2834.  
  2835. RepeatedCacheSize (RCS) 
  2836.           A number that determines whether all Update and Insert statements are 
  2837.           to be executed as repeated statements. This attribute improves the 
  2838.           performance of applications that repeat the same SQL statement. When 
  2839.           set to 0, the initial default, no statements are repeated. The 
  2840.           recommended setting for this attribute is 100 
  2841.           (RepeatedCacheSize=100). 
  2842.  
  2843.           To repeat a single statement rather than all statements, use the 
  2844.           INGRES REPEATED syntax. 
  2845.  
  2846. RepeatedSelects (RS) 
  2847.           RepeatedSelects={0 | 1 | 2}. A number that determines whether the 
  2848.           driver optimizes Select statements or executes them as repeated 
  2849.           queries. When set to 0, the initial default, the driver executes all 
  2850.           Select statements as it did in previous versions of the product. When 
  2851.           set to 1, the driver optimizes Select statements that return only one 
  2852.           result row. When set to 2, the driver executes all Select statements 
  2853.           as repeated queries. If this attribute is set to 1 or 2, the 
  2854.           RepeatedCacheSize attribute must be set to greater than zero. Setting 
  2855.           this option to 1 or 2 has no effect on Select statements containing a 
  2856.           For Update clause. These settings also limit the driver to one active 
  2857.           statement and one active connection. 
  2858.  
  2859. ValueReplacement (VR) 
  2860.           ValueReplacement={0 | 1}. A number that determines whether the driver 
  2861.           substitutes parameters for hardcoded values in repeated statements. 
  2862.           This option is convenient in applications that do not use dynamic 
  2863.           parameters. 
  2864.  
  2865.           When set to 0, the initial default, the driver does not substitute 
  2866.           parameters. When set to 1, the driver substitutes parameters for 
  2867.           hardcoded values and the RepeatedCacheSize attribute must be greater 
  2868.           than zero or the REPEATED INGRES keyword must be used. 
  2869.  
  2870.           This option has no effect upon Select statements that contain a For 
  2871.           Update clause that requires a cursor or upon statements that already 
  2872.           use parameter markers. 
  2873.  
  2874.           This attribute supports only a subset of standard ODBC SQL grammer. 
  2875.           It is intended for performance and does not utilize a full SQL 
  2876.           parser. For example, subselects are not supported and use of "is 
  2877.           NULL" for columns other than character columns is not supported. 
  2878.  
  2879.  
  2880. ΓòÉΓòÉΓòÉ 6.5. INGRES Data Types ΓòÉΓòÉΓòÉ
  2881.  
  2882. INGRES data types map to the standard ODBC data types as follows: 
  2883.  
  2884.  
  2885. INGRES    ODBC 
  2886. Char      SQL_CHAR 
  2887. Date      SQL_TIMESTAMP 
  2888. Float     SQL_DOUBLE 
  2889. Float4    SQL_REAL 
  2890. Integer   SQL_INTEGER 
  2891. Integer1  SQL_TINYINT 
  2892. Money     SQL_DECIMAL 
  2893. Smallint  SQL_SMALLINT 
  2894. Varchar   SQL_VARCHAR 
  2895.  
  2896. Note that INGRES date values do not directly map to the ODBC type 
  2897. SQL_TIMESTAMP. If interval data is placed in date columns, then the driver 
  2898. raises an error when attempting to read the value. 
  2899.  
  2900.  
  2901. ΓòÉΓòÉΓòÉ 6.6. Isolation and Lock Levels Supported by INGRES ΓòÉΓòÉΓòÉ
  2902.  
  2903. INGRES supports isolation levels 1 (read committed, the default) and 3 
  2904. (serializable).  INGRES supports page-level locking. 
  2905.  
  2906.  
  2907. ΓòÉΓòÉΓòÉ 6.7. INGRES ODBC Conformance Level ΓòÉΓòÉΓòÉ
  2908.  
  2909. The INGRES driver supports the Core, Level 1, and Level 2 API functions listed 
  2910. in Supported ODBC Functions.  In addition, the SQLBrowseConnect Level 2 
  2911. function is supported. 
  2912.  
  2913. The driver supports the minimum SQL grammar. 
  2914.  
  2915.  
  2916. ΓòÉΓòÉΓòÉ 6.8. Number of Connections and Statements Supported by INGRES ΓòÉΓòÉΓòÉ
  2917.  
  2918. The INGRES database system supports multiple connections and multiple 
  2919. statements per connection. Note that if you set the RepeatedSelects connection 
  2920. string attribute to 1 or 2, the driver is limited to one active statement and 
  2921. one active connection. 
  2922.  
  2923.  
  2924. ΓòÉΓòÉΓòÉ 7. MicroDecisionware Driver ΓòÉΓòÉΓòÉ
  2925.  
  2926. The MicroDecisionware driver supports the IBM Database 2 (DB2) and InfoHub 
  2927. (formerly Teradata) database systems.  The MicroDecisionware Database Gateway 
  2928. makes an InfoHub database resemble a DB2 database. These topics refer to all 
  2929. databases accessed through the MicroDecisionware Gateway as DB2 databases. 
  2930. Catalog functions are not currently supported for InfoHub. 
  2931.  
  2932. The driver filename is IVMDInn.DLL. 
  2933.  
  2934. System Requirements 
  2935.  
  2936. Configuring Data Sources 
  2937.  
  2938. Connecting to DB2 Using a Logon Dialog Box 
  2939.  
  2940. Connecting to DB2 Using a Connection String 
  2941.  
  2942. Data Types 
  2943.  
  2944. Isolation and Lock Levels Supported 
  2945.  
  2946. ODBC Conformance Level 
  2947.  
  2948. Number of Connections and Statements Supported 
  2949.  
  2950.  
  2951. ΓòÉΓòÉΓòÉ 7.1. System Requirements ΓòÉΓòÉΓòÉ
  2952.  
  2953. You must have the appropriate DB-Library and Net-Library installed to gain 
  2954. access to MDI DB2 databases. 
  2955.  
  2956. Your database must support catalog stored procedures. 
  2957.  
  2958. For OS/2, you must have Net-Library version 2.0 (32-bit) or higher, which is 
  2959. required to set up your network environment. Contact a Sybase SQL Server vendor 
  2960. for more information on Net-Library. 
  2961.  
  2962. Also, you must have DB-Library version 4.6 (32-bit) or higher, available from 
  2963. Sybase. 
  2964.  
  2965. All DLLs from Net-Library and DB-Library must be in directories listed in the 
  2966. LIBPATH environment variable in your CONFIG.SYS file. 
  2967.  
  2968.  
  2969. ΓòÉΓòÉΓòÉ 7.2. Configuring Data Sources ΓòÉΓòÉΓòÉ
  2970.  
  2971. To configure a MicroDecisionware DB2 data source, do the following: 
  2972.  
  2973.  1. Start the ODBC Administrator.  A list of data sources appears. 
  2974.  
  2975.  2. If you are configuring a new data source, click Add.  A list of installed 
  2976.     drivers appears.  Select INTERSOLV MDI and click OK. 
  2977.  
  2978.  3. If you are configuring an existing data source, select the data source name 
  2979.     and click Setup. 
  2980.  
  2981.     The setup dialog box appears. 
  2982.  
  2983.  4. Specify values as follows: 
  2984.  
  2985. Data Source Name:  A string that identifies this MicroDecisionware data source 
  2986. configuration in ODBC.INI. Examples include "Accounting" or "MicroDecisionware 
  2987. Serv1." 
  2988.  
  2989. Description:  An optional long description of a data source name.  For example, 
  2990. "My Accounting Database" or "MicroDecisionware on Server number 1." 
  2991.  
  2992. Server Name:  The name of the OS/2 server running the MicroDecisionware 
  2993. Database Gateway.  This value will appear as the initial default in the logon 
  2994. dialog box. 
  2995.  
  2996. The following values are optional: 
  2997.  
  2998. Server List:  The list of servers that will appear in the logon dialog box. 
  2999. Separate the server names with commas. 
  3000.  
  3001. Default Authorization ID:  The default authorization ID used to connect to your 
  3002. DB2 database.  This ID is case-sensitive.  An authorization ID is required only 
  3003. if security is enabled on your database.  Your ODBC application may override 
  3004. this value or you may override this value in the logon dialog box. 
  3005.  
  3006. Groups:  A list of the groups to which you belong, used to determine which 
  3007. tables you can access.  Separate each group name with a comma.  Alternatively, 
  3008. enter the word ALL so that you can see all table names even if you cannot 
  3009. access the table. 
  3010.  
  3011. Application Name:  The name used to identify your application. 
  3012.  
  3013. Workstation ID:  The workstation ID used by the MicroDecisionware Database 
  3014. Gateway. 
  3015.  
  3016. Cancel Behavior:  A value to specify how a previously executed statement should 
  3017. be canceled. 
  3018.  
  3019.  1. 0 fetches all remaining records if the statement was a Select. 
  3020.  
  3021.  2. 1 cancels the statement by calling dbcancel.  This is the default. 
  3022.  
  3023.  3. {bmc bullet.bmp}2 closes the connection to the server for the statement. 
  3024.  
  3025. Yield Proc:  A numeric value that determines whether you can work in other 
  3026. applications when the gateway is busy.  This attribute is useful to users of 
  3027. ODBC applications.  Valid values are: 
  3028.  
  3029.  1. 0 (peek and dispatch), which causes the driver to check the Windows message 
  3030.     queue and send any messages to the appropriate Windows application. 
  3031.  
  3032.  2. 1 (no yielding, the default), which does not let you work in other 
  3033.     applications. 
  3034.  
  3035.  3. 3 (dispatch via Windows Yield function), which turns control over to the 
  3036.     Windows kernel.  The Windows kernel checks the message queue and sends any 
  3037.     messages to the appropriate application window. 
  3038.  
  3039. It is recommended that you use the value 1.  The values 0 and 3 do not work 
  3040. with all Windows applications. 
  3041.  
  3042. Owner of Catalog Tables:  The owner of views of the system tables.  The tables 
  3043. themselves are owned by SYSIBM.  If you have read access to the system tables, 
  3044. this option does not have to be changed .  If you do not have read access, the 
  3045. database administrator must create a view of the system tables in another 
  3046. account and give you permission to use the view.  Enter the authorization ID 
  3047. for the account that owns the views for the system tables. 
  3048.  
  3049. Tablespace to Create Tables in:  The name of the tablespace in which new tables 
  3050. are stored.  For example, DSNDB04. 
  3051.  
  3052. DB2 Site Allows User to Log On More Than Once: A check box that specifies that 
  3053. your site lets a user log on to DB2 more than once. Selecting this check box 
  3054. may improve performance. 
  3055.  
  3056. NETAPI.DLL Library Available:  A check box that specifies that the driver can 
  3057. use NETAPI.DLL to get the name of your workstation.  Most major PC networks 
  3058. support this feature.  If your network does not support this capability, 
  3059. deselect this option.  If you supply a workstation ID, this setting is ignored. 
  3060.  
  3061. Use Catalog Stored Procedures:  A check box that specifies whether the driver 
  3062. uses Catalog Stored Procedures or direct SQL to obtain system catalog 
  3063. information. 
  3064.  
  3065. Click Translate to perform a translation of your data from one character set to 
  3066. another. The Select Translator dialog box appears in which you can select a 
  3067. translator to peform the translation. INTERSOLV provides a translator named 
  3068. INTERSOLV OEM ANSI that translates your data from the IBM PC character set to 
  3069. the ANSI character set. Click OK to leave this dialog box and perform the 
  3070. translation. 
  3071.  
  3072. The translators that are listed in this dialog box are determined by the values 
  3073. listed in the ODBC Translators section of your ODBCINST.INI file. 
  3074.  
  3075. 5Click OK to write these values to ODBC.INI.  These values are now the defaults 
  3076. when you connect to the data source.  You can change the defaults by 
  3077. configuring your data source again.  You can override the defaults by 
  3078. connecting to the data source using a connection string with alternate values. 
  3079.  
  3080.  
  3081. ΓòÉΓòÉΓòÉ 7.3. Connecting to DB2 Using a Logon Dialog Box ΓòÉΓòÉΓòÉ
  3082.  
  3083. Some ODBC applications display a logon dialog box when you are connecting to a 
  3084. data source.  In these cases, the data source name has already been specified. 
  3085.  
  3086. In the logon dialog box, do the following: 
  3087.  
  3088.  1. Type the name of the OS/2 server running the Database Gateway you wish to 
  3089.     access or select the name from the Gateway Server box, which displays the 
  3090.     server names specified in the Setup dialog box. 
  3091.  
  3092.  2. If required, type your Authorization ID (case-sensitive). 
  3093.  
  3094.  3. If required, type your password for the system (case-sensitive). 
  3095.  
  3096.  4. Click OK to complete the logon and to update the values in ODBC.INI. 
  3097.  
  3098.  
  3099. ΓòÉΓòÉΓòÉ 7.4. Connecting to DB2 Using a Connection String ΓòÉΓòÉΓòÉ
  3100.  
  3101. If your application requires a connection string to connect to a data source, 
  3102. you must specify the data source name that tells the driver which ODBC.INI 
  3103. section to use for the default connection information. Optionally, you may 
  3104. specify attribute=value pairs in the connection string to override the default 
  3105. values stored in ODBC.INI .  These values are not written to ODBC.INI. 
  3106.  
  3107. You can specify either long or short names in the connection string. The 
  3108. connection string has the form: 
  3109.  
  3110. DSN=data_source_name[;attribute=value [;attribute=value]...] 
  3111.  
  3112. An example of a connection string for the MicroDecisionware Database Gateway is 
  3113.  
  3114. DSN=DB2 VIA MDI;SRVR=IVSRVR;UID=JOHN;PWD=XYZZY;APP=Q4 
  3115.  
  3116. The following list gives the long and short names for each attribute, as well 
  3117. as a description. 
  3118.  
  3119. The defaults listed in the table are initial defaults that apply when no value 
  3120. is specified in either the connection string or in the data source definition 
  3121. in ODBC.INI.  If you specified a value for the attribute when configuring the 
  3122. data source, that value is your default. 
  3123.  
  3124. DataSourceName (DSN) 
  3125.           A string that identifies a MicroDecisionware data source 
  3126.           configuration in ODBC.INI.  Examples include "Accounting" or 
  3127.           "MicroDecisionware Serv1." 
  3128.  
  3129. ServerName (SRVR) 
  3130.           The name of the OS/2 server running the MicroDecisionware Database 
  3131.           Gateway. 
  3132.  
  3133. LogonID (UID) 
  3134.           The default logon ID (authorization ID) used to connect to your DB2 
  3135.           database.  This ID is case-sensitive.  A logon ID is required only if 
  3136.           security is enabled on your database.  If so, contact your system 
  3137.           administrator to get your logon ID. 
  3138.  
  3139. Password (PWD) 
  3140.           A case-sensitive password. 
  3141.  
  3142. Groups (GRP) 
  3143.           A list of the group to which you belong, used to determine which 
  3144.           tables you can access.  Set Groups to the names of any groups to 
  3145.           which you belong; separate each name with a comma.  Groups=ALL lets 
  3146.           your application see all table names even if you cannot access the 
  3147.           table. 
  3148.  
  3149. ApplicationName (APP) 
  3150.           The name used to identify your application. 
  3151.  
  3152. WorkstationID (WKID) 
  3153.           The workstation ID used by the MicroDecisionware Database Gateway. 
  3154.  
  3155. Cancel (CAN) 
  3156.           Cancel={0 | 1 | 2}. A value that specifies how a previously executed 
  3157.           statement should be canceled. 
  3158.  
  3159.           {bmc bullet.bmp}Cancel=0 fetches all of the remaining records if the 
  3160.           statement was a Select. 
  3161.  
  3162.           {bmc bullet.bmp}Cancel=1 cancels the statement by calling dbcancel. 
  3163.           Set Cancel=1 if dbcancel is supported in your client/server 
  3164.           configuration.  This is the initial default. 
  3165.  
  3166.           {bmc bullet.bmp}Cancel=2 closes the connection to the server for the 
  3167.           statement.  Set Cancel=2 only if dbcancel is not supported for your 
  3168.           configuration and the performance of fetching all remaining records 
  3169.           is unacceptable. 
  3170.  
  3171. Sysibm (SI) 
  3172.           The authorization ID for the system tables.  The initial default is 
  3173.           SYSIBM. 
  3174.  
  3175. CreateDB (CDB) 
  3176.           The name of the tablespace in which new tables are stored.  For 
  3177.           example, CreateDB=DSNDB04. 
  3178.  
  3179. MultipleLogon (MULT) 
  3180.           MultipleLogon={0 | 1}. A value that specifies whether the DB2 site 
  3181.           lets users log on more than once.  Set this attribute to 1 if this is 
  3182.           the case; 0 otherwise. 
  3183.  
  3184. Netapi (NAPI) 
  3185.           Netapi={0 | 1}. A value that specifies whether NETAPI.DLL is 
  3186.           available.  Most major PC networks support this feature. Netapi=0 
  3187.           indicates it is not available; Netapi=1 indicates it is available. 
  3188.           If you supply a value for the attribute WorkstationID, this attribute 
  3189.           is ignored. 
  3190.  
  3191. YieldProc (YLD) 
  3192.           This option is not available in OS/2. 
  3193.  
  3194. ModifySQL (MS) 
  3195.           ModifySQL={0 | 1}. This attribute is provided for backward 
  3196.           compatibility.  Specify ModifySQL=0 to have the driver understand SQL 
  3197.           dialects found in earlier drivers.  Specify ModifySQL=1 (the default) 
  3198.           to have the driver modify the SQL statement to conform to ODBC 
  3199.           specifications. 
  3200.  
  3201. UseCatalogStored Procedures (UCSP) 
  3202.           UseCatalogStored Procedures={0 | 1}. This attribute determines 
  3203.           whether the driver uses Catalog Stored Procedures or direct SQL to 
  3204.           obtain system catalog information. If set to 0, the driver uses 
  3205.           direct SQL. The initial default is 0. 
  3206.  
  3207. ProfileName (PN) 
  3208.           For InfoHub only. This attribute is the InfoHub profile name. If you 
  3209.           specify a name, the driver issues a "Use profilename" statement at 
  3210.           data source connect time. 
  3211.  
  3212.  
  3213. ΓòÉΓòÉΓòÉ 7.5. Data Types ΓòÉΓòÉΓòÉ
  3214.  
  3215. The DB2 data types are mapped to the standard ODBC data types as follows: 
  3216.  
  3217. DB2       ODBC 
  3218. Char      SQL_CHAR 
  3219. Char() For Bit Data SQL_BINARY 
  3220. Date      SQL_DATE 
  3221. Decimal   SQL_DECIMAL 
  3222. Float     SQL_DOUBLE 
  3223. Integer   SQL_INTEGER 
  3224. Long Varchar SQL_LONGVARCHAR 
  3225. Long Varchar For Bit Data SQL_LONGVARBINARY 
  3226. Smallint  SQL_SMALLINT 
  3227. Time      SQL_TIME 
  3228. Timestamp SQL_TIMESTAMP 
  3229. Varchar   SQL_VARCHAR 
  3230. Varchar() For Bit Data SQL_VARBINARY 
  3231.  
  3232. Note:  The Graphic, Vargraphic, and Long Vargraphic data types are not 
  3233. supported.  If you create DB2 tables using these types, you will not be able to 
  3234. read the records in those tables. 
  3235.  
  3236.  
  3237. ΓòÉΓòÉΓòÉ 7.6. Isolation and Lock Levels Supported ΓòÉΓòÉΓòÉ
  3238.  
  3239. DB2 supports isolation levels 1 (repeatable read) and 2 (read committed, the 
  3240. default).  DB2 supports page-level locking. 
  3241.  
  3242.  
  3243. ΓòÉΓòÉΓòÉ 7.7. ODBC Conformance Level ΓòÉΓòÉΓòÉ
  3244.  
  3245. The MicroDecisionware driver supports the Core, Level 1, and Level 2 API 
  3246. functions listed in Supported ODBC Functions.  The driver supports the minimum 
  3247. SQL grammar. 
  3248.  
  3249.  
  3250. ΓòÉΓòÉΓòÉ 7.8. Number of Connections and Statements Supported ΓòÉΓòÉΓòÉ
  3251.  
  3252. If your site does not allow multiple connections, the MicroDecisionware gateway 
  3253. supports a single connection and one statement per connection. 
  3254.  
  3255. If your site allows multiple connections and SQL_AUTOCOMMIT is 1, the 
  3256. MicroDecisionware gateway supports multiple connections and multiple statements 
  3257. per connection. 
  3258.  
  3259. If your site allows multiple connections and SQL_AUTOCOMMIT is 0, the 
  3260. MicroDecisionware gateway supports multiple connections and one statement per 
  3261. connection. 
  3262.  
  3263.  
  3264. ΓòÉΓòÉΓòÉ 8. Oracle Drivers ΓòÉΓòÉΓòÉ
  3265.  
  3266. The Oracle driver supports the Oracle 7 database system. 
  3267.  
  3268. Two separate Oracle drivers support the Oracle 6 and Oracle 7 database systems. 
  3269. The driver filename for Oracle 6 is IVORAnn.DLL, and for Oracle 7, IVOR7nn.DLL. 
  3270.  
  3271.  
  3272. ΓòÉΓòÉΓòÉ 8.1. Oracle System Requirements ΓòÉΓòÉΓòÉ
  3273.  
  3274. The Oracle SQL*Net product is required to access remote Oracle databases. 
  3275.  
  3276. The following line must be included in your CONFIG.SYS file: 
  3277.  
  3278. SET CONFIG=C:\ORACLE\CONFIG.ORA
  3279.  
  3280. Oracle 6 requires ORA6O32.DLL. Oracle 7 requires ORA7O32.DLL. These 32-bit DLLs 
  3281. are supplied by Oracle along with other required DLLs. All the DLLs must be in 
  3282. directories that are included in the LIBPATH specification in your CONFIG.SYS 
  3283. file. 
  3284.  
  3285.  
  3286. ΓòÉΓòÉΓòÉ 8.2. Configuring Oracle Data Sources ΓòÉΓòÉΓòÉ
  3287.  
  3288. To configure an Oracle data source, do the following: 
  3289.  
  3290.  1. Start the ODBC Administrator.  A list of data sources appears. 
  3291.  
  3292.  2. If you are configuring a new data source, click Add.  A list of installed 
  3293.     drivers appears.  Select INTERSOLV Oracle or INTERSOLV Oracle7 and click 
  3294.     OK. 
  3295.  
  3296.     If you are configuring an existing data source, select the data source name 
  3297.     and click Setup. 
  3298.  
  3299.     The setup dialog box appears. 
  3300.  
  3301.  3. Specify values as follows: 
  3302.  
  3303.    Data Source Name: 
  3304.              A string that identifies this Oracle data source configuration in 
  3305.              ODBC.INI. Examples include "Accounting" or "Oracle-Serv1." 
  3306.  
  3307.    Description: 
  3308.              An optional long description of a data source name. For example, 
  3309.              "My Accounting Database" or "Oracle on Server number 1." 
  3310.  
  3311.    Server Name: 
  3312.              The SQL*Net connection string designating the server and database 
  3313.              to be accessed.  The information required varies depending on the 
  3314.              SQL*Net driver you are using.  The section "Connecting to Oracle 
  3315.              Using a Connection String" gives the format of the SQL*Net 
  3316.              connection string. 
  3317.  
  3318.              The following values are optional: 
  3319.  
  3320.    Server List: 
  3321.              The list of SQL*Net connection strings that will appear in the 
  3322.              logon dialog box.  Separate the strings with commas.  If the 
  3323.              SQL*Net connection string contains a comma, enclose it in 
  3324.              quotation marks; for example, "Serv,1", "Serv,2", "Serv,3." 
  3325.  
  3326.    Default User Name: 
  3327.              The default user name used to connect to your Oracle database.  A 
  3328.              default user name is required only if security is enabled on your 
  3329.              database.  Your ODBC application may override this value or you 
  3330.              may override this value in the logon dialog box or connection 
  3331.              string. 
  3332.  
  3333.    Lock Time Out: 
  3334.              A value that specifies whether Oracle should wait for a lock to be 
  3335.              freed before raising an error when processing a Select...For 
  3336.              Update Of statement. Values can be -1 (wait forever) or 0 (don't 
  3337.              wait).  The default is -1. 
  3338.  
  3339.    Array Size: 
  3340.              The number of bytes the driver uses for fetching multiple rows. 
  3341.              Values can be 0 to 65536; the default is 60000. Larger values 
  3342.              increase throughput by reducing the number of times the driver 
  3343.              fetches data across the network. Smaller values increase response 
  3344.              time, as there is less of a delay waiting for the server to 
  3345.              transmit data. 
  3346.  
  3347.    Catalog Comments: 
  3348.              Check this box if you want to retrieve the contents of the 
  3349.              COMMENTS column in your Oracle tables.  Doing so may impact the 
  3350.              performance of your queries. 
  3351.  
  3352.  4. Click Translate to perform a translation of your data from one character 
  3353.     set to another. The Select Translator dialog box appears in which you can 
  3354.     select a translator to peform the translation. INTERSOLV provides a 
  3355.     translator named INTERSOLV OEM ANSI that translates your data from the IBM 
  3356.     PC character set to the ANSI character set. Click OK to leave this dialog 
  3357.     box and perform the translation. 
  3358.  
  3359.  5. Click OK to write these values to ODBC.INI.  These values are now the 
  3360.     defaults when you connect to the data source.  You can change the defaults 
  3361.     by configuring your data source again.  You can override the defaults by 
  3362.     connecting to the data source using a connection string with alternate 
  3363.     values. 
  3364.  
  3365.  
  3366. ΓòÉΓòÉΓòÉ 8.3. Connecting to Oracle Using a Logon Dialog Box ΓòÉΓòÉΓòÉ
  3367.  
  3368. Some ODBC applications display a logon dialog box when you are connecting to a 
  3369. data source.  In these cases, the data source name has already been specified. 
  3370.  
  3371. In the logon dialog box, do the following: 
  3372.  
  3373.  1. Type the SQL*Net connection string of the computer containing the Oracle 
  3374.     database tables you want to access or select the string from the Server 
  3375.     Name drop-down list, which displays the names you specified in the setup 
  3376.     dialog box. 
  3377.  
  3378.  2. If required, type your Oracle user name. 
  3379.  
  3380.  3. If required, type your Oracle password. 
  3381.  
  3382.  4. Click OK to log on to the Oracle database installed on the server you 
  3383.     specified and to update the values in ODBC.INI. 
  3384.  
  3385.  
  3386. ΓòÉΓòÉΓòÉ 8.4. Connecting to Oracle Using a Connection String ΓòÉΓòÉΓòÉ
  3387.  
  3388. If your application requires a connection string to connect to a data source, 
  3389. you must specify the data source name that tells the driver which ODBC.INI 
  3390. section to use for the default connection information.  Optionally, you may 
  3391. specify attribute=value pairs in the connection string to override the default 
  3392. values stored in ODBC.INI.  These values are not written to ODBC.INI. 
  3393.  
  3394. You can specify either long or short names in the connection string. The 
  3395. connection string has the form: 
  3396.  
  3397. DSN=data_source_name[;attribute=value[;attribute=value]...] 
  3398.  
  3399. An example of a connection string for Oracle is 
  3400.  
  3401. DSN=Accounting;SRVR=X:IVSRVR;UID=JOHN;PWD=XYZZY
  3402.  
  3403. If the server name contains a semicolon, enclose it in quotation marks: 
  3404.  
  3405. DSN=Accounting;SRVR="X:IV;SRVR";UID=JOHN;PWD=XYZZY
  3406.  
  3407. The following table gives the long and short names for each attribute, as well 
  3408. as a description. 
  3409.  
  3410. The defaults listed in the table are initial defaults that apply when no value 
  3411. is specified in either the connection string or in the data source definition 
  3412. in ODBC.INI.  If you specified a value for the attribute when configuring the 
  3413. data source, that value is your default. 
  3414.  
  3415. DataSourceName (DSN) 
  3416.           A string that identifies an Oracle data source configuration in 
  3417.           ODBC.INI. Examples include "Accounting" or "Oracle-Serv1." 
  3418.  
  3419. LogonID (UID) 
  3420.           The logon ID (user name) that the application uses to connect to your 
  3421.           Oracle database. A logon ID is required only if security is enabled 
  3422.           on your database. If so, contact your system administrator to get 
  3423.           your logon ID. 
  3424.  
  3425. Password (PWD) 
  3426.           Your password. 
  3427.  
  3428. LockTimeOut (LTO) 
  3429.           A value that specifies whether Oracle should wait for a lock to be 
  3430.           freed before raising an error when processing a Select...For Update 
  3431.           Of statement. Values can be -1 (wait forever, the initial default) or 
  3432.           0 (don't wait). 
  3433.  
  3434. ArraySize (AS) 
  3435.           The number of bytes the driver uses for fetching multiple rows. 
  3436.           Values can be 0 to 65536.  The initial default is 60000.  Larger 
  3437.           values increase throughput by reducing the number of times the driver 
  3438.           fetches data across the network. Smaller values increase response 
  3439.           time, as there is less of a delay waiting for the server to transmit 
  3440.           data. 
  3441.  
  3442. ServerName (SRVR) 
  3443.           The SQL*Net connection string designating the server and database to 
  3444.           be accessed.  The information required varies depending on the 
  3445.           SQL*Net driver you are using.  The SQL*Net connection string has the 
  3446.           following form: 
  3447.  
  3448.                     driver_prefix:computer_name[:sid]
  3449.  
  3450.           driver_prefix is a letter identifying the network protocol being 
  3451.           used.  The driver prefix can be as follows:  P (named pipes), X 
  3452.           (SPX), B (NetBIOS), T (TCP/IP), D (DECNet), A (Oracle Async), or AT ( 
  3453.           AppleTalk).  Check your Oracle documentation for other protocols. 
  3454.  
  3455.           computer_name is the name of the Oracle Listener on your network. 
  3456.  
  3457.           sid is the Oracle System Identifier and refers to the instance of 
  3458.           Oracle running on the host.  This item is required when connecting to 
  3459.           systems that support more than one instance of an Oracle database. 
  3460.  
  3461.           If the SQL*Net connection string contains semicolons, enclose it in 
  3462.           quotation marks.  See your SQL*Net documentation for more 
  3463.           information. 
  3464.  
  3465. CatalogComments (CC) 
  3466.           CatalogComments={0 | 1}. A value that specifies whether the driver 
  3467.           returns the contents of the COMMENTS column for catalog functions. 
  3468.           CatalogComments=1 returns COMMENTS. Retrieving the COMMENTS column 
  3469.           may reduce the performance of your data catalog operations. 
  3470.           CatalogComments=0 does not return COMMENTS (the initial default). 
  3471.  
  3472.  
  3473. ΓòÉΓòÉΓòÉ 8.5. Oracle 6 Data Types ΓòÉΓòÉΓòÉ
  3474.  
  3475. The Oracle 6 data types are mapped to the standard ODBC data types as follows: 
  3476.  
  3477. Oracle 6  ODBC 
  3478. Char      SQL_VARCHAR 
  3479. Date      SQL_TIMESTAMP 
  3480. Long      SQL_LONGVARCHAR 
  3481. Long Raw  SQL_LONGVARBINARY 
  3482. Number    SQL_DOUBLE 
  3483. Number(p,s) SQL_DECIMAL 
  3484. Raw       SQL_VARBINARY 
  3485.  
  3486.  
  3487. ΓòÉΓòÉΓòÉ 8.6. Oracle 7 Data Types ΓòÉΓòÉΓòÉ
  3488.  
  3489. The Oracle 7 data types are mapped to the standard ODBC data types as follows: 
  3490.  
  3491. Oracle 7  ODBC 
  3492. Char      SQL_CHAR 
  3493. Date      SQL_TIMESTAMP 
  3494. Long      SQL_LONGVARCHAR 
  3495. Long Raw  SQL_LONGVARBINARY 
  3496. Number    SQL_DOUBLE 
  3497. Number(p,s) SQL_DECIMAL 
  3498. Raw       SQL_VARBINARY 
  3499. Varchar2  SQL_VARCHAR 
  3500.  
  3501.  
  3502. ΓòÉΓòÉΓòÉ 8.7. Isolation and Lock Levels Supported ΓòÉΓòÉΓòÉ
  3503.  
  3504. Oracle 6 and 7 both support isolation level 2 (repeatable read) only. Both 
  3505. versions support record-level locking. 
  3506.  
  3507.  
  3508. ΓòÉΓòÉΓòÉ 8.8. ODBC Conformance Level ΓòÉΓòÉΓòÉ
  3509.  
  3510. Both Oracle drivers supports the Core, Level 1, and Level 2 API functions 
  3511. listed in Supported ODBC Functions. 
  3512.  
  3513. The Oracle 6 driver also supports the Level 2 function SQLBrowseConnect. 
  3514.  
  3515. The Oracle 7 driver also supports the following Level 2 functions: 
  3516.  
  3517. Γûá  SQLBrowseConnect 
  3518. Γûá  SQLProcedures 
  3519. Γûá  SQLPrimaryKeys 
  3520.  
  3521. Both drivers support the core SQL grammar. 
  3522.  
  3523.  
  3524. ΓòÉΓòÉΓòÉ 8.9. Number of Connections and Statements Supported ΓòÉΓòÉΓòÉ
  3525.  
  3526. Oracle 6 and Oracle 7 support multiple connections and multiple statements per 
  3527. connection. 
  3528.  
  3529.  
  3530. ΓòÉΓòÉΓòÉ 9. SQL Server Driver ΓòÉΓòÉΓòÉ
  3531.  
  3532. The SQL Server driver supports the SQL Server database system available from 
  3533. Microsoft and Sybase, Inc.  It also supports the Sybase Net gateway to DB2. 
  3534.  
  3535. The driver filename is IVSSnn.DLL. 
  3536.  
  3537.  
  3538. ΓòÉΓòÉΓòÉ 9.1. SQL Server System Requirements ΓòÉΓòÉΓòÉ
  3539.  
  3540. You must install the Sybase Open Client-Library and the appropriate Sybase 
  3541. Net-Library to gain access to Microsoft SQL Server or Sybase SQL Server 
  3542. databases. 
  3543.  
  3544. SYBPING is a tool that is provided to test connectivity from your client 
  3545. workstation to the database server (servers that are added through SQLEdit). 
  3546. Use this tool to test your connection. 
  3547.  
  3548. SQLEdit is a tool that allows you to define servers and adds them to SQL.INI. 
  3549.  
  3550. Set the environment variable SYBASE to the directory where you installed the 
  3551. System 10 client. For example, set SYBASE=C:\SQL10. You set this environment 
  3552. variable in the config.sys file. 
  3553.  
  3554.  
  3555. ΓòÉΓòÉΓòÉ 9.2. Configuring SQL Server Data Sources ΓòÉΓòÉΓòÉ
  3556.  
  3557. To configure a SQL Server data source, do the following: 
  3558.  
  3559.  1. Start the ODBC Administrator.  A list of data sources appears. 
  3560.  
  3561.  2. If you are configuring a new data source, click Add.  A list of installed 
  3562.     drivers appears.  Select INTERSOLV SQLServer and click OK. 
  3563.  
  3564.     If you are configuring an existing data source, select the data source name 
  3565.     and click Setup. 
  3566.  
  3567.     The setup dialog box appears. 
  3568.  
  3569.  3. Specify values as follows: 
  3570.  
  3571.    Data Source Name: 
  3572.              A string that identifies this SQL Server data source configuration 
  3573.              in ODBC.INI.  Examples include "Accounting" or "SQL Server-Serv1." 
  3574.  
  3575.    Description: 
  3576.              An optional long description of a data source name. For example, 
  3577.              "My Accounting Database" or "SQL Server on Server number 1." 
  3578.  
  3579.    Server Name: 
  3580.              The name of the server that contains the desired database. 
  3581.  
  3582.    Database Name: 
  3583.              The name of the database to which you want to connect by default. 
  3584.              If you do not specify a value, the default database defined by SQL 
  3585.              Server is used. 
  3586.  
  3587.    The following values are optional: 
  3588.  
  3589.    Server List: 
  3590.              A comma-separated list of servers that will appear in the logon 
  3591.              dialog box. 
  3592.  
  3593.    Database List: 
  3594.              The databases that will be available in the SQL Server Logon 
  3595.              Options dialog box.  Separate the names with commas. 
  3596.  
  3597.    Default Logon ID: 
  3598.              The default logon ID used to connect to your SQL Server database. 
  3599.              This ID is case-sensitive.  A logon ID is required only if 
  3600.              security is enabled on your database.  Your ODBC application may 
  3601.              override this value or you may override this value in the logon 
  3602.              dialog box or connection string. 
  3603.  
  3604.    Language: 
  3605.              The national language to be used by the client.  The default is 
  3606.              English. 
  3607.  
  3608.    Application Name: 
  3609.              The name SQL Server uses to identify your application. 
  3610.  
  3611.    Workstation ID: 
  3612.              The workstation ID used by the client. 
  3613.  
  3614.    Cursor Cache Size: 
  3615.              The number of cursors the cursor cache can hold. The driver 
  3616.              creates a cache of statements; each statement represents an open 
  3617.              connection to SQL Server.  The cursor cache increases performance 
  3618.              but uses database resources.  The default is 1 (one cursor). 
  3619.  
  3620.    Yield Proc: 
  3621.              (This attribute is not available in OS/2.) A numeric value that 
  3622.              determines whether you can work in other applications when SQL 
  3623.              Server is busy. 
  3624.  
  3625.    Character Conversion: 
  3626.              This value controls the character set conversion between SQL 
  3627.              Server (version 4.8 or later) and a client application.  If you 
  3628.              omit this value, no character conversion takes place on your 
  3629.              server. Common values include iso-1 for ISO-8859-1, cp850 for Code 
  3630.              Page 850, roman8 for Roman8 character set, and SJIS for a Japanese 
  3631.              character set. See your SQL Server documentation for a complete 
  3632.              list of values. 
  3633.  
  3634.    Cancel Behavior: 
  3635.              A value that specifies how a previously executed statement should 
  3636.              be canceled.  Valid values are 
  3637.  
  3638.              Γûá  0 fetches all of the remaining records if the statement was a 
  3639.              Select. 
  3640.  
  3641.              Γûá  1 cancels the statement by calling dbcancel.  This is the 
  3642.              default and should be used if dbcancel is supported in your 
  3643.              client/server configuration. 
  3644.  
  3645.              Γûá  2 closes the connection to the server for the statement.  Use 
  3646.              this value only if dbcancel is not supported for your 
  3647.              configuration and the performance of fetching all remaining 
  3648.              records is unacceptable. 
  3649.  
  3650.    Using Gateway: 
  3651.              Select this check box if you are using Sybase Net-Gateway to 
  3652.              access a DB2 database with this data source. 
  3653.  
  3654.    NETAPI.DLL Library Available: 
  3655.              The driver uses NETAPI.DLL to get the name of your workstation. 
  3656.              Most major PC networks support this feature.  If your network 
  3657.              supports this capability, select this option.  If you supply a 
  3658.              workstation ID, this field is ignored. 
  3659.  
  3660.    Two-Phase Commit: 
  3661.              This check box, when selected, enables you to have two active 
  3662.              statements within a transaction, using the SQL Server two-phase 
  3663.              commit services. The active statements may deadlock if they 
  3664.              reference the same SQL Server table. 
  3665.  
  3666.  4. Click Translate to perform a translation of your data from one character 
  3667.     set to another. The Select Translator dialog box appears in which you can 
  3668.     select a translator to peform the translation. INTERSOLV provides a 
  3669.     translator named INTERSOLV OEM ANSI that translates your data from the IBM 
  3670.     PC character set to the ANSI character set. Click OK to leave this dialog 
  3671.     box and perform the translation. 
  3672.  
  3673.  5. Click OK to write these values to ODBC.INI.  These values are now the 
  3674.     defaults when you connect to the data source.  You can change the defaults 
  3675.     by configuring your data source again.  You can override the defaults by 
  3676.     connecting to the data source using a connection string with alternate 
  3677.     values. 
  3678.  
  3679.  
  3680. ΓòÉΓòÉΓòÉ 9.3. Connecting to SQL Server Using a Logon Dialog Box ΓòÉΓòÉΓòÉ
  3681.  
  3682. Some ODBC applications display a logon dialog box when you are connecting to a 
  3683. data source.  In these cases, the data source name has already been specified. 
  3684. For SQL Server, the dialog box is as follows: 
  3685.  
  3686. In this dialog box, do the following: 
  3687.  
  3688.  1. Type the name of the server containing the SQL Server database tables you 
  3689.     want to access (case-sensitive) or select the name from the Server Name 
  3690.     drop-down list, which displays the server names you specified in the setup 
  3691.     dialog box. 
  3692.  
  3693.  2. If required, type your case-sensitive login ID. 
  3694.  
  3695.  3. If required, type your case-sensitive password for the system. 
  3696.  
  3697.  4. Optionally, click Options to display the SQL Server Logon Options dialog 
  3698.     box and specify the initial SQL Server database to connect to and the name 
  3699.     of your workstation. 
  3700.  
  3701.  5. Click OK to log on to the SQL Server database installed on the server you 
  3702.     specified and to update the values in ODBC.INI. 
  3703.  
  3704.  
  3705. ΓòÉΓòÉΓòÉ 9.4. Connecting to SQL Server Using a Connection String ΓòÉΓòÉΓòÉ
  3706.  
  3707. If your application requires a connection string to connect to a data source, 
  3708. you must specify the data source name that tells the driver which ODBC.INI 
  3709. section to use for the default connection information.  Optionally, you may 
  3710. specify attribute=value pairs in the connection string to override the default 
  3711. values stored in ODBC.INI.  These values are not written to ODBC.INI. 
  3712.  
  3713. You can specify either long or short names in the connection string. The 
  3714. connection string has the form: 
  3715.  
  3716. DSN=data_source_name[;attribute=value[;attribute=value]...] 
  3717.  
  3718. An example of a connection string for SQL Server is 
  3719.  
  3720. DSN=Accounting;DB=PAYROLL;UID=JOHN;PWD=XYZZY
  3721.  
  3722. The following table gives the long and short names for each attribute, as well 
  3723. as a description. 
  3724.  
  3725. The defaults listed in the table are initial defaults that apply when no value 
  3726. is specified in either the connection string or in the data source definition 
  3727. in ODBC.INI.  If you specified a value for the attribute when configuring the 
  3728. data source, that value is your default. 
  3729.  
  3730. DataSourceName (DSN) 
  3731.           A string that identifies a SQL Server data source configuration in 
  3732.           ODBC.INI. Examples include "Accounting" or "SQL Server-Serv1." 
  3733.  
  3734. ServerName (SRVR) 
  3735.           The name of the server containing the SQL Server tables you want to 
  3736.           access. 
  3737.  
  3738. Database (DB) 
  3739.           The name of the database to which you want to connect. 
  3740.  
  3741. LogonID (UID) 
  3742.           The case-sensitive logon ID used to connect to your SQL Server 
  3743.           database.  A logon ID is required only if security is enabled on your 
  3744.           database.  If so, contact your system administrator to get your logon 
  3745.           ID. 
  3746.  
  3747. Password (PWD) 
  3748.           A case-sensitive password. 
  3749.  
  3750. Language (LANG) 
  3751.           The national language to be used by the client.  The initial default 
  3752.           is English. 
  3753.  
  3754. ApplicationName (APP) 
  3755.           The name SQL Server uses to identify your application. 
  3756.  
  3757. WorkstationID (WKID) 
  3758.           The workstation ID used by the client. 
  3759.  
  3760. CursorCacheSize (CCS) 
  3761.           The number of cursors the cursor cache can hold.  The driver creates 
  3762.           a cache of statements; each statement represents an open connection 
  3763.           to SQL Server.  The cursor cache increases performance but uses 
  3764.           database resources.  The initial default is 1. 
  3765.  
  3766. YieldProc (YLD) 
  3767.           (This attribute not available for OS/2.) A numeric value that 
  3768.           determines if you can work in other applications when SQL Server is 
  3769.           busy. 
  3770.  
  3771. CharConv (CC) 
  3772.           A value that controls the character set conversion between SQL Server 
  3773.           (version 4.8 or later) and a client application.  Common values 
  3774.           include iso-1 for ISO-8859-1, cp850 for Code Page 850, roman8 for the 
  3775.           Roman8 character set, and SJIS for a Japanese character set.  See 
  3776.           your SQL Server documentation for a complete list of values. 
  3777.  
  3778. Cancel (CAN) 
  3779.           Cancel={0 | 1 | 2}. A value that specifies how a previously executed 
  3780.           statement should be canceled.  Valid values are 
  3781.  
  3782.           Γûá  Cancel=0 fetches all remaining records if the statement was a 
  3783.           Select. 
  3784.  
  3785.           Γûá  Cancel=1 cancels the statement by calling dbcancel. Set Cancel=1 
  3786.           if dbcancel is supported in your client/server configuration.  This 
  3787.           is the initial default. 
  3788.  
  3789.           Γûá  Cancel=2 closes the connection to the server for the statement. 
  3790.           Set Cancel=2 only if dbcancel is not supported for your configuration 
  3791.           and the performance of fetching all remaining records is 
  3792.           unacceptable. 
  3793.  
  3794. Gateway (GW) 
  3795.           Gateway={0 | 1}. A value that specifies whether you are using the 
  3796.           Sybase Net-Gateway to access a DB2 database with this data source. 
  3797.           Set Gateway=1 if this is the case.  Otherwise, set Gateway=0 (the 
  3798.           initial default). 
  3799.  
  3800. TwoPhaseCommit (TPC) 
  3801.           TwoPhaseCommit={0 | 1}. This attribute lets you have two or more 
  3802.           active statements within a transaction, using the SQL Server 
  3803.           two-phase commit services. Set TwoPhaseCommit=1 to use two-phase 
  3804.           commit.  The active statements may deadlock if they reference the 
  3805.           same SQL Server table.  Otherwise, set TwoPhaseCommit=0 (the initial 
  3806.           default). 
  3807.  
  3808. Netapi (NAPI) 
  3809.           Netapi={0 | 1}. A value that specifies whether NETAPI.DLL is 
  3810.           available. Netapi=0, the initial default, indicates it is not 
  3811.           available; Netapi =1 indicates it is available.  If you supply a 
  3812.           value for the WorkstationID attribute, this attribute is ignored. 
  3813.  
  3814. ModifySQL (MS) 
  3815.           ModifySQL={0 | 1}. This attribute is provided for backward 
  3816.           compatibility. It determines whether the driver modifies SQL 
  3817.           statements to conform to ODBC specifications or passes the SQL 
  3818.           statement directly to SQL Server. Specify ModifySQL=1 to have the 
  3819.           driver modify the SQL statement to conform to ODBC specifications. 
  3820.           Specify ModifySQL=0 to have the driver understand SQL dialects found 
  3821.           in earlier drivers.  The default is 1. 
  3822.  
  3823.  
  3824. ΓòÉΓòÉΓòÉ 9.5. SQL Server Data Types ΓòÉΓòÉΓòÉ
  3825.  
  3826. The SQL Server data types are mapped to the standard ODBC data types as 
  3827. follows: 
  3828.  
  3829. SQL Server     ODBC Data Type 
  3830. binary         SQL_BINARY 
  3831. bit            SQL_BIT 
  3832. char           SQL_CHAR 
  3833. datetime       SQL_TIMESTAMP 
  3834. float          SQL_FLOAT 
  3835. image          SQL_LONGVARBINARY 
  3836. int            SQL_INTEGER 
  3837. money          SQL_DECIMAL 
  3838. real           SQL_REAL 
  3839. smalldatetime  SQL_TIMESTAMP 
  3840. smallint       SQL_SMALLINT 
  3841. smallmoney     SQL_DECIMAL 
  3842. sysname        SQL_VARCHAR 
  3843. text           SQL_LONGVARCHAR 
  3844. timestamp      SQL_VARBINARY 
  3845. tinyint        SQL_TINYINT 
  3846. varbinary      SQL_VARBINARY 
  3847. varchar        SQL_VARCHAR 
  3848.  
  3849.  
  3850. ΓòÉΓòÉΓòÉ 9.6. Isolation and Lock Levels Supported ΓòÉΓòÉΓòÉ
  3851.  
  3852. SQL Server supports isolation level 1 (read committed) and 3 (serializable). 
  3853. SQL Server supports page-level locking. 
  3854.  
  3855.  
  3856. ΓòÉΓòÉΓòÉ 9.7. ODBC Conformance Level ΓòÉΓòÉΓòÉ
  3857.  
  3858. The SQL Server driver supports the Core, Level 1, and Level 2 API functions 
  3859. listed in Supported ODBC Functions.  In addition, the following Level 2 
  3860. functions are supported: 
  3861.  
  3862. Γûá  SQLBrowseConnect 
  3863. Γûá  SQLColumnPrivileges 
  3864. Γûá  SQLForeignKeys 
  3865. Γûá  SQLPrimaryKeys 
  3866. Γûá  SQLProcedureColumns 
  3867. Γûá  SQLProcedures 
  3868. Γûá  SQLTablePrivileges 
  3869.  
  3870. The driver supports the minimum SQL grammar. 
  3871.  
  3872.  
  3873. ΓòÉΓòÉΓòÉ 9.8. Number of Connections and Statements Supported ΓòÉΓòÉΓòÉ
  3874.  
  3875. The SQL Server database system supports multiple connections.  With two-phased 
  3876. commit, SQL Server supports multiple statements per connection. Otherwise, SQL 
  3877. Server supports a single statement per connection if SQL_AUTOCOMMIT is 0 and 
  3878. multiple statements per connection if SQL_AUTOCOMMIT is 1. 
  3879.  
  3880.  
  3881. ΓòÉΓòÉΓòÉ 10. SQLBase Driver ΓòÉΓòÉΓòÉ
  3882.  
  3883. The SQLBase driver supports the Gupta SQLBase database system in the Windows 
  3884. and OS/2 environments.  It also supports Gupta's SQLHost gateway to DB2. 
  3885.  
  3886. The driver filename is IVGUPnn.DLL. 
  3887.  
  3888.  
  3889. ΓòÉΓòÉΓòÉ 10.1. SQLBase System Requirements ΓòÉΓòÉΓòÉ
  3890.  
  3891. The SQLBase driver requires the SQLBase client DLLs SQLOS22.DLL and SQLGCI.DLL. 
  3892. It also requires one or more SQLBase communication files (such as SQLPIPE.DLL) 
  3893. to provide access to local and remote SQLBase databases. 
  3894.  
  3895. The SQLBase driver is a 32-bit DLL and requires version 5.2 or greater of 
  3896. SQLBase client DLLs. 
  3897.  
  3898.  
  3899. ΓòÉΓòÉΓòÉ 10.2. Configuring SQLBase Data Sources ΓòÉΓòÉΓòÉ
  3900.  
  3901. To configure a SQLBase data source, do the following: 
  3902.  
  3903.  1. Start the ODBC Administrator.  A list of data sources appears. 
  3904.  
  3905.  2. If you are configuring a new data source, click Add.  A list of installed 
  3906.     drivers appears.  Select INTERSOLV SQLBase and click OK. 
  3907.  
  3908.  3. If you are configuring an existing data source, select the data source name 
  3909.     and click Setup. 
  3910.  
  3911.  4. The setup dialog box appears. 
  3912.  
  3913.  5. Specify values as follows: 
  3914.  
  3915.    Data Source Name: 
  3916.              A string that identifies this SQLBase data source configuration in 
  3917.              ODBC.INI. Examples include "Accounting" or "SQLBase-Serv1." 
  3918.  
  3919.    Description: 
  3920.              An optional long description of a data source name. For example, 
  3921.              "My Accounting Database" or "SQLBase on Server number 1." 
  3922.  
  3923.    Database Name: 
  3924.              The name of the database to which you want to connect by default. 
  3925.  
  3926.              The following values are optional: 
  3927.  
  3928.    Server Name: 
  3929.              The name of the server that contains the desired database. 
  3930.              Specify the word LOCAL if you are using the local server. 
  3931.  
  3932.              The server name is not required to log on.  The logon dialog box 
  3933.              appears more quickly if you do not specify a server name.  If you 
  3934.              do specify a server name, the Database Name drop-down list in the 
  3935.              logon dialog box is populated with the names of the databases 
  3936.              available on that server. 
  3937.  
  3938.    Server List: 
  3939.              A comma-separated list of servers that will appear in the Logon 
  3940.              dialog box.  Specify LOCAL to add the local server to the list. 
  3941.  
  3942.    Default User Name: 
  3943.              The default user name used to connect to your SQLBase database.  A 
  3944.              user name is required only if security is enabled on your 
  3945.              database.  Your ODBC application may override this value or you 
  3946.              may override this value in the logon dialog box or connection 
  3947.              string. 
  3948.  
  3949.    Cursor Cache Size: 
  3950.              The number of cursors the cursor cache can hold. The default is 6. 
  3951.  
  3952.    Yield Proc: 
  3953.              (This attribute is not available in OS/2.) A numeric value that 
  3954.              determines whether you can work in other applications when SQLBase 
  3955.              is busy. 
  3956.  
  3957.    Input Message Size: 
  3958.              The number of bytes in the input message buffer.  The default is 
  3959.              determined by SQLBase.  Increasing this value retrieves more 
  3960.              records across the network in a single fetch. 
  3961.  
  3962.    Lock Time Out: 
  3963.              The number of seconds SQLBase should wait for a lock to be freed 
  3964.              before raising an error.  Values can be -1 (wait forever) to 1800; 
  3965.              the default is 300. 
  3966.  
  3967.    No Recovery: 
  3968.              Select this check box to disable transaction recovery. Selecting 
  3969.              this box is dangerous because your database can become 
  3970.              inconsistent in the event of a system crash. 
  3971.  
  3972.    Release Plan: 
  3973.              A number that determines whether a lock is maintained on a table 
  3974.              when the cursors accessing the table are freed. Freeing the lock 
  3975.              on the table results in a request to the server, which can 
  3976.              decrease performance. No locks are freed when this option is set 
  3977.              to the default, 0. Locks are freed when this option is set to 1. 
  3978.  
  3979.  6. Click Translate to perform a translation of your data from one character 
  3980.     set to another. The Select Translator dialog box appears in which you can 
  3981.     select a translator to peform the translation. INTERSOLV provides a 
  3982.     translator named INTERSOLV OEM ANSI that translates your data from the IBM 
  3983.     PC character set to the ANSI character set. Click OK to leave this dialog 
  3984.     box and perform the translation. 
  3985.  
  3986.  7. Click OK to write these values to ODBC.INI.  These values are now the 
  3987.     defaults when you connect to the data source.  You can change the defaults 
  3988.     by configuring your data source again.  You can override the defaults by 
  3989.     connecting to the data source using a connection string with alternate 
  3990.     values. 
  3991.  
  3992.  
  3993. ΓòÉΓòÉΓòÉ 10.3. Connecting to SQLBase Using a Logon Dialog Box ΓòÉΓòÉΓòÉ
  3994.  
  3995. Some ODBC applications display a logon dialog box when you are connecting to a 
  3996. data source. 
  3997.  
  3998. In the logon dialog box, do the following: 
  3999.  
  4000.  1. Optionally, type the name of the server containing the SQLBase database 
  4001.     tables you want to access or select the name from the Server Name drop-down 
  4002.     list, which displays the server names you specified in the Setup dialog 
  4003.     box. Type the word LOCAL to access a local SQLBase database. 
  4004.  
  4005.  2. Type the name of the database you want to access.  If you specified a 
  4006.     server name, you can select the name from the Database Name drop-down list. 
  4007.  
  4008.  3. If required, type your user name. 
  4009.  
  4010.  4. If required, type your password. 
  4011.  
  4012.  5. Click OK to complete the logon and to update the values in ODBC.INI. 
  4013.  
  4014.  
  4015. ΓòÉΓòÉΓòÉ 10.4. Connecting to SQLBase Using a Connection String ΓòÉΓòÉΓòÉ
  4016.  
  4017. If your application requires a connection string to connect to a data source, 
  4018. you must specify the data source name that tells the driver which ODBC.INI 
  4019. section to use for the default connection information.  Optionally, you may 
  4020. specify attribute=value pairs in the connection string to override the default 
  4021. values stored in ODBC.INI.  These values are not written to ODBC.INI. 
  4022.  
  4023. You can specify either long or short names in the connection string. The 
  4024. connection string has the form: 
  4025.  
  4026. DSN=data_source_name[;attribute=value[;attribute=value]...] 
  4027.  
  4028. An example of a connection string for SQLBase is 
  4029.  
  4030. DSN=SQLBASE TABLES;DB=PAYROLL;UID=JOHN;PWD=XYZZY
  4031.  
  4032. The following table gives the long and short names for each attribute, as well 
  4033. as a description. 
  4034.  
  4035. The defaults listed in the table are initial defaults that apply when no value 
  4036. is specified in either the connection string or in the data source definition 
  4037. in ODBC.INI.  If you specified a value for the attribute when configuring the 
  4038. data source, that value is your default. 
  4039.  
  4040. Attribute 
  4041.           Description 
  4042.  
  4043. DataSourceName (DSN) 
  4044.           A string that identifies a SQLBase data source configuration in 
  4045.           ODBC.INI. Examples include "Accounting" or "SQLBase-Serv1." 
  4046.  
  4047. Database (DB) 
  4048.           The name of the database to which you want to connect. 
  4049.  
  4050. LogonID (UID) 
  4051.           The default logon ID (user name) used to connect to your SQLBase 
  4052.           database. If so, contact your system administrator to get your logon 
  4053.           ID.  A logon ID is required only if security is enabled on your 
  4054.           database. 
  4055.  
  4056. ServerName (SRVR) 
  4057.           The name of the server containing the SQLBase database tables you 
  4058.           want to access.  Specify ServerName=LOCAL if you are using the local 
  4059.           server. 
  4060.  
  4061. Servers (SRVRLIST) 
  4062.           A comma-separated list of servers with which to prompt the user in a 
  4063.           Logon dialog box.  Specify LOCAL to add the local server to the list. 
  4064.  
  4065. Password (PWD) 
  4066.           A case-sensitive password. 
  4067.  
  4068. CursorCacheSize (CCS) 
  4069.           The number of cursors the cursor cache can hold.  The cursor cache 
  4070.           increases performance and uses few database resources.  The initial 
  4071.           default is 6. 
  4072.  
  4073. InputMessageSize (IMS) 
  4074.           The number of bytes of the input message buffer.  Increasing this 
  4075.           value retrieves more records across the network in a single fetch. 
  4076.           The initial default is determined by SQLBase. 
  4077.  
  4078. LockTimeOut (LTO) 
  4079.           The number of seconds SQLBase should wait for a lock to be freed 
  4080.           before raising an error.  Values can be -1 to 1800; -1 means wait 
  4081.           forever.  The initial default is 300. 
  4082.  
  4083. DB2IsolationLevel (DIL) 
  4084.           DB2IsolationLevel={CS | RR}. The DB2 isolation level SQLHost is 
  4085.           using, provided for use with SQLHost connections.  Set 
  4086.           DB2IsolationLevel=CS when DB2 is using the Cursor Stability isolation 
  4087.           level; DB2IsolationLevel=RR (the default) when DB2 is using 
  4088.           Repeatable Read. 
  4089.  
  4090. YieldProc (YLD) 
  4091.           (This attribute is not available in OS/2.) This option, which 
  4092.           determines if you can work in other applications when SQLBase is 
  4093.           busy. 
  4094.  
  4095. NoRecovery (NR) 
  4096.           NoRecovery={0 | 1}. A value that enables or disables transaction 
  4097.           recovery. NoRecovery=0 (the initial default) enables recovery; 
  4098.           NoRecovery=1 disables recovery.  NoRecovery=1 improves performance 
  4099.           but is dangerous because your database can become inconsistent in the 
  4100.           event of a system crash.  See your SQLBase documentation for 
  4101.           information on this option. 
  4102.  
  4103. ReleasePlan (RP) 
  4104.           ReleasePlan={0 | 1}. A number that determines whether a lock is 
  4105.           maintained on a table when the cursors accessing the table are freed. 
  4106.           Freeing the lock on the table results in a request to the server, 
  4107.           which can decrease performance. 
  4108.  
  4109.           When set to 0, the default, no locks on tables are freed. When set to 
  4110.           1, locks are freed. 
  4111.  
  4112.  
  4113. ΓòÉΓòÉΓòÉ 10.5. SQLBase Data Types ΓòÉΓòÉΓòÉ
  4114.  
  4115. The SQLBase data types are mapped to the standard ODBC data types as follows: 
  4116.  
  4117. SQLBase             ODBC 
  4118. Char                SQL_VARCHAR 
  4119. Date                SQL_DATE 
  4120. Decimal             SQL_DECIMAL 
  4121. Double Precision    SQL_DOUBLE 
  4122. Integer             SQL_INTEGER 
  4123. Long Varchar        SQL_LONGVARCHAR 
  4124. Number              SQL_DOUBLE 
  4125. Real                SQL_REAL 
  4126. Smallint            SQL_SMALLINT 
  4127. Time                SQL_TIME 
  4128. Timestamp           SQL_TIMESTAMP 
  4129. Varchar             SQL_VARCHAR 
  4130.  
  4131. Note:   The SQLBase Real data type is replaced by Float(21) when using DB2 via 
  4132. the SQLHost gateway.  The Graphic, Vargraphic, and Long Vargraphic DB2 data 
  4133. types are not supported. 
  4134.  
  4135.  
  4136. ΓòÉΓòÉΓòÉ 10.6. Isolation and Lock Levels Supported by SQLBase ΓòÉΓòÉΓòÉ
  4137.  
  4138. SQLBase supports isolation levels 1 (read committed, the default) and 3 
  4139. (serializable).  SQLBase also supports an alternative isolation level 1 called 
  4140. cursor stability.  Your ODBC application can use this isolation level by 
  4141. calling SQLSetConnectOption (1040,1). 
  4142.  
  4143. SQLBase supports page-level locking. 
  4144.  
  4145.  
  4146. ΓòÉΓòÉΓòÉ 10.7. SQLBase ODBC Conformance Level ΓòÉΓòÉΓòÉ
  4147.  
  4148. The SQLBase driver supports the Core, Level 1, and Level 2 API functions listed 
  4149. in Supported ODBC Functions.  In addition, the following Level 2 functions are 
  4150. supported: 
  4151.  
  4152. Γûá SQLBrowseConnect 
  4153. Γûá SQLColumnPrivileges 
  4154. Γûá SQLForeignKeys 
  4155. Γûá SQLPrimaryKeys 
  4156. Γûá SQLSetPos 
  4157. Γûá SQLTablePrivileges 
  4158.  
  4159. The driver also supports backward and random fetching in SQLExtendedFetch. It 
  4160. supports the core SQL grammar. 
  4161.  
  4162.  
  4163. ΓòÉΓòÉΓòÉ 10.8. Number of Connections and Statements Supported by SQLBase ΓòÉΓòÉΓòÉ
  4164.  
  4165. The SQLBase database system supports multiple connections and multiple 
  4166. statements per connection. 
  4167.  
  4168.  
  4169. ΓòÉΓòÉΓòÉ 11. Sybase System 10 Driver ΓòÉΓòÉΓòÉ
  4170.  
  4171. The Sybase System 10 driver supports the SQL Server System 10 database system 
  4172. from Sybase. 
  4173.  
  4174. The driver filename is IVSYBnn.DLL. 
  4175.  
  4176.  
  4177. ΓòÉΓòÉΓòÉ 11.1. Sybase System 10 System Requirements ΓòÉΓòÉΓòÉ
  4178.  
  4179. You must install the Sybase Open Client-Library and the appropriate Sybase 
  4180. Net-Library to gain access to System 10. 
  4181.  
  4182. SYBPING is a tool that is provided to test connectivity from your client 
  4183. workstation to the database server (servers that are added through SQLEdit). 
  4184. Use this tool to test your connection. 
  4185.  
  4186. SQLEdit is a tool that allows you to define servers and adds them to SQL.INI. 
  4187.  
  4188. Set the environment variable SYBASE to the directory where you installed the 
  4189. System 10 client. For example, set SYBASE=C:\SQL10. You set this environment 
  4190. variable in the config.sys file. 
  4191.  
  4192.  
  4193. ΓòÉΓòÉΓòÉ 11.2. Configuring Sybase System 10 Data Sources ΓòÉΓòÉΓòÉ
  4194.  
  4195. To configure a System 10 data source, do the following: 
  4196.  
  4197.  1. Start the ODBC Administrator.  A list of data sources appears. 
  4198.  
  4199.  2. If you are configuring a new data source, click Add.  A list of installed 
  4200.     drivers appears.  Select INTERSOLV Sybase System 10 and click OK. 
  4201.  
  4202.     If you are configuring an existing data source, select the data source name 
  4203.     and click Setup. 
  4204.  
  4205.     The setup dialog box appears. 
  4206.  
  4207.  3. Specify values as follows: 
  4208.  
  4209.    Data Source Name: 
  4210.              A string that identifies this Sybase System 10 data source 
  4211.              configuration in ODBC.INI.  Examples include "Accounting" or 
  4212.              "Sys10-Serv1." 
  4213.  
  4214.    Description: 
  4215.              An optional long description of a data source name. For example, 
  4216.              "My Accounting Database" or "System 10 on Server number 1." 
  4217.  
  4218.    Server Name: 
  4219.              The name of the server that contains the System 10 tables you want 
  4220.              to access.  If not supplied, the server name in the DSQUERY 
  4221.              environment variable is used. 
  4222.  
  4223.              The following values are optional: 
  4224.  
  4225.    Server List: 
  4226.              The list of servers that appear in the logon dialog box.  Separate 
  4227.              the server names with commas. 
  4228.  
  4229.    Database Name: 
  4230.              The name of the database to which you want to connect by default. 
  4231.              If you do not specify a value, the default is the database defined 
  4232.              by the  system administrator for each user. 
  4233.  
  4234.    Database List: 
  4235.              The databases that appear in the logon dialog box. Separate the 
  4236.              names with commas. 
  4237.  
  4238.    Default Logon ID: 
  4239.              The default logon ID used to connect to your System 10 database. 
  4240.              This ID is case-sensitive.  A logon ID is required only if 
  4241.              security is enabled for the database you are connecting to.  Your 
  4242.              ODBC application may override this value or you may override this 
  4243.              value in the logon dialog box or connection string. 
  4244.  
  4245.    Interfaces File: 
  4246.              The pathname of the interfaces file.  The default is the normal 
  4247.              Sybase interfaces file. 
  4248.  
  4249.    Password Encryption: 
  4250.               A number that determines whether password encryption can be 
  4251.              performed from the Open Client Library to the server 
  4252.              (PasswordEncryption=1). When set to 0, the default, this cannot be 
  4253.              done. 
  4254.  
  4255.    Charset: 
  4256.              The name of a character set corresponding to a subdirectory in 
  4257.              $SYBASE/charsets.  The default is the setting on the System 10 
  4258.              server. 
  4259.  
  4260.    Workstation ID: 
  4261.              The workstation ID used by the client. 
  4262.  
  4263.    Language: 
  4264.              The national language corresponding to a subdirectory in 
  4265.              $SYBASE/locales. The default is English. 
  4266.  
  4267.    Application Name: 
  4268.              The name used by System 10 to identify your application. 
  4269.  
  4270.    Yield Proc: 
  4271.              This attribute is not available under OS/2. A numeric value that 
  4272.              determines whether you can work in other applications when Sybase 
  4273.              System 10 is busy. 
  4274.  
  4275.    Optimize Prepare: 
  4276.              A value of 0, 1, or 2 that determines whether stored procedures 
  4277.              are created on the server for every call to SQLPrepare. 
  4278.  
  4279.              When set to 0, stored procedures are created for every call to 
  4280.              SQLPrepare. This setting can diminish performance. 
  4281.  
  4282.              When set to 1, the initial default, the driver creates stored 
  4283.              procedures only if the statement contains parameters. Otherwise, 
  4284.              the statement is cached and executed directly at SQLExecute time. 
  4285.  
  4286.              When set to 2, the driver never creates stored procedures. 
  4287.  
  4288.    Array Size: 
  4289.              The number of rows the driver retrieves from the server for each 
  4290.              fetch. This is not the number of rows given to the user. The 
  4291.              default is 10 rows. 
  4292.  
  4293.    Select Method: 
  4294.              A value of 0 or 1 that determines whether database cursors are 
  4295.              used for Select statements. When set to 0, the default, database 
  4296.              cursors are used. When set to 1, Select statements are executed 
  4297.              directly, without using database cursors. A setting of 1 limits 
  4298.              the data source to one active statement and one active connection. 
  4299.  
  4300.    Packet Size: 
  4301.              A number that determines the number of bytes per network packet 
  4302.              transferred from the database server to the client. The correct 
  4303.              setting of this attribute can improve performance. 
  4304.  
  4305.              When set to 0, the initial default, the driver uses the default 
  4306.              packet size as specified in the System 10 server configuration. 
  4307.  
  4308.              When set to -1, the driver computes the maximum allowable packet 
  4309.              size on the first connect to the data source and save the value in 
  4310.              the odbc.ini file. 
  4311.  
  4312.              When set to x, an integer from 1 to 10, which indicates a multiple 
  4313.              of 512 bytes (for example, Packet Size=6 means to set the packet 
  4314.              size to 6 * 512 = 3072 bytes). 
  4315.  
  4316.              For you to take advantage of this connection attribute, you must 
  4317.              configure the System 10 server for a maximum network packet size 
  4318.              greater than or equal to the value you specified for Packet Size. 
  4319.              For example, 
  4320.  
  4321.                           sp_configure "maximum network packet size", 5120
  4322.                           reconfigure
  4323.                           Restart System 10 Server
  4324.  
  4325.              Note that the ODBC specification specifies a connect option, 
  4326.              SQL_PACKET_SIZE, that offers this same functionality. To avoid 
  4327.              conflicts  with applications that may set both the connection 
  4328.              string attribute and the ODBC connect option, they have been 
  4329.              defined as mutually exclusive. If PacketSize is specified, you 
  4330.              will receive a message "Driver Not Capable" if you attempt to call 
  4331.              SQL_PACKET_SIZE. If you do not set Packet Size, then application 
  4332.              calls to SQL_PACKET_SIZE are accepted by the driver. 
  4333.  
  4334.  4. Click Translate to perform a translation of your data from one character 
  4335.     set to another. The Select Translator dialog box appears in which you can 
  4336.     select a translator to peform the translation. INTERSOLV provides a 
  4337.     translator named INTERSOLV OEM ANSI that translates your data from the IBM 
  4338.     PC character set to the ANSI character set. Click OK to leave this dialog 
  4339.     box and perform the translation. 
  4340.  
  4341.  5. Click OK to write these values to ODBC.INI.  These values are now the 
  4342.     defaults when you connect to the data source.  You can change the defaults 
  4343.     by configuring your data source again.  You can override the defaults by 
  4344.     connecting to the data source using a connection string with alternate 
  4345.     values. 
  4346.  
  4347.  
  4348. ΓòÉΓòÉΓòÉ 11.3. Connecting to System 10 Using a Logon Dialog Box ΓòÉΓòÉΓòÉ
  4349.  
  4350. Some ODBC applications display a Logon dialog box when you are connecting to a 
  4351. data source.  In these cases, the data source name has already been specified. 
  4352.  
  4353. In the logon dialog box, do the following: 
  4354.  
  4355.  1. Type the case-sensitive name of the server containing the System 10 
  4356.     database tables you want to access or select the name from the Server Name 
  4357.     drop-down list, which displays the server names you specified in the setup 
  4358.     dialog box. 
  4359.  
  4360.  2. If required, type your case-sensitive login ID. 
  4361.  
  4362.  3. If required, type your case-sensitive password for the system. 
  4363.  
  4364.  4. Type the name of the database you want to access (case-sensitive) or select 
  4365.     the name from the Database drop-down list, which displays the names you 
  4366.     specified in the setup dialog box. 
  4367.  
  4368.  5. Click OK to complete the logon and to update the values in ODBC.INI. 
  4369.  
  4370.  
  4371. ΓòÉΓòÉΓòÉ 11.4. Connecting to System 10 Using a Connection String ΓòÉΓòÉΓòÉ
  4372.  
  4373. If your application requires a connection string to connect to a data source, 
  4374. you must specify the data source name that tells the driver which ODBC.INI 
  4375. section to use for the default connection information.  Optionally, you may 
  4376. specify attribute=value pairs in the connection string to override the default 
  4377. values stored in ODBC.INI.  These values are not written to ODBC.INI. 
  4378.  
  4379. You can specify either long or short names in the connection string. The 
  4380. connection string has the form: 
  4381.  
  4382. DSN=data_source_name[;attribute=value[;attribute=value]...]
  4383.  
  4384. An example of a connection string for Sybase System 10 is 
  4385.  
  4386. DSN=SYS10 TABLES;SRVR=IVSRVR;DB=PAYROLL;UID=JOHN;PWD=XYZZY
  4387.  
  4388. The following table gives the long and short names for each attribute, as well 
  4389. as a description. 
  4390.  
  4391. The defaults listed in the table are initial defaults that apply when no value 
  4392. is specified in either the connection string or in the data source definition 
  4393. in ODBC.INI.  If you specified a value for the attribute when configuring the 
  4394. data source, that value is your default. 
  4395.  
  4396. Attribute 
  4397.           Description 
  4398.  
  4399. DataSourceName (DSN) 
  4400.           A string that identifies a single connection to a System 10 database. 
  4401.           Examples include "Accounting" or "Sys10-Serv1." 
  4402.  
  4403. ServerName (SRVR) 
  4404.           The name of the server containing the System 10 tables you want to 
  4405.           access. If not supplied, the initial default is the server name in 
  4406.           the DSQUERY environment variable. 
  4407.  
  4408. LogonID (UID) 
  4409.           The default logon ID used to connect to your System 10 database. 
  4410.           This ID is case-sensitive.  A logon ID is required only if security 
  4411.           is enabled on your database.  If so, contact your system 
  4412.           administrator to get your logon ID. 
  4413.  
  4414. Password (PWD) 
  4415.           A case-sensitive password. 
  4416.  
  4417. Database (DB) 
  4418.           The name of the database to which you want to connect. 
  4419.  
  4420. Language (LANG) 
  4421.           The national language corresponding to a subdirectory in 
  4422.           $SYBASE/locales. 
  4423.  
  4424. Charset (CS) 
  4425.           The name of a character set corresponding to a subdirectory in 
  4426.           $SYBASE/charsets. 
  4427.  
  4428. WorkstationID (WKID) 
  4429.           The workstation ID used by the client. 
  4430.  
  4431. ApplicationName (APP) 
  4432.           The name used by System 10 to identify your application. 
  4433.  
  4434. InterfacesFile (IFILE) 
  4435.           The pathname to the interfaces file. 
  4436.  
  4437. ArraySize (AS) 
  4438.           The number of rows the driver retrieves from the server for a fetch. 
  4439.           This is not the number of rows given to the user.  This increases 
  4440.           performance by reducing network traffic.  The initial default is 10 
  4441.           rows. 
  4442.  
  4443. YieldProc (YLD) 
  4444.           A numeric value that determines whether you can work in other 
  4445.           applications when Sybase System 10 is busy.  This attribute is not 
  4446.           available in OS/2. 
  4447.  
  4448. OptimizePrepare (OP) 
  4449.           OptimizePrepare={0 | 1 | 2}. A value that determines whether stored 
  4450.           procedures are created on the server for every call to SQLPrepare. 
  4451.  
  4452.           When set to 0, stored procedures are created for every call to 
  4453.           SQLPrepare. This setting can result in bad performance. 
  4454.  
  4455.           When set to 1, the initial default, the driver creates stored 
  4456.           procedures only if the statement contains parameters. Otherwise, the 
  4457.           statement is cached and executed directly at SQLExecute time. 
  4458.  
  4459.           When set to 2, the driver never creates stored procedures. 
  4460.  
  4461. SelectMethod (SM) 
  4462.           SelectMethod={0 | 1}. A value that determines whether database 
  4463.           cursors are used for Select statements. When set to 0, the initial 
  4464.           default, database cursors are used. In some cases performance 
  4465.           degradation can ocur when performing large numbers of sequential 
  4466.           Select statements because of the amount of overhead associated with 
  4467.           creating database cursors. When set to 1, Select statements are 
  4468.           executed directly without using database cursors. When set to 1, the 
  4469.           data source is limited to one active statement and one active 
  4470.           connection. 
  4471.  
  4472. Password Encryption (PE) 
  4473.           Password Encryption={0 | 1}. A number that determines whether 
  4474.           password encryption can be performed from the Open Client Library to 
  4475.           the server (PasswordEncryption=1). When set to 0, the default, this 
  4476.           cannot be done. 
  4477.  
  4478. PacketSize (PS) 
  4479.           PacketSize={-1 | 0 | x}. A number that determines the number of bytes 
  4480.           per network packet transferred from the database server to the 
  4481.           client. The correct setting of this attribute can improve 
  4482.           performance. 
  4483.  
  4484.           When set to 0, the initial default, the driver uses the default 
  4485.           packet size as specified in the System 10 server configuration. 
  4486.  
  4487.           When set to -1, the driver computes the maximum allowable packet size 
  4488.           on the first connect to the data source and save the value in the 
  4489.           odbc.ini file. 
  4490.  
  4491.           When set to x, an integer from 1 to 10, which indicates a multiple of 
  4492.           512 bytes (for example, PacketSize=6 means to set the packet size to 
  4493.           6 * 512 = 3072 bytes). 
  4494.  
  4495.           For you to take advantage of this connection attribute, you must 
  4496.           configure the System 10 server for a maximum network packet size 
  4497.           greater than or equal to the value you specified for PacketSize. For 
  4498.           example, 
  4499.  
  4500.                     sp_configure "maximum network packet size", 5120
  4501.                     reconfigure
  4502.                     Restart System 10 Server
  4503.  
  4504.           Note that the ODBC specification specifies a connect option, 
  4505.           SQL_PACKET_SIZE, that offers this same functionality. To avoid 
  4506.           conflicts with applications that may set both the connection string 
  4507.           attribute and the ODBC connect option, they have been defined as 
  4508.           mutually exclusive. If PacketSize is specified, you will receive a 
  4509.           message "Driver Not Capable" if you attempt to call SQL_PACKET_SIZE. 
  4510.           If you do not set PacketSize, then application calls to 
  4511.           SQL_PACKET_SIZE are accepted by the driver. 
  4512.  
  4513.  
  4514. ΓòÉΓòÉΓòÉ 11.5. Sybase System 10 Data Types ΓòÉΓòÉΓòÉ
  4515.  
  4516. The System 10 data types are mapped to the standard ODBC data types as follows: 
  4517.  
  4518.  
  4519. System 10      ODBC 
  4520. binary         SQL_BINARY 
  4521. bit            SQL_BIT 
  4522. char           SQL_CHAR 
  4523. datetime       SQL_TIMESTAMP 
  4524. decimal        SQL_DECIMAL 
  4525. float          SQL_FLOAT 
  4526. image          SQL_LONGVARBINARY 
  4527. int            SQL_INTEGER 
  4528. money          SQL_DECIMAL 
  4529. numeric        SQL_NUMERIC 
  4530. real           SQL_REAL 
  4531. smalldatetime  SQL_TIMESTAMP 
  4532. smallint       SQL_SMALLINT 
  4533. smallmoney     SQL_DECIMAL 
  4534. sysname        SQL_VARCHAR 
  4535. text           SQL_LONGVARCHAR 
  4536. timestamp      SQL_VARBINARY 
  4537. tinyint        SQL_TINYINT 
  4538. varbinary      SQL_VARBINARY 
  4539. varchar        SQL_VARCHAR 
  4540.  
  4541. Note:  The nchar, nvarchar, sensitivity, and sensitivity_boundary data types 
  4542. are not supported. 
  4543.  
  4544.  
  4545. ΓòÉΓòÉΓòÉ 11.6. Isolation and Lock Levels Supported by Sybase System 10 ΓòÉΓòÉΓòÉ
  4546.  
  4547. System 10 supports isolation levels 1 (read committed, the default) and 3 
  4548. (serializable).  It supports page-level locking. 
  4549.  
  4550.  
  4551. ΓòÉΓòÉΓòÉ 11.7. Sybase System 10 ODBC Conformance Level ΓòÉΓòÉΓòÉ
  4552.  
  4553. The Sybase System 10 driver supports the Core, Level 1, and Level 2 API 
  4554. functions listed in Supported ODBC Functions.  In addition, the following Level 
  4555. 2 functions are supported: 
  4556.  
  4557. Γûá  SQLBrowseConnect 
  4558. Γûá  SQLColumnPrivileges 
  4559. Γûá  SQLForeignKeys 
  4560. Γûá  SQLPrimaryKeys 
  4561. Γûá  SQLProcedureColumns 
  4562. Γûá  SQLProcedures 
  4563. Γûá  SQLTablePrivileges 
  4564.  
  4565. The driver supports the minimum SQL grammar. 
  4566.  
  4567.  
  4568. ΓòÉΓòÉΓòÉ 11.8. Number of Connections and Statements Supported by Sybase System 10 ΓòÉΓòÉΓòÉ
  4569.  
  4570. The System 10 database system supports multiple connections and multiple 
  4571. statements per connection. 
  4572.  
  4573.  
  4574. ΓòÉΓòÉΓòÉ 12. Text Driver ΓòÉΓòÉΓòÉ
  4575.  
  4576. The Text driver supports ASCII text files.  These files can be printed directly 
  4577. or edited with text editors or word processors, since none of the data is 
  4578. stored in a binary format. 
  4579.  
  4580. The driver filename is IVTXTnn.DLL. 
  4581.  
  4582. The Text driver executes SQL statements directly on the text files. The driver 
  4583. supports Insert statements, and inserts the record at the end of the file. 
  4584. However, you may not execute Update or Delete statements. 
  4585.  
  4586.  
  4587. ΓòÉΓòÉΓòÉ 12.1. Common Text File Formats ΓòÉΓòÉΓòÉ
  4588.  
  4589. Some common formats for text files are listed in the following table: 
  4590.  
  4591. Format 
  4592.           Description 
  4593.  
  4594. Comma-separated values 
  4595.           Commas separate column values, and each line is a separate record. 
  4596.           Column values can vary in length.  These files often have the .CSV 
  4597.           extension. 
  4598.  
  4599. Tab-separated values 
  4600.           Tabs separate column values, and each line is a separate record. 
  4601.           Column values can vary in length. 
  4602.  
  4603. Character-separated values 
  4604.           Any printable character except single or double quotation marks can 
  4605.           separate column values, and each line is a separate record. Column 
  4606.           values can vary in length. 
  4607.  
  4608. Fixed 
  4609.           No character separates column values.  Instead, values start at the 
  4610.           same position and have the same length in each line.  The values 
  4611.           appear in fixed columns if you display the file.  Each line is a 
  4612.           separate record. 
  4613.  
  4614. Comma-, tab-, and character-separated files are called character-delimited 
  4615. files, since values are separated by a special character. 
  4616.  
  4617.  
  4618. ΓòÉΓòÉΓòÉ 12.2. Configuring Text Data Sources ΓòÉΓòÉΓòÉ
  4619.  
  4620. To configure a Text data source, do the following: 
  4621.  
  4622.  1. Start the ODBC Administrator.  A list of data sources appears. 
  4623.  
  4624.  2. If you are configuring a new data source, click Add.  A list of installed 
  4625.     drivers appears.  Select INTERSOLV TextFile and click OK. 
  4626.  
  4627.     If you are configuring an existing data source, select the data source name 
  4628.     and click Setup. 
  4629.  
  4630.     The Setup dialog box appears. 
  4631.  
  4632.  3. Specify values as follows: 
  4633.  
  4634.    Data Source Name: 
  4635.              A string that identifies this Text data source configuration in 
  4636.              ODBC.INI. Examples include "Accounting" or "Text Files." 
  4637.  
  4638.    Description: 
  4639.              An optional long description of a data source name. For example, 
  4640.              "My Accounting Files" or "My Text Files in the Accounting 
  4641.              Directory." 
  4642.  
  4643.    Database Directory: 
  4644.              The directory in which the text files are stored.  If none is 
  4645.              specified, the current working directory is used. 
  4646.  
  4647.              The following values are optional: 
  4648.  
  4649.    Rows to Scan: 
  4650.              The number of rows in a text file that the driver scans to 
  4651.              determine the data types in the file.  If the value is 0, all rows 
  4652.              in the file are scanned. The default is 25. 
  4653.  
  4654.    Default Table Type: 
  4655.              The type of text file:  comma-separated, tab-separated, 
  4656.              character-separated, or fixed length.  This value tells the driver 
  4657.              the default type, which is used when creating a new table and 
  4658.              opening an undefined table. 
  4659.  
  4660.    Delimiter Character: 
  4661.              The character used as a delimiter for character-separated files. 
  4662.              It can be any printable character.  The default is a comma (,). 
  4663.  
  4664.    Action for Undefined Tables: 
  4665.              Two radio buttons that indicate what action the driver should take 
  4666.              when it encounters a file that has not been defined.  Set the 
  4667.              Prompt for Definition radio button, if you want the driver to 
  4668.              prompt the user when it encounters a file whose format is not 
  4669.              defined.  Otherwise, set the Guess Definition radio button; in 
  4670.              this case, the driver guesses the file's format. 
  4671.  
  4672.    Return Additional Tables: 
  4673.              Select this check box to tell the driver to return files you have 
  4674.              defined in functions like SQLTables, SQLColumns, etc.  and files 
  4675.              with a given extension. In Extension List, specify a 
  4676.              comma-separated list of the extensions.  To have files with no 
  4677.              extensions returned, specify NONE.  For example, if some of your 
  4678.              files have the extensions TXT and CSV and others have no 
  4679.              extension, specify TXT,CSV,NONE. 
  4680.  
  4681.              By default, when an application requests a list of tables, only 
  4682.              files that have been defined are returned. 
  4683.  
  4684.    File Open Cache: 
  4685.              A numeric value to specify the maximum number of unused file opens 
  4686.              to cache. For example, the value 4 specifies that when a user 
  4687.              opens and closes four tables, the tables are not actually closed. 
  4688.              The driver keeps them open so that if another query uses one of 
  4689.              these tables, the driver does not have to perform another open, 
  4690.              which is expensive.  The advantage of file open caching is 
  4691.              increased performance.  The disadvantage is that a user who 
  4692.              specifies file locking on open may get a locking conflict even 
  4693.              though no one appears to have the file open.  The default is 0, 
  4694.              which means no file open caching. 
  4695.  
  4696.    Cache Size: 
  4697.              The number of 64K blocks the driver uses to cache database 
  4698.              records.  The higher the number, the better the performance.  The 
  4699.              maximum number of blocks you can set depends on the system memory 
  4700.              available.  If the cache size is greater than 0, when browsing 
  4701.              backwards, you will not be able to see updates made by other users 
  4702.              until you reexecute the Select statement. The default is 4. 
  4703.  
  4704.    Column Names in First Line: 
  4705.              Select this check box to tell the driver to look for column names 
  4706.              in the first line of the file. 
  4707.  
  4708.    International Sort: 
  4709.              A setting to indicate the order in which records are retrieved 
  4710.              when you issue a Select statement with an Order By clause.  Select 
  4711.              this check box to use the international sort order as defined by 
  4712.              your operating system.  International sort order is 
  4713.              case-insensitive (a precedes B); the sorting of accented 
  4714.              characters is also affected (see your operating system 
  4715.              documentation).  Leave this box blank to use the ASCII sort order. 
  4716.              ASCII sort order is case-sensitive, where uppercase letter precede 
  4717.              lowercase letters (B precedes a). 
  4718.  
  4719.              Note:   The Rows to Scan, Default Table Type, Delimiter Character, 
  4720.              and Column Names in First Line settings apply only to tables not 
  4721.              previously defined.  These fields also determine the attributes of 
  4722.              new tables created with the Create Table statement. 
  4723.  
  4724.    Use Long Qualifiers: 
  4725.              A setting to enable the driver to use long pathnames as table 
  4726.              qualifiers. When you set this check box, pathnames can be up to 
  4727.              255 characters. The default length for pathnames is 128 
  4728.              characters. 
  4729.  
  4730.  4. Click Translate to perform a translation of your data from one character 
  4731.     set to another. The Select Translator dialog box appears in which you can 
  4732.     select a translator to peform the translation. INTERSOLV provides a 
  4733.     translator named INTERSOLV OEM ANSI that translates your data from the IBM 
  4734.     PC character set to the ANSI character set. Click OK to leave this dialog 
  4735.     box and perform the translation. 
  4736.  
  4737.  5. Click OK to write these values to ODBC.INI.  These values are now the 
  4738.     defaults when you connect to the data source.  You can change the defaults 
  4739.     by configuring your data source again.  You can override the defaults by 
  4740.     connecting to the data source using a connection string with alternate 
  4741.     values. 
  4742.  
  4743. Click Define in this dialog box to define the structure of your text files. 
  4744. Defining Table Structure discusses how to define the column names and data 
  4745. types in a table. 
  4746.  
  4747.  
  4748. ΓòÉΓòÉΓòÉ 12.3. Defining Text Table Structure ΓòÉΓòÉΓòÉ
  4749.  
  4750. Since text files do not all have the same structure, the driver provides the 
  4751. option of defining the structure of an existing file. Although defining the 
  4752. structure is not mandatory, since the driver can attempt to guess the names and 
  4753. types of the columns, this feature is extremely useful. 
  4754.  
  4755. Define the structure of a file as follows: 
  4756.  
  4757.  1. Display the Define Table dialog box. 
  4758.  2. Specify table information. 
  4759.  3. Specify column information. 
  4760.  4. Define the table. 
  4761.  
  4762. Display the Define Table Dialog Box 
  4763.  
  4764.  1. Click Define in the ODBC Text Driver Setup dialog box, which you can access 
  4765.     through the ODBC Administrator.  The Define File dialog box appears. 
  4766.  
  4767.  2. Select the correct file and click OK to define the file's structure using 
  4768.     the Define Table dialog box. 
  4769.  
  4770.     In the Define Table dialog box, Database Name and File display the name of 
  4771.     the database directory that contains the file and the name of the file you 
  4772.     previously selected, respectively. 
  4773.  
  4774. Specify Table Information 
  4775.  
  4776. In the Table Information section of this dialog box, specify information about 
  4777. the overall structure of the file: 
  4778.  
  4779.  1. In the Table box, type a table name.  Values may be up to 32 characters in 
  4780.     length and may not be the same as another defined table in the database. 
  4781.     This name is returned by SQLTables.  By default, it is the filename without 
  4782.     its extension. 
  4783.  
  4784.  2. Select the Column Names in First Line check box if the first line of the 
  4785.     file contains column names.  Otherwise, do not select this check box. 
  4786.  
  4787.  3. Open the Table Type box and select a table type:  comma, tab, fixed, or 
  4788.     character. 
  4789.  
  4790.  4. If the table type is character-separated, type the character that separates 
  4791.     the values in the Delimiter Character box. 
  4792.  
  4793.  5. If you are using Windows, select the OEM to ANSI Translation check box to 
  4794.     tell the driver that the data is stored in the IBM PC character set.  If 
  4795.     your data is stored in the ANSI character set, do not select this check 
  4796.     box.  This changes the display format only; the data is not converted. 
  4797.  
  4798. Specify Column Information 
  4799.  
  4800. In the Column Information section, define the types and names of the columns in 
  4801. the table.  The box in the upper-left corner of this section lists the defined 
  4802. columns. 
  4803.  
  4804. If you specified a comma-separated, tab-separated, or character-separated table 
  4805. type, the Guess button appears in this section.  Click Guess to tell the driver 
  4806. to guess the fields.  The driver then displays what it thinks the fields are. 
  4807. You can then modify the field definitions by specifying values in the Name, 
  4808. Type, Mask, Precision, and Scale boxes (as appropriate) and clicking Modify. 
  4809. If you do not want the driver to guess the fields, take the following steps to 
  4810. define the fields: 
  4811.  
  4812.  1. In the Name box, type the name of the field. 
  4813.  
  4814.  2. Open the Type drop-down list and select the data type of the field. If the 
  4815.     field type is date, then you must select a date mask for the field or type 
  4816.     one in.  See the following section, "Date Masks," for more information. 
  4817.  
  4818.  3. In the Precision box, type the precision of the field. 
  4819.  
  4820.  4. In the Scale box, type the scale of the field. 
  4821.  
  4822.     The precision and scale values determine how numeric data is to be 
  4823.     returned. 
  4824.  
  4825.  5. If you specified a fixed-length table type, you may specify the length and 
  4826.     offset in the Length and Offset boxes, or you can specify a parse string. 
  4827.     The length is the number of bytes the data takes up in storage; the offset 
  4828.     is the number of bytes from the start of the table to the start of the 
  4829.     field. 
  4830.  
  4831.  6. Click Add to add this field definition to the list box. 
  4832.  
  4833. To modify the selected field in the list box, click Modify. 
  4834.  
  4835. To remove the selected field in the list box, click Remove. 
  4836.  
  4837. If you specified a fixed-length table type, the Parse button is displayed. If 
  4838. you have not entered values in the length and offset boxes, click Parse to 
  4839. define the columns of the table.  The Parse Table dialog box appears. 
  4840.  
  4841. This dialog box displays the first line of the file.  You must mark where each 
  4842. field begins and ends by enclosing it in brackets.  These brackets indicate the 
  4843. position and length of each field value in the record.  You must do this for 
  4844. all the fields in the table.  Click OK when you are done. 
  4845.  
  4846. Define the Table 
  4847.  
  4848. Click OK to define the table. 
  4849.  
  4850.  
  4851. ΓòÉΓòÉΓòÉ 12.4. Date Masks for Text Driver ΓòÉΓòÉΓòÉ
  4852.  
  4853. Date masks tell the driver how a date is stored in a text file.  When a value 
  4854. is inserted into a text file, the date is formatted so that it matches the 
  4855. mask. When reading a text file, the driver converts the formatted date into a 
  4856. date data type. 
  4857.  
  4858. The following table lists the symbols to use when specifying the date mask: 
  4859.  
  4860. Symbol 
  4861.           Description 
  4862.  
  4863.           Output the month's number (1-12). 
  4864.  
  4865. mm 
  4866.           Output a leading zero if the month number is less than 10. 
  4867.  
  4868. mmm, Mmm, MMM 
  4869.           Output the three-letter abbreviation for the month depending on the 
  4870.           case of the M's (that is, jan, Jan, JAN). 
  4871.  
  4872. mmmm, Mmmm, MMMM 
  4873.           Output the full month name depending on the case of the M's (that is, 
  4874.           january, January, JANUARY). 
  4875.  
  4876.           Output the day number (1-31). 
  4877.  
  4878. dd 
  4879.           Output a leading zero if the day number is less than 10. 
  4880.  
  4881. ddd, Ddd, DDD 
  4882.           Output the three-letter day abbreviation depending on the case of the 
  4883.           D's (that is, mon, Mon, MON). 
  4884.  
  4885. dddd, Dddd, DDDD 
  4886.           Output the day depending on the case of the D's (that is, monday, 
  4887.           Monday, MONDAY). 
  4888.  
  4889. yy 
  4890.           Output the last two digits of the year. 
  4891.  
  4892. yyyy 
  4893.           Output the full four digits of the year. 
  4894.  
  4895.           Output the Julian value for the date.  The Julian value is the number 
  4896.           of days since 4712 BC. 
  4897.  
  4898.  / - .  :  , (space) 
  4899.           Output special characters used to separate the parts of a date. 
  4900.  
  4901.  / 
  4902.           Output the next character.  For example, if the mask is mm/dd/yyyy 
  4903.           /A/D, the value appears as 10/01/1993 AD in the text file. 
  4904.  
  4905. "string", 'string' 
  4906.           Output the string in the text file. 
  4907.  
  4908.           The following table shows some example masks and output when applied 
  4909.           to the date value "1993-10-01". 
  4910.  
  4911.    Mask 
  4912.              Value 
  4913.  
  4914.    yyyy-mm-dd 
  4915.              1993-10-01 
  4916.  
  4917.    m/d/yy 
  4918.              10/1/93 
  4919.  
  4920.    Ddd, Mmm dd, yyyy 
  4921.              Fri, Oct 01, 1993 
  4922.  
  4923.  
  4924. ΓòÉΓòÉΓòÉ 12.5. Connecting to a Text Database Using a Connection String ΓòÉΓòÉΓòÉ
  4925.  
  4926. If your application requires a connection string to connect to a data source, 
  4927. you must specify the data source name that tells the driver which ODBC.INI 
  4928. section to use for the default connection information.  Optionally, you may 
  4929. specify attribute=value pairs in the connection string to override the default 
  4930. values stored in ODBC.INI.  These values are not written to ODBC.INI. 
  4931.  
  4932. You can specify either long or short names in the connection string. The 
  4933. connection string has the form: 
  4934.  
  4935. DSN=data_source_name[;attribute=value[;attribute=value]...]
  4936.  
  4937. An example of a connection string for text files is 
  4938.  
  4939. DSN=TEXT FILES;TT=CHARACTER;DC=&
  4940.  
  4941. The following list gives the long and short names for each attribute, as well 
  4942. as a description. 
  4943.  
  4944. The defaults listed in the list are initial defaults that apply when no value 
  4945. is specified in either the connection string or in the data source definition 
  4946. in ODBC.INI.  If you specified a value for the attribute when configuring the 
  4947. data source, that value is your default. 
  4948.  
  4949. Attribute 
  4950.           Description 
  4951.  
  4952. DataSourceName (DSN) 
  4953.           A string that identifies a Text data source configuration in 
  4954.           ODBC.INI. Examples include "Accounting" or "Text Files." 
  4955.  
  4956. Database (DB) 
  4957.           The directory in which the text files are stored. 
  4958.  
  4959. ScanRows (SR) 
  4960.           The number of rows in a text file that the driver scans to determine 
  4961.           the column types in the file.  If the value is 0, all rows in the 
  4962.           file are scanned. The initial default is 25. 
  4963.  
  4964. TableType (TT) 
  4965.           TableType={Comma | Tab | Character | Fixed}. The Text driver supports 
  4966.           four types: comma-separated, tab-separated, character-separated, and 
  4967.           fixed length.  Setting this value tells the driver the default type, 
  4968.           which is used when creating a new table and opening an undefined 
  4969.           table. 
  4970.  
  4971. Delimiter (DC) 
  4972.           The character used as a delimiter for character-separated files.  It 
  4973.           can be any printable character except a single or double quote.  The 
  4974.           initial default is a comma (,). 
  4975.  
  4976. UndefinedTable (UT) 
  4977.           The Text driver can perform two operations when it encounters a file 
  4978.           that has not been defined. UndefinedTable=PROMPT tells the driver to 
  4979.           display a dialog box that allows the user to describe the file's 
  4980.           format.  UndefinedTable=GUESS tells the driver to guess the file's 
  4981.           format.  This is the initial default. 
  4982.  
  4983. ExtraExtensions (EE) 
  4984.           A list of additional filename extensions to be recognized as text 
  4985.           tables. When an application requests a list of tables, only files 
  4986.           that have been defined are returned.  To have the driver also return 
  4987.           names of undefined files, specify a comma-separated list of file 
  4988.           extensions.  To specify files with no extension, use the keyword 
  4989.           NONE. 
  4990.  
  4991. FileOpenCache (FOC) 
  4992.           The maximum number of unused file opens to cache.  For example, when 
  4993.           FileOpenCache=4, and a user opens and closes four files, the files 
  4994.           are not actually closed.  The driver keeps them open so that if 
  4995.           another query uses one of these files, the driver does not have to 
  4996.           perform another open, which is expensive.  The advantage of using 
  4997.           file open caching is increased performance. The disadvantage is that 
  4998.           a user who tries to open the file exclusively may get a locking 
  4999.           conflict even though no one appears to have the file open.  The 
  5000.           initial default is 0. 
  5001.  
  5002. CacheSize (CSZ) 
  5003.           The number of 64K blocks the driver uses to cache database records. 
  5004.           The higher the number, the better the performance.  The maximum 
  5005.           number of blocks you can set depends on the system memory available. 
  5006.           If the cache size is greater than 0, when browsing backwards, you 
  5007.           will not be able to see updates made by other users until you 
  5008.           reexecute the Select statement. The default is 4. 
  5009.  
  5010. FirstLineNames (FLN) 
  5011.           FirstLineNames={0 | 1}. A value that determines whether the driver 
  5012.           looks for column names in the first line of the file.  If 
  5013.           FirstLineNames=1, the driver looks for column names in the first line 
  5014.           of the file.  If FirstLineNames=0 (the initial default), the first 
  5015.           line is interpreted as the first record in the file. 
  5016.  
  5017. IntlSort (IS) 
  5018.           IntlSort={0 | 1}. A value that determines the order that records are 
  5019.           retrieved when you issue a Select statement with an Order By clause. 
  5020.           If IntlSort=1, the driver uses the international sort order as 
  5021.           defined by your operating system.  The sort is case-insensitive (a 
  5022.           precedes B); the sorting of accented characters is also affected (see 
  5023.           your operating system documentation). If IntlSort=0 (the initial 
  5024.           default), the driver uses the ASCII sort order, where uppercase 
  5025.           letters precede lowercase letters (B precedes a). 
  5026.  
  5027. UseLongQualifiers (ULQ): 
  5028.           UseLongQualifiers={0 | 1}. Enables the driver to use long pathnames 
  5029.           as table qualifiers. The default is 0, do not use long pathnames. The 
  5030.           default length for pathnames is 128 characters. When 
  5031.           UseLongQualifiers=1, pathnames can be up to 255 characters. 
  5032.  
  5033.           Note:  The ScanRows, TableType, Delimiter, and FirstLineNames 
  5034.           attributes apply to tables that have not been defined.  These 
  5035.           attributes also determine the characteristics of new tables created 
  5036.           with the Create Table statement. 
  5037.  
  5038.  
  5039. ΓòÉΓòÉΓòÉ 12.6. Text Data Types ΓòÉΓòÉΓòÉ
  5040.  
  5041. The text file data types are mapped to the standard ODBC data types as follows: 
  5042.  
  5043.  
  5044. Text      ODBC 
  5045. Numeric   SQL_NUMERIC 
  5046. Date      SQL_DATE 
  5047. Varchar   SQL_VARCHAR 
  5048.  
  5049.  
  5050. ΓòÉΓòÉΓòÉ 12.7. Text Select Statement ΓòÉΓòÉΓòÉ
  5051.  
  5052. You use the SQL Select statement to specify the columns and records to be read. 
  5053. The driver supports all Select statement clauses as described in SQL for 
  5054. Flat-File Drivers. 
  5055.  
  5056.  
  5057. ΓòÉΓòÉΓòÉ 12.8. Text ODBC Conformance Level ΓòÉΓòÉΓòÉ
  5058.  
  5059. The Text driver supports the Core, Level 1, and Level 2 API functions listed in 
  5060. Supported ODBC Functions.  It also supports backward and random fetching in 
  5061. SQLExtendedFetch. 
  5062.  
  5063. The driver supports the minimum SQL grammar. 
  5064.  
  5065.  
  5066. ΓòÉΓòÉΓòÉ 12.9. Number of Connections and Statements Supported by Text ΓòÉΓòÉΓòÉ
  5067.  
  5068. Text files support multiple connections and multiple statements per connection.