Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Need example of Stored Procedure that returns a resultset

Re: Need example of Stored Procedure that returns a resultset

From: Johan Thorselius <johan.thorselius_at_outright.se>
Date: Tue, 05 Jan 1999 16:18:51 +0100
Message-ID: <36922D5B.59AE6785@outright.se>


Look in the samples for Pro*C, there are examples of using Pro*C and stored procs. Especially
the so called array interface is good to use. The main difference b/w SQL Server and Oracle is that
you can keep the cursor (implicit or explicit) on the serverside....SQL Server is a kind of primitive antique here.

You can loop inside the stored proc before returning an array with the resultset. So don't just convert, look at the samples and you can do better solutions with Oracle.

Johan Thorselius

dkochan_at_kcginc.com wrote:

> Hello everyone,
>
> Could someone show me an example of how to create a stored procedure that
> returns a resultset? I would like to have my Access application call a SQL-
> Passthrough query so that it returns list of rows. I am able to create a
> stored procedure in SQL Server but cannot figure out how to do it in Oracle
> (even after browsing the newsgroups and reading Oracle documentation).
>
> For example, I can create a stored procedure in SQL Server with the following
> code:
>
> CREATE PROCEDURE spTest(@some_var int)
> AS
> SELECT * FROM someTable WHERE amt = @some_var
> go
>
> How do I do this in Oracle? Please show an example of how this procedure
> would like in Oracle. Thank you.
>
> --David Kochan
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own


Received on Tue Jan 05 1999 - 09:18:51 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US