Re: DBA_TAB_PARTITIONS
Date: Tue, 16 Jan 2018 21:33:53 +0000
Message-ID: <HE1P190MB02504EDCAB574414E03B65D1A1EA0_at_HE1P190MB0250.EURP190.PROD.OUTLOOK.COM>
https://orastory.wordpress.com/2013/12/12/sql-utils-using-xml/
Sent from my iPhone
On 16 Jan 2018, at 21:28, Norman Dunbar <oracle_at_dunbar-it.co.uk<mailto:oracle_at_dunbar-it.co.uk>> wrote:
Evening Elizabeth,
Toad etc don't need to convert as they are selecting the LONG data in it's entirety. Similar to how they can show a NUMBER without converting using TO_CHAR() - these utilities fetch the data into local variables in whatever language they are written in - C, Delphi etc - so an Oracle LOND (or VARCHAR2 etc) will be converted into a C char[] or similar 'on the fly'.
LONGs are a monumental PITB when you want to do anything with them.
This blog post might help show you how to convert to a CLOB, which you can then use DBMS_LOB.SUBSTR etc to slice up. https://ellebaek.wordpress.com/2010/12/06/converting-a-long-column-to-a-clob-on-the-fly/<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fellebaek.wordpress.com%2F2010%2F12%2F06%2Fconverting-a-long-column-to-a-clob-on-the-fly%2F&data=02%7C01%7C%7Cda36871121ab4070ae6908d55d282581%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636517349368903673&sdata=2bfvOhnY%2BqDOkxycA%2Fo8E6iJKd34KR0XIcwAfjkG6CA%3D&reserved=0>
There are some less frantic solutions in PL/SQL at https://www.toadworld.com/platforms/oracle/b/weblog/archive/2014/05/20/long-to-clob-conversion-constraint-conditions-and-database-d-i-y<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.toadworld.com%2Fplatforms%2Foracle%2Fb%2Fweblog%2Farchive%2F2014%2F05%2F20%2Flong-to-clob-conversion-constraint-conditions-and-database-d-i-y&data=02%7C01%7C%7Cda36871121ab4070ae6908d55d282581%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636517349368903673&sdata=zGMvWBk24AO6l3sgCKu35niRnk4RbSjutiWTwhyKvpg%3D&reserved=0> - near the end - it looks like PL/SQL does implicit conversions. Test and see how you get on.
Finally, I had a similar problem myself looking for broken check constraints which suffered from a similar LONG problem. As the amount of data was small, I created a temporary table as described at http://qdosmsq.dunbar-it.co.uk/blog/2016/08/dropping-temporary-tables-with-bonus-broken-check-constraints/<https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fqdosmsq.dunbar-it.co.uk%2Fblog%2F2016%2F08%2Fdropping-temporary-tables-with-bonus-broken-check-constraints%2F&data=02%7C01%7C%7Cda36871121ab4070ae6908d55d282581%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636517349368903673&sdata=MtbRVPfXI%2FPSN5Z%2FrHGhYIGqOvUK5Q9%2BZIeQ6k%2BdK3Q%3D&reserved=0>
HTH
Cheers,
Norm.
On 16 January 2018 19:46:07 GMT+00:00, "Reen, Elizabeth " <dmarc-noreply_at_freelists.org<mailto:dmarc-noreply_at_freelists.org>> wrote:
We are trying to create a sql which will create a script of partitions to compress which are older than a certain date. That information is kept in High_value. When displayed high_value looks like this
TO_DATE(' 2017-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN') So the first thing we did was to query where high_value like ‘TO_DATE%’. We got an invalid character error. Long story short, we discovered that high_value’s data type is long. There must be a way to translate this into text. SQLplus, Sqldeveloper, and TOAD all do that. The question is how do they do it? Does anyone know how it is done?
Thanks,
Liz
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
--
http://www.freelists.org/webpage/oracle-l
Received on Tue Jan 16 2018 - 22:33:53 CET