Oracle + ADO - stored procedure problem

Oracle + ADO - stored procedure problem

Post by Edga » Fri, 30 Mar 2001 07:53:49



Hello,
I use Oracle stored procedure which builds interim table out of many other
tables and
finally it retrieves a record set from that table (select *). At one of my
installation this
stored procedure is running about 5 times slower from Delphi application (
through ADO )
than from Oracle PL/SQL console.  I did not have this before. Please see
more details at the bottom.
I believe it is a matter of  configuring ADO and/or Oracle.

Does anybody hav a clue what I should be looking for ?

An additional and useful informatoin could be that to return a cursor from
stored procedure to ADO I use this construction

     ( ACURSOR IN OUT MY_TYPE.TCUR ) AS
    begin
      /* build my UserData table here */
      OPEN ACURSOR FOR SELECT * FROM USERDATA;
    end;

    where MY_TYPE.TCUR is a package ( defined in "Pacage" ) in this way :

     AS
         TYPE TCUR IS REF CURSOR;
    END;

I found this as the only way to retrieve cursor from stored procedure to
ADO.
I also noticed that this stored procedure works fine with ADO but does not
want to work from PL/SQL console, could anybody tell my why ? Is it possible
to
create stored procedure which retrieves dataset and runs correctly in PL/SQL
and with ADO ?

I appreciate any help.

Marek.

 
 
 

1. problem in executing an Oracle stored procedure by ADO

I have a problem of getting a recordset from a Oracle stored procedure.
The procedure has one IN and two OUT parameter as follows:

procedure sp_pix_test (hiredate IN char(10),
        o_lastname OUT employee.LAST_NAME%type,
        o_date OUT employee.HIRE_DATE%type) AS
BEGIN
SELECT
 EMPLOYEE.LAST_NAME,
 EMPLOYEE.HIRE_DATE,
INTO
  o_lastname,  o_date
FROM
 EMPLOYEE
WHERE
 EMPLOYEE.HIRE_DATE > TO_DATE(hiredate,'yyyy-mm-dd');
END;

here is basicaly what I am doing in code:
'suppose I already had the connection and procedure name
'now I need to retireve the procedure's parameter list
'in order to present to user
With adoCmd
            .ActiveConnection = conn
            .CommandType = adCmdStoredProc
            .CommandText = procName
            .Parameters.Refresh
 End With
'Now, parameters are retrieved and user can modify
'the IN parameters from UI, for example:
adoCmd.Parameters("hiredate").Value = "1992-02-12"
'after user input all the IN parameters
Set rs = adoCmd.Execute

The problem is: rs is always nothing. I don't know what I should do with the
OUT parameters
I would apprecate if you can help me out.

2. Group Heaer ; Keep With Next

3. Problems calling Oracle stored procedures from VC++ over ADO(OLEDB)

4. How do we get rid of Old Backups?

5. ado recordsets from stored procedures, stored procedures have input parameters

6. How to add a "private" dimension to an OLAP cube using DSO

7. US-NC-Raleigh-Oracle DBAs Needed

8. Problem with stored procedure that calls other stored procedures

9. Problem compiling stored procedure that calls another stored procedure

10. Stored procedures problem using DB2 Stored Procedure Builder

11. How to call an Oracle Stored procedure from MSSQL Server Stored Procedure

12. Tool for converting Store Procedure in SQL Server to Oracle Store Procedures