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

Home -> Community -> Usenet -> c.d.o.misc -> ampersand problem in dynamic sql and PL/SQL tables

ampersand problem in dynamic sql and PL/SQL tables

From: Kal Khatib <kkhatib_at_cisco.com>
Date: Wed, 05 Aug 1998 15:11:37 -0700
Message-ID: <35C8D899.D6C3689A@cisco.com>


In a package..
I'm retrieving data using dynamic sql, then stroing it in a PL/SQL table.
If a column contains the ampersand (&) I get an error ORA-06502: PL/SQL: numeric or value error

c1 := dbms_sql.open_cursor;
dbms_sql.parse(c1, sql_stmt, dbms_sql.NATIVE); dbms_sql.define_column (c1, 1, v_field_c1, 2000); v_dummy := dbms_sql.execute(c1);

v_row := 1;
WHILE (dbms_sql.fetch_rows(c1) > 0)
LOOP
   dbms_sql.column_value(c1, 1, v_field_c1);    plsql_table(v_row).field1 := v_field_c1; <--chokes if v_field_c1 has an '&' in it.

   v_row := v_row + 1;
END LOOP; How do I get around this problem without having to string substitute in v_field_c1?

I tried setting scan off in the beginning of the package.. doesn't work.

I would greatly appreciate any help.

Kal

ps. please copy me when responding to group. Received on Wed Aug 05 1998 - 17:11:37 CDT

Original text of this message

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