oracle, ado, delphi5

From: Phil Hobgen <phil_at_barbari.co.uk>
Date: Tue, 25 Sep 2001 16:47:54 +0100
Message-ID: <3bb0a807_at_news2lo.highwayone.net>



Hi,

[Quoted] Firstly sorry for the cross-post, Im not sure where this problem belongs:

I am having problems calling an oracle stored function that returns a recordset using Delphi 5 ADO components. Its driving me mad, and we're working to a deadline which is approaching fast (of course). Any help would be greatly appreciated.....

The Oracle function works correctly, returning a REFCURSOR type to SQL *Plus.

The function takes a single VARCHAR2 parameter. We are using Oracle 8.1.7 server and client, MDAC 2.6.1, Delphi 5 + updates (including the ADO update). We need to use ADO as the system was originally built using that & MS SQLServer.

When trying to use a TADOCommand to call the Oracle function component I get the following error:

Merant Driver
ORA-06550: line 1, column 15:
PLS-00306: wrong number or types of arguments in call to
'GETPRIMARYKEYFIELDS'

ORA-06550: line 1, column 8:
PL/SQL: Statement ignored

Oracle Driver

ORA-06550: line 1, column 7:
PLS-00221: 'GETPRIMARYKEYFIELDS' is not a procedure or is undefined
ORA-06550: line 1, column 7:

PL/SQL: Statement ignored

Microsoft Driver
ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to
'GETPRIMARYKEYFIELDS'

ORA-06550: line 1, column 7:
PL/SQL: Statement ignored

The Delphi code is as follows:

    adocmdRES.CommandText := 'GETPRIMARYKEYFIELDS';     adocmdRES.CommandType := cmdStoredProc;     with adocmdRES.Parameters.AddParameter do     begin

      Name := 'PTABLENAME';
      DataType := ftString;
      Direction := pdInput;
      Value := 'ASSET';

    end;
    adocmdRES.Execute;

This reflects as closely as possible, an ASP code sample I found for doing exactly this.

Ive tried all sorts and cant get this to work.

Please help.....

Cheers
Phil
phil.hobgen_at_btinternet.com Received on Tue Sep 25 2001 - 17:47:54 CEST

Original text of this message