[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 574: sizeof(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 630: sizeof(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 113: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 113: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 113: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 5348: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3937)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 5348: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3937)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 5348: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3937)
Russian Progress User Group • Как выполнять действия в транзакции через ODBC
Страница 1 из 1

Как выполнять действия в транзакции через ODBC

Добавлено: 18 июл 2016, 14:48
shatalxe
Добрый день! Если вопрос задан не туда, то пожалуйста направьте меня куда надо

Создаю соединение из 1с:

Connection = Новый COMОбъект("ADODB.Connection");
Connection.ConnectionTimeOut = 20;
Connection.Provider = "MSDASQL.1";
Connection.Open(СтрокаПодключения);

Выполняю некоторые запросы:

Command = Новый COMОбъект("ADODB.Command");
Command.ActiveConnection = Connection;
Command.CommandText = ТекстЗапроса;
Command.CommandType = 1;

Вопрос: как мне несколько запросов выполнить в одной транзакции

Re: Как выполнять действия в транзакции через ODBC

Добавлено: 18 июл 2016, 18:22
Arelav

Re: Как выполнять действия в транзакции через ODBC

Добавлено: 19 июл 2016, 08:06
shatalxe
Да, OpenEdge.

В данной SQL я ни разу не работал, нет доступа. Данные получаю/изменяю/удаляю конструкцией

Command = Новый COMОбъект("ADODB.Command");
Command.ActiveConnection = Connection;
Command.CommandText = ТекстЗапроса;
Command.CommandType = 1;

Где ТекстЗапроса, например:
SELECT
*
FROM pub.Table

Дк вот мне нужно выполнить несколько таких команд в одной транзакции

Re: Как выполнять действия в транзакции через ODBC

Добавлено: 19 июл 2016, 12:13
Arelav
Что-то вроде этого?

SELECT Name, Address, State, PostalCode
FROM Customer
UNION
SELECT Name, Address, State, PostalCode
FROM Supplier
ORDER BY 1;

Re: Как выполнять действия в транзакции через ODBC

Добавлено: 19 июл 2016, 12:15
Arelav
Посмотрите по документации:
OpenEdge Data Management: SQL Reference
http://documentation.progress.com/outpu ... eface.html

Re: Как выполнять действия в транзакции через ODBC

Добавлено: 20 июл 2016, 12:20
shatalxe

Re: Как выполнять действия в транзакции через ODBC

Добавлено: 20 июл 2016, 13:24
Arelav
INSERT INTO pub.customer ("Cust-Num", Name, Country) VALUES (1001, 'New Customer Name', 'USA');
INSERT INTO pub.customer ("Cust-Num", Name, Country) VALUES (1002, 'New Customer Name', 'USA');
INSERT INTO pub.customer ("Cust-Num", Name, Country) VALUES (1003, 'New Customer Name', 'USA');
COMMIT;
SELECT "Cust-Num", Name, Country FROM pub.customer WHERE "Cust-Num" >= 1001;

Транзакция откроется автоматически с первым оператором INSERT и будет действовать до выполнения оператора COMMIT.

Если что-то пойдёт не так на первых трёх INSERT или COMMIT не будет выполнен, а сессия завершится, то изменения откатятся.

Re: Как выполнять действия в транзакции через ODBC

Добавлено: 20 июл 2016, 13:28
Arelav
Для информации: ""

Re: Как выполнять действия в транзакции через ODBC

Добавлено: 20 июл 2016, 15:47
shatalxe