Comments on: Dynamic SQL Pivoting – Stealing Anton’s Thunder https://technology.amis.nl/2006/05/24/dynamic-sql-pivoting-stealing-antons-thunder/ Friends of Oracle and Java Thu, 21 May 2015 20:49:51 +0000 hourly 1 http://wordpress.org/?v=4.2.2 By: srilag https://technology.amis.nl/2006/05/24/dynamic-sql-pivoting-stealing-antons-thunder/#comment-3313 Mon, 21 Nov 2011 09:35:49 +0000 http://technology.amis.nl/blog/?p=1207#comment-3313 i hav a table of this format:

Id                   Descrip.
1                note1 note2 note3
2                note1 note2 note3
3                note1 note2 note3

i want the output as :

Id                   Descrip.

1                    note1
note2
note3

2                    note1
note2
note3

]]>
By: satya https://technology.amis.nl/2006/05/24/dynamic-sql-pivoting-stealing-antons-thunder/#comment-3312 Tue, 08 Nov 2011 14:01:45 +0000 http://technology.amis.nl/blog/?p=1207#comment-3312 Hi,

Many thanks for this excellent code, when i am  using this code with storedproc following error is showing

PL/SQL: ORA-22905: cannot access rows from a non-nested table item

OPEN porec_rpt FOR
      SELECT *
        FROM TABLE
                (pivot
                    (   ‘select * from document’
                    )
                );

could you please help

Regards

]]>
By: Svenka https://technology.amis.nl/2006/05/24/dynamic-sql-pivoting-stealing-antons-thunder/#comment-3311 Tue, 01 Nov 2011 18:50:05 +0000 http://technology.amis.nl/blog/?p=1207#comment-3311 ORDER BY clause in passed query is not being executed. Any ideas why?

]]>
By: Olu https://technology.amis.nl/2006/05/24/dynamic-sql-pivoting-stealing-antons-thunder/#comment-3310 Thu, 27 Oct 2011 16:13:27 +0000 http://technology.amis.nl/blog/?p=1207#comment-3310 Hi,
Many thanks for this fantastic piece of work
 I got the same ORA-29913: error in executing ODCITABLEDESCRIBE callout’ err. How may i resolve this.
With best wishes
Olu

]]>
By: Kannan https://technology.amis.nl/2006/05/24/dynamic-sql-pivoting-stealing-antons-thunder/#comment-3309 Sat, 20 Aug 2011 21:33:19 +0000 http://technology.amis.nl/blog/?p=1207#comment-3309 This is a brilliant piece conceptual explanation and code.  I had a similar  context about , delivering an output of  an arbitrary sql string , using parallel pipelined  functions which accepts a character string as input. I had a tough time to make it parallel as the plsql syntax more or less demanded an input ref cursor for the parallel operation to click , and I had to give it up.

]]>
By: Eugene https://technology.amis.nl/2006/05/24/dynamic-sql-pivoting-stealing-antons-thunder/#comment-3308 Thu, 11 Aug 2011 15:18:18 +0000 http://technology.amis.nl/blog/?p=1207#comment-3308 Did you ever figure out the issue with not picking up new column values?

]]>
By: DB https://technology.amis.nl/2006/05/24/dynamic-sql-pivoting-stealing-antons-thunder/#comment-3307 Wed, 21 Oct 2009 07:33:20 +0000 http://technology.amis.nl/blog/?p=1207#comment-3307 Great work guys! I used it and it helped a lot..
I got the same ORA-29913: error in executing ODCITABLEDESCRIBE callout’ err,
after digging in a bit I saw it is sensitive to reserved oracle words in the pivot column (the n-1 column). when I changed ‘user’ and ‘rowid’ values into ‘username’ and ‘row_id’ it worked fine.
another thing regarding that n-1 pivot column – can’t extend beyond 30 chars or it will pop the “invalid … ” err.

after fixing those two all I was left with was admiring your nice work.

]]>
By: KT https://technology.amis.nl/2006/05/24/dynamic-sql-pivoting-stealing-antons-thunder/#comment-3306 Tue, 18 Aug 2009 05:37:26 +0000 http://technology.amis.nl/blog/?p=1207#comment-3306 Hi,
I tried implementing the code.Even after creating the type PIVOTIMPL,when I run the select statement,i get an error message that PIVOTIMPL is not declared.
Any inputs what could be the reason?

]]>
By: SUdarshan https://technology.amis.nl/2006/05/24/dynamic-sql-pivoting-stealing-antons-thunder/#comment-3305 Wed, 28 Nov 2007 21:08:26 +0000 http://technology.amis.nl/blog/?p=1207#comment-3305 I get the error “PLS-00302 SETUROWID must be declared”

when dbms_types.typecode_urowid then
dbms_sql.column_value( self.cur, i, ur1 );
outset.seturowid( ur1 );

]]>
By: Patrick Sinke https://technology.amis.nl/2006/05/24/dynamic-sql-pivoting-stealing-antons-thunder/#comment-3304 Mon, 25 Jun 2007 15:21:30 +0000 http://technology.amis.nl/blog/?p=1207#comment-3304 For all you people experiencing problems with the ODCITABLEDESCRIBE callout, you might want to check two things. The number columns are quite strict: a column for the vertical axis, a column for the horizontal axis, and a third one for the result values.
Secondly, I haven’t found a way to parametize the query results, e.g. concatenating a parameter in the query. If you stick to that, it works like a charm!

]]>
By: Ionut https://technology.amis.nl/2006/05/24/dynamic-sql-pivoting-stealing-antons-thunder/#comment-3303 Wed, 11 Apr 2007 15:13:28 +0000 http://technology.amis.nl/blog/?p=1207#comment-3303 Hi, Is there a way of getting this to work on oracle 9i? I managed to make it compile somehow but I get the same ‘ORA-29913: error in executing ODCITABLEDESCRIBE callout’ error message when I try to run it.

]]>
By: Sudeep https://technology.amis.nl/2006/05/24/dynamic-sql-pivoting-stealing-antons-thunder/#comment-3302 Fri, 13 Oct 2006 08:12:20 +0000 http://technology.amis.nl/blog/?p=1207#comment-3302 It’s nice.

I am getting error while executing as

‘ORA-29913: error in executing ODCITABLEDESCRIBE callout’

]]>
By: Marco https://technology.amis.nl/2006/05/24/dynamic-sql-pivoting-stealing-antons-thunder/#comment-3301 Wed, 24 May 2006 17:19:38 +0000 http://technology.amis.nl/blog/?p=1207#comment-3301 Anton, Lucas, did you guys ever tried this by building a dynamic array? Or does this have to many disadvanges?

]]>
By: Viliam https://technology.amis.nl/2006/05/24/dynamic-sql-pivoting-stealing-antons-thunder/#comment-3300 Wed, 24 May 2006 07:52:19 +0000 http://technology.amis.nl/blog/?p=1207#comment-3300 Bad luck, it does not compile on 9iR2 we are using :-(

]]>
By: Karl r. https://technology.amis.nl/2006/05/24/dynamic-sql-pivoting-stealing-antons-thunder/#comment-3299 Wed, 24 May 2006 07:09:39 +0000 http://technology.amis.nl/blog/?p=1207#comment-3299 Hi,
that’s really a kind o f magic.
now i understand the implementation via interface.
it’s an interface mechanism like in C#; as you must satisfy those oci prefixed interface and then internally in the sql-engine methods of the interfaces are called.
a really interesting approach.
Karl

]]>