Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: PL/SQL !
Try this
FUNCTION sp_tableexists( i_s_tablename IN VARCHAR2) RETURN BOOLEAN IS
CURSOR cq_usertab (i_s_tablename VARCHAR2) IS
SELECT table_name FROM user_tables
WHERE table_name = i_s_tablename;
l_r_tablerow cq_usertab%rowtype;
BEGIN
OPEN cq_usertab (i_s_tablename);
FETCH cq_usertab INTO l_r_tablerow;
IF cq_usertab%notfound THEN
CLOSE cq_usertab; RETURN FALSE; ELSE CLOSE cq_usertab; RETURN TRUE;
George Barbour.
"Rahul" <rahul_europe_at_yahoo.com> wrote in message
news:923a99a4.0108201211.f59a523_at_posting.google.com...
> hi there:
>
> I was wondering if you have the answer of following two questions:
>
> a. Inside PL/SQL block, how to check that a particular table does not
> exist.
>
> I know this one,but there will be some other better ways as well, so
> do you know some of them?
>
> if(rad_cursor2%NOTFOUND) then
> dbms_output.put_line('the table is emply');
>
>
> b. how to call a trigger block from PL/SQL block.
>
>
> regards,
> rahul
Received on Tue Aug 21 2001 - 09:30:46 CDT