Ref Cursors

misuk11

Member
Im trying to retrieve a recordset from a stored procedure and have creted the procedure below. What is the correct way to call this from a TOraclewwDataset component in Delphi ?
this is the SQL

BEGIN
Artist.GETARTISTS();
END;

I get an error 'wrong number or types of argument'
What should the argument type be for a ref cursor ?

PROCEDURE GETARTISTS(p_recordset OUT SYS_REFCURSOR )
IS
BEGIN
OPEN p_recordset FOR
SELECT ARTISTS_ID, FORENAME, SURNAME
FROM ARTISTS;

END GETARTISTS;
 
Your SQL should be as follows:
Code:
BEGIN
  Artist.GETARTISTS(:p_recordset);
END;
The "p_recordset" varriable should be declared as Cursor. The dataset will automatically call this PL/SQL Block and fetch the records from the cursor.

See also the PkgApply demo project.
 
Back
Top