FALCONSEYE
Programmer
t-sql:
I have to the same thing in Oracle. Currently I have:
the problem is the first select statement sometimes returns 'no rows selected' and tempquantity > 0 fails.
I tried tempquantity number := -1; but had no luck either.
any help?
Code:
if exists(
select quantity, id
from myTable
where id = 55
)
begin
print 'yes'
end
else
begin
.. run another select statement to look another table
end
I have to the same thing in Oracle. Currently I have:
Code:
declare
tempquantity number;
tempid number;
begin
select quantity, id
into tempquantity, tempid
from myTable
where id = 55
if tempquantity > 0
then
/* found */
else
.. run another select statement to look another table
end if;
end;
the problem is the first select statement sometimes returns 'no rows selected' and tempquantity > 0 fails.
I tried tempquantity number := -1; but had no luck either.
any help?