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: Nuno Souto <nsouto_at_acay.com.au>
Date: Sat, 20 Feb 1999 00:21:36 +1100
Message-ID: <36cd675e.0@job.acay.com.au>


Jonathan Tew wrote in message <36CB8C20.72722F56_at_bpsinfo.com>...
>Wow, thanks for posting a solution to the problem. That strikes we as
>really complex code though.

Try this:
previous code...

.
.
.

select * from test where name = 'bob';
if SQL%NOTFOUND then

   BLAH,BLAH;
end if;

.
.
.


Does the same. SQL is the name of the most recently executed cursor in PL/SQL. It can be tested just like a normal cursor.

HTH
>I've been told that cursors are very
>inefficent things and should be used as little as possible. Under MS
>SQL Server often a cursor will blow up in a stored proc causing
>problems. Does Oracle have such problems with cursors and would this be
>a bad thing performance wise?

Definitely not.

> I'm under the impression that the kinds
>of things that I'm trying to do are simple and common... why hasn't
>Oracle taken care of this problem with an exists() construct?

See above.

--
Cheers
Nuno Souto
nsouto_at_acay.com.au
http://www.acay.com.au/~nsouto/welcome.htm Received on Fri Feb 19 1999 - 07:21:36 CST

Original text of this message

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