PLSQL / Dynamic SQL question

From: Alvaro Palma Aste <apalma.nospam_at_cec.uchile.cl>
Date: 27 Sep 2000 19:53:08 GMT
Message-ID: <8qtj74$ulk$4_at_localhost.localdomain>


Im developing an script in PLSQL using dynamic sql. As a part of this script, I need to create a dynamic cursor that returns all the columns in a table concatenated in one varchar2 type variable, something like:

select to_char(column1) || to_char(column1) || to_char(column1) from tableX

I use Dynamic SQL because I don't know prior the number of column in the table (it can be any table in a database).

But when I try to compile this script, the next line

--> dbms_sql.define_column(cursor_handle,1,output_variable) <--

fails. SQLPlus returns an error "define_column is related to too many columns in the query"

Output_variable is a varchar2 tpye variable predefined.

Thanks for any help

-- 
Atte.
Álvaro Palma Aste
Grupo de Ing Biomédica - U. de Chile
apalma_at_cipres.cec.uchile.cl 
Received on Wed Sep 27 2000 - 21:53:08 CEST

Original text of this message