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: PL/SQL !

Re: PL/SQL !

From: George Barbour <gbarbour_at_csc.com>
Date: Tue, 21 Aug 2001 15:30:46 +0100
Message-ID: <3b826e2f$1@pull.gecm.com>


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;

    END IF;
END sp_tableexists;

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

Original text of this message

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