Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Dynamic SQL with more than one table

Dynamic SQL with more than one table

From: Omen <bf109e_at_teleline.es>
Date: 13 Jun 2002 03:30:44 -0700
Message-ID: <25edf32d.0206130230.39b557f5@posting.google.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US