| | 411 | </li> |
|---|
| | 412 | </ul> |
|---|
| | 413 | |
|---|
| | 414 | <h2><a name="PDOSQLExecTask"></a>PDOSQLExecTask</h2> |
|---|
| | 415 | |
|---|
| | 416 | <p>The <em>PDOSQLExecTask</em> executes SQL statements using PDO.</p> |
|---|
| | 417 | |
|---|
| | 418 | <h3>Examples</h3> |
|---|
| | 419 | |
|---|
| | 420 | <pre><pdo url="pgsql:host=localhost dbname=test"> |
|---|
| | 421 | <fileset dir="sqlfiles"> |
|---|
| | 422 | <include name="*.sql"/> |
|---|
| | 423 | </fileset> |
|---|
| | 424 | </pdo> |
|---|
| | 425 | </pre> |
|---|
| | 426 | |
|---|
| | 427 | <pre><pdo url="mysql:host=localhost;dbname=test" userid="username" password="password"> |
|---|
| | 428 | <transaction src="path/to/sqlfile.sql"/> |
|---|
| | 429 | </pdo> |
|---|
| | 430 | </pre> |
|---|
| | 431 | |
|---|
| | 432 | <h3>Attributes</h3> |
|---|
| | 433 | <table> |
|---|
| | 434 | <thead> |
|---|
| | 435 | <tr> |
|---|
| | 436 | <th>Name</th> |
|---|
| | 437 | <th>Type</th> |
|---|
| | 438 | <th>Description</th> |
|---|
| | 439 | <th>Default</th> |
|---|
| | 440 | <th>Required</th> |
|---|
| | 441 | </tr> |
|---|
| | 442 | </thead> |
|---|
| | 443 | <tbody> |
|---|
| | 444 | <tr> |
|---|
| | 445 | <td>url</td> |
|---|
| | 446 | <td>String</td> |
|---|
| | 447 | <td>PDO connection URL (DSN) </td> |
|---|
| | 448 | <td>none</td> |
|---|
| | 449 | <td>Yes</td> |
|---|
| | 450 | </tr> |
|---|
| | 451 | <tr> |
|---|
| | 452 | <td>userid</td> |
|---|
| | 453 | <td>String</td> |
|---|
| | 454 | <td>Username for connection (if it cannot be specified in URL) </td> |
|---|
| | 455 | <td>none</td> |
|---|
| | 456 | <td>No</td> |
|---|
| | 457 | </tr> |
|---|
| | 458 | <tr> |
|---|
| | 459 | <td>password</td> |
|---|
| | 460 | <td>String</td> |
|---|
| | 461 | <td>The password to use for the connection (if it cannot be specified in URL) </td> |
|---|
| | 462 | <td>none</td> |
|---|
| | 463 | <td>No</td> |
|---|
| | 464 | </tr> |
|---|
| | 465 | <tr> |
|---|
| | 466 | <td>encoding</td> |
|---|
| | 467 | <td>String</td> |
|---|
| | 468 | <td>The database encoding.</td> |
|---|
| | 469 | <td>none</td> |
|---|
| | 470 | <td>No</td> |
|---|
| | 471 | </tr> |
|---|
| | 472 | <tr> |
|---|
| | 473 | <td>src</td> |
|---|
| | 474 | <td>File</td> |
|---|
| | 475 | <td>A single source file of SQL statements to execute.</td> |
|---|
| | 476 | <td>none</td> |
|---|
| | 477 | <td>No</td> |
|---|
| | 478 | </tr> |
|---|
| | 479 | <tr> |
|---|
| | 480 | <td>onerror</td> |
|---|
| | 481 | <td>String</td> |
|---|
| | 482 | <td>The action to perform on error (continue, stop, or abort)</td> |
|---|
| | 483 | <td>abort</td> |
|---|
| | 484 | <td>No</td> |
|---|
| | 485 | </tr> |
|---|
| | 486 | <tr> |
|---|
| | 487 | <td>output</td> |
|---|
| | 488 | <td>File</td> |
|---|
| | 489 | <td>The file to which output should be logged.</td> |
|---|
| | 490 | <td>none</td> |
|---|
| | 491 | <td>No</td> |
|---|
| | 492 | </tr> |
|---|
| | 493 | <tr> |
|---|
| | 494 | <td>print</td> |
|---|
| | 495 | <td>Boolean</td> |
|---|
| | 496 | <td>Whether to print results of query.</td> |
|---|
| | 497 | <td>false</td> |
|---|
| | 498 | <td>No</td> |
|---|
| | 499 | </tr> |
|---|
| | 500 | <tr> |
|---|
| | 501 | <td>showheaders</td> |
|---|
| | 502 | <td>Boolean</td> |
|---|
| | 503 | <td>Whether to show column headers.</td> |
|---|
| | 504 | <td>false</td> |
|---|
| | 505 | <td>No</td> |
|---|
| | 506 | </tr> |
|---|
| | 507 | <tr> |
|---|
| | 508 | <td>delimiter</td> |
|---|
| | 509 | <td>String</td> |
|---|
| | 510 | <td>The delimeter to separate SQL statements (e.g. "GO" in MSSQL)</td> |
|---|
| | 511 | <td>;</td> |
|---|
| | 512 | <td>No</td> |
|---|
| | 513 | </tr> |
|---|
| | 514 | <tr> |
|---|
| | 515 | <td>delimitertype</td> |
|---|
| | 516 | <td>String</td> |
|---|
| | 517 | <td>The delimiter type ("normal" or "row"). Normal means that any occurence of the delimiter |
|---|
| | 518 | terminate the SQL command whereas with row, only a line containing just |
|---|
| | 519 | the delimiter is recognized as the end of the command.</td> |
|---|
| | 520 | <td>normal</td> |
|---|
| | 521 | <td>No</td> |
|---|
| | 522 | </tr> |
|---|
| | 523 | </tbody> |
|---|
| | 524 | </table> |
|---|
| | 525 | |
|---|
| | 526 | <h3>Supported Nested Tags</h3> |
|---|
| | 527 | <ul> |
|---|
| | 528 | <li>transaction |
|---|
| | 529 | <p>Wrapper for a single transaction.</p> |
|---|
| | 530 | </li> |
|---|
| | 531 | <li>fileset |
|---|
| | 532 | <p>Files containing SQL statements.</p> |
|---|