MSDataShape + OraOLEDB + return recordset from Stored Proced
От: Аноним  
Дата: 26.04.04 13:45
Оценка:
При использовании указанной связки получаю ошибку о неправильно указанных параметрах
Ошибка вылазит только при использовании ораклового провайдера.
При использовании MSDAORA все проходит нормально...
Если кто смог решить эту проблемку, большая просьба рассказать как...
Re: MSDataShape + OraOLEDB + return recordset from Stored Pr
От: romashka Удмуртия  
Дата: 26.04.04 13:50
Оценка:
PLSQLRSet

This property is similar to the PLSQLRSet Connection string attribute.

The property specifies whether OraOLEDB must return a rowset from the PL/SQL stored procedure. If the stored procedure, provided by the consumer, returns a rowset, PLSQLRSet must be set to TRUE (enabled). This property should be set to FALSE after the command has been executed. By default, the property is set to FALSE (disabled).

Consumers should use the property over the attribute, as the property can be set at the command object rather than at the session. By setting it at the command object, the consumer is able to set the property only for the command object executing stored procedures which are returning rowsets. With the attribute, the consumer needed to set it even if only one of many stored procedures being executed by the ADO application returned a rowset. The use of this property should provide a performance boost to applications making use of the attribute previously.

Example: Setting the Custom Property PLSQLRSet
Dim objRes As NEW ADODB.Recordset
Dim objCon As NEW ADODB.Connection
Dim objCmd As NEW ADODB.Command
....
objCmd.ActiveConnection = objCon
objCmd.CommandType = adCmdText

' Enabling the PLSQLRSet property indicates to the provider
' that the command returns one or more rowsets
objCmd.Properties("PLSQLRSet") = TRUE

' Assume Employees.GetEmpRecords() has a REF CURSOR as
' one of the arguments
objCmd.CommandText = "{ CALL Employees.GetEmpRecords(?,?) }"

' Execute the SQL
set objRes = objCmd.Execute

' It is a good idea to disable the property after execute as the
' same command object may be used for a different SQL statement
objCmd.Properties("PLSQLRSet") = FALSE
Re[2]: DETAILS for people? what intresting it
От: sibman1971  
Дата: 27.04.04 06:49
Оценка:
Простейшая процедура, возвращающая рекордсет с Оракла:
PACKAGE SAMPLE IS

  TYPE cur_out IS REF CURSOR;

  PROCEDURE test(p_out  OUT cur_out);           
                 
END;

PACKAGE BODY SAMPLE IS
    PROCEDURE test(p_out  OUT cur_out)
    IS
BEGIN    

open p_out for
select 1 from dual;
END;    
    
END sample;


VB-программа:

Dim objRes As New ADODB.Recordset
Dim objCon As New ADODB.Connection
Dim objCmd As New ADODB.Command
objCon.Provider = "MSDataShape"
objCon.ConnectionString = "Data Provider=OraOLEDB.Oracle;Data Source=MyServer;User ID=MyLogin;Password=MyPassword;PLSQLRSet=True;"
objCon.Open
objCmd.ActiveConnection = objCon
objCmd.CommandType = adCmdStoredProc
objCmd.CommandText = "sample.TEST"
Set objRes = objCmd.Execute



НЕ ПЫТАЙТЕСЬ использовать СВОЙСТВО команды:
objCmd.Properties("PLSQLRSet") = True
выдается ошибка!!!

Указывайте аттрибут в строке соединения!

вставлена раскраска кода. _MM_
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.