Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Dynamic SQL with more than one table
Hi Group!
I need to create a stored procedure which adds columns to a table in runtime. I use DBMS_SQL package, but I stopped because I've a problem. The problem is:
I'ts possible to open a cursor with DBMS_SQL.EXECUTE when the FROM clause has more than one table? I.E.
SQL clause to parse with DBMS_SQL.PARSE:
'SELECT N.IDNIVEL3, AVG(P.PVP) PMED FROM NIVEL3 N, PRECIOS P WHERE
N.IDNIVEL3 = P.IDNIVEL3 AND
N.ENS = ' ||WENS
WENS is a variable value wich is obtained from a static cursor.
Column definitions:
DBMS_SQL.DEFINE_COLUMN(cid, 1, IDNIVEL3);
DBMS_SQL.DEFINE_COLUMN(cid, 2, PMED);
...where IDNIVEL3 and PMED are NUMBER
When I execute the procedure the error "ORA-06502: PL/SQL: error: error de conversión de carácter a número numérico o de valor" is displayed at the DBMS_SQL.EXECUTE line.
Thanks in advance.
Juanfra.
Received on Thu Jun 13 2002 - 05:30:44 CDT