Этот баннер — требование Роскомнадзора для исполнения 152 ФЗ.
«На сайте осуществляется обработка файлов cookie, необходимых для работы сайта, а также для анализа использования сайта и улучшения предоставляемых сервисов с использованием метрической программы Яндекс.Метрика. Продолжая использовать сайт, вы даёте согласие с использованием данных технологий».
Политика конфиденциальности
|
|
|
SQL Query within cursor (MSSQL ODBC) - проблема
|
|||
|---|---|---|---|
|
#18+
Доброго всем времени суток! PB 9.0.1 6533, MSSQL ODBC Опишу проблему: В разработке и сопровождении проект, который разрабатывался еще под PB7. Программа работает с DB Oracle & MS SQL through ODBC bridge ( не OLE DB ). При работе с ораклом нет проблем, вот с MS SQL есть одна неприятность ( вернее, неприятность скорей всего с дровами ODBC ): В коде программы полно мест, в которых используются курсорные циклы, внутри которых вызываются хранимые процедуры. В PB 7, 8 все работало как часы, а вот в 9-ке: SQLSTATE = S1000[Microsoft][ODBC SQL Server Driver]Connection is busy with results for another hstmt SQLReturnData = Microsoft SQL Server SQLCode = -1 SQLNRows = 0 Никто с таким траблом не сталкивался? Мы выходим из положения заменой курсора на ds, но сколько еще таких точек оге - ответить трудно. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 10.12.2004, 11:53 |
|
||
|
SQL Query within cursor (MSSQL ODBC) - проблема
|
|||
|---|---|---|---|
|
#18+
От:Steve_Katz_[TeamSybase] (Steve_Katz_[TeamSybase]) Тема:Re: Error trying to run a stored procedure from within powerbuilder Группы новостей:powersoft.public.powerbuilder.general Дата:2001-07-16 17:58:32 PST This error means that the transaction object your are using for the sp call is currently in the middle of processing something else and hasn't concluded it's conversation with the database. For example, if you have a cursor open and for each row in the cursor, you want to use values from the row and call a stored proc, you MUST use a second transaction object for the stored proc call. You need to look at where the stored proc is being called and determine if something has not completed. Running a database trace is helpful here. Add the keyword "Trace" before the DBMS value on the transaction object before connecting (e.g. "ODBC" becomes "Trace ODBC"). When you connect, a messagebox will indicate that tracing is enabled and where the trace log will be written. HTH, steve [TeamSybase] ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 10.12.2004, 16:20 |
|
||
|
SQL Query within cursor (MSSQL ODBC) - проблема
|
|||
|---|---|---|---|
|
#18+
Alexander KolotinetsНикто с таким траблом не сталкивался? Да вроде нет. Девяточку посвежее не пробовали ставить? А драйвер Merant или Microsoft? А менять драйвер не пробовали? Alexander KolotinetsВ PB 7, 8 все работало как часы Странно странно. Мне почему то казалось что при открытом курсоре ничего кроме FETCH делать нельзя. Или это справедливо только для Db-lib ? или это как-то зависит от типа курсора? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 10.12.2004, 16:24 |
|
||
|
SQL Query within cursor (MSSQL ODBC) - проблема
|
|||
|---|---|---|---|
|
#18+
ЗоринАндрейОт:Steve_Katz_[TeamSybase] (Steve_Katz_[TeamSybase]) Тема:Re: Error trying to run a stored procedure from within powerbuilder Группы новостей:powersoft.public.powerbuilder.general Дата:2001-07-16 17:58:32 PST This error means that the transaction object your are using for the sp call is currently in the middle of processing something else and hasn't concluded it's conversation with the database. For example, if you have a cursor open and for each row in the cursor, you want to use values from the row and call a stored proc, you MUST use a second transaction object for the stored proc call. You need to look at where the stored proc is being called and determine if something has not completed. Running a database trace is helpful here. Add the keyword "Trace" before the DBMS value on the transaction object before connecting (e.g. "ODBC" becomes "Trace ODBC"). When you connect, a messagebox will indicate that tracing is enabled and where the trace log will be written. HTH, steve [TeamSybase] Спасибо, Андрей, все понятно. Но вызов ХП внутри курсора был доступен в версиях ПБ < 9. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 10.12.2004, 16:24 |
|
||
|
SQL Query within cursor (MSSQL ODBC) - проблема
|
|||
|---|---|---|---|
|
#18+
ЗоринАндрей Alexander KolotinetsНикто с таким траблом не сталкивался? Да вроде нет. Девяточку посвежее не пробовали ставить? А драйвер Merant или Microsoft? А менять драйвер не пробовали? Alexander KolotinetsВ PB 7, 8 все работало как часы Странно странно. Мне почему то казалось что при открытом курсоре ничего кроме FETCH делать нельзя. Или это справедливо только для Db-lib ? или это как-то зависит от типа курсора? Драйвер Microsoft Менять драйвер не пробовали, да и вряд ли будем это делать, софт распространен достаточно большими партиями. Данный баг проявился только в версии ПБ 9.0.1 build 6533, более свежий EBF не устанавливали ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 10.12.2004, 16:28 |
|
||
|
SQL Query within cursor (MSSQL ODBC) - проблема
|
|||
|---|---|---|---|
|
#18+
Возможно будет проще завести второй transaction object и использовать его для вызова процедур. Хотя вариант решения с datastore мне нравится больше. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 10.12.2004, 16:33 |
|
||
|
SQL Query within cursor (MSSQL ODBC) - проблема
|
|||
|---|---|---|---|
|
#18+
Alexander Kolotinetsда и вряд ли будем это делать Йопт! Ну нельзя ж так.... Я ж не предлагаю бежать сразу и всем клиентам ставить драйвер другой! Надо ж разобраться сначала. Для диагностики можно было бы и проверить проявляется это только на одном драйвере или для обоих. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 10.12.2004, 16:34 |
|
||
|
SQL Query within cursor (MSSQL ODBC) - проблема
|
|||
|---|---|---|---|
|
#18+
Alexander KolotinetsДанный баг проявился только в версии ПБ 9.0.1 build 6533 Неужели? Только в девятке? А вот есть и про пятерку: автор This SELECT is used on the same orders table. However, whenever I use the SELECT I get an error stating: SQLSTATE = S1000[Microsoft][ODBC SQL Server Driver]Connection is busy with results for another hstmt". Am I in some locking problem ? Any resolutions. Any help is appreciated, because this seems to be my last major bug in my almost complete system ! Thanks Using: PowerBuilder 5.0.02, MS-SQL Server 6.5 Jamiel Humayun Sharpe Capital, Inc. Так что странно что он у Вас раньше не проявлялся :-) ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 10.12.2004, 16:39 |
|
||
|
SQL Query within cursor (MSSQL ODBC) - проблема
|
|||
|---|---|---|---|
|
#18+
SQL Server ODBC Driver HelpUsing Default Result Sets The default ODBC cursor attributes are: SQLSetStmtAttr(hstmt, SQL_ATTR_CURSOR_TYPE, SQL_CURSOR_FORWARD_ONLY); SQLSetStmtAttr(hstmt, SQL_ATTR_CONCURRENCY, SQL_CONCUR_READ_ONLY); SQLSetStmtAttr(hstmt, SQL_ATTR_ROW_ARRAY_SIZE, 1); Whenever these attributes are set to their defaults, the Microsoft® SQL Server™ ODBC driver uses a SQL Server default result set. Default result sets can be used for any SQL statement supported by SQL Server, and are the most efficient method of transferring an entire result set to the client. Default result sets do not support multiple active statements on the same connection. After an SQL statement is executed on a connection, the server does not accept commands (except a request to cancel the rest of the result set) from the client on that connection until all the rows in the result set have been processed. To cancel the remainder of a partially processed result set, call SQLCloseCursor or SQLFreeStmt with the fOption parameter set to SQL_CLOSE. To finish a partially processed result set and test for the presence of another result set, call SQLMoreResults. If an ODBC application attempts a command on a connection handle before a default result set has been completely processed, the call generates SQL_ERROR and a call to SQLGetDiagRec returns: szSqlState: "HY000", pfNativeError: 0 szErrorMsg: "[Microsoft][SQL Server ODBC Driver] Connection is busy with results for another hstmt." ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 10.12.2004, 16:47 |
|
||
|
SQL Query within cursor (MSSQL ODBC) - проблема
|
|||
|---|---|---|---|
|
#18+
авторThe cursor library implements a cursor by fetching the entire result set from the underlying driver and caching the result set on the client. When using the ODBC cursor library, the application is limited to the cursor functionality of the cursor library; any support for additional cursor functionality in the underlying driver is not available to the application. Вот это вроде бы включается если добавить в DBParm CursorLib='ODBC_Cur_Lib' Еще можно попробовать поменять CursorScroll на 'Dynamic' или какое другое значение отличное от дефолта. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 10.12.2004, 16:53 |
|
||
|
SQL Query within cursor (MSSQL ODBC) - проблема
|
|||
|---|---|---|---|
|
#18+
ЗоринАндрей авторThe cursor library implements a cursor by fetching the entire result set from the underlying driver and caching the result set on the client. When using the ODBC cursor library, the application is limited to the cursor functionality of the cursor library; any support for additional cursor functionality in the underlying driver is not available to the application. Вот это вроде бы включается если добавить в DBParm CursorLib='ODBC_Cur_Lib' Еще можно попробовать поменять CursorScroll на 'Dynamic' или какое другое значение отличное от дефолта. Он у нас как раз и есть Dynamic, с остальными параметрами попробуем поиграться, спасибо! ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 10.12.2004, 17:08 |
|
||
|
SQL Query within cursor (MSSQL ODBC) - проблема
|
|||
|---|---|---|---|
|
#18+
Кстати, у меня тоже при работе PB6 и PB7 через ODBC драйвер с MS SQL 2000, при открытых курсорах вложенные селекты не работали. А через натив - работало. Но я все равно переделал, т.к. мне показалось не слишком логичным держать открытый курсор. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 10.12.2004, 22:59 |
|
||
|
|

start [/forum/topic.php?fid=15&msg=32823760&tid=1338655]: |
0ms |
get settings: |
10ms |
get forum list: |
13ms |
check forum access: |
4ms |
check topic access: |
4ms |
track hit: |
76ms |
get topic data: |
9ms |
get forum data: |
2ms |
get page messages: |
46ms |
get tp. blocked users: |
1ms |
| others: | 276ms |
| total: | 441ms |

| 0 / 0 |
