oracle, ado, delphi5

oracle, ado, delphi5

Post by Phil Hobge » Thu, 27 Sep 2001 00:47:54



Hi,

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

 
 
 

oracle, ado, delphi5

Post by M.H. Avegaar » Thu, 27 Sep 2001 01:02:48


Try:

adocmdRES.CommandText := 'GETPRIMARYKEYFIELDS';
adocmdRES.CommandType := cmdStoredProc;
adocmdRES.Execute('ASSET');

or

adocmdRES.Execute(VarArrayOf(['ASSET']));


> Hi,

> 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



 
 
 

1. SQL7 - Delphi5 - ADO - TimeoutError

Hi,

we developed a program, which transforms Data from different Tables on a MS
SQL 7.0 Database into other tables on the same system.
These transormations are quite big. In the midst of it, we receive a timeout
error.
In the connection string (or *.udl-file) we set the timeout value on more
than 30 sec., which is the timespan of the error, but nothing happened.
The database has infinite timeout.
We use Borland Delphi 5 Enterprise Edt. with both AdoUpdates (incl. the
Delphi 5 Ent. Updt,).

Does somebody knows how to solve this problem?

Thanks in advance
Thomas Maus

2. ADO 2.5/OleDB CommandTimeout ?

3. problems with windows 2000, delphi5, dbe and oracle 8

4. VB 6 DataReport orientation

5. Oracle + Delphi5: Transactions and Locking

6. Need input on Oracle's Application Development Consultants

7. Interesting way to crash Oracle

8. MySQL and Delphi5

9. Delphi5, Pervasive and Identity field type

10. Getting Interbase & Delphi5 working

11. Delphi5 tutorial

12. PARADOX - DELPHI5 - CORRUPT TABLE / INDEX HEADER