Re: Please help converting from Sybase to Oracle - Retunring results

From: Thomas Olszewicki <ThomasO_at_noSpm.cpas.com>
Date: Sat, 08 Sep 2001 20:23:36 GMT
Message-ID: <c7vm7.51469$w75.21625650_at_news3.rdc2.on.home.com>


jw,
If you are using Oracle 8i or later do the search in your HTML Oracle help for "ref cursor"
Pl/Sql and Java developer help comes with many examples. HTH
Thomas

"jw" <jw21604_at_newsguy.com> wrote in message news:9nbccl02o2p_at_drn.newsguy.com...
> I'm not sure how to get results back from a stored procedure on Oracle. If
 these
> Sybase SPs:
>
> ------------------------------------------------------------------
> create proc GetAccounts
> _at_UserID char(8)
> as
> begin
>
> declare _at_cnt int
> select _at_cnt = count(*)
> from UserAccount
> where UserID = _at_UserID
>
> if _at_cnt > 0
> begin
> select AccountMnemonic
> from UserAccount
> where UserID = _at_UserID
> end
>
> end
> ------------------------------------------------------------------------
>
> the other is:
>
> create proc ValidateUser
> _at_USERID char(8)
> as
> begin
>
> declare _at_cnt int
> declare _at_mesg char(20)
>
> select _at_cnt = count(*) from PTSUser
> where UserID = _at_USERID
>
> if _at_cnt = 0
> begin
> select _at_mesg = "User Not Found"
> select _at_mesg
> return
> end
>
> select _at_mesg = "Found the User"
> select _at_mesg
>
> end
>
> ------------------------------------------------------------------------
>
> These procdures are called from a Java program and in sybase work jus find
> returning a results but I can't figure out the syntax in Oracle to just
 return a
> result set.
>
> Thanks IN Advance
>
> jw
>
Received on Sat Sep 08 2001 - 22:23:36 CEST

Original text of this message