Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: coaty
  • Order by date
  1. coaty

    Tablename is a variable

    Oracool, Thought I'd try a different tack to do the same thing but still no luck, Can you see what's wrong eith this? 1 PROCEDURE cnt_tbl (var1 IN VARCHAR2) AS 2 cid INTEGER; 3 BEGIN 4 cid := DBMS_SQL.OPEN_CURSOR; 5 DBMS_SQL.PARSE(cid,'SELECT COUNT(*) FROM...
  2. coaty

    Tablename is a variable

    Oracool, My cutting & pasting is lacking - the '/' is there. The buffer definitely contains: DECLARE var1 char(20):= 'ng1.users'; sql_stmt varchar2(500):= null; BEGIN select 'select count(*) from '||var1 into sql_stmt from dual; EXECUTE IMMEDIATE sql_stmt; end; / but still getting the last 2...
  3. coaty

    Tablename is a variable

    OraCool Thanks for the response. Still having a problem tho'. Now running: 1 DECLARE 2 var1 char(20):= 'ng1.users'; 3 sql_stmt varchar2(500):= null; 4 BEGIN 5 select 'select count(*) from '||var1 into sql_stmt 6 from dual; 7 EXECUTE IMMEDIATE sql_stmt; 8* end; which gives ERROR at line...
  4. coaty

    Tablename is a variable

    Hi, I am trying to write a generic bit of SQL (Oracle 8i) to run against more than one table - the table being unknown until runtime. I am therfore trying to pass the table name as a variable to the Select statement as follows: 1 DECLARE 2 var1 char(20):= 'ng1.users'; 3 sql_stmt varchar2(500):=...

Part and Inventory Search

Back
Top