Re: Connecting to a table dynamiclly

From: Matt B. <mcb_at_fightspam.sd.znet.com>
Date: Tue, 22 Aug 2000 21:12:01 -0700
Message-ID: <sq6jh0gt9198_at_corp.supernews.com>


"Sean" <s_at_hotmail.com> wrote in message news:39A15105.B07ECF4E_at_hotmail.com...
> Hi,
> I am having problems retrieving fromn a dynamic table. I have the
> following code to
> set what table is to be queried.
>
> DECLARE
> TBL_REPL_SITS varchar2(50) :=
> 'SVW__'||:GLOBAL.ENVCHG||'_NTL_REPL_CONS_SITS';
> BEGIN
> set_block_property('REPL_CONS_SITS',QUERY_DATA_SOURCE_NAME,
> TBL_REPL_SITS);
> set_block_property('REPL_CONS_SITS', default_where,'process_type =
> 1');
> EXECUTE_QUERY;
> END;
>
> For some reason this will not work for this form?

I checked into this some more at work and here's what might be the problem (any combination of these):

  1. Oracle still wants no more than 30 characters for a table name (I tried to create a table with more than 30 characters for a name and it wouldn't let me), so I would make your variable varchar2(30), not varchar2(50). Might not be the problem but it can't hurt.
  2. You have 24 characters as it is. Is your global's value more than 6 characters? That'd put you over the limit of 30. If you make your variable 30 (see above) you'll at least get a value error that would tip you off that something's wrong.
  3. Are the two underscores after "SVW" a typo? (Should it be only one underscore?)
  4. Are you connected as a user that can "see" the table?

-Matt Received on Wed Aug 23 2000 - 06:12:01 CEST

Original text of this message