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 -> PL/SQL variable in a cursor as partition name? Oracle 8.1.7

PL/SQL variable in a cursor as partition name? Oracle 8.1.7

From: Tim Lindsey <Timothy.D.Lindsey_at_Boeing.com>
Date: Wed, 27 Jun 2001 19:23:07 GMT
Message-ID: <GFLsIo.600@news.boeing.com>

We are using Oracle 8.1.7 and I would like to pass a variable to a PL/SQL procedure and have that variable used in a cursor. The cursor is extracting from a partitioned table.

CREATE OR REPLACE PROCEDURE PR_TEST (vPartitionName in VARCHAR2) IS
  CURSOR c_SmallTable
  IS
  SELECT model,
  pn_id
  FROM BAMB.TA_TABLE1 partition (vPartitionName);

When I run this in my procedure it doesn't replace vPartitionName with MODEL_757 that I pass in when I execute the procedure. What am I doing wrong? If I hardcode the partition name it works fine.

I have Steven Feuerstein's "Oacle PL/SQL" book and in the section on cursor variables he seems to be doing the same thing except the variable is being used as a selected field or on the right of the equal sign on the WHERE clause. Why won't it work for a partition name?

Thanks in advance! Timothy.D.Lindsey_at_Boeing.com Received on Wed Jun 27 2001 - 14:23:07 CDT

Original text of this message

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