Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Simple SQL request
My need is to search if there is at least one recordset in a table.
(from a procdure in Oracle)
My solution is:
my_count PLS_INTEGER;
...
SELECT COUNT(*) INTO my_count FROM my_table WHERE (my_filters ...); IF (my_count >= 1) THEN
I ve try to do thinks like:
CURSOR my_cursor IS
SELECT 1 FROM my_table WHERE (my_filters ...);
BEGIN
OPEN EMP_CUR; -- open the cursor
FETCH EMP_CUR INTO v_FoundOne;
CLOSE EMP_CUR;
IF (v_FoundOne IS NOT NULL) THEN
Is there another solution?
Something like SELECT FIRST(*) FROM my_Table WHERE ...
Received on Fri Jan 14 2005 - 05:26:08 CST
![]() |
![]() |