home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.databases.oracle      Overblown overpriced overengineered SHIT      2,288 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 478 of 2,288   
   Ana C. Dent to Suresh   
   Re: table name substitution in pl/sql   
   01 Oct 03 17:27:20   
   
   From: anacedent@hotmail.com   
      
   Suresh wrote:   
   > how can we use a variable in the place of a tablename?   
   >   
   > towner=scott   
   > ttable_name=emp   
   > select count(*) into totrows from towner.ttable_name;   
   >   
   > ERROR at line 18:   
   > ORA-06550: line 18, column 49:   
   > PLS-00201: identifier 'TOWNER.TTABLE_NAME' must be declared   
   > ORA-06550: line 18, column 15:   
   > PL/SQL: SQL Statement ignored   
   >   
   > I need to substitute different table names. How do I pass variable   
   > names as table names? Towner and ttable_names are declared in the   
   > declare section.   
   >   
   > Thanks   
   >   
   > Suresh   
      
      
   Use Dynamic SQL, such as EXECUTE IMMEDIATE   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca