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: Can't PL/SQL do the simple stuff that Transact-SQL can?

Re: Can't PL/SQL do the simple stuff that Transact-SQL can?

From: Mladen Gogala <mgogala_at_yahoo.com>
Date: Thu, 18 Feb 1999 22:41:53 GMT
Message-ID: <7ai4vg$6ab$1@nnrp1.dejanews.com>


In article <36CB6E6F.3B21AFB2_at_bpsinfo.com>,   Jonathan Tew <jtew_at_bpsinfo.com> wrote:
> I'm having a difficult time seeing how Oracle can be so great when we
> can't even find a way to express simple Microsoft SQL Server
> Transact-SQL statements in equivalent PL/SQL. For instance here is
> something I'm not sure PL/SQL can do. It is the if exists() begin ...
> end clause:
>
> if exists(select * from Test where name = 'Bob') begin
> end
>
> How is that accomplished in PL/SQL? I've searched the documentation and
> the only thing they talk about is using exist in the where clause and
> for collections.
>
> Another quite annoying thing is not being able to return a result set
> from a PL/SQL. I've seen nasty kludges where they return a cursor and
> then use the cursor to move through the result set.
>
> Granted I find PL/SQL has a large number of cool functions, but the
> basics have to come first. Hopefully I'm just overlooking something in
> my manuals and books.
>
> Thanks,
> Jonathan Tew
>

declare
cursor csr is select * from Test where name = 'Bob'; begin
open csr;
if csr%FOUND then

   begin

   .................

   end;
.............................

close csr;
end;

Mladen Gogala

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Thu Feb 18 1999 - 16:41:53 CST

Original text of this message

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