Write to file using pro*C

I have a procedure that would retrieve some table info based on which computes the sum of transactions for different types of transactions. I want to prepare a summary transaction report that would give the total transactions for each transaction type. Can someone sugest a pro*C proram to perform this task. I'd like to format the report using pro*C. I've never done a pro*C before and would like to take your help in this regards.
Thanks in advance

http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:459020243348

Similar Messages

  • How to write a file using mod pl/sql

    hi,
    i am having a submit button in my procedure. which should inturn create .sql file in a file path.
    is there any way to create a fileusing htp and htf methods.
    Thanks in advance
    Hari

    >
    i am having a submit button in my procedure. which should in turn create .sql file in a file path.
    is there any way to create a file using htp and htf methods.
    >
    Why are you wasting your time coding from scratch using the PL/SQL Web Toolkit instead of the APEX framework?
    From Re: how to write a file using mod pl/sql it appears that you are not using APEX, so a number of the approaches APEX offers are not relevant. You appear to be looking for a file download solution using the <tt>wpg_docload.download_file</tt> method, such as:
    create or replace procedure download_file (
        p_filename  in     varchar2
      , p_mimetype  in     varchar2
      , p_content   in out nocopy blob)
    is
    begin
      -- Set up HTTP header.
      -- Use "application/octet" as default MIME type.
      owa_util.mime_header(nvl(p_mimetype, 'application/octet'), false);
      -- Set the size so the browser knows how much to download.
      htp.p('Content-length: ' || dbms_lob.getlength(p_content));
      -- Filename will be used as default by the browser in "Save as..."
      htp.p('Content-Disposition: attachment; filename="' || p_filename || '"');
      -- Close header.
      owa_util.http_header_close();
      -- Stream the file content to the browser.
      wpg_docload.download_file(p_content);
    end download_file;

  • Beginner question - Can't read nor write a file using NetBean...

    Hi ,
    I'm a beginner java programmer, I got trouble when it comes to read or write a file program..
    I tried 3 programs and all of them can't read the file I want to read, eventhought I have put the txt file in the same folder with my source code.
    here is the source code I got from some site
    import java.io.*;
    class FileReadTest {
    public static void main (String[] args) {
         FileReadTest f = new FileReadTest();
    f.readMyFile();
    void readMyFile() {
    DataInputStream dis = null;
    String record = null;
    int recCount = 0;
    try {
    File f = new File("mydata.txt");
    FileInputStream fis = new FileInputStream(f);
    BufferedInputStream bis = new BufferedInputStream(fis);
    dis = new DataInputStream(bis);
    while ( (record=dis.readLine()) != null ) {
    recCount++;
    System.out.println(recCount + ": " + record);
    } catch (IOException e) {
    // catch io errors from FileInputStream or readLine()
    System.out.println("Uh oh, got an IOException error! " + e.getMessage());
    } finally {
    // if the file opened okay, make sure we close it
    if (dis != null) {
         try {
    dis.close();
         } catch (IOException ioe) {
    I also have tried another from book , both of them give the same result, can't read the file...
    Please help me with this...
    Thank you very much

    To start with use the full path to the file
    i.e. File f = new File("c:\\the\\full\\path\\to\\your\\file\\mydata.txt"); // Assumes a Windows platform using the C drive
    Then check to make sure you fiel exists e.g. System.out.println("File exists = " + f.exists());
    You can even test to see if the file is readable but since you created the file this porbably is not required.

  • How do I break a pdf into smaller pdf files using Pro?

    How do I make a smaller pdf (i.e. pgs 17-22) from a larger pdf file using Adobe Acrobat Pro?

    It would help if you told us what version of Acrobat Pro you have. (The interface changed substantially in Acrobat X Pro.)
    If you're using Acrobat 9 Pro or Acrobat 8 Professional, choose Document > Extract Pages.

  • Read&write Excel file using java

    Hi everybody,
    I have an assignment about methods that read and write an excel file using java (Eclipse SDK), so if anyone know about that please post the solution as soon as possible.
    Thanks
    Sendbad

    http://onesearch.sun.com/search/onesearch/index.jsp?qt=read+write+excel&subCat=siteforumid%3Ajava31&site=dev&dftab=siteforumid%3Ajava31&chooseCat=javaall&col=developer-forums

  • Cannot create pdf files using Pro X

    I am running Mac OS 10.7 (Lion) and just installed Acrobat Pro X and am unable to create ANY pdf files from any type of document. I am also running Office 2011 and Pages for Mac. Every time I click on a document file and try to convert it to pdf I get a message that says "Acrobat could not open the file because it is not a supported file type" These are simple .doc; docx; .xls and pages documents I am trying to create. Straightforward word processing files, nothing more. I am able to convert .jpeg files to pdf with no problem. But there has to be something basic I am doing wrong or some basic setting needs to be changed.
    Any ideas?

    You have to recognize that Acrobat can only convert certain file formats to PDF. And there are less formats that can be converted on the Macintosh than in Windows. In Windows, Acrobat uses an Office plug-in to convert Word, PowerPoint, etc. files. That plug-in is not provided by Adobe for the Macintosh. As to why that is, that's been a subject of ongoing debate for at least a decade.
    Here are the formats you can convert WITHIN Acrobat on the Mac: Image formats (JPEG, TIFF, etc.), EPS, PostScript, Text, HTML.
    So if you want to convert your Word or Pages documents you'll need to use the Macintosh Save as PDF facility. PDF is Mac OS  X's native file format. Keep in mind that you can't expect to do some of the fancier things with Word files made possible by the Windows Office plug-in. You can't save bookmarks, hyperlinks, etc. and expect them to appear in the PDF file.
    You can also use a script that should be installed by default when you install Acrobat Pro X. Instead of choosing Save as PDF (the OS X option), you can choose Save as Adobe PDF. This script (when it works...it seems pretty fragile) uses Distiller in the background to do the conversion. And this script can also not convert Word bookmarks or hyperlinks.

  • Multiple object files using Pro*C/C++

    We are trying to build an executable from several .pc files. Compilation and linking are OK, but at run-time we find that Oracle always use the context of the first invoked transaction from (from any .pc files). Subsequent transactions in different object files simply failed with different reasons (since they have used the wrong context).
    The program works fine if we manually edit the generated C file to assign different sqlctx value (the line static unsigned int sqlctx = 1)
    We don't think this is acceptable except if Oracle is expecting us to build application from one large source file?
    Any help?
    Regards
    null

    I had the same problem, but only on Linux version of Pro*C/C++ 8.1.5. I guess it is a bug. Anyway, I used to precompile the program on Windows NT and then to compile it on Linux. So the error is in precompiler.
    You can also find previous postings regarding this subject with some additional proposals, but no one really solved this problem.
    null

  • Setting a loop to write a file using the UTL_FILE

    I never done this using the UTL file, so I am going to ask, I need to create a file that is looks like this
    H xxxxxxxxxxxx (the header same for the all file)
    I Invoice Data (Information on Each account Number)
    D (invoice Dtail) Detail information in each account
    D
    D
    D
    I  Invoice Data (Information on Each account Number (record 2 ) diferrent Account #n )
    D (invoice Dtail) Detail information on account2
    D
    D
    D
    I  Invoice Data (Information on Each account Number (record 3 ) diferrent Account #n )
    D (invoice Dtail) Detail information on account3
    D
    D
    D
    File Footer
    Number on invoices
    And totals I have the H the header the I (invoice Data) and D (detail) in cursors
    I wonder how I can set up the loop, so the information will ended
    like
    The heade on top of the file, not problem here
    but each
    I Invoice Data
    needs to have the respectively
    D detail lines
    I hope this is clear!!

    If cursors x, y, and z map to H, I, and D in your file spec, you would need to nest the D cursor within the I cursor
    FOR   x in  Invoice_data_cur
       LOOP
             utl_file.put_line(outfile,
               RPAD ('I', 2, ' ')
             ||RPAD (x.spriden_id, 9)
             ||TO_CHAR (SYSDATE, 'MM/DD/RRRR')
             ||RPAD (x.balance1, 13, '0')
               ---more stuff
       FOR  y in invoice_detail_charges_cur(x.pidm) 
             LOOP
                 utl_file.put_line( outfile,
                  RPAD ('D', 2, ' ')
                ||RPAD (y.spriden_id, 9)
                ||RPAD ('Previous Balance', 16, ' ')
                ||RPAD (y.stvterm_desc, 9, ' ')
                ||RPAD (TO_CHAR (SYSDATE, 'MM/DD/RRRR'), 10)
                ||RPAD (y.tbbdetc_desc, 50, ' ')
                ||LPAD(NVL (y.tbraccd_amount, '0000000000000'), 13, '0')
           for z in invoice_detail_payments_cur(x.pidm)
              LOOP
                   utl_file.put_line( outfile,
                    RPAD ('D', 2, ' ')
                  ||RPAD (z.spriden_id, 9)
                  ||RPAD ('Pending Aid ', 16, ' ')
                  ||RPAD (z.STVTERM_DESC, 9, ' ')
                  ||RPAD (TO_CHAR (SYSDATE, 'MM/DD/RRRR'), 10)
                  ||RPAD (z.tbbdetc_desc, 50, ' ')
                  ||LPAD (NVL (z.tbraccd_amount, '0000000000000'), 13, '0')
              END LOOP;      
            END LOOP;
    END LOOP;From a code clarity standpoint, if your file spec uses H, I, and D as a sort of row-type identifier, I would strongly suggest that your loop variable follow that convention or spell out the row type. That is
    FOR h IN Invoice_data_cur
    LOOP
      <<write header>>
      FOR i IN invoice_detail_charges_cur(h.pidm)
      LOOP
        <<write invoice data>>
        FOR d IN invoice_detail_payments_cur( h.pidm )
        LOOP
          <<write invoice detail>>
        END LOOP;
      END LOOP;
    END LOOP;Justin

  • How to write to file using fixed width columns

    I need to write some data to a text file such that it is formatted in columns of fixed width. Each column can have different width. eg if i have to write 5 fields in each record the first field would be of 5 characters, second field of 3 characters and so on.
    Can u please suggest how I can do it. Its urgent.

    Can't you search? Now you know what to google on: java 5 printf
    Kaj

  • Possible to read/ write word files using Java?

    I'm planning to write a Java application that can read an MS word document, extract something (including mathematics equations created with the equation editor) from the document and write it to another word document.
    Is it possible to do this?
    Can anyone give me some idea?
    Any idea is much appreciated :)

    I think I may have misunderstood your question, but in case I didn't and you find this helpful, following is the code to read a word doc, replace certain strings, then write it out as a new doc.
    import java.io.*;
    public class Copy {
         public static String endResult;
         public static void main(String[] args) {
              String oldAuthor = "Samuel Foote";
              String newAuthor = "New Author";
              String oldDate = "1720-1777";
              String newDate = "1975 -- ";
          try {
              File inputFile = new File("C:\\document.doc");
              BufferedReader input = null;
              input = new BufferedReader(new FileReader(inputFile));
              StringBuffer contents = new StringBuffer();
              String line = null;
              while ((line = input.readLine()) != null){
                   contents.append(line);
                   contents.append(System.getProperty("line.separator"));          
              String text = contents.toString();
    //     Replace the author and the dates
              Copy y = new Copy();
              y.replace(text, oldAuthor, newAuthor);
              text = endResult;
              y.replace(text, oldDate, newDate);
    //     Copy the new, improved text to another file     //
              Copy z = new Copy();
              z.finalReplace(text);
              input.close();
         catch (FileNotFoundException ex) {
              ex.printStackTrace();
         catch (IOException ex){
              ex.printStackTrace();
         String replace(String text, String oldSubstring, String newSubstring) {
    //          Search the text for a string, then replace it //
              int fromIndex = 0;
              int e = 0;
              StringBuffer sb = new StringBuffer();
              while ((e = text.indexOf(oldSubstring, fromIndex)) >= 0) {
                   sb.append(text.substring(fromIndex, e));
                   sb.append(newSubstring);
                   fromIndex = e + oldSubstring.length();
              sb.append(text.substring(fromIndex));
              endResult = sb.toString();
              System.out.println("final string = " + sb);
              return sb.toString();
         String finalReplace (String args) throws IOException {
    //          Move the altered text to a new file  //
              File outputFile = new File("C:\\copied document.doc");
              FileWriter out = new FileWriter(outputFile);
              Writer output = null;
              try {
                   output = new BufferedWriter(new FileWriter(outputFile));
                   output.write(endResult);
              finally {
                   if (output != null) output.close();
                 return endResult;

  • Procedure to write in file using spool otoption

    Hi
    Please find the below procedure to spool a file from procedure using execute immediate..
    create or replace procedure file_write
    IS
    sethead varchar2(1500);
    setserve varchar2(1500);
    setspool varchar2(1500);
    setspoolof varchar2(1500);
    Begin
    sethead:='set feedback off verify off heading off pagesize 0';
    setserve:='set serveroutput on';
    setspool:='spool C:\file_check_spool.txt APPEND';
    setspoolof:='spool off';
    execute immediate(sethead);
    execute immediate (setserve);
    execute immediate (setspool);
    dbms_output.put_line('no errors');
    execute immediate (setspoolof);
    EXCEPTION
    THEN
    execute immediate(sethead);
    execute immediate (setserve);
    execute immediate (setspool);
    dbms_output.put_line('-20001,Error Encountered - file_check - '||SQLCODE|| '-'|| SQLERRM);
    execute immediate (setspoolof);
    end file_write;
    Please suggest ...
    i cant able to use file utilities ...only by this way or any other option is there
    Thanks in advance

    You would need to create a sql script to run the procedure, something along the lines of:
    set feedback off verify off heading off pagesize 0 serveroutput on;
    spool C:\file_check_spool.txt APPEND;
    exec your_procedure;
    spool off;Then your procedure would look something like:
    create or replace procedure my_proc
       <declarations>
    begin
       <do stuff>
       dbms_output.put_line('no errors');
    exception
       when <trap exception here> then
          dbms_output.put_line('Error Encountered - file_check - 'SQLERRM);
    end;Note that there is no need to outpu both SQLCODE and SQLERRM since SQLERRM contains the value of SQLCODE.
    Note also that depending on your version of Oracle, there are limits on how much data can be put into the dbms_output buffer.
    John

  • Exeption  - trying to write to file, using CSVWriter.

    I have got the following exception:
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    at application.utils.GestureGuideLogger.logExcel(GestureGuideLogger.java
    :238)
    the row code is:
         238:     writerExcel.writeNext(new String[]{buffer.toString()});
    same happens, if I write instead:
              writerExcel.writeNext(messageExcel);
    //messageExcel is "String[]" as well.
    What is wrong?
    Thanks!

    What is wrong?Well, you get a NullPointerException. That means only one thing: you try to call a method on an object reference that is null.
    Check the line, there are two objects that can be null at that point.
    - writerExcel
    - buffer
    I'm betting that buffer contains null.

  • Read / Write Excel file using package dbms_util and util_files

    hi,
    i am beginner to this so please elaborate the answer more concisely

    there's a ton of reading on this subject on google my friend.
    http://www.google.co.uk/search?hl=en&source=hp&biw=954&bih=517&q=plsql+read+write+excel&btnG=Google+Search&aq=f&aqi=&aql=&oq=plsql+read+write+excel
    and check the forum faq, there's a topic on excel in here:
    SQL and PL/SQL FAQ
    Edited by: smon on Mar 2, 2011 3:39 AM

  • Pls Help--- URGENT... Combining XML file and HTML file Using java program.

    Hi, I need to implemnt this for my project....
    I need to combine XML and HTML file and generate a new HTML file
    Sample XML File:
    <user>
    <txtName>sun</txtName>
    <txtAge>21 </txtAge>
    </user>
    Sample HTML File:
    <body>
    Name: <input type="text" name="txtName" value=""
    Age : <input type="text" Age="txtAge" value=""
    </body>
    I need a java program to combine the above xml and html files and generate the output in HTML.
    Any kind of help is sincerely Appreciated.
    Thanks.

    toucansam wrote:
    So you want us to write it for you? It's pretty straight forward, first parse the xml file with the *[best java xml parser|http://www.google.com/search?&q=parsing+xml+in+java]* and then go through the nodes and construct the html with strings and concatination. Then write the file using *[the best java file writer|http://www.google.com/search?hl=en&q=writing+to+a+file+in+java]*.
    He would do better to use existing tools that make this easy [http://www.ling.helsinki.fi/kit/2004k/ctl257/JavaXSLT/Ch05.html|http://www.ling.helsinki.fi/kit/2004k/ctl257/JavaXSLT/Ch05.html]

  • Reading encrypted file using file adapter...

    Is it possible to read and write encrypted file using file adapter or if the file adapter is capable to encryption and decryption?

    what is the soa version you are currently running?

Maybe you are looking for

  • How to use Result Search (TREX) Impagination in customize Layout Set

    Hello Experts We are using a customise Layout Set get from "NewsBrowser" duplication.. At the moment we are using it to show the first three documents of a km folder, but that folder contains a lot of documents and in the bottom of the iview are show

  • Had to revert to previous version of Flash to regain HD in video.

    I dual boot Xp and Win 7.  Win 7 is fine but after updating to flash version 10.2.153.1 in Xp the high definition videos became unwatchable (herkyjerky).  I reinstalled everything...drivers etc., even reinstalling XP but it was useless.  As a last re

  • Bapi or function module to create conter readings in service order

    hi all, i have used crm_service_order_create to create the service order it was very helpful . I could also create the service order with the i base component. But i need to enter the counter readings against the i base component. Is there any bapi o

  • Want Linked Node to return self in getNext(0)

    I'm trying to make a getNext for my linked list that can return anywhere from several nodes ahead to itself. How do I make a method that can return itself? I don't want to pass the calling object in with the parameters, that seems rather messy. I can

  • Help needed by neophyte! - part 2

    Searching the Support files yielded this: "...error is caused by conflicts between Windows (XP and 2000) and the version of Macromedia Director used to create the auto-run menu..." Assuming that's the nature of the problem, how can I fix it without g