Question for ORACLE developers

  • I've been told that ORACLE stored procedures do not return recordsets. 

    Is someone pulling my leg on this?

    If this is true how do you return a recordset?

  • They aren't exactly pulling you leg, just not telling the whole story.  Oracle stored procs do not return recordsets by default like SQL Server stored procs, but they can be made to return a recordset by the use of Oracle cursors. 

    for example:

    create package defs is

      type rc is ref cursor;

    end;

    create procedure getEmps(c out defs.rc) is

    begin

      open c for 'Select id, name from employee   where name like ''A%''';

    end;

     

    See http://www.vbip.com/books/1861001789/chapter_1789_10.asp for a vb sample.  I always use examples rather than write from scratch.

    Use the Microsoft Oracle Data Provider as opposed to the general OLE/DB data provider.

    Francis

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply