Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Stuck on SP and bind variables. Help?

Stuck on SP and bind variables. Help?

From: Kev <java2e_at_yahoo.com>
Date: Mon, 11 Jun 2001 18:58:35 -0700
Message-ID: <qptaitg4r0s2s7lb57jgi0mrlqur8e5mu3@4ax.com>

Hello all,

I am trying to get this sample SP to work with bind varialbes as the CPU get pegged at 100%. This is not the query being used but if I can get some help on how to convert this to use bind variables I would greatly appreciate it. Now I can use the bind variables in a PLSQL block but or the life of me cant get it to work in a SP.

CREATE OR REPLACE PACKAGE PKG_CAT
AS
CURSOR cur_CAT
IS
SELECT TABLE_NAME FROM CAT; TYPE t_CUR_CAT IS REF CURSOR RETURN cur_CAT%ROWTYPE;

PROCEDURE sp_CAT

(

    p_TABLE_TYPE VARCHAR2,
    IO_CURSOR IN OUT t_cur_CAT
    );

END PKG_CAT; CREATE OR REPLACE PACKAGE BODY PKG_CAT
AS

    PROCEDURE sp_CAT
(

    p_TABLE_TYPE VARCHAR2,
    IO_CURSOR IN OUT t_CUR_CAT
    )
    AS
    v_CURSOR t_CUR_CAT;
    BEGIN

        OPEN IO_CURSOR FOR
        SELECT TABLE_NAME FROM CAT WHERE TABLE_TYPE = p_TABLE_TYPE;
    END sp_CAT;

END PKG_CAT; I need the variable p_Table_Type to be the bind variable. If you can point me where I can find some information on this or some samples I would greatly appreacite it.

Again Thanks,

Kev Received on Mon Jun 11 2001 - 20:58:35 CDT

Original text of this message

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