Re: identifying variable declaration within PL/SQL

From: Marc Mazerolle <informaze_at_sympatico.ca>
Date: Wed, 31 Mar 1999 14:29:52 GMT
Message-ID: <3702324B.16F611C_at_sympatico.ca>


Answer inline

Ingo Peters wrote:

 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
Would this work ?if length(line_of_text) > vsize(customer_rec.line_storage)
  then
    -- truncate line of text to fit.
  end if;

 

Thanks in advance,

Ingo Peters

Regards,

Marc Mazerolle
  Received on Wed Mar 31 1999 - 16:29:52 CEST

Original text of this message