Hi David,

you are right, but we cannot modify the base tables of an ERP.

anyways, I got a simple solution to the problem using "CASE WHEN" in
place of DECODE.

don't know if there is better solution to this problem.


Regards,
Sonty

On Jun 29, 7:16 pm, ddf <orat...@msn.com> wrote:
> On Jun 29, 5:56 am, sonty <saurabh.zen...@gmail.com> wrote:
>
>
>
>
>
> > even this don't work..
>
> > On Jun 29, 12:23 pm, Lux <wieland.v...@googlemail.com> wrote:
>
> > > Hi sonty,
> > > just make sure, that the datatypes in the decode-statement are of the
> > > same type.
>
> > > To run your query, you can do it like this:
>
> > > select decode(mod(column1,2),0,column2,to_char(column3)) from
> > > table_for_example;
>
> > > Greetings
> > > Lux- Hide quoted text -
>
> > - Show quoted text -
>
> It won't because of the LONG datatype.  You'll need to use PL/SQL to
> extract a substring of the LONG into a character string, and even then
> you can't use DECODE.  Use CLOB instead of LONG and you'll have
> success:
>
> SQL> create table table_for_example(
>   2          column1 number,
>   3          column2 varchar2(100),
>   4          column3 clob
>   5  );
>
> Table created.
>
> SQL>
> SQL> insert into table_for_example
>   2  values(2, 'This is only a test','This is only a test, really');
>
> 1 row created.
>
> SQL>
> SQL> commit;
>
> Commit complete.
>
> SQL>
> SQL> select decode(mod(column1,2),0,column2,column3) from
>   2  table_for_example;
>
> DECODE(MOD(COLUMN1,2),0,COLUMN2,COLUMN3)
> ---------------------------------------------------------------------------­-----
> This is only a test
>
> SQL>
>
> David Fitzjarrell- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Oracle PL/SQL" group.
To post to this group, send email to Oracle-PLSQL@googlegroups.com
To unsubscribe from this group, send email to
oracle-plsql-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/Oracle-PLSQL?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to