Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9311987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T01:31:04+00:00 2026-06-19T01:31:04+00:00

Why does oracle not allow the following query select to_clob(1) from dual union select

  • 0

Why does oracle not allow the following query

select to_clob(1) from dual
union
select wm_concat(sysdate) from dual;

wm_concat returns a clob. To make both queries in the union have the same type columns i convert the column in the first query to a clob but Oracle gives me an [1]: ORA-00932: inconsistent datatypes: expected - got CLOB error even though both are returning a clob value.

Each of the queries work individually and both return a clob value.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-19T01:31:05+00:00Added an answer on June 19, 2026 at 1:31 am

    I don’t believe wm_concat returns a CLOB.

    This shows that the return is Typ=1 which is a VARCHAR2

    SQL> select dump(wm_concat(sysdate)) from dual;
    
    DUMP(WM_CONCAT(SYSDATE))
    --------------------------------------------------------------------------------
    Typ=1 Len=9: 49,52,45,70,69,66,45,49,51
    

    which you can also see if you create a view

    SQL> ed
    Wrote file afiedt.buf
    
      1  create view vw_wm_concat
      2  as
      3* select wm_concat(sysdate) col from dual
    SQL> /
    
    View created.
    
    SQL> desc vw_wm_concat;
     Name                                      Null?    Type
     ----------------------------------------- -------- ----------------------------
     COL                                                VARCHAR2(4000)
    

    If you convert the VARCHAR2 returned by WM_CONCAT into a CLOB, the next problem is that Oracle doesn’t support doing a DISTINCT on a CLOB column which is required in order to do a UNION. Assuming that you don’t really need to remove duplicate rows, you can use a UNION ALL rather than a UNION.

    Putting the two together, something like this

    SQL> ed
    Wrote file afiedt.buf
    
      1   select to_clob(1) from dual
      2   union all
      3* select to_clob(wm_concat(sysdate)) col from dual
    SQL> /
    
    TO_CLOB(1)
    ------------------------------------------------------------
    1
    14-FEB-13
    

    will work

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following query: SELECT wm_concat(DISTINCT NAME) as Methods FROM TPM_TRAININGPLAN JOIN TPM_DELIVERYMETHODS
In Oracle, this returns 03/01/2010. That does not make sense to me. Anybody know
On Oracle 9i, why does the following produce the result 'abc' select 'abc '
Why does Oracle 10 R2 not allow use of notational parameters while calling functions
Oracle does not support a bit datatype or any other type for true/false scenarios.
In Oracle (10g), when I use a View (not Materialized View), does Oracle take
Using an Oracle temporary table does not generate much redo log as a normal
MySQL has special table type MyISAM that does not support transactions. Does Oracle has
Can someone enlighten on why is that oracle does not support an autoincrement feature
Here is one (typical?) example taken from the List.addAll doc that does not seem

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.