home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 8 Other / 08-Other.zip / odbcpa22.zip / IBTXT08.HLP (.txt) < prev    next >
OS/2 Help File  |  1998-04-20  |  10KB  |  250 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. Configuring a Text Data Source ΓòÉΓòÉΓòÉ
  3.  
  4. Data Source Name: 
  5.           A string that identifies this Text data source configuration in 
  6.           ODBC.INI.  Examples include "Accounting" or "Text Files." 
  7.  
  8. Description: 
  9.           An optional long description of a data source name. For example, "My 
  10.           Accounting Files" or "My Text Files in the Accounting Directory." 
  11.  
  12. Database Directory: 
  13.           The directory in which the text files are stored.  If none is 
  14.           specified, the current working directory is used. 
  15.  
  16. The following values are optional: 
  17.  
  18. Rows to Scan: 
  19.           The number of rows in a text file that the driver scans to determine 
  20.           the data types in the file.  If the value is 0, all rows in the file 
  21.           are scanned.  The default is 25. 
  22.  
  23. Default Table Type: 
  24.           The type of text file:  comma-separated, tab-separated, 
  25.           character-separated, or fixed length.  This value tells the driver 
  26.           the default type, which is used when creating a new table and opening 
  27.           an undefined table. 
  28.  
  29. Delimiter Character: 
  30.           The character used as a delimiter for character-separated files.  It 
  31.           can be any printable character.  The default is a comma (,). 
  32.  
  33. Action for Undefined Tables: 
  34.           Two radio buttons that indicate what action the driver should take 
  35.           when it encounters a file that has not been defined.  Set the Prompt 
  36.           for Definition radio button, if you want the driver to prompt the 
  37.           user when it encounters a file whose format is not defined. 
  38.           Otherwise, set the Guess Definition radio button; in this case, the 
  39.           driver guesses the file's format. 
  40.  
  41. Return Additional Tables: 
  42.           Select this check box to tell the driver to return files you have 
  43.           defined in functions like SQLTables, SQLColumns, etc.  and files with 
  44.           a given extension.  In Extension List, specify a comma-separated list 
  45.           of the extensions.  To have files with no extensions returned, 
  46.           specify NONE.  For example, if some of your files have the extensions 
  47.           TXT and CSV and others have no extension, specify TXT,CSV,NONE. 
  48.  
  49.           By default, when an application requests a list of tables, only files 
  50.           that have been defined are returned. 
  51.  
  52. File Open Cache: 
  53.           A numeric value to specify the maximum number of unused file opens to 
  54.           cache.  For example, the value 4 specifies that when a user opens and 
  55.           closes four tables, the tables are not actually closed.  The driver 
  56.           keeps them open so that if another query uses one of these tables, 
  57.           the driver does not have to perform another open, which is expensive. 
  58.           The advantage of file open caching is increased performance.  The 
  59.           disadvantage is that a user who specifies file locking on open may 
  60.           get a locking conflict even though no one appears to have the file 
  61.           open.  The default is 0, which means no file open caching. 
  62.  
  63. Cache Size: 
  64.           The amount of memory, in 64K blocks, that the driver uses to cache 
  65.           database records.  The higher the number, the better the performance. 
  66.           The maximum number you can set depends on the system memory 
  67.           available.  This value must be a multiple of 64.  The default is 
  68.           256K.  If the cache size is greater than 0, when browsing backwards, 
  69.           you will not be able to see updates made by other users until you 
  70.           reexecute the Select statement. 
  71.  
  72. Column Names in First Line: 
  73.           Select this check box to tell the driver to look for column names in 
  74.           the first line of the file. 
  75.  
  76. International Sort: 
  77.           A setting to indicate the order in which records are retrieved when 
  78.           you issue a Select statement with an Order By clause.  Select this 
  79.           check box to use the international sort order as defined by your 
  80.           operating system.  International sort order is case-insensitive (a 
  81.           precedes B); the sorting of accented characters is also affected (see 
  82.           your operating system documentation).  Leave this box blank to use 
  83.           the ASCII sort order.  ASCII sort order is case-sensitive, where 
  84.           uppercase letter precede lowercase letters (B precedes a). 
  85.  
  86. Note: 
  87.           The Rows to Scan, Default Table Type, Delimiter Character, and Column 
  88.           Names in First Line settings apply only to tables not previously 
  89.           defined.  These fields also determine the attributes of new tables 
  90.           created with the Create Table statement. 
  91.  
  92. Use Long Qualifiers: 
  93.           A setting that enables the driver to use long pathnames as table 
  94.           qualifiers. When you set this check box, pathnames can be up to 255 
  95.           characters. The default length for pathnames is 128 characters. 
  96.  
  97. Translate 
  98.  
  99. Displays the Select Translator dialog box to allow you to perform  a 
  100. translation of your data from one character set to another. Choose the 
  101. INTERSOLV OEM ANSI translator to translate your data from the IBM PC character 
  102. set to the ANSI character set. 
  103.  
  104.  
  105. ΓòÉΓòÉΓòÉ 2. Defining Table Structure ΓòÉΓòÉΓòÉ
  106.  
  107. Since text files do not all have the same structure, the driver provides the 
  108. option of defining the structure of an existing file. Although defining the 
  109. structure is not mandatory, since the driver can attempt to guess the names and 
  110. types of the columns, this feature is extremely useful. 
  111.  
  112. In this dialog box, the Database Name field and the File field are 
  113. informational fields only. The Database Name field displays the name of the 
  114. database directory that contains the file. The File field displays the name of 
  115. the file you previously selected. 
  116.  
  117. Specifying Table Information 
  118.  
  119. In the Table Information section of this dialog box, specify information about 
  120. the overall structure of the file: 
  121.  
  122.  1. In the Table field, enter a table name. Values may be up to 32 characters 
  123.     in length and may not be the same as another defined table in the database. 
  124.     This name is returned by SQLTables. By default, it is the filename without 
  125.     its extension. 
  126.  
  127.  2. Select the Column Names in First Line check box if the first line of the 
  128.     file contains column names. Otherwise, do not select this check box. 
  129.  
  130.  3. Open the Table Type box and select a table type: comma, tab, fixed, or 
  131.     character. 
  132.  
  133.  4. If the table type you select is character-separated, enter the character 
  134.     that separates the values in the Delimiter Character field. 
  135.  
  136.  5. Select the OEM to ANSI Translation check box to tell the driver that the 
  137.     data is stored in the IBM PC character set. If your data is stored in the 
  138.     ANSI character set, do not select this check box. This changes the display 
  139.     format only; the data is not converted. 
  140.  
  141.     Specifying Column Information 
  142.  
  143.     In the Column Information section, define the types and names of the 
  144.     columns in the table. The box in the upper-left corner of this section 
  145.     lists the defined columns. 
  146.  
  147.     If you specified a comma-separated, tab-separated, or character-separated 
  148.     table type, a Guess button is displayed in this section. Click Guess to 
  149.     tell the driver to guess the fields. The driver then displays what it 
  150.     thinks the fields are. You can then modify the field definitions by 
  151.     clicking Modify and completing the Name, Precision, and Scale fields. If 
  152.     you do not want the driver to guess the fields, take the following steps to 
  153.     define the fields: 
  154.  
  155.     a. In the Name field, type the name of the field. 
  156.  
  157.     b. Open the Type box and select the data type of the field. If the field 
  158.        type is date, then you must select a date mask for the field or type one 
  159.        in. 
  160.  
  161.     c. In the Precision field, type the precision of the field. 
  162.  
  163.     d. In the Scale field, type the scale of the field.  The precision and 
  164.        scale values determine how numeric data is to be returned. 
  165.  
  166.     e. If you specified a fixed-length table type, you may enter the length and 
  167.        offset in the Length and Offset fields, or you can specify a parse 
  168.        string. The length is the number of bytes the data takes up in storage; 
  169.        the offset is the number of bytes from the start of the table to the 
  170.        start of the field. 
  171.  
  172.     f. Click Add to add this field definition to the list box. 
  173.  
  174.        To modify the currently selected field in the list box, click Modify. 
  175.  
  176.        To remove the currently selected field in the list box, click Remove. 
  177.  
  178.  
  179. ΓòÉΓòÉΓòÉ 3. Parsing Fixed Length Files ΓòÉΓòÉΓòÉ
  180.  
  181. This dialog box displays the first line of the file. You must mark where each 
  182. field begins and ends by enclosing it in brackets. These brackets indicate the 
  183. position and length of each field value in the record. You must do this for all 
  184. the fields in the table. 
  185.  
  186.  
  187. ΓòÉΓòÉΓòÉ 4. Date Masks ΓòÉΓòÉΓòÉ
  188.  
  189. Date masks tell the driver how a date is stored in a text file. When a value is 
  190. inserted into the text file, the date is formatted so that it matches the mask. 
  191. When reading the text file, the driver converts the formatted date into a date 
  192. data type. 
  193.  
  194. The following list shows the symbols to use when specifying the date mask and 
  195. describes the output of the mask: 
  196.  
  197.           Output the month's number (1-12). 
  198.  
  199. mm 
  200.           Output a leading zero if the month number is less than 10. 
  201.  
  202. mmm, Mmm, MMM 
  203.           Output the three-letter abbreviation for the month depending on the 
  204.           case of the M's (that is, jan, Jan, JAN). 
  205.  
  206. mmmm, Mmmm, MMMM 
  207.           Output the full month name depending on the case of the M's (that is, 
  208.           january, january, JANUARY). 
  209.  
  210.           Output the day number (1-31). 
  211.  
  212. dd 
  213.           Output a leading zero if the day number is less than 10. 
  214.  
  215. ddd, Ddd, DDD 
  216.           Output the three-letter day abbreviation depending on the case of the 
  217.           D's (that is, mon, Mon, MON). 
  218.  
  219. dddd, Dddd, DDDD 
  220.           Output the day depending on the case of the D's (that is, monday, 
  221.           Monday, MONDAY). 
  222.  
  223. yy 
  224.           Output the last two digits of the year. 
  225.  
  226. yyyy 
  227.           Output the full four digits of the year. 
  228.  
  229.           Output the Julian value for the date. The Julian value is the number 
  230.           of days since 4712 BC. 
  231.  
  232. \ - . : , (space) 
  233.           Output special characters to separate the parts of a date. 
  234.  
  235.           Output the next character. For example, if the mask is mm/dd/yyyy 
  236.           \A\D, the value appears as 10/01/1993 AD in the text file. 
  237.  
  238. "string", 'string' 
  239.           Output the string in the text file. 
  240.  
  241. For example, applying these masks to the date "1993-10-01" outputs the 
  242. following values in the text file: 
  243.  
  244. The mask "yyyy-mm-dd" outputs "1993-10-01" 
  245.  
  246. The mask "m/d/yy" outputs "10/1/93"