Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: help: decode syntax
Hi ,
This is working at my site. (Oracle 8.0.5)
SELECT dic.index_name index_name,
dic.column_name column_name,
DECODE(dc.constraint_type,
'C', 'Check Constraint', 'P', 'Primary Key', 'R', 'Foreign Key', 'U', 'Unique', 'Other') constraint_type
<kal121_at_yahoo.com> wrote in message news:807ta6$ug9$1_at_nnrp1.deja.com...
> Help - can anybody tell me what the problem is here? I've never had a
> problem with DECODE before on previous versions. It's either something
> very obvious that I'm missing or something strange on 8i.
>
> Version: Oracle 8i on Solaris
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> > SELECT dic.index_name index_name,
> 2 dic.column_name column_name,
> 3 DECODE(dc.constraint_type,
> 4 'C', 'Check Constraint',
> 5 'P', 'Primary Key',
> 6 'R', 'Foreign Key',
> 7 'U', 'Unique',
> 8 'Other') constraint_type
> 9 FROM dba_ind_columns dic, dba_constraints dc
> 10 WHERE dic.table_name = table_name_in
> 11 AND dic.table_owner = user_name_in
> 12 AND dic.table_owner = dc.owner
> 13 AND dic.table_name = dc.table_name
> 14 ORDER BY index_name, column_position;
>
> 'C', 'Check Constraint',
> *
> ERROR at line 4:
> ORA-00911: invalid character
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Tue Nov 09 1999 - 06:43:41 CST
![]() |
![]() |