Save result of clob query to file

What is the best way to export a clob to a file, as the result of a query?
I have something like:
select xmlelement( "big_clob", big_clob ).getclobval() as "result"
spool in sqlplus will corrupt the clob/xml-output because of spool line-breaking.
Can it been done in sqlplus 9.2.0.5?
What are the alternatives?

I never found a way to get around the line-break issue at 32k so I resorted to a java program.

Similar Messages

  • Is it possible to save Result of the Query?

    Hi All,
    I run a simple query in Project Raptor.
    And I am looking for options to save my query Results into an xls file.
    Is there any options to save the output file?
    Thanks
    Mouly

    this function is bugged
    Re: 919 Export->Insert nothing

  • How to spool the result of an query into a file in sql 2000

    Hi All,
    I have an SQL query which iterates through number of times for checking on some conditions and will return results each time. I wants to save the results into an different xml file each time. I tried using below query:
    exec xp_cmdshell 'bcp "use Mimsadaptorlogs; select top 10 * from log order by logdate" queryout "D:\cdr_cg.xml" -T -c -t,'  ---> Its not working as expected.
    I got the Below output:
    NULL
    Starting copy...
    SQLState = 01000, NativeError = 5701
    Warning = [Microsoft][ODBC SQL Server Driver][SQL Server]Changed database context to 'MIMSAdaptorlogs'.
    NULL
    10 rows copied.
    Network packet size (bytes): 4096
    Clock Time (ms.): total       62
    NULL
    Could you anuone please suggest me on this.......
    Thanks and Regards, Bala

    You will need to write a client program to do this. SQL Server is not intended for writing files. People still do it by calling BCP through xp_cmdshell, but this is a dubious practice. Better is to write a CLR stored procedure for the task. However, you
    are on SQL 2000, and the CLR support was added in SQL 2005. Furthermore, there is no XML type in SQL 2000, and the only way to generate XML is with the FOR XML clause. But this output is not well understood by BCP. Then I try: [code} bcp "SELECT * FROM Northwind..Customers
    FOR XML RAW" queryout slask.bcp -c -T [/code] on SQL 2000, I get [code] 11 rows copied. [/code] which is complete hogwash, because there are 91 rows in that table, and the output should be a single XML document, and the output looks like this: [code] <row
    CustomerID="ALFKI"... Bouchers" City="Marseil... tomerID="DUMON" Company... 0.32.21.21" Fax="40.32.... los Hern ndez" ContactT... n Steel" ContactTitle="... e" ContactTitle="Market... ="Salzburg" PostalCode=... " Phone="(21) 555-3412"... ty="Charleroi" PostalCo...
    <row CustomerID="WARTH"... [/code] I have truncated the output on the right side, but the left side is authentic. It really is that bad.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Help Me! I want save CLOB to OS file (XML file)

    file size about 10 Mb
    i want example PL/SQL procedure Save CLOB to OS file.
    Thank you.

    See here
    Re: How to export the blob column data to a OS text file

  • Af:query what does Save Results Layout do

    Hi,
    af:query allows you to create a new saved search by opening a new popup "Create Saved Search"
    Which contains
    InputText for Name :
    checkbox for Set As Default
    checkbox for Run Automatically
    checkbox for Save Results Layout
    what does the Save Results Layout actually do ? I do not see any visual difference with that flag on/off
    thank you all in advance,

    Simplyadf,
    (I'm guessing) - when you re-order the columns in the results table - that checkbox would save the re-ordering.
    You may know: in the current release, saved searches only persist for the session - you need MDS (which is supposed to be in the next release) to permanently persist them.
    John

  • Exporting BEx Query results to CSV or other files.

    Hi All,
    We have a report designed in WAD, which uses a BEx query to display department’s information. Because of amount of data in the results it crashes when u get all the Free Characters into ROWS(Error is : Result set too large(552244 cells); data retrieval restricted by configuration (maximum =500000 cells).  It is a requirement from the user to have all the free characteristics in the rows( which I can understand is not the right way to go ahead). As it is crashing when you add last characteristic(WBS Purpose)  into the rows, they aren’t able to export data into spread sheet from the results. (as there are no results)
    Now my question is…..is there any way we can export the results from BEX query into any format for example text or csv? If yes, can we schedule that process? Please note that this characteristics are displayed as hierarchies.
    Am new to SAP BW and its been only six months since I have been in this role. Any help would be much appreciated???
    I looked online and some where in the forum it was mentioned of using program RSCRM_BAPI, but looks like it needs some sort of downloads from SAP.
    Is there any other way to export the BEx query results?
    Cheers
    Sandeep

    Hello Sandeep,
    You can use the Item "Context Menu" in your WAD and in the properties by default you can see the Options:
    Export to Excel & Export to CSV will be there and also there are many options which you wanted to see.
    It works for you!!!
    With Regards,
    PJ.

  • Best way to print result of query to file from pl/sql?

    If I have a query, let's say 'select * form my_table', what's the best way to print it to a file from pl/sql?
    Do I have to create a cursor, go through each line, and use some file output function? Or is there some clever way to say 'print this query to file!'

    The rest of my procedure (the one generating the query itself) is in PL/SQL. So it needs to be done from there. Any tricks?
    (What's paper? I meant 'write to file')

  • Not able to save report output in a text file and RTF file

    I am using Oracle Developer6.0 . I am facing problem with reports. I am invoking reports from form using run_product.
    1. I could not able to save the report in text file . Whenever i try to save the report output in a text file.It gives dump and application get closed.
    2. In RTF format , it execute the query which i have given at the design time while creating a report . But while running i am passing query either through lexical parameter or passing value of where criteria user parameters. It display the output for the specified value. But when i save this report output in rtf file . It execute design time query and save that in a rtf file.
    If any body is having any idea about it . Please let me ASAP . It is very urgent for me.
    Thanks in advance

    Try the following:
    Do not generate the report to .rep file, but rename/copy the .rdf file to .rep file and execute it.

  • How to use one query results in another query

    hi,
    in help.sap I have founded that using variable type replacement path I can use one query results in another query. It is wrote there that I have to choose query name results I want to get in variable definition but I do not know where.
    How I can do this?
    Result I want to get is:
    In one query I have material prices in another material quantities. I want to calculate inventory value (price * quantity). Moreover prices are on plant level, quantities on storage type level. Plant is atribute of storage type.
    Can I do this?
    Regards,
    Andrzej

    Hi Andrzej,
    please check out this thread: Set parameters values depending on other parameters
    I had a discussion about query results as input for another query in there.
    For creating a workbook, just click on the save button after you ran your query in the bex.
    Siggi
    Message was edited by: Siegfried Szameitat

  • How do I save a PDF as an excel file when the PDF is horizontal. Adobe tries to rotate the page, but the data is entered in an  horizontal format.

    How do I save a PDF as an excel file when the PDF is horizontal. Adobe tries to rotate the page, but the data is entered in an  horizontal format.

    Thanks for the quick reply.  I figured out how to get the desired results by using tagging.  For anyone who may reference this post in the future, I went to "Customize" in the top right corner of Adobe, then selected "Create new tool set...", looked under "accessiblity and found the "tag" option.  Hit ok, tag is added to the toolbar.  Then I highlighted the dataset in the PDF that was relevant to the output format, then clicked "tag", saved as spreadsheet.  Sorry I can't provide more details on how tagging works or if there's a more elegant solution available, but I'm sure one's out there.

  • How to hide the Save Results Layout checkbox on the Create Saved Search pop

    I need to hide the Save Results Layout checkbox on the Create Saved Search popup. Can anyone tell me how to do it?
    This popup is used when the user is on a query (rendered by the af:query component) and they select click the "Save..." button. The have three options, Set as Default, Run Automatically, and Save Results Layout. I have an implementation that supports everything except saving the layout. So I need to hide that checkbox.
    Thanks,
    Mike

    For anybody else who needs to do this, here is how I did it.
    Add this to your css
    /* This hides the Save Results Layout checkbox on the Create Saved Search screen */
    span[id$='saveLayout'] {
    visibility: hidden;
    }

  • Photoshop CS4 11.0.1  crash upon save, leaves small sized corrupt PSD file

    Hi!
    I've just updated our retouchers Photoshop CS4 to 11.0.1 but one of the issues we had with 11.0.0 remains. The problem doesn't happen that often, but since the result is an unusable .PSD file it's pretty nasty...
    Sometimes when saving Photoshop crashes and the .PSD that was to be saved becomes a small (68 KB in the last example) and unusable.
    The hardware/software we have:
    Mac Pro 2.66 GHz (some with 5 GB RAM and some with 9 GB RAM)
    Mac OS X 10.5.6
    Photoshop CS4 Standard (updated to 11.0.1)
    People work on server volumes shared via AFP. I've heard saving over the network isn't supported, but there's no other way, plus this issue never happened in CS3 so...
    Any ideas on what can be done?
    Below is the latest crash log:
    Process: Adobe Photoshop CS4 [41265]
    Path: /Applications/Adobe Photoshop CS4/Adobe Photoshop CS4.app/Contents/MacOS/Adobe Photoshop CS4
    Identifier: com.adobe.Photoshop
    Version: 11.0.1 (11.0.1x20090216 [20090216.r.522 2009/02/16:17:00:00 cutoff; r branch]) (11.0.1)
    Code Type: X86 (Native)
    Parent Process: launchd [84]
    Date/Time: 2009-03-24 11:04:07.914 +0100
    OS Version: Mac OS X 10.5.6 (9G55)
    Report Version: 6
    Exception Type: EXC_BAD_ACCESS (SIGBUS)
    Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000008
    Crashed Thread: 0
    Thread 0 Crashed:
    0 com.adobe.Photoshop 0x00748248 0x1000 + 7631432
    1 com.adobe.Photoshop 0x004d962d 0x1000 + 5080621
    2 com.adobe.Photoshop 0x004dda2f 0x1000 + 5098031
    3 com.adobe.Photoshop 0x004dedba 0x1000 + 5103034
    4 com.adobe.Photoshop 0x004a6a58 0x1000 + 4872792
    5 com.adobe.Photoshop 0x000821ad 0x1000 + 528813
    6 com.adobe.Photoshop 0x00082bdb 0x1000 + 531419
    7 com.adobe.Photoshop 0x00acb564 0x1000 + 11314532
    8 com.adobe.Photoshop 0x004a5f6e 0x1000 + 4869998
    9 com.adobe.Photoshop 0x00077f9e 0x1000 + 487326
    10 com.adobe.Photoshop 0x0006b9ed 0x1000 + 436717
    11 com.adobe.Photoshop 0x00069906 0x1000 + 428294
    12 com.adobe.Photoshop 0x00063d65 0x1000 + 404837
    13 com.adobe.Photoshop 0x00063ed3 0x1000 + 405203
    14 com.adobe.Photoshop 0x0006222f 0x1000 + 397871
    15 com.adobe.Photoshop 0x002206aa 0x1000 + 2225834
    16 com.adobe.Photoshop 0x00220736 0x1000 + 2225974
    17 com.adobe.Photoshop 0x00003912 0x1000 + 10514
    18 com.adobe.Photoshop 0x00003839 0x1000 + 10297
    Thread 1:
    0 libSystem.B.dylib 0x92893906 kevent + 10
    1 libSystem.B.dylib 0x92894095 _pthread_start + 321
    2 libSystem.B.dylib 0x92893f52 thread_start + 34
    Thread 2:
    0 libSystem.B.dylib 0x9286320e semaphore_wait_signal_trap + 10
    1 libSystem.B.dylib 0x92895206 _pthread_cond_wait + 1267
    2 libSystem.B.dylib 0x928da539 pthread_cond_wait + 48
    3 com.adobe.amt.services 0x04da4552 AMTConditionLock::LockWhenCondition(int) + 46
    4 com.adobe.amt.services 0x04d9f995 _AMTThreadedPCDService::PCDThreadWorker(_AMTThreadedPCDService*) + 115
    5 com.adobe.amt.services 0x04da45b0 AMTThread::Worker(void*) + 20
    6 libSystem.B.dylib 0x92894095 _pthread_start + 321
    7 libSystem.B.dylib 0x92893f52 thread_start + 34
    Thread 3:
    0 libSystem.B.dylib 0x9286a3ae __semwait_signal + 10
    1 libSystem.B.dylib 0x92894d0d pthread_cond_wait$UNIX2003 + 73
    2 libGLProgrammability.dylib 0x95affb32 glvmDoWork + 162
    3 libSystem.B.dylib 0x92894095 _pthread_start + 321
    4 libSystem.B.dylib 0x92893f52 thread_start + 34
    Thread 4:
    0 libSystem.B.dylib 0x9286321a semaphore_timedwait_trap + 10
    1 ...ple.CoreServices.CarbonCore 0x9237449b MPWaitOnSemaphore + 125
    2 MultiProcessor Support 0x1

    This is the boilerplate text I use in connection to saving to a network (please NOTE the part where it explains that
    normally, it does work
    , but that it is impossible to troubleshoot someone else's network remotely, and that's why it's not supported by Adobe):
    If you are opening files over a network or saving them to a network server, please
    cease and desist immediately
    in the event you are currently experiencing problems with one or more files.
    Working across a network is not supported.
    See:
    http://www.adobe.com/support/techdocs/322391.html
    Copy the
    CLOSED file from your server to your local hard disk, work on it, save it again to your local hard disk, close it, and copy the closed file back to the server.
    Of course, the fact that Adobe does not support working across a network does not necessarily mean it won't work. It should.
    Adobe's position is that there are too many variables in a network environment for them to guarantee that everything will work correctly in every network, especially given the fact that if something does
    not work properly, it's probably the network's fault, and Adobe has no way of troubleshooting your network.
    If you can't work locally, you are on your own, and if something happens, you're on your own. If you must work from a server, make sure your network administrator is a competent professional.
    When problems arise, a lot of valuable work can be lost.

  • SQL Dev 2.1:Ability to save and load visual query models?

    At SQL Dev 2.1, do we now have the ability to save and load visual query models as with TOAD? Or has that functionality been rolled into the for-pay Data Modeler extension? Seemed strange to hide the functionality deep within SQL Worksheet, then not allow query models to be saved or loaded. From what I recall, load/save was scheduled to be in 2.0.
    I've not yet downloaded and installed 2.1, but also as I recall, it was promised to be a significant (e.g. new-feature rich) release. Has it lived up to that promise? Hoping also that it's not so buggy as to not merit an upgrade. At my workplace, folks have different versions of SQL Dev 1.X installed, each for the purpose of retaining functionality that got broken in future releases, etc. Would love to be able to advise them to retire their 1.X installs in favor of 2.1.
    Edited by: Dana N on Jan 21, 2010 6:45 AM

    Dana, We are working on the query builder. We have not done anything with it in recent releases as we knew that it needed completely overhauled and a
    couple of bug fixes were not going to give us the query builder we needed. Sue will be able to tell you more as the we get closer to releasing it as a feature.Thanks Barry. I know it's probably impossible to give firm dates, but my colleagues would love to know, ballpark, when query builder might be ready. Any particular year/quarter that's targeted for?
    A lot of the bugs in the 2.1 are probably my fault as we decided to build a framework which allowed tasks to be scheduled like eclipse and push them to the
    background. Coupled with this, we tore apart the worksheet to allow us to fit tasks in, but to also give us the ability to do some of the enhancement requests
    that you guys, our users, have been asking for. While its not perfect, I believe its getting much better from both a functionality and performance standpoint. The
    worksheet will not change again and there are no enhancements logged or scheduled which will do that. The issues that have come as part of 2.1 are being
    addressed and we are fixing the highest priority ones as we speak. One of my priorities is to make these components as rock solid as possible.Thanks again. It really is a nice tool to work with, and I'm grateful to have it. I would choose stability for existing features over new ones, but I suppose there always has to be a balance in development. What was really scary in the past was getting bizarre / wrong answers in query results--that's a complete show stopper; e.g. clicking on a row/col intersection in a result set row would show strange and false values. New features can wait, but core functionality must be solid. If one can't presume integrity of query results, it's game over--using a version of SQL Developer that returns inconsistent result sets between runs could be Considered Harmful, or so it is to me.
    Anyway, thanks for responding and I hope Oracle Corp gets you whatever assistance you need to improve the quality of existing functionality while adding new features; with one not being at the expense of the other. :-) Glad also to see Sue has authored a book on the tool. Hopefully that will drive customer demand and force increased allocation of development resources toward the product. I'd like to think having out-of-the-box tools that are a joy to use might even increase market share.
    Data Modeler I would love to use, but am completely priced out of it. Enterprise Architect from Sparx Systems is the best value there so far as I can tell.
    Dana

  • 0 result returned for query "collection ('exampledata.dbxml')/article

    I  using  BDB XML I create a container called Exampledata.dbxml using java API. using a separate program I put my sigmodRecord.xml  file into the container. I then wrote another program (see the program below) to test my Query
    where Query =  "collection ('Exampledata.dbxml')/article"  but dont know why i always have
                                                      0 result returned for query "collection ('exampledata.dbxml')/article  if  the program is run. Pls can anybody help me?
    package xmldbdemo;
    import com.sleepycat.db.Environment;
    import com.sleepycat.dbxml.*;
    import dbxml.gettingStarted.myDbEnv;
    import java.io.File;
    public class simpleQuery3 {
        public static void main (String[] args) throws Throwable  {
         String theContainer = "Exampledata.dbxml";
          File path2DbEnv = new File("c:/myJavaProgs/examplesEnvironment");
         if (path2DbEnv == null || ! path2DbEnv.isDirectory()) {
               System.out.println("Bad file name");
          System.exit( -1 );
      myDbEnv env = null;
      XmlContainer openedContainer = null;
         env = new myDbEnv(path2DbEnv);
                Environment enviro = env.getEnvironment();
         // create xmlmanager
           XmlManagerConfig myManagerConf = new  XmlManagerConfig();
           myManagerConf.setAdoptEnvironment(true);
           myManagerConf.setAllowExternalAccess(true);
           XmlManager myManager = new XmlManager  (enviro, myManagerConf);
       // XmlManager myManager = new XmlManager();
        XmlContainerConfig myContainerConf = new  XmlContainerConfig();
        XmlContainer myContainer = myManager.openContainer( theContainer, myContainerConf);
        XmlQueryContext myContext =  myManager.createQueryContext();
        String myQuery = "collection('Exampledata.dbxml')/article";
        XmlResults myResults = myManager.query(myQuery, myContext, null);
        XmlValue myValue = myResults.next();
        while (myValue != null){
         XmlDocument myDocument = myValue.asDocument();
         String name  = myDocument.getName();
         System.out.println(name);

    Hi,
    The BDB forum is located here : Berkeley DB Family

  • Read the results shown in the trace files

    Hi,
    I have a question,
    In oracle 10g or 11g, How can I interpret the results shown in the trace files?
    ok I explain more ... when I enable the trace sql session , a trace file is created under user dump!
    What 's the meaning of :
    *1- PARSING IN CURSOR*
    *2- tim= is it in Microseconds? Timestamp ? How can I convert it in seconds?*
    *3- STAT*
    *4- CLOSE*
    *5- hv=*
    *6- tim=*
    *7- lid=*
    *8-dep=*
    PARSING IN CURSOR #2 len=104 dep=0 uid=0 oct=2 lid=0 tim=13651992547 hv=3760112805 ad='284c0e6c' sqlid='6shmgvbh1xj55'
    INSERT INTO employee(ID,NAME,department_id, DEPARTMENT_SUB_ID) VALUES(10002, 'employee', 12, 0)
    END OF STMT
    PARSE #2:c=93750,e=102539,p=24,cr=471,cu=0,mis=1,r=0,dep=0,og=1,plh=0,tim=13651992547
    EXEC #2:c=0,e=0,p=5,cr=1,cu=7,mis=0,r=1,dep=0,og=1,plh=0,tim=13651992547
    STAT #2 id=1 cnt=0 pid=0 pos=1 obj=0 op='LOAD TABLE CONVENTIONAL  (cr=1 pr=5 pw=0 time=0 us)'
    CLOSE #2:c=0,e=0,dep=0,type=0,tim=13652013059Thnak you a lot guys,
    Smith

    794130 wrote:
    Thank you,
    Sorry, I am new in Oracle and I want to get things really clear (something that is diifficult I think)
    When an end user submit a query, one user process communicates the query to a server process.
    The server process analyse the syntax and the symentic of the query, this known as the parse process.
    The syntax of the query and the tables, columns are verified against the database buffer cache.
    One PGA is allocated to store the query.
    The server process read from the datafile and gets the results and store it into the shared pool.
    The result is then back to the user process and then to the end user
    Is it correct ?
    Thank you all,
    SSome of the above concepts are close. There is a nice description in the Oracle Database Concepts guide of what happens during the processing of a SQL statement (see the stages listed in the documentation):
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/sqlplsql.htm#sthref3460
    It is probably a good idea to distinguish between a hard parse, a soft parse, and a session cursor cache hit:
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/glossary.htm#sthref1591
    The database buffer cache is not used to verify the validity of SQL statements, but instead as a means to reduce the number of disk accesses that are required to return a query result to a client computer.
    One or more pieces of PGA memory may be used simultaneously while processing a SQL statement. I have a couple of blog articles that show multiple PGA memory allocations in use at the same time.
    The server process may not need to access a physical data file to return the query results to a client computer, depending of course on the current contents of the buffer cache.
    I recommend that you wait a while before trying to work with 10046 trace files. Right now the contents are probably providing too much detail for you, although I definitely recommend that you return to working with 10046 trace files at a later time. A good starting point is either the free Database Concepts Guide:
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14220.pdf
    or Tom Kyte's "Expert Oracle Database Architecture: Oracle Database Programming 9i, 10g, and 11g Techniques and Solutions, Second Edition" book. You can read my review of that book on Amazon's website:
    http://www.amazon.com/Expert-Oracle-Database-Architecture-Programming/dp/1430229462/ref=dp_ob_title_bk
    Charles Hooper
    Co-author of "Expert Oracle Practices: Oracle Database Administration from the Oak Table"
    http://hoopercharles.wordpress.com/
    IT Manager/Oracle DBA
    K&M Machine-Fabricating, Inc.

Maybe you are looking for

  • IP address sent to TACACS server

    Setup a TACACS server on out network to control console and telnet access to routers and switches. Most of our remote routers have multiple wan paths to the TACACS servers and may present a different IP address depending on which path is available or

  • How to compare two excel files in java ?

    how do i compare two excel files in java.? I have two excel files stored on my computer in d: drive. Ex: D:\\file a D:\\file b How to compare the contents of these two files and print " files are equal " or "files not equal "

  • INotes web based emails

    Why I can't print all my iNotes web based emails in one go to PDF file? Error message "There was an error processing a page. There was a problem reading this document (109)" always appear and give no solution

  • How to set single parameters for two tables?

    SELECT GM.GRNNO,GM.GRNDATE,SUM(GS.APPROVED),SM.ISSUENO,SM.ISSUEDATE,GS.ITEMCODE,SUM(SS.ISSUEDQTY) FROM IMS_GRNM GM,IMS_GRNS GS, IMS_ISSUEM SM, IMS_ISSUES SS WHERE GM.GRNMSERIAL=GS.GRNSSERIAL AND SM.ISSUEMSERIAL=SS.ISSUESSERIAL AND GM.POSTED='T' AND S

  • I am trying to send items to the Trash but it is continually running and will not complete.

    I am trying to send items to the Trash but it is continually running and will not complete.