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

Home -> Community -> Usenet -> c.d.o.misc -> Re: very new to oracle : need stored procedure sample

Re: very new to oracle : need stored procedure sample

From: Josh Miller <jmiller_at_iterated.com>
Date: Fri, 17 Mar 2000 10:05:27 -0500
Message-ID: <38d249ae$0$19360@wodc7nh7.news.uu.net>

Sybrand Bakker <postbus_at_sybrandb.demon.nl> wrote in message news:953288378.9340.0.pluto.d4ee154e_at_news.demon.nl...
> This is a FAQ... You need to use a REF CURSOR in a procedure.
>
> either refer to the PL/SQL documentation (online at
> http://technet.oracle.com )
> or http://osi.oracle.com/~tkyte/Resultsets/index.html

Christian,
One more resource for you (it took me a while to find this as well since it's not a part of the HTML docs). Under your <OracleHome>, 'Network Administration' program groups is a Windows help file (sqora.hlp) for which the shortcut is called 'Oracle ODBC Help'. It contains examples of both the PL/SQL stored procedure and a C program using ODBC which calls the stored procedure and processes the result sets. (if for some reason you don't have this file let me know and I'll email it to you)

> Several final remarks:
>
> - Usually a direct 'port' from one system to another is not the best
> solution. Oracle didn't have resultsets until very recent, and the package
> has been able to do without it. Also, a one on one translation usually
> doesn't teach you the full power of the new software.

I agree with this, except in the case where a system is not necessarily being moved permanently from another platform to Oracle, but will need to run on both. In that scenario there are advantages to keeping the two platforms as similar as possible. Even if there are advantages to be gained by using the full power of the new software, that's not to say that porting it and getting it working first, then improving it is a bad approach (as opposed to, say, redesigning the entire system to make it work optimally with Oracle).

> - Please search the newsgroup archives at www.deja.com

Good advice, I've found this to be a great resource.

> - Please avoid crossposting to multiple oracle newsgroups. PL/SQL is a
> server issue only.
>
> Regards,
>
> Sybrand Bakker, Oracle DBA
>
> Christian BRUNO <brunoc_at_ifrance.com> wrote in message
> news:8asp9v$pco$1_at_minus.oleane.net...
> > hello,
> >
> > i'm new to oracle 8 (migrating from SQL Server) and i want to call, via
> > ODBC, a procedure stored on the
> > oracle server
> >
> > this procedure should give me the same result as an sql "select" order
> >
> > please, tell me how to write this procedure
> >
> > i've tried this :
> >
> > CREATE OR REPLACE PROCEDURE spFindCustInfo ( in_code IN VARCHAR(8) )
> > IS
> > BEGIN
> > select CUSTEXT,CUSTADDRESS1 from CUSTOMERS where CUSCODE=in_code;
> > END;
> > /
> >
> > but it does not compile
> >
> > help!!!
> > Christian
> >
> >
> >
> >
> >
>
>

Josh Miller Received on Fri Mar 17 2000 - 09:05:27 CST

Original text of this message

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