From: markhath@my-dejanews.com
Subject: Dynamic SQL
Date: 1998/05/22
Message-ID: <6k4jvk$e9e$1@nnrp1.dejanews.com>#1/1
X-Http-User-Agent: Mozilla/2.0 (compatible; MSIE 3.02; Windows 95)
Organization: Deja News - The Leader in Internet Discussion
X-Article-Creation-Date: Fri May 22 19:34:12 1998 GMT
Newsgroups: comp.databases.oracle.misc



Does anyone know why the following script errors? If I store a "select"
statement in the variable l_text it works just fine. Why can't I call a
procedure here?

Test MED> Declare
  2   l_text   Varchar2(60);
  3   cur_name  INTEGER;
  4   l_cnt   NUMBER;
  5   l_rc  NUMBER;
  6  BEGIN
  7   l_text := 'PRC_REGISTER_SAVE';
  8
  8   cur_name  := dbms_sql.OPEN_CURSOR;
  9
  9   dbms_sql.PARSE( cur_name, l_text, dbms_sql.NATIVE );
 10
 10   l_cnt := dbms_sql.EXECUTE( cur_name );
 11
 11   dbms_sql.CLOSE_CURSOR( cur_name );
 12
 12  END;
 13  /
Declare
*
ERROR at line 1:
ORA-00900: invalid SQL statement
ORA-06512: at "SYS.DBMS_SYS_SQL", line 239
ORA-06512: at "SYS.DBMS_SQL", line 32
ORA-06512: at line 9


Test MED>

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


