Bold and other styles of a row in a table

Hi all,
we need to change the appearance of a table row in a configTable or configCellerator according to it's data.
Can it be done in BSP? how?
Thanks in Advance,
dekel31.

Include this interface: IF_HTMLB_TABLEVIEW_ITERATOR in the controller
and implement the RENDER_CELL_START method.
eg: Date format
data: lv_date type char10,
          lv_data type string,
          lr_label type ref to cl_thtmlb_label.
case p_column_key.
when 'XYZ_DATE'.    " Column name in the table
    call function 'CONVERSION_EXIT_PDATE_OUTPUT'
        exporting
             input =    " Input value
        importing
             output = lv_date.
    lv_data = lv_date.
     create object lr_label.
      lr_label->id      = p_cell_id.
      lr_label->encode  = space.
      lr_label->text    = lv_data.
      lr_label->tooltip = lv_data.
      p_replacement_bee ?= lr_label.
endcase.
Edited by: Chandra Indukuri on Oct 6, 2011 11:42 PM

Similar Messages

  • How can i input some text in bold and other in normal font in h:messages

    Hi
    I have a message which comes from properties file.I need half of the text in bold and the other half in normal font.

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Test extends JFrame {
        public Test() {
         setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         Container content = getContentPane();
         JEditorPane jep = new JEditorPane("text/html",
                  "Joe: <font color=red>R u <b>There</b>?</Font><BR>"+
                  "Mary: <font color=green>Keep ur shorts on...</Font>");
         content.add(new JScrollPane(jep), BorderLayout.CENTER);
         setSize(200,200);
         show();
        public static void main(String[] args) { new Test(); }
    }

  • Displayin message and fixing the number of rows in a table

    Hi Experts,
    I have a requirement like this
    there is a table, where i need to diplay a message when there are no records and no rows should be visible on that table.
    Also, when the records are populated from the context, i need to fix the number of rows in that table and display the records.
    Please let me know hw this can be achieved.
    Also in the table I have Link to URL, please let me know how to handle this reference, when i set the reference Property, its giving me an error stating that the file doesn't exist when the table gets loaded.
    Thanks in Advance
    Regards,
    Palani

    Hi
    Oh!!  You should to  explain it at first thread itself that you want to display a JPG imange or other WDWebResourceTypetaken form the backend.
    1. So this is not at all a URL
    2. You have to convert binary data to WDWebResource then display it in either Image UI element or other (like PDF , txt etc)
    3
    try
                   //        Read the datasource of the FileUpload
                   IWDResource res = wdContext.currentContextElement().getResource();
                   InputStream in = res.read(false);
                   ByteArrayOutputStream bOut = new ByteArrayOutputStream();
                   int length;
                   byte[] part = new byte[10 * 1024];
                   while ((length = in.read(part)) != -1)
                        bOut.write(part, 0, length);
                   in.close();
                   bOut.close();
                   IPrivateUploadCompView.IImageTableElement ele = wdContext.nodeImageTable().createImageTableElement();
                   ele.setImage(wdContext.currentContextElement().getResource().getUrl(0));
                   ele.setText(res.getResourceName());
                   wdContext.nodeImageTable().addElement(ele);
              catch (Exception e)
                   wdComponentAPI.getMessageManager().reportWarning(e.toString());
    Here I assume that you convert that data to IWDResource type or
    4.
    WDWebResource.getWebResource(wdContext.currentContextElement().getresource(), type);
    // getResource of type binary which u read from BAPI and set it in local context , type is MIMETYPE or hardcode it as "JPG"
    5. Further help
       [Help1|To Displayan Image in Webdynpro Java from Standard Function Module;
    [Help2|http://wiki.sdn.sap.com/wiki/display/KMC/GettinganimagefromKMDocumentstobeusedinWeb+Dynpro]
    [Help3|http://wiki.sdn.sap.com/wiki/display/KMC/GettinganimagefromKMDocumenttobeusedinWeb+DynPro]
    It might code look strange at first , please do some reserch in SDN ,I did my best at this level.
    Best Regards
    Satish Kumar

  • PDFExport fonts. How they are detected, difference between bold and italic.

    Hi,
    i am experiencing issues with PDFExport mainly because i don't understand how the engine detects fonts in the original document.
    First i will explain my issue:
    PDFExport is used on linux machine environment.
    Copyright reasons prevents me from using windows fonts for PDFExport. I downloaded some open source fonts, most of time they are working fine. the issues that i have are with the variations the fonts. italicized and bold.
    Lets take an example of a .doc file. the file contains Hebrew characters some of them are bolded some italicized and some are regular. the font that .doc used is a windows font called David.
    When i use PDFExport with the original David fonts everything works fine and converted correctly to PDF. Since i cannot use windows fonts i resorted to using the Open Source fonts, they too have similar in style to David. they have bold version, italicized version and regular version.
    When i use the open source fonts the detection of the font is incorrect. the entire document becomes italic. when i remove the italic version of the font everything is bold. and when i remove the bold version everything becomes regular. -- i am missing the bold and italic styles when they are used in the document.
    (note that the original document can use any font it wants not restricted to the Copyright issue)
    if i understood how the detection worked, i could modified the open source fonts that i have so that it will detect correctly all the different style (bold and italicized ) correctly.
    my first question:
    How can i use the Open source fonts and also not lose the bold and italicized styles?
    my second question:
    2. Is there a way to recieve via the API which fonts the engine looked for and didn't find? it can help me to better understand which fonts i need. and may be look for them and bring them manually.
    sometimes even when i used the entire windows fonts folder still the fonts where missing or incorrect. (in the resulted converted PDF 'squares' instead of characters). an API like this may help me look for the missing fonts.
    my third question:
    is there a general guide or Standard which fonts to use. i wish to use the minimum number of fonts which will get the job done. i.e characters will be visible and not squares, styles (bold and italicized) should not be lost.
    my forth question:
    How do the engine choose which font to use?

    These are very deep technical questions and I assume it will be difficult to find anyone who knows answers on this forum.
    You will need to speak with Outside In people (you could also try other conversion component such as OpenOfficeConversion - see http://docs.oracle.com/cd/E23943_01/doc.1111/e10800/c03_pdfi_all.htm#IBRAG238). Contacts to OIT are available at Oracle Outside In Technology, or try to create a SR via Metalink.

  • CSS styles for a row

    I want to include some css style for a row inside a table(which fetches results from database.)CSS style works for the table but not for the row inside.Pls help.
    Here is my code:(inside php script)
    echo "<table align=\"center\" class=\"studinfo\">
            <tr class=\"studinforow\"><td>Name:</td><td>".$row['Name']."</td></tr>
            <tr class=\"studinforow\"><td>Exam No:</td><td>".$row['Examno']."</td></tr>
            <tr class=\"studinforow\"><td>Roll No:</td><td>".$row['Rno']."</td></tr>
            <tr class=\"studinforow\"><td>Semester:</td><td>".$row['Sem']."</td></tr></table>";
    CSS code:
    .studinfo {
        margin-top: 20px;
        background-color: #E9F9FC;
        margin-bottom: 10px;
        width: 350px;
        font-family: Sintony;
        font-size: 13px;
        line-height: 22px;
        padding: 5px;
        border: 1px solid #AEE8F4;
        height: 150px;
    .studinforow {
        padding: 25px;

    I don't think padding works on the <tr> tag so you may find you need to add it to the <td> tag:
    <td class=\"studinforow\">Semester:</td><td class=\"studinforow\">".$row['Sem']."</td>
    You could just add the padding like below instead on every <td> tag:
    .studinfo td {
    padding: 25px;

  • Inserting multiple rows in a table automatically

    Hello everyone,
    A question about SQL/PLSQL.
    I have a homework to create a table in SQL and to insert 10,000 rows in the table regardless of what the values are. The question is: is there a way (like a PLSQL code that has a loop) to inserts values in a table automatically without the need to insert the values 10,000 times manually?
    I really appreciate it and thanks in advance...

    Frank Kulash wrote:
    Is it possible to give me an example of a complete Connect BY/Insert statement would look like in my case?See the SQL Language reference manual
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/statements_9014.htm#i2145081
    or your textbook for examples of inserting values with a subquery.
    A subquery using dual will work as well as a subquery using any other table; there's nothing about dual or CONNECT BY that complicates using a subquery in an INSERT statement.
    If you get stuck, post your best attempt here. If your problem involves an error, then post the complete error message, too.Frank,
    Thank you for your help and reply.
    I think I did not explain the situation well because what I am looking for is called <b>populating a table</b> and it seems that the CONNECT BY makes a loop of a single column and that is not the case.
    I have a table which is called customer and it contains 7 coulmns in which the first one (cust_id) is sequenced as shown below:
    create table customers
    cust_id int primary key,
    f_name varchar2(40),
    l_name varchar2(40),
    address varchar2(40),
    postnr varchar2(40),
    city varchar2(40),
    e_mail varchar2 (40)
    create sequence cust_id
    minvalue 0
    maxvalue 99999
    start with 1
    increment by 1
    cache 20;Now the quesiton is: how to populate this table with random data of 10,000 rows?
    Thank you very much in advanced.

  • Rows in Pivot Table of answers

    Hi Gurus,
    I want to show row in pivot table from count of some values in perticular column and also want to show row as pivot table some values in perticular column
    Suppose we have values a,b,a,c in column i want to show 2(that is count of a) in below of this column
    Please suggest me is this possible?
    Thnaks in advance

    Col1 | Col2 | Col3 | Col4 | Col5 | Col6 | Col7|col8     
    abc | kafj | 4 |     4 | True | jdj |     2 | 2
    bcd | asfj | 4 |     4 | True | sfa |     4 | 4
    asd | asda | 1 |     1 | False | sda |     2 | 2
    cde | Iruei | 5 |     5 | False | sdfs |     1 | 1
    Count| 4 | True | 2 |True     | 50% | True|66.67%
    |Req | |Req% | | Rate|
    On True | 6 | Total | 9
    Count | | Count|
    Hi venkat,
    I want to display the following pattern of output.
    In the above table format
    Count 4 is the count of total number lines in col2.
    True Req count 2 is the count of true lines in the column 5.
    True Req% 50% is col2/col5.
    On True Count is the count of (2+4 in col7) when condition is True.
    Total Count is the count of all (in col7).
    How to calculate these types of calculations in the answes.
    Could u please suggest me the solution.
    Thanks in Advance,

  • Table layout w.r.t other tables and text while inserting/deleting rows.

    I have 3 tables in a single page. One is left aligned and other two are right aligned. Then there is some text below the tables. 
    Now when I delete some rows from Table-1 the left aligned one, the Table 2 and text shift up filling the space below Table1.
    Now I don't want the text/table to shift up/down when I add/delete rows from Table1 i.e Table1  should expand/contract in the empty space below it.
    Now If I do the same thing for Table3 (Right aligned one) i.e add/delete rows there is no effect on text as shown :
    All 3 tables are same and have exact positioning and other properties.
    Please suggest any solution as I would be populating the table through word automation service (interop).

    Another approach would be to use nested tables, with your 'outer' table having two columns and the inner tables going into different columns. You can hide the outer table's cell borders so its presence is less apparent. If the Outer table has auto row
    height, it will adjust to accommodate whatever row addition/deletion you do to the inner tables. The only proviso is that the inner tables shouldn't have 'around' text wrapping. The two rhs tables can go into the same cell - all they need is a separating paragraph.
    With this layout, the text will always remain below the outer table.
    Cheers
    Paul Edstein
    [MS MVP - Word]

  • Message alert and other alerts beep more than 3 times in a row. how to fix it.

    message alert and other alerts beep more than 3 times in a row. how to fix it.

    If they are happening at 2 minute intervals check the Settings>Notifications>Messages>Repeat Alert setting.

  • Make only the new row in a table editable and other rows display mode.

    Hiii all,
    I am working on the component GSWISET, there is a table view for substitutes, the requirement is to show all the rows in the table view in display mode. Whenever the user clicks the button (Add employee), a search popup triggers and the user selects an employee from that and it will come as a new row in the table view. Here I need to be able to make only the new row editable and all the other rows in display mode.
    Could you please suggest a way to achieve this. Thanks for your time..

    Hi,
    Try with  the code below in.htm page
    data: lv_displaymode  TYPE string.
      IF controller->view_group_context->is_view_in_display_mode( controller ) = abap_true.
        lv_displaymode = 'X'.
      ELSE.
        lv_displaymode = ' '.
      ENDIF.
    if lv_displaymode = 'X'.
    <chtmlb:tableExtension tableId = "Substitutes"
                           layout  = "FIXED" >
      <chtmlb:configTable actions               = "<%= controller->gt_button %>"
                          id                    = "Substitutes"
                          onRowSelection        = "select"
                          selectedRowIndex      = "<%= substitutes->SELECTED_INDEX %>"
                          selectedRowIndexTable = "<%= substitutes->SELECTION_TAB %>"
                          table                 = "//Substitutes/Table"
                          width                 = "100%"
                          selectionMode         = "<%= substitutes->selection_mode %>"                    
                          visibleFirstRow       = "<%= substitutes->VISIBLE_FIRST_ROW_INDEX %>"
                          usage                 = "ASSIGNMENTBLOCK"
                          headerText            = "<%= controller->gv_header_text %>" />
    </chtmlb:tableExtension>
    else.
    <chtmlb:tableExtension tableId = "Substitutes"
                           layout  = "FIXED" >
      <chtmlb:configTable actions               = "<%= controller->gt_button %>"
                          id                    = "Substitutes"
                          onRowSelection        = "select"
                          selectedRowIndex      = "<%= substitutes->SELECTED_INDEX %>"
                          selectedRowIndexTable = "<%= substitutes->SELECTION_TAB %>"
                          table                 = "//Substitutes/Table"
                          width                 = "100%"
                          selectionMode         = "<%= substitutes->selection_mode %>"
                          allRowsEditable       = "TRUE"
                          visibleFirstRow       = "<%= substitutes->VISIBLE_FIRST_ROW_INDEX %>"
                          usage                 = "EDITLIST"
                          headerText            = "<%= controller->gv_header_text %>" />
    </chtmlb:tableExtension>
    endif.
    Regards,
    Gangadhar.S
    Edited by: gangadhar rao on Dec 24, 2010 12:49 PM

  • How can I change the style of a row in tableview?

    Hi,
    How can I change the style of a row in tableview, for example ,I have 10 items in table view, and I'd like to change row 1,4,10 background-color:red; font-family:Arial ,Font-Weight:BOLD.
    Any suggestion?

    Yes, I knew how can I change the style using cell factory. there is a lot of work to do if it has so many columns in table view. we need to implement every cell factory, Do we have a simple way to change the whole row style , just like fabsav said, I 'd like to set the special row like this line:
    tableview.getItems().get(i).setStyle("myRowstyle"); And I found a bug if I implement my functionality with cell factory way, I can't change the cell style after rendering cell.
    protected void updateItem(Object object, boolean empty) {
          super.updateItem(object, empty);
    }updateItem() was only triggered while cell is being rendering, there is no way if I'd like to change the cell style after rendering event.
    Hi fabsav, How can I apply a CSS class to a specific row? Can you please provide a short example?
    Edited by: imtoocute on Aug 28, 2012 10:31 AM

  • Applescript/Pages and adjusting column width (and paragraph style)

    I was hoping that some someone might know how to adjust the width of individual columns in Pages using Applescript. It seems like it should be a simple task, and I can adjust the overall width/height of the table, but I haven't found a way to adjust the column width. Alternatively, I could have the program create the table in Numbers and copy/paste it into Pages, but I'd imagine that would get a bit messy and wouldn't allow me to use a hanging indent in the cells (to the best of my knowledge).
    Also, is there a way to adjust the paragraph style used by the text in the table? Otherwise, I could just use a templet and define the the default table style appropriately. (Though not the most elegant solution).
    Thanks in advance for your help!
    (In case it helps, the script I'm working on parses an unformatted inventory and parses it into paragraphs/tables.)

    Try this:
    set tableCount to 0
    --open file to be pased here, excluded for example
    tell application "Pages"
        activate
        set theDoc to (make new document)
        tell theDoc
            --makes paragraph styles used
            make new paragraph style with properties {name:"Folio", font name:"Times New Roman", font size:12, bold:true, alignment:left, space after:5, keep with next paragraph:true, space before:15}
            make new paragraph style with properties {name:"Place", font name:"Times New Roman", font size:12, bold:false, alignment:left, line spacing type:relative, line spacing:100}
            make new paragraph style with properties {name:"Description", font name:"Times New Roman", font size:12, bold:false, italic:true, alignment:left, line spacing type:relative, line spacing:100}
            make new paragraph style with properties {name:"Table", font name:"Times New Roman", font size:12, alignment:left, left indent:0.5, first line indent:0.0}
            --begin repeat, gathers MS info from one doc (unformatted) and writes it into another with formatting, setting variables directly for example
            set MSName to "new Manuscript"
            set MSPlace to "place where MS is stored"
            set MSDesc to "description of MS"
            set tableData to {{"folio", "title", "composer"}, {"", "subtitle", ""}, {"etc", "next", "next"}}
            --write paragraph information from earlier
            set currentPar to (make new paragraph at end of paragraphs with data MSName)
            set paragraph style of currentPar to "Folio"
            set currentPar to (make new paragraph at end of paragraphs with data MSPlace)
            set paragraph style of currentPar to "Place"
            set currentPar to (make new paragraph at end of paragraphs with data MSDesc)
            set paragraph style of currentPar to "Description"
            --create table, add data, and format
            tell application "System Events" to tell process "Pages"
                key code 125 using {command down} -- move the insertion point to the end
                tell menu bar 1
                    -- Insert a new table:
                    click menu item "Table" of menu 1 of menu bar item "Insert"
                    -- Delete the header row:
                    tell menu 1 of menu bar item "Format"
                        click menu item "Delete Row" of menu 1 of menu item "Table"
                    end tell
                    -- Show the Inspector:
                    tell menu 1 of menu bar item "View"
                        if menu item "Show Inspector" exists then
                            click menu item "Show Inspector"
                        end if
                    end tell
                end tell
                tell window 1 -- the Inspector window
                    click radio button 7 of radio group 1 -- select the Table Inspector
                    perform action "AXRaise" -- activate the Table Inspector
                    tell tab group 1 of group 1
                        click radio button "Table" -- select “Table”
                        -- Reduce width of all three columns:
                        repeat 3 times
                            set value of text field 2 to "0.5 in"
                            set focused of text field 2 to true
                            keystroke return
                            keystroke tab -- next column
                        end repeat
                        key code 126 -- the Up Arrow
                        -- Set width of each column:
                        repeat with theValue in {"0.75 in", "4.25 in", "1.5 in"}
                            set value of text field 2 to theValue
                            set focused of text field 2 to true
                            keystroke return
                            keystroke tab -- next column
                        end repeat
                        key code 126 -- the Up Arrow
                    end tell
                end tell
                keystroke "i" using {option down, command down} -- hide the Inspector
                -- Add the data:
                repeat with i from 1 to 3
                    set thisRow to item i of tableData
                    repeat with j from 1 to 3
                        keystroke (item j of thisRow)
                        if (i * j = 9) then exit repeat
                        keystroke tab
                    end repeat
                end repeat
            end tell
            set tableCount to tableCount + 1
            tell table tableCount
                select
                set stroke width to 0.0
                set wrap to center
                set name to MSName
            end tell
            --after which it would continue with the next MS and repeat the process until all are done
        end tell
    end tell

  • In APEX 4.0, question on formating bold and underline in a table

    I am using APEX 4.0,
    I see I can format Bold and underline in a textbox using a control but when I save this to a clob in the database, it using the command punctuation and not really the underline or the bold.
    I am using a word doc to display the contents of the clob but I just get the command punctuation and not the real underline or bold, what am I doing wrong?
    Thanks for your help,
    Doug

    You do NOT save formatting to a CLOB type column, hence the C lob (Character). If you want to save a Word style document to a column, then look at a Blob (Binary)..
    Thank you,
    Tony Miller
    Webster, TX
    What if you really were stalking a paranoid schizophrenic... Would they know?

  • How do you have the bottom stroke of a table show up using Table Styles and Cell Styles only?

    I am using InDesign CS6, and I want to create a Table Style that has the bottom stroke show up, but does not have a table border, such as:
    However, whenever I try to change the Table or Cell strokes so that the last stroke shows up, I get the entire table border, or some strange combination of borders:
    Does anyone have any insight on how I can get the bottom stroke to show up while preserving my other stroke properties? Since I work with long documents, it's necessary to be able to control all of my tables through Table Styles and Cell Styles, and not by manually changing each and every table with the Stroke palette.
    For reference, here are the my current Table Style properties and the resulting table:

    Michael Murphy is the InDesign style-meister. He wrote "Adobe InDesign Styles" for Adobe Press, and did a great Lynda.com title on InDesign styling. Here's what he says in the book:
    "As mentioned at the beginning of this chapter, with all the power of table and cell styles, it is important to understand not only how they work and what they can do for you, but also to understand their limitations.
    "Two formatting features missing in table and cell styles have already been discussed: You will always have to set the column width and row height of cells when applying a table style for the first time, and you will always have to convert body rows to header and/or footer rows every time you apply a table style for first time or update the table's data....
    "But there's another kind of limitation that's important to keep in mind as you are designing tables: It is very easy to design a table that cannot be completely defined by a table style. In many cases, you'll need to define an extra cell style or two that lets you complete for formatting. [my emphasis]."
    So I think that's what you have to do: Apply another cell style on top of the cells at the bottom of the table after applying the table style.

  • Table name input. and output i need  all rows and columns  using procedures

    hi,
    question: table name input. and output i need all rows and columns by using procedures.
    thanks,
    To All

    An example of using DBMS_SQL package to execute dynamic SQL (in this case to generate CSV data in a file)...
    As sys user:
    CREATE OR REPLACE DIRECTORY TEST_DIR AS '\tmp\myfiles'
    GRANT READ, WRITE ON DIRECTORY TEST_DIR TO myuser
    /As myuser:
    CREATE OR REPLACE PROCEDURE run_query(p_sql IN VARCHAR2
                                         ,p_dir IN VARCHAR2
                                         ,p_header_file IN VARCHAR2
                                         ,p_data_file IN VARCHAR2 := NULL) IS
      v_finaltxt  VARCHAR2(4000);
      v_v_val     VARCHAR2(4000);
      v_n_val     NUMBER;
      v_d_val     DATE;
      v_ret       NUMBER;
      c           NUMBER;
      d           NUMBER;
      col_cnt     INTEGER;
      f           BOOLEAN;
      rec_tab     DBMS_SQL.DESC_TAB;
      col_num     NUMBER;
      v_fh        UTL_FILE.FILE_TYPE;
      v_samefile  BOOLEAN := (NVL(p_data_file,p_header_file) = p_header_file);
    BEGIN
      c := DBMS_SQL.OPEN_CURSOR;
      DBMS_SQL.PARSE(c, p_sql, DBMS_SQL.NATIVE);
      d := DBMS_SQL.EXECUTE(c);
      DBMS_SQL.DESCRIBE_COLUMNS(c, col_cnt, rec_tab);
      FOR j in 1..col_cnt
      LOOP
        CASE rec_tab(j).col_type
          WHEN 1 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000);
          WHEN 2 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_n_val);
          WHEN 12 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_d_val);
        ELSE
          DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000);
        END CASE;
      END LOOP;
      -- This part outputs the HEADER
      v_fh := UTL_FILE.FOPEN(upper(p_dir),p_header_file,'w',32767);
      FOR j in 1..col_cnt
      LOOP
        v_finaltxt := ltrim(v_finaltxt||','||lower(rec_tab(j).col_name),',');
      END LOOP;
      --  DBMS_OUTPUT.PUT_LINE(v_finaltxt);
      UTL_FILE.PUT_LINE(v_fh, v_finaltxt);
      IF NOT v_samefile THEN
        UTL_FILE.FCLOSE(v_fh);
      END IF;
      -- This part outputs the DATA
      IF NOT v_samefile THEN
        v_fh := UTL_FILE.FOPEN(upper(p_dir),p_data_file,'w',32767);
      END IF;
      LOOP
        v_ret := DBMS_SQL.FETCH_ROWS(c);
        EXIT WHEN v_ret = 0;
        v_finaltxt := NULL;
        FOR j in 1..col_cnt
        LOOP
          CASE rec_tab(j).col_type
            WHEN 1 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_v_val);
                        v_finaltxt := ltrim(v_finaltxt||',"'||v_v_val||'"',',');
            WHEN 2 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_n_val);
                        v_finaltxt := ltrim(v_finaltxt||','||v_n_val,',');
            WHEN 12 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_d_val);
                        v_finaltxt := ltrim(v_finaltxt||','||to_char(v_d_val,'DD/MM/YYYY HH24:MI:SS'),',');
          ELSE
            v_finaltxt := ltrim(v_finaltxt||',"'||v_v_val||'"',',');
          END CASE;
        END LOOP;
      --  DBMS_OUTPUT.PUT_LINE(v_finaltxt);
        UTL_FILE.PUT_LINE(v_fh, v_finaltxt);
      END LOOP;
      UTL_FILE.FCLOSE(v_fh);
      DBMS_SQL.CLOSE_CURSOR(c);
    END;This allows for the header row and the data to be written to seperate files if required.
    e.g.
    SQL> exec run_query('select * from emp','TEST_DIR','output.txt');
    PL/SQL procedure successfully completed.Output.txt file contains:
    empno,ename,job,mgr,hiredate,sal,comm,deptno
    7369,"SMITH","CLERK",7902,17/12/1980 00:00:00,800,,20
    7499,"ALLEN","SALESMAN",7698,20/02/1981 00:00:00,1600,300,30
    7521,"WARD","SALESMAN",7698,22/02/1981 00:00:00,1250,500,30
    7566,"JONES","MANAGER",7839,02/04/1981 00:00:00,2975,,20
    7654,"MARTIN","SALESMAN",7698,28/09/1981 00:00:00,1250,1400,30
    7698,"BLAKE","MANAGER",7839,01/05/1981 00:00:00,2850,,30
    7782,"CLARK","MANAGER",7839,09/06/1981 00:00:00,2450,,10
    7788,"SCOTT","ANALYST",7566,19/04/1987 00:00:00,3000,,20
    7839,"KING","PRESIDENT",,17/11/1981 00:00:00,5000,,10
    7844,"TURNER","SALESMAN",7698,08/09/1981 00:00:00,1500,0,30
    7876,"ADAMS","CLERK",7788,23/05/1987 00:00:00,1100,,20
    7900,"JAMES","CLERK",7698,03/12/1981 00:00:00,950,,30
    7902,"FORD","ANALYST",7566,03/12/1981 00:00:00,3000,,20
    7934,"MILLER","CLERK",7782,23/01/1982 00:00:00,1300,,10The procedure allows for the header and data to go to seperate files if required. Just specifying the "header" filename will put the header and data in the one file.
    Adapt to output different datatypes and styles are required.

Maybe you are looking for

  • How do I recover photos off the iTunes backup from my iPhone so I can put them on my new computer?

    My computer hard drive recently crashed and is unrecoverable.  Like a dummies we didn't have it backed up.  But do I have my photos and files still on my iPhone.  So, bought a new computer with Windows 8 operating system.  Went to the iTunes store an

  • Tables to find out Vendor Invoices without refrence to a PO

    Hi All, I need to extract all the invoices for a time period which have been raised without refrence to PO and with refrence to a GL account. If possible I need to get a table from where I can get all these invoices which have been raised with refren

  • Canon LBP 2900 B installation on OS X Mountain

    I upgraded my mac to mountain lion recently. i have canon LBP 2900 B which was previously connected now not detecting. i downloaded driver from canon uk site. still could not solved the problem. pl guide.

  • Number precision too large

    THE FOLLOWING SIMPLE CODE IS GIVING ERROR even though i have given the definition (2,3) which is larger than the length of value 3.14 ? declare pi constant number(2,3):=3.14; r number(5) ; a number(5); begin r:=2; a:=pi*power(r,2); dbms_output.put_li

  • How to transfer iPhoto library into another existing iPhoto library?

    Hi. I need to transfer iPhoto (the whole library - created folders and the events the way they been downloaded from camera) from Imac iPphoto to an existing MacBook iPhoto library. I did find in here how to transfer the entire library to the new comp