Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Oracle Miscellaneous > Re: SELECT A CL...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 8 Topic 6815 of 7279
Post > Topic >>

Re: SELECT A CLOB - GROUP BY

by trpost@[EMAIL PROTECTED] Apr 4, 2008 at 08:49 AM

On Apr 4, 9:21=A0am, "Shakespeare" <what...@[EMAIL PROTECTED]
> wrote:
> <trp...@[EMAIL PROTECTED]
> schreef in
berichtnews:132260f0-7ad9-4fe6-b9b1-e4c4904f=
366e@[EMAIL PROTECTED]
> On Apr 3, 3:56 pm, trp...@[EMAIL PROTECTED]
 wrote:
>
>
>
>
>
> > Hi,
>
> > I am having trouble selecting a CLOB (CASE_LIST), here is what
> > happens:
>
> > SELECT PRODUCT_NAME AS "Product Name", SUM(CASES_CREATED) AS "Cases
> > Created",
> > CASE_LIST
> > FROM PEOPLESOFTBUCUSTPROD
> > GROUP BY PRODUCT_NAME, CASE_LIST
> > ORDER BY PRODUCT_NAME
>
> > I get this error: ORA-00932: inconsistent datatypes: expected - got
> > CLOB
>
> > Then I did this, using TO_CHAR:
>
> > SELECT PRODUCT_NAME AS "Product Name", SUM(CASES_CREATED) AS "Cases
> > Created",
> > TO_CHAR(CASE_LIST)
> > FROM PEOPLESOFTBUCUSTPROD
> > GROUP BY PRODUCT_NAME, TO_CHAR(CASE_LIST)
> > ORDER BY PRODUCT_NAME
>
> > I get this error: ORA-22835: Buffer too small for CLOB to CHAR or BLOB
> > to RAW conversion (actual: 4997, maximum: 4000)
>
> > So lastly I did this, using DBMS_LOB.SUBSTR:
>
> > SELECT PRODUCT_NAME AS "Product Name", SUM(CASES_CREATED) AS "Cases
> > Created",
> > DBMS_LOB.SUBSTR(CASE_LIST, 4000, 1) CASE_LIST
> > FROM PEOPLESOFTBUCUSTPROD
> > GROUP BY PRODUCT_NAME, DBMS_LOB.SUBSTR(CASE_LIST, 4000, 1)
> > ORDER BY PRODUCT_NAME
>
> > I am now able to get results, but my data is truncated at 4000
> > characters, which will not work
>
> > Any ideas on how to get the full clob results in one query?
> > Is it possible to Select a CLOB in a GROUP BY? Is there a work around
> > for when TO_CHAR exceeds 4000 characters?
>
> Don't put your CLOB in the group by clause, just in the select and only
> group by product_name. I don't expect you really want to group by a
CLOB, =
do
> you?
>
> Shakespeare- Hide quoted text -
>
> - Show quoted text -

If I do that I get an error:

SELECT PRODUCT_NAME AS "Product Name", SUM(CASES_CREATED) AS "Cases
Created",
CASE_LIST
FROM PEOPLESOFTBUCUSTPROD
GROUP BY PRODUCT_NAME
ORDER BY PRODUCT_NAME

ORA-00979: not a GROUP BY expression
 




 8 Posts in Topic:
SELECT A CLOB - GROUP BY
trpost@[EMAIL PROTECTED]   2008-04-03 14:56:42 
Re: SELECT A CLOB - GROUP BY
trpost@[EMAIL PROTECTED]   2008-04-04 07:47:39 
Re: SELECT A CLOB - GROUP BY
"Shakespeare" &  2008-04-04 17:21:20 
Re: SELECT A CLOB - GROUP BY
trpost@[EMAIL PROTECTED]   2008-04-04 08:49:42 
Re: SELECT A CLOB - GROUP BY
"Shakespeare" &  2008-04-04 17:53:54 
Re: SELECT A CLOB - GROUP BY
trpost@[EMAIL PROTECTED]   2008-04-07 15:06:20 
Re: SELECT A CLOB - GROUP BY
"Shakespeare" &  2008-04-09 09:53:51 
Re: SELECT A CLOB - GROUP BY
Ed Prochak <edprochak@  2008-04-08 05:17:12 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Dec 1 20:22:04 CST 2008.