DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: decode query

  1. #1
    Join Date
    Apr 2006
    Posts
    2

    decode query

    hi guys

    hope everyone will be fine.

    I am facing a problem in using decode query function. actually i have three fields in my table

    FieldA VARCHAR
    FieldB VARCHAR
    FeildC Long

    now in Fielda if there is '+' then Field C should be shown. I am writing query like this.

    select FieldA, decode(FieldA,'+',FieldC) from abc

    i am getting this error

    "ORA-00997: Illegal use of LONG datatype"

    is it means that decode can't be used with the LONG datatype.

    please help

  2. #2
    Join Date
    Apr 2006
    Posts
    50
    you need to write a function that will convert long to varchar2 so that you can select it. this link should give you a headstart

    http://asktom.oracle.com/pls/ask/f?p...D:839298816582

  3. #3
    Join Date
    Apr 2006
    Posts
    2
    Quote Originally Posted by graham_o
    you need to write a function that will convert long to varchar2 so that you can select it. this link should give you a headstart

    http://asktom.oracle.com/pls/ask/f?p...D:839298816582

    well thanks

    I use CASE in the query & it solved my problem

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width