Re: Oracle Procedure and ADO
Date: Thu, 1 Feb 2001 16:33:10 -0500
Message-ID: <95ckmn$s60$1_at_bob.news.rcn.net>
You need to wrap your code with a package adn you need to return the record
set
L
with a cursor.
"Phill Atkinson" <Phill_at_tibble.net> wrote in message
news:FCcd6.57497$pp2.3961518_at_news3.cableinet.net...
> Can anyone help?
>
> I'm trying to return a recordset to ADO from an Oracle procedure.
>
> In MS SQL the following would work ok:
>
> create procedure spSelStaff
> _at_nStaffID Int =null
> as
>
> begin
>
> if _at_nStaffID is null
> begin
> select s.StaffID,
> s.TitleID,
> t.Title,
> s.FirstName,
> s.LastName
> from Staff s
> inner join Title t
> on s.TitleID = t.TitleID
> end
> else
> begin
> select s.StaffID,
> s.TitleID,
> t.Title,
> s.FirstName,
> s.LastName
> from Staff s
> inner join Title t
> on s.TitleID = t.TitleID
> where StaffID = _at_nStaffID
> end
>
> end
>
>
> In Oracle this is invalid. Why?
>
> create or replace procedure scott.test is
> begin
>
> select *
> from emp;
>
> end;
>
>
>
Received on Thu Feb 01 2001 - 22:33:10 CET