| 1 |
|
| 2 |
=head1 Database and Driver Characteristics |
| 3 |
|
| 4 |
This document is designed to give you a flavour of the functionality |
| 5 |
and quirks of the different DBI drivers and their databases. |
| 6 |
|
| 7 |
The line between the functionality and quirks of a given driver and the |
| 8 |
functionality and quirks of its corresponding database is blurred. In |
| 9 |
some cases the database has functionality that the driver can't or |
| 10 |
doesn't access, in others the driver may emulate functionality that the |
| 11 |
database doesn't support, like placeholders. So when you see the terms |
| 12 |
driver and database below, take them with a pinch of salt. |
| 13 |
|
| 14 |
We don't attempt to describe the drivers and database in full detail |
| 15 |
here, we're only interested in the key features that are most commonly |
| 16 |
used. And for those features we're just providing an outline guide. |
| 17 |
Consult the database documentation for full details. |
| 18 |
|
| 19 |
The primary goals are: |
| 20 |
|
| 21 |
- to provide a simple overview of each driver and database. |
| 22 |
- to help you initially select a suitable DBI driver and database. |
| 23 |
- to help you quickly identify potential issues if you need to port |
| 24 |
an application from one driver and database to another. |
| 25 |
|
| 26 |
=head2 Driver Name, Version, Author and Contact Details |
| 27 |
|
| 28 |
This driver summary is for DBD::XBase version 0.130 |
| 29 |
|
| 30 |
The driver author is Jan Pazdziora and he can be contacted via his |
| 31 |
e-mail [email protected] or the dbi-(dev|users) mailing lists. |
| 32 |
|
| 33 |
=head2 Supported Database Versions and Options |
| 34 |
|
| 35 |
The DBD::XBase module supports dBaseIII and IV and Fox* flawors of |
| 36 |
dbf files, including their dbt and fpt memo files. |
| 37 |
|
| 38 |
=head2 Connect Syntax |
| 39 |
|
| 40 |
Details of the syntax of the dsn including any optional parts. |
| 41 |
|
| 42 |
The DBI->connect Data Source Name (DSN) should include the directory |
| 43 |
where the dbt files are located as the third part. |
| 44 |
|
| 45 |
dbi:XBase:/path/to/directory |
| 46 |
|
| 47 |
It defaults to current directory. |
| 48 |
|
| 49 |
Details of any driver specific attributes applicable to the |
| 50 |
connect method. |
| 51 |
|
| 52 |
There are no driver specific attributes for the DBI->connect method. |
| 53 |
|
| 54 |
=head2 Numeric Data Handling |
| 55 |
|
| 56 |
What numeric data types do the database and driver support? (INTEGER, |
| 57 |
FLOAT, NUMBER(p,s) etc). What is the maximum scale and precision for |
| 58 |
each type? |
| 59 |
|
| 60 |
Generic NUMBER(p,s) and FLOAT(p,s), INTEGER(l). Maximul scale and |
| 61 |
precision unknown, resp. limited by Perl's handling of numbers. In |
| 62 |
the dbf files, the numbers are stored as ASCII strings, or binary |
| 63 |
integers or floats. |
| 64 |
|
| 65 |
Numbers are always returned converted to numbers, so numbers outside |
| 66 |
of Perl's valid range are not possible (even if this restriction might |
| 67 |
be withdrawn in the future). |
| 68 |
|
| 69 |
Does the database and driver support numbers outside the valid range |
| 70 |
for perl numbers? |
| 71 |
|
| 72 |
No. |
| 73 |
|
| 74 |
Are numbers returned as strings in this case? |
| 75 |
|
| 76 |
N/A |
| 77 |
|
| 78 |
=head2 String Data Handling |
| 79 |
|
| 80 |
What string data types does the database support? (CHAR, VARCHAR, etc) |
| 81 |
|
| 82 |
DBD::XBase knows CHAR(length) and VARCHAR(length), both are stored as |
| 83 |
fixed length chars however. These can contain any binary values. No |
| 84 |
charset options are recongnized. |
| 85 |
|
| 86 |
What is the maximum size for each type? |
| 87 |
|
| 88 |
65535 characters (even if the older dBase's only allowed 255 |
| 89 |
characters, so created dbf might not be porteble to other xbase-like |
| 90 |
software). |
| 91 |
|
| 92 |
Are any types blank padded? If so which, e.g., CHAR. |
| 93 |
|
| 94 |
Yes. |
| 95 |
|
| 96 |
How does the database handle data with the 8th bit set (national |
| 97 |
language character sets etc)? |
| 98 |
|
| 99 |
Data with the 8th bit set are handles transparently, no national |
| 100 |
language character set conversions are done. |
| 101 |
|
| 102 |
Is Unicode supported? |
| 103 |
|
| 104 |
No (there is no notion of charsets). |
| 105 |
|
| 106 |
=head2 Date Data Handling |
| 107 |
|
| 108 |
What date, time and date+time data types are supported |
| 109 |
and what is their valid range and resolution? |
| 110 |
|
| 111 |
Default (and only possible) date format for input and output is 8 char |
| 112 |
string 'YYYYMMDD'. DBD::XBase doesn't check for validity of this |
| 113 |
string. |
| 114 |
|
| 115 |
The datetime type works internally with the precision up to 1/1000 s. |
| 116 |
DBD::XBase currently supports this using Un*x standard |
| 117 |
seconds-since-epoch value (possibly with decimal part). This might |
| 118 |
change in the future. |
| 119 |
|
| 120 |
What date, time and date+time formats are supported? |
| 121 |
|
| 122 |
No formats except the defaults are supported. |
| 123 |
|
| 124 |
What is the default output format for each? |
| 125 |
|
| 126 |
'YYYYMMDD' and number of seconds since 1970/1/1. |
| 127 |
|
| 128 |
What is the default input format for each? |
| 129 |
Are multiple input format recognised? |
| 130 |
|
| 131 |
'YYYYMMDD' and number of seconds since 1970/1/1. This is the only |
| 132 |
possibility. |
| 133 |
|
| 134 |
If only part of a date is specified, how does the rest default? |
| 135 |
|
| 136 |
No partial definitions are allowed. |
| 137 |
|
| 138 |
If two digit years can be used, how is the century determined? |
| 139 |
|
| 140 |
N/A |
| 141 |
|
| 142 |
Can the default format be changed? If so, how (both for a single |
| 143 |
expression in an sql statement, and as a database connection default)? |
| 144 |
|
| 145 |
No. |
| 146 |
|
| 147 |
How can I get the current date+time in an SQL expression? |
| 148 |
|
| 149 |
There is no way to get the current date/time. |
| 150 |
|
| 151 |
How can I input date and date+time values in other formats? |
| 152 |
|
| 153 |
N/A |
| 154 |
|
| 155 |
How can I output date and date+time values in other formats? |
| 156 |
|
| 157 |
N/A |
| 158 |
|
| 159 |
What kinds of date and time arithmetic and functions are supported? |
| 160 |
|
| 161 |
None. |
| 162 |
|
| 163 |
What SQL expression can be used to convert from an integer "seconds |
| 164 |
since 1-jan-1970 GMT" value to the corresponding database date+time? |
| 165 |
If not possible, then what perl expression can be used? |
| 166 |
|
| 167 |
N/A |
| 168 |
|
| 169 |
What SQL expression can be used to convert from a database date+time |
| 170 |
value into the corresponding "seconds since 1-jan-1970 GMT" value? |
| 171 |
If not possible, then what perl expression can be used? |
| 172 |
|
| 173 |
N/A |
| 174 |
|
| 175 |
How does the database deal with time zones, especially where the |
| 176 |
client inserting a date, the server and a client reading the date |
| 177 |
are all in different time zones? |
| 178 |
|
| 179 |
There is no time zones handling. |
| 180 |
|
| 181 |
=head2 LONG/BLOB Data Handling |
| 182 |
|
| 183 |
What LONG/BLOB data types does the database support? |
| 184 |
(LONG, LONG RAW, CLOB, BLOB, BFILE etc) |
| 185 |
What are their maximum sizes? |
| 186 |
|
| 187 |
BLOB/MEMO data types are supported. With dBaseIII dbt files, the memo |
| 188 |
field cannot contain \x1a byte, with dBaseIV and Fox* dbt/fpt's any |
| 189 |
value can be stored. |
| 190 |
|
| 191 |
Which types, if any, must be passed to and from the database as pairs |
| 192 |
of hex digits? |
| 193 |
|
| 194 |
None. |
| 195 |
|
| 196 |
Do the LongReadLen and LongTruncOk attributes work as defined? |
| 197 |
What is the maximum value, if any, for LongReadLen? |
| 198 |
|
| 199 |
The LongReadLen and LongTruncOk attributes are ignored/are broken |
| 200 |
(will be fixed). |
| 201 |
|
| 202 |
Is special handling required for some or all LONG/BLOB data types? |
| 203 |
|
| 204 |
No. |
| 205 |
|
| 206 |
=head2 Other Data Handling issues |
| 207 |
|
| 208 |
Does the driver support type_info method? |
| 209 |
|
| 210 |
The DBD::XBase driver supports the type_info method. |
| 211 |
|
| 212 |
=head2 Transactions and Transaction Isolation |
| 213 |
|
| 214 |
Does the database support transactions? |
| 215 |
|
| 216 |
No. |
| 217 |
|
| 218 |
If so, what is the default transaction isolation level? |
| 219 |
|
| 220 |
N/A |
| 221 |
|
| 222 |
What other isolation levels are supported and how can they |
| 223 |
be enabled per-connection or per-transaction? |
| 224 |
|
| 225 |
N/A |
| 226 |
|
| 227 |
=head2 Explicit Locks |
| 228 |
|
| 229 |
What is the default locking behaviour for reading and writing? |
| 230 |
|
| 231 |
N/A |
| 232 |
|
| 233 |
What statements can be used to explicitly lock a table with |
| 234 |
various types/levels of lock? E.g., "lock table ...". |
| 235 |
|
| 236 |
N/A |
| 237 |
|
| 238 |
How can a select statement be modified to lock the selected rows |
| 239 |
from being changed by another transaction. |
| 240 |
E.g., "select ... for update". |
| 241 |
|
| 242 |
N/A |
| 243 |
|
| 244 |
=head2 No-Table Expression Select Syntax |
| 245 |
|
| 246 |
What syntax is used for 'selecting' a constant expression |
| 247 |
from the database? E.g., "select 42 from dual" (Oracle). |
| 248 |
|
| 249 |
N/A |
| 250 |
|
| 251 |
=head2 Table Join Syntax |
| 252 |
|
| 253 |
If equi-joins are supported but don't use the standard |
| 254 |
"WHERE a.field = b.field" syntax, then describe the syntax. |
| 255 |
|
| 256 |
Are 'outer joins' supported, if so with what syntax? |
| 257 |
|
| 258 |
N/A |
| 259 |
|
| 260 |
=head2 Table and Column Names |
| 261 |
|
| 262 |
What is the max size of table names? And column names? |
| 263 |
|
| 264 |
For table names limited by OS's max filename length. For column name |
| 265 |
11 characters. |
| 266 |
|
| 267 |
What characters are valid without quoting? |
| 268 |
|
| 269 |
It has to start with letter and a combination of letters, digits and |
| 270 |
underscores may follow. |
| 271 |
|
| 272 |
Can table and field names be quoted? If so, how? |
| 273 |
What characters are valid with quoting? |
| 274 |
|
| 275 |
N/A |
| 276 |
|
| 277 |
Are table/column names stored as uppercase, lowercase or |
| 278 |
as-entered? |
| 279 |
Are table/column names case sensitive? |
| 280 |
|
| 281 |
Table names are stored and treated as entered (case sensitively), |
| 282 |
column names as uppoercase. |
| 283 |
|
| 284 |
Can national character sets (with the 8th bit set) be used? |
| 285 |
|
| 286 |
National character sets can be used. |
| 287 |
|
| 288 |
=head2 Case sensivity of like operator |
| 289 |
|
| 290 |
Is the LIKE operator case sensitive? |
| 291 |
If so, how can case insensitive LIKE operations be performed? |
| 292 |
|
| 293 |
The LIKE operator is not case sensitive. There is (currently) no case |
| 294 |
sensitive operator. |
| 295 |
|
| 296 |
=head2 Row ID |
| 297 |
|
| 298 |
If the database supports a 'row id' pseudocolumn, what is |
| 299 |
it called? E.g., 'rowid' in Oracle, 'tid' in Ingres. |
| 300 |
|
| 301 |
No. |
| 302 |
|
| 303 |
Can it be treated as a string when fetching and reusing in |
| 304 |
later statements? If not, what special handling is required? |
| 305 |
|
| 306 |
N/A |
| 307 |
|
| 308 |
=head2 Automatic Key or Sequence Generation |
| 309 |
|
| 310 |
Does the database offer automatic key generation such as |
| 311 |
'auto increment' or 'system generated' keys? |
| 312 |
|
| 313 |
No. |
| 314 |
|
| 315 |
Does the database support sequence generators? |
| 316 |
If so, what syntax is used? |
| 317 |
|
| 318 |
No. |
| 319 |
|
| 320 |
=head2 Automatic Row Numbering and Row Count Limiting |
| 321 |
|
| 322 |
Can you select a row-numbering pseudocolumn and if so, what |
| 323 |
is it called? |
| 324 |
|
| 325 |
No. |
| 326 |
|
| 327 |
=head2 Parameter binding |
| 328 |
|
| 329 |
Is parameter binding supported by the database, emulated by the |
| 330 |
driver or not supported at all? |
| 331 |
|
| 332 |
Parameter binding is emulated by the driver. |
| 333 |
|
| 334 |
If parameter binding is supported, is the :1 placeholder style also |
| 335 |
supported? |
| 336 |
|
| 337 |
No (yet). |
| 338 |
|
| 339 |
Does the driver support the TYPE attribute do bind_param? |
| 340 |
If so, which types are supported and how do they affect the bind? |
| 341 |
|
| 342 |
TBWS. |
| 343 |
|
| 344 |
Do unsupported values of the TYPE attribute generate a warning? |
| 345 |
|
| 346 |
TBWS. |
| 347 |
|
| 348 |
=head2 Stored procedures |
| 349 |
|
| 350 |
What syntax is used to call stored procedures and, where possible, |
| 351 |
get results? |
| 352 |
|
| 353 |
N/A |
| 354 |
|
| 355 |
=head2 Table Metadata |
| 356 |
|
| 357 |
Does the driver support table_info method? |
| 358 |
|
| 359 |
DBD::XBase supports the table_info method. |
| 360 |
|
| 361 |
How can detailed information about the columns of a table be fetched? |
| 362 |
|
| 363 |
TBWS. |
| 364 |
|
| 365 |
How can detailed information about the indexes of a table be fetched? |
| 366 |
|
| 367 |
Indexes are not supported. |
| 368 |
|
| 369 |
How can detailed information about the keys of a table be fetched? |
| 370 |
|
| 371 |
Keys are not supported. |
| 372 |
|
| 373 |
=head2 Driver-specific database handle attributes |
| 374 |
|
| 375 |
xbase_ignorememo. |
| 376 |
|
| 377 |
=head2 Driver-specific statement handle attributes |
| 378 |
|
| 379 |
xbase_ignorememo. |
| 380 |
|
| 381 |
=head2 Default local row cache size and behaviour |
| 382 |
|
| 383 |
Does the driver or database implement a local row cache when fetching |
| 384 |
rows from a select statement? What is the default size? |
| 385 |
|
| 386 |
DBD::XBase doesn't maintain any row cache. |
| 387 |
|
| 388 |
=head2 Positioned updates and deletes |
| 389 |
|
| 390 |
Does the driver support positioned updates and deletes (also called |
| 391 |
updatable cursors)? If so, what syntax is used? E.g, "update ... |
| 392 |
where current of $cursor_name". |
| 393 |
|
| 394 |
DBD::XBase does not support positioned updates or deletes. |
| 395 |
|
| 396 |
=head2 Differences from the DBI specification |
| 397 |
|
| 398 |
List any significant differences in behaviour from the current DBI |
| 399 |
specification. |
| 400 |
|
| 401 |
DBD::XBase has no known significant differences in behaviour from the |
| 402 |
current DBI specification. |
| 403 |
|
| 404 |
=head2 URLs to more database/driver specific information |
| 405 |
|
| 406 |
http://www.e-bachmann.dk/docs/xbase.htm |
| 407 |
|
| 408 |
=head2 Multiple concurrent database connections |
| 409 |
|
| 410 |
Does the driver allow multiple concurrent database connections |
| 411 |
to the same database? |
| 412 |
|
| 413 |
DBD::XBase supports an unlimited number of concurrent database |
| 414 |
connections to one or more databases. |
| 415 |
|
| 416 |
=head2 Concurrent use of multiple statement handles from same $dbh. |
| 417 |
|
| 418 |
Does the driver allow a new statement handle to be prepared and used |
| 419 |
while still fetching data from another statment handle associated |
| 420 |
with the same database handle? |
| 421 |
|
| 422 |
DBD::XBase supports the preparation and execution of a new statement |
| 423 |
handle while still fetching data from another statment handle |
| 424 |
associated with the same database handle. |
| 425 |
|
| 426 |
=head2 Driver specific methods |
| 427 |
|
| 428 |
What generally useful private ($h->func(...)) methods are provided? |
| 429 |
|
| 430 |
None. |
| 431 |
|
| 432 |
=cut |
| 433 |
|