identifying variable declaration within PL/SQL

From: Ingo Peters <Ingo_Peters_at_ott.lgs.ca>
Date: Wed, 31 Mar 1999 14:22:38 GMT
Message-ID: <37022FE3.9D40B95C_at_ott.lgs.ca>



I'm just curious, is it possible within PL/SQL to identify how big the
VARCHAR declaration of some record member is, which is anchored to a database
table? I'm thinking of parsing routines which may need to truncate text
if it's too long to fit into a memory structure's data element.

eg.
declare
  customer_rec customer%ROWTYPE;
  line_of_text VARCHAR2(4000);
begin
  line_of_text := parse_line();
  -- I know the %LEN probably doesn't exist; the point is that I'd like to find
  -- out, without going to the data dictionary if possible, how much I can
  -- store in the line_storage element.
  if length(line_of_text) > customer_rec.line_storage%LEN
  then
    -- truncate line of text to fit.
  end if;


Thanks in advance,

Ingo Peters Received on Wed Mar 31 1999 - 16:22:38 CEST

Original text of this message