| 667 | |
| 668 | |
| 669 | == Wywołanie zapytania na zewnętrznym źródle danych (MSSQL, ORACLE,..) == |
| 670 | |
| 671 | {{{ |
| 672 | $dsID = 1; // ID źródła danych (dtscid) lub nazwa (dtscnm) z tabeli data_sources |
| 673 | $query = 'SELECT * FROM tabela WHERE kolumna = 12'; |
| 674 | |
| 675 | ErrorHandler::tryBegin(); |
| 676 | |
| 677 | try { |
| 678 | $result = DataSourceManager::execute($dsID, $query); |
| 679 | } catch (Exception $e) { |
| 680 | |
| 681 | } |
| 682 | |
| 683 | ErrorHandler::tryEnd(); |
| 684 | |
| 685 | if (!$result) { |
| 686 | JScript::alert(DataSourceManager::getLastErrorMessage()); |
| 687 | return FALSE; |
| 688 | } |
| 689 | |
| 690 | var_dump($result); |
| 691 | |
| 692 | }}} |