DBMS_Output.put_line doesn't print in one single line

Hi People,
I am using 'DBMS_Output.put_line' in my procedure for the output. Here's the code:
DBMS_OUTPUT.put_line('LOGIT_T. Detail records for act:'||v_count_act||',Detail records for Bal:'||v_count_bal||',Updated records for act:'||v_updat_act||',Updated records for bal:'||v_updat_bal||',Total records for act:'||v_count_act||',Total records for Bal:'||v_count_bal);
When the procedure runs, it prints the output as shown below:
LOGIT_T. Detail records for act:619,Detail records for Bal:324,Updated records
for act:0,Updated records for bal:0,Total records for act:693,Total records for
Bal:410
As a result, when inserting this whole line into table, it only inserts the following text. Hence, ignores the rest of the text (table field width is 2000 bytes):
LOGIT_T. Detail records for act:619,Detail records for Bal:324,Updated records
Looks like, it is automatically wrapping the text to the next line. While I want the above output in a single line as shown below and to be inserted into my table the whole text:
LOGIT_T. Detail records for act:619,Detail records for Bal:324,Updated records for act:0,Updated records for bal:0,Total records for act:693,Total records for Bal:410
Any idea how to achieve this? Any parameter or setting I am missing here?
Hope I made sense above and clearly described my situation.
Thanks in advance guys!

in sqlplus, you can use set linesize:
SQL> set serverout on
SQL> set linesize 10
SQL> exec dbms_output.put_line('This is a line of text that exceeds 10 characters');
This is a
line of
text that
exceeds 10
characters
PL/SQL procedure successfully completed.
SQL> set linesize 132
SQL> exec dbms_output.put_line('This is a line of text that exceeds 10 characters');
This is a line of text that exceeds 10 characters
PL/SQL procedure successfully completed.

Similar Messages

  • When I print a Word document to a shared printer, print preview looks fine but the printed page has too much blank space at the top and doesn't print the bottom few lines.

    When I print a Word for Mac document to a shared printer (that is connected to my iMac) from my Macbook Pro, print preview looks fine but the printed page has too much blank space at the top and doesn't print the bottom few lines.  I have tried to adjust the margins and the page setup settings but to no avail.  It used to print fine until recently.  Is there a way to fix it so that the printer prints what print preview shows?

    I should add that when I e-mail this document to myself and print it directky from the iMac, it prints fine.

  • Measuring of Text with Multiple Fonts in One Single Line

    I am following a request to write C++ code for a label that contains several text elements in one single line, varying by font, size, color.... Ok, that can be done easily in GDI+ by measuring each element's width and then execute a DrawString
    for each of the text elements starting at its calculated position.
    So far, I failed miserably.
    The horizontal text positions did not appear to be correct. I reverted now to very simple text width measuring tests where the results are still puzzling.
    Test 1 (GDI+): Use of MeasureString
    With the same font, the width of the string "MM" does not match the double with of the string "M". This cannot be explained with eventual rounding problems.
    Test 2 (GDI+): Use of MeasureCharacterRanges
    Used the same font as for the first test. The width of "MM" is now exactly double of the width of "M". But: The width of the "M" ist lightyears away from the measurement result in the first test.
    Test 3 (GDI): Use of GetCharABCWidthsFloat
    Attempted to create a GDI font as close as possible to the GDI+ font in the previous tests. Unfortunately, this third test shows results which do not match the previous results at all.
    I am appending the full example here; the results I found during the debug session have been added as comments:
    void ApplWindow_TextDrawTest(HDC hDC)
    Gdiplus::Graphics *G = new Gdiplus::Graphics(hDC);
    G->SetTextRenderingHint(TextRenderingHint::TextRenderingHintClearTypeGridFit);
    Gdiplus::StringFormat MyFormat;
    MyFormat.SetAlignment(Gdiplus::StringAlignment::StringAlignmentNear);
    MyFormat.SetFormatFlags(Gdiplus::StringFormatFlags::StringFormatFlagsNoWrap);
    Gdiplus::Font TextFont(L"Calibri", 36, Gdiplus::FontStyle::FontStyleBold, Gdiplus::Unit::UnitPixel);
    const wchar_t *Text1M = L"M";
    Gdiplus::PointF TextOrigin1M(0, 0);
    Gdiplus::RectF TextBounds1M;
    const wchar_t *Text2M = L"MM";
    Gdiplus::PointF TextOrigin2M(0, 50);
    Gdiplus::RectF TextBounds2M;
    //--- Test #1: using MeasureString ----------
    G->MeasureString(Text1M, (INT)wcslen(Text1M), &TextFont, TextOrigin1M, &MyFormat, &TextBounds1M);
    G->MeasureString(Text2M, (INT)wcslen(Text2M), &TextFont, TextOrigin2M, &MyFormat, &TextBounds2M);
    //--- Results: Text 1 Width= 44.414 ("M")
    //--- Text 2 Width= 76.828 ("MM")
    //--- Test #2: using MeasureCharacterRanges ----------
    Gdiplus::Status RCode;
    Gdiplus::RectF LayoutRect(0, 0, 1000, 100);
    Gdiplus::Region RegionsList[3];
    Gdiplus::CharacterRange CRanges[3];
    CRanges[0].First = 0; CRanges[0].Length = 1;
    CRanges[1].First = 1; CRanges[1].Length = 1;
    CRanges[2].First = 0; CRanges[2].Length = 2;
    MyFormat.SetMeasurableCharacterRanges(3, CRanges);
    G->MeasureCharacterRanges(Text2M, (INT)wcslen(Text2M), &TextFont, LayoutRect, &MyFormat, 3, RegionsList);
    RCode = RegionsList[0].GetBounds(&TextBounds1M, G); // Result: Text 1 Width = 32.000 ("M")
    RCode = RegionsList[1].GetBounds(&TextBounds1M, G); // Result: Text 1 Width = 32.000 ("M"; the second char)
    RCode = RegionsList[2].GetBounds(&TextBounds2M, G); // Result: Text 2 Width = 64.000 ("MM")
    //--- Test #3: using the good old GDI ----------
    int MapModeResult = SetMapMode(hDC, MM_TEXT); // MM_TEXT is equivalent to Unit::UnitPixel?
    HFONT TextFont3 = CreateFont(36, 0, 0, 0, FW_BOLD, false, false, false, ANSI_CHARSET, OUT_TT_ONLY_PRECIS, CLIP_DEFAULT_PRECIS, CLEARTYPE_QUALITY, VARIABLE_PITCH | FF_DONTCARE, L"Calibri");
    HGDIOBJ PrevFont = SelectObject(hDC, TextFont3);
    ABCFLOAT ABCCharData;
    BOOL RFlg = GetCharABCWidthsFloat(hDC, (UINT)'M', (UINT)'M', &ABCCharData); // Results: abcfA = 2.000; abcfB = 22.000; abcfC = 2.000
    //--- End of Test ---
    delete G;
    Does anybody have an idea why I get so different results?
    Thanks in advance.

    This is a development question and should be directed to a forum that assists in coding. The forum you posted to is for Windows 7 related questions.
    Sorry I cannot help you
    Don't forget to mark the post that solved your issue as "Answered." By marking the Answer you are enabling users with similar issues to find what helped you. Lewis Renwick - IT Professional

  • How print address in Single line in Address window in Smartform

    Hi All,
    How print address in Single line in Address window in Smartform?
    Thanks in advance.
    Message was edited by: Vipin Nagpal

    Hi Vipin,
    if u r defining the variables for the address manually,
    then u can define all the fileds in a single line in the edit mode of address window u will get the address in the single line only
    if u r using the standard format
    modify the address format by using the user exit:
    "EXIT_SAPLSADR_001"
    Check OSS Note : 454987
    or in the least case u can use the address window setting to change the format and lines
    May be this will help you.
    Regards,
    Naveen

  • DBMS_OUTPUT.PUT_LINE doesn't work in Reports

    Version 1.1.2.25 Build Main 25.97
    I've tried to create a Report using the PL/SQL-DBMS_OUTPUT option and it just sends out a sinle line of text without any line throws. Copy the block of code and run it as a script and it works fine.
    Anybody else come across this problem?

    Here's the PL/SQL code for the Report....
    declare
    vowner VARCHAR2(30);
    vindex VARCHAR2(30);
    vtable VARCHAR2(30);
    CURSOR cIndex
    IS
    select OWNER, INDEX_NAME, TABLE_NAME
    from dba_indexes;
    begin
    dbms_output.enable(1000000);
    open cIndex;
    LOOP
    FETCH cIndex INTO vowner, vindex, vtable;
    EXIT WHEN cIndex%NOTFOUND;
    if (vowner = :OWNER) and (vTable like :TABLENAME)
    then
    dbms_output.put_line('alter index ' || vowner || '.' || vindex || ' nomonitoring usage;');
    end if;
    end loop;
    close cIndex;
    end;
    I've tested by setting the bind variables :OWNER to a schema and :TABLENAME to '%' to return all indexes owner by the schema.
    As you can see, I don't use \n.
    This works fine when run as a script in SQL Developer (each put_line coming out on a separate line) but not as a report.

  • How to stop auto from-feed on a dot matrix printer for printing only a single line of data at a frequency of 30 seconds

    Hello friends
    In a particular application, it is required to print a single line of data on a dot matrix printer (continuous sheets) at a frequency of 30 seconds. That is printing is to be carried out line-by-line on the same form without a form feed.
    We are facing a problem of a form feed after printing of each line. Kindly help me to solve this problem of auto form-feed. How to continuously print at a regular interval without from-feeding.
    Shahid Baig

    Is this printer connected to a network?
    You may need to look at the printer manual to see if there is a setting for a form feed.  I remember when we had a dot matrix printer on the network about 12 years ago, there would be a network timeout setting of something like 30 seconds.  So if you didn't continue to send data, the network will end the print job and send the file to the printer which would auto form feed at the end.  Many of our basic programs had to be rewritten because they would do an LPRINT periodically, if you took along time progressing through the inputs, you would easily hit the 30 second timeout.  So all the programs had to be rewritten to save the data to be printed to a file, and only once you execute a print command, it would read the file back in and Lprint it (or a Print#1) to the LPT port.
    Since the printer was on the network, and basic could only print to LPT's, we had to use a net command to capture the LPT1 port and direct it to the network queue.
    I don't remember all the details, but those are the bits and pieces I do remember.  I think the answer to your problem lies in there somewhere.
    Namely:
    1.  Printer setting to auto form feed.
    2.  Network setting that closes print job after timeout period.

  • DBMS_OUTPUT.PUT_LINE not working in Stored Functions

    Hi All,
    I have one doubt, why is dbms_output.put_line not supported in Stored Functions?
    create or replace function func_in_sql(var number) return varchar2
    is
    begin
    If var is not null then
    return to_char(dbms_output.put_line(var));
    else
    return to_char(dbms_output.put_line('null'));
    end if;
    end;
    Returns error -
    LINE/COL ERROR
    5/3 PL/SQL: Statement ignored
    5/18 PLS-00222: no function with name 'PUT_LINE' exists in this scope
    7/3 PL/SQL: Statement ignored
    7/18 PLS-00222: no function with name 'PUT_LINE' exists in this scope
    Any idea why this is happening?
    I know that to print value one can just use return statement and value will be printed in SQL Prompt.
    But what makes me think is why error for PUT_LINE method?
    If error is not thrown at DBMS_OTUPUT then doesnt that mean all methods of DBMS_OUTPUT should be accessible in a function.
    Thanks in advance!
    Av.

    Hi,
    For cant call proc inside func, or in-line thing you mentioned, just tried following -
    Here is our previous Func -
    create or replace function func_in_sql(var number) return varchar2
    is
    begin
    /*If var is not null then
    return to_char(dbms_output.put_line(var));
    else
    return to_char(dbms_output.put_line('null'));
    end if;
    exception_test;
    return 'a';
    end;
    and here is our proc -
    procedure exception_test
    as
    v_count1 number;
    v_count2 number;
    begin
    select count(test_id)
    INTO V_COUNT1
    from TEST_TABLE;
    If SQL%NOTFOUND Then
    dbms_output.put_line('notfound');
    End If;
    dbms_output.put_line(v_count1);
    exception
    when no_data_found then
    If SQL%NOTFOUND Then
    dbms_output.put_line('notfound');
    End If;
    dbms_output.put_line('no_data');
    WHEN TOO_MANY_ROWS THEN
    dbms_output.put_line('too many rows');
    when others then
    dbms_output.put_line('others');
    end;
    and here is the call to func -
    SQL> select func_in_sql(x) from t1;
    FUNC_IN_SQL(X)
    a
    a
    a
    a
    4 rows selected.
    So this shows it works.
    Is this what you said? or Am I getting you wrong?
    Thanks!
    Av.

  • Problem in dbms_output.put_line boolean variable

    hello guys m practicing PL/SQL when i try to exicute below code i get following error:
    DECLARE
    I BOOLEAN:=TRUE;
    BEGIN
    dbms_output.put_line(i);
    END;
    error:
    Error starting at line 1 in command:
    DECLARE
    I BOOLEAN:=TRUE;
    BEGIN
    dbms_output.put_line(i);
    END;
    Error report:
    ORA-06550: line 4, column 1:
    PLS-00306: wrong number or types of arguments in call to 'PUT_LINE'
    ORA-06550: line 4, column 1:
    PL/SQL: Statement ignored
    06550. 00000 - "line %s, column %s:\n%s"
    *Cause:    Usually a PL/SQL compilation error.
    *Action:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    user13355933 wrote:
    hello guys m practicing PL/SQL when i try to exicute below code i get following error:
    DECLARE
    I BOOLEAN:=TRUE;
    BEGIN
    dbms_output.put_line(i);
    END;
    error:
    Error starting at line 1 in command:
    DECLARE
    I BOOLEAN:=TRUE;
    BEGIN
    dbms_output.put_line(i);
    END;
    Error report:
    ORA-06550: line 4, column 1:
    PLS-00306: wrong number or types of arguments in call to 'PUT_LINE'
    ORA-06550: line 4, column 1:
    PL/SQL: Statement ignored
    06550. 00000 - "line %s, column %s:\n%s"
    *Cause:    Usually a PL/SQL compilation error.
    *Action:DBMS_OUTPUT.PUT_LINE only accepts strings (VARCHAR2) datatype
    what exactly do you expect to see, if in fact it worked as desired?

  • PBDOM : Exporting to XML file gives a single line

    I've been starting developing with PowerBuilder 12.5 a few weeks ago. I had to write some XML files, so I got familiar with the PBDOM library.
    I can build a lot of different things, it's very nice, but one thing still bothers me :
    In the output file, the whole XML is written on a single line.
    I use the SaveDocument function.
    For example, here is some code :
    PBDOM_Document doc
    PBDOM_Element noderoot, node1, node11, node12
    doc = CREATE PBDOM_Document
    doc.NewDocument("NodeRoot")
    noderoot = doc.GetRootElement()
    node1 = CREATE PBDOM_Element
    node1.SetName("Node1")
    noderoot.AddContent(node1)
    node1.SetAttribute("Attr", "AttrValue")
    node11 = CREATE PBDOM_Element
    node11.SetName("Node11")
    node11.AddContent("Here is a value")
    node1.AddContent(node11)
    node12 = CREATE PBDOM_ELEMENT
    node12.SetName("Node12")
    node12.AddContent("Here is another value")
    node1.AddContent(node12)
    doc.SaveDocument("myDoc.xml")
    Here is the result when I open it with notepad++
    <NodeRoot><Node1 Attr="AttrValue"><Node11>Here is a value</Node11><Node12>Here is another value</Node12></Node1></NodeRoot>
    Whereas I wanted :
    <NodeRoot> <Node1 Attr="AttrValue"> <Node11>Here is a value</Node11> <Node12>Here is another value</Node12> </Node1> </NodeRoot>
    With the notepad++ XML tools plugin, I can use the "pretty print" function to get this nice representation. But I would like my file to be formatted this way from the beginning. I noticed that the "line ending" was set to UNIX format (indicator on bottom right of the window), but I'm working on Windows. When I use the menu to convert it to Windows format (CR+LF), it changes this indicator, but the code stays on one single line.
    Is there a way to tell PBDOM to export the XML file with a nice output ?
    Thank you !
    Notes :
    - Opening the XML file with Internet Explorer or Google Chrome gives me a nice vizualisation, with indentation, line breaks...
    - Adding a <?xml version="1.0" encoding="ISO-8859-1" ?> does not help (I've been doing it while exporting some more complex files, but I still get the output on one line...)

    Here is a very simple powerbuilder example. It uses MSXML instead of PBDOM. See my comments for hints how to use it with PBDOM.
    oleobject lole_dom, lole_root, lole_element1, lole_element11, lole_element12
    oleobject lole_Writer, lole_saxreader
    string ls_result
    // build DOM (you don't need this if you use PBDOM)
    lole_dom = create oleobject
    lole_dom.ConnectToNewObject ("Msxml2.DOMDocument")
    lole_root = lole_dom.CreateElement ("NodeRoot")
    lole_dom.documentElement = lole_root
    lole_element1 = lole_dom.CreateElement("Node1")
    lole_root.AppendChild(lole_element1)
    lole_element1.SetAttribute("Attr", "AttrValue")
    lole_element11 = lole_dom.CreateElement("Node11")
    lole_element11.AppendChild (lole_dom.CreateTextNode("Here is a value"))
    lole_element1.AppendChild(lole_element11)
    lole_element12 = lole_dom.CreateElement("Node12")
    lole_element12.AppendChild (lole_dom.CreateTextNode("Here is another value"))
    lole_element1.AppendChild(lole_element12)
    // this saves the DOM without formatting
    //lole_dom.save ("d:\testxml.xml")
    // this part is for formating
    lole_Writer = create oleobject
    lole_saxreader = create oleobject
    lole_Writer.ConnectToNewObject ("MSXML2.MXXMLWriter")
    lole_saxreader.ConnectToNewObject ("MSXML2.SAXXMLReader")
    lole_Writer.omitXMLDeclaration = True
    lole_Writer.indent = True
    lole_saxreader.contentHandler = lole_Writer
    // instead of DOM you can also put a XML string to parser: lole_saxreader.parse ("<node>...</node>")
    // so you can also use the PBDOM output directly
    lole_saxreader.parse (lole_dom)
    // here is your formatted output
    ls_Result = lole_Writer.output
    MessageBox ("", ls_result)
    lole_writer.Disconnectobject( )
    lole_saxreader.Disconnectobject( )
    lole_dom.Disconnectobject( )
    DESTROY lole_writer
    DESTROY lole_saxreader
    DESTROY lole_dom

  • Output of select query in a single line

    hi,
    I want to know how to get the each row in a table to be printed in a single line.. Each row in the table will be of 1500 characters length..
    Thanks

    Is there any limit to the value that we can specify
    for linesize.. I read somewhere that the max value is
    dependent on systemIn [url http://download.oracle.com/docs/cd/B19306_01/server.102/b14357/ch12040.htm#SQPUG085]the documentation, they don't talk about a maximum, but I saw there is one:
    SQL> set linesize 1500
    SQL> set linesize 32767
    SQL> set linesize 32768
    SP2-0267: linesize optie 32768 ligt buiten toegestane bereik (1 t/m 32767).Regards,
    Rob.

  • Single line item for multiple line item payment.

    Hi
    I have booked the 3 vendor invoices (in FB60) for a single vendor. Now today i paid (with F-53) all the three invoices together. One payment document number was generated.
    However when i saw the vendor line item, i saw that three debit line items was generated for the clearing the open invoices (i..e 3 credit line items). so when i say vendor line item report, there were total 6 cleared line items (3 for credit i.e invoice and 3 for debit i.e. payments)
    But is it possible to get  single debit line item for all the three invoices cleared. If yes, please let me know how i can get it.
    If i will have one single line item for payment, vendor report would be simpler. Please help

    Hi,
    1. If you do payment through F-53, then each invoice have separate payment line item. This is not avoidable. If you do payment through F110, then you can group the line items for payment, so there only one payment line item for many number of invoices.
    2. While clearing through F-44, system is generating automatic line items because, there are exchange rate fluctuations. You can't avoid these line items, as these automatic line items only match Debit and Credit amounts in order to post the document.
    Rgds
    Murali. N

  • html:errors don't show in a single line

    I use Struts <html:errors>
    <html:text property="test" /><html:errors name="test"/>
    when errors is not empty,it will show error information.But what puzzled with me is that I find the show of <html:errors property="test"/> occupy three lines,not a single line.
    My application.properties file:
    errors.footer=
    errors.header=
    errors.test.required=This is a test
    I want to show "This is a test" in only one single line,but in fact it shows three lines,like follows:
    null
    This is a test
    null
    If I modify the content of application.properties file:
    errors.test.required=This is a test
    It still show three lines,like follows:
    blank line
    This is a test
    blank line
    I want to show it in a single line without header and footer,anybody knows how to do it?

    Hi,
    in Struts <html:errors/> will show errors in a listed manner.
    so in ur properties file u have to specify ur errors within<li></li> tag and u have to add the additional valuee for header and footer.
    Try this
    errors.header=<UL>
    errors.footer=</UL>
    errors.test.required=<li>This is a test</li>You can decorate this using html tags in Porperty file.
    p(`)(`)ja.

  • Convert multiple lines for same material into a single line in Sales Order

    Our company has a requirement, they want if there are multiple lines exist for the same material in sales order and purchase order then it should become like one single line.
    10    35712  5pcs
    20   100885  10 pcs
    30   35712   10pcs
    Now our requirement is that should  become a single line like this
    10  35712  15pcs.
    I will   Text Removed.
    Regards,
    Khawar
    Message was edited by: G Lakshmipathi
    Please dont add such text in your post

    Now our requirement is that should  become a single line like this
    Where?  Meanwhile, I hope, you would have searched in SCN / Google before posting as it is a basic question and needs to be locked.  If searched, specify clearly what efforts you took to find out solution to your requirement.
    G. Lakshmipathi

  • Mercator xml single line translation

    hi guys,
    I have a map that reads in an xml file and outputs an edifact msg.
    When the xml is formatted, i.e spaced apart according to the tags, the map performs fine.
    Unfortunately, my xml file is generated by another application that outputs the xml all on one single line.
    i.e
    <line1>A</line1><line2>B</line2><line3>C</line3>when i run the input file (single line xml) through the map, i get an invalid input message!!
    I've already removed all the <cr> and <nl> from all the Terminators in my input type tree, but i still get an Invalid input error message. has anyone experianced this before?
    Any help or suggestions are greatly appreciated.

    Mallik,
    I do not think that this can be achieved in XML to XML (unless you can create a specific module and add to the module tab)
    But if you create say a CSV or TXT file and use the <b>Content Conversion Parameters</b> option
    Here you can specify the fieldSeparator to be 'nl'
    <b>Input</b>
    <?xml version="1.0" encoding="UTF-8"?>
    <record>
    <field1>f1</field1>
    <field2>f2</field2>
    <field3>f3</field3>
    </record>
    <b>Output</b>
    f1
    f2
    f3
    Here you have retained your data and each field is separated by a new line.  Unfortunatley with this method you lose your XML tags
    Regards,
    Mike

  • Yes/No fields, single line. Long question in seperate text field. How to avoid gap between lines?

    I have made two single-choice fields side by side (Yes and No) on one single line. The question for the choices is long, so I wrote it in a separate text field placed above the Yes and No fields. If I use the Yes field for the question, the No field would end up too far to the right.
    Question ....
    [Single-choice text fields space]
    [  ] Yes
    [  ] No
    Problem now is there's too much space under the question, since the automatic text fields in the Yes and No fields are still there, though "invisible"/not used. How can I have a long question on a single line and have the Yes and No fields on the next line without a big gap between the two lines? Is it possible to delete the automatic text field in the Yes and No fields?
    Just realised that if one makes a single Yes field, and a single No field to the right, you are ("of course") able to mark both the fields, since they are not linked anymore as with two choices in one field. The point with the single choice fields is then lost; to be able to choose only either one. Yes or No.
    [X] Yes   [X] No

    The Single Choice is designed such that you have a single label and multiple choices, but the user can only select a single choice (in your case Yes or No).  If you like the choices to appear side by side you can deselect Stack Choices Vertically in the Field Properties widget.  You should also set the Label to Above.  See the attached image.
    Jeff Canepa
    Software Quality Engineer
    Adobe Systems, Inc.
    [email protected]

Maybe you are looking for