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

Home -> Community -> Usenet -> c.d.o.tools -> HELP !: how concat/select a LONG field ??

HELP !: how concat/select a LONG field ??

From: <monsri_at_my-deja.com>
Date: 2000/04/13
Message-ID: <8d4pae$jnu$1@nnrp1.deja.com>#1/1

Hi,
I'm trying to dynamically create a file containing all my constraints, but I've been stalling against the SEARCH_CONDITION LONG field of the DBA_CONSTRAINTS table. I can't concatenate it to the string 'add check ' for example, and when I do the following:

> select 'alter table &&1'||chr(10)||
> 'add check (',
> search_condition,
> ');'
> from DBA_CONSTRAINTS a,
> DBA_CONS_COLUMNS b
> where a.TABLE_NAME = '&&1'
> and b.TABLE_NAME = '&&1'
> and a.constraint_name = b.constraint_name
> and a.constraint_type = 'C';

I get something very funny: Oracle obsviously gets confused and I'm returned a messy SQL statement, looking like:

> alter table MY_TABLE STCAS = 'O' OR STCAS = 'C'
> add check (

(the string "STCAS = 'O' OR STCAS = 'C'" being the contents of my SEARCH_CONDITION field !)
!!! Anybody can explain me this behaviour ? And does someone think I can solve my problem one way or another ????

Thanks a lot !
Seb

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Thu Apr 13 2000 - 00:00:00 CDT

Original text of this message

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