Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Can't PL/SQL do the simple stuff that Transact-SQL can?
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
.................
.............................
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