Loosing break lines when writing string to object

Hi,
I am tring to write a string (docText) to file:
FileOutputStream myfile = new FileOutputStream(filename);
BufferedWriter myOutput = new BufferedWriter (new OutputStreamWriter(myfile));
myOutput.write(docText);
the problem is that I get the string in the file as one line and I loose all the line breaks I had in the string.
can anyone help?
Thanks,
Itzik

It's quite possible for that to happen, if for example
your String's line breaks are only '\n' and the tool
you try to display your file with is a piece of
Windows software that is ignorant of this possibility
and demands '\r\n' as the only possible line break.
PC�Exactly. And thats why its a good idea to use [url http://java.sun.com/docs/books/tutorial/essential/system/properties.html] System properties  in such cases

Similar Messages

  • How do i create a new line when writing to file

    I am trying to write a few stings to a file but i cant get them to print on seperate lines. They all end up together. I tried to include the \n in the string but that didnt work. Any suggestions? I thought that this part would be simple.

    http://forum.java.sun.com/thread.jsp?forum=54&thread=450725&tstart=0&trange=15

  • Need to print new line when "," in string

    Hi,
    I have a string having value 12,221,23,67...
    I need to print a new line after ", "
    i;e 12
    221
    23
    67....
    Please suggest.
    Thanks,
    Ajit

    Hi Team ,
    its done.
    I have used chr 13, chr10 and it print new lines for me
    v_serial_num:=v_serial_num||','||CHR(13) || CHR(10)||rec.SERIAL_NUMBER;
    Thanks,
    Ajit

  • How to make new-line when printing strings?

    Please help me with code . I can't able to print the string in new line
    Anil

    ... the same question as your other post:
    Printing the string

  • Books / links on best practices when writing on-line Help

    Hi everyone
    Not sure were to place this topic...
    I have not posted in here for ages...
    I am a RoboHelp user and I am looking for one or several
    books about best practices when writing on-line help. For examples,
    what are the "rules" or "do's" and "don'ts" for CSS, topic linking,
    number of clicks, links within a topic, index building, etc.
    Just wondering if some people on this forum know about some
    good books where all of the rules or do's would be compiled?
    Thanks in advance for any input.
    Regards

    KeepItSimple,Stupid!
    That is, just because there are neat things like drop-down
    text, marquees, and such, doesn't mean you should use them.
    Stick to the basic HTML fonts and colors (use the
    w3schools web site for all
    things HTML and CSS.
    Instead of styles, create your lists by selecting Normal
    paragraphs and formatting with the Bullet and Number toolbar
    buttons.
    Keep your tables as simple as possible (try not to nest them
    and have all sorts of row and column spans, and try to avoid lists
    and figures, if you can). Also, break up very long tables into
    functional groupings with introductory headings.
    Use
    Peter Grainge's web
    site and
    Rick
    Stone's web site for all the best workarounds and diagnostics.
    Good luck,
    Leon

  • When writing an email or word doc, If i press ' key on my keyboard it returns down a line

    Every-time i use the Apostrophe key ' when writing an email on Mac mail the curser automatically drops down a line, like I've hit the enter key.
    Please help me fix.

    Try a different keyboard.   At least on the QWERTY USA keyboards, the two keys are side by side.  If anything gets stuck between those keys, it can make it take both keys as a command.    Alternatively if you aren't careful where you type, you may hit enter when you've not meant to.  Pulling the keys off the keyboard is rarely recommended as you can damage the key mechanism.   There are keyboard vacuums that can help if the machine is turned off.  I would not use them when the machine is turned on, as static electricity could easily damage the mechanism when it is on.

  • I see a line when an object moves fast

    Ok, I shoot a Video with My CANON XHA1S AT: 1440 X 1080 30 fps, with the speed of 60. I created a new project as you can see in Capture Shot.
    I don't know why, But I suddenly see a shakey - line when a hand or any object moves close to the camera. Inside my Timeline I Slowed Motion few Tracks to 32%, the rest is at normal speed, When I check the speed for other Tracks it shows 99.9 %.
    Any answer please
    Thanks
    Simon

    Try rendering a small part (and exporting it) of your timeline and preview it. Is the line still there?
    My experience now is that with the hacked Mercury, the preview is not always top notch but rendering is.
    Are you using interlaced video (you seem to be)? If yes, and you are slowing down your footage the shutter speed you used will make a huge difference in your slows. Usually you want it to be double what you normally use. 60 would be the bare minimum. 250 would be great.
    On my XH A1 (not your model) 120 works fine (increasing it to 250 would mean I have lots of light, like outdoors for example). BTW, try the 60i mode. It has *double* the frames, which is great for slows.

  • Insert a break line in a content of a variable

    Hi all, my problem is:
    I want to put a break line at position 40 of a string (where exist a space), for example.
    DATA: v_string TYPE string.
    v_string = 'testline1_testline1_testline1_testline1 testline2_testline2_testline2_testline2'.
    Because i want a result like this
    testline1_testline1_testline1_testline1
    testline2_testline2_testline2_testline2.
    I tried with cl_abap_char_utilities=>cr_lf but are printing  testline1_testline1_testline1_testline1##testline2_testline2_testline2_testline2.
    I tried too with cl_abap_char_utilities=>new_line but don´t work.
    Tks to all.

    Hi sadavisa,
    follow my program:
    start----
    DATA: gv_string TYPE string,
          gv_result TYPE string,
          gv_len TYPE i,
          gv_div TYPE f,
          gv_num_lin TYPE i,
          gv_len_upd type i,
          gv_position type i,
          gv_count type i,
          gv_40(1) type c,
          gv_39(1) type c,
          gv_38(1) type c,
          gv_37(1) type c,
          gv_36(1) type c,
          gv_35(1) type c.
    gv_string = 'testline1_testline1_testline1_testline1 testline2_testline2_testline2_testline2'.
    gv_len = STRLEN( gv_string ).
    IF gv_len <= 40.
      WRITE gv_string.
    ELSE.
      gv_div = gv_len / 40.
      gv_num_lin = CEIL( gv_div ).
      gv_count = 1.
      WHILE gv_num_lin => gv_count.
        IF gv_num_lin = sy-index. "this code is executed only in the last time
          CONCATENATE gv_result gv_string INTO gv_result.
          gv_count = gv_count + 1.
          CONTINUE.
        ENDIF.
        gv_40 = gv_string+40(1).
        gv_39 = gv_string+39(1).
        gv_38 = gv_string+38(1).
        gv_37 = gv_string+37(1).
        gv_36 = gv_string+36(1).
        gv_35 = gv_string+35(1).
        IF gv_40 = space.
          gv_position = 40.
          PERFORM update_variables USING gv_position.
          continue.
        ELSEIF gv_39 = space.
          gv_position = 39.
          PERFORM update_variables USING gv_position.
          continue.
        ELSEIF gv_38 = space.
          gv_position = 38.
          PERFORM update_variables USING gv_position.
          continue.
        ELSEIF gv_37 = space.
          gv_position = 37.
          PERFORM update_variables USING gv_position.
          continue.
        ELSEIF gv_36 = space.
          gv_position = 36.
          PERFORM update_variables USING gv_position.
          continue.
        ELSEIF gv_35 = space.
          gv_position = 35.
          PERFORM update_variables USING gv_position.
          continue.
        endif.
        gv_count = gv_count + 1.
      ENDWHILE.
    ENDIF.
    write gv_result.
    *&      Form  UPDATE_VARIABLES
          Update variables
         -->P_POSITION  text
    form UPDATE_VARIABLES  using p_position type i.
      CONCATENATE gv_result gv_string(p_position) cl_abap_char_utilities=>cr_lf INTO gv_result.
      gv_len_upd = gv_len - p_position.
      gv_string = gv_string+p_position(gv_len_upd).
      CONDENSE gv_string.
      gv_count = gv_count + 1.
    endform.                    " UPDATE_VARIABLES
    end----
    So my question is why when i write CR_LF on file text go right and when i join into a variable and then write on screen go wrong.
    Tks.

  • Upload IT1002 description auto break lines

    Hello,
    I am using LSMW to upload IT1002 - description.
    Below is free text I need to transfer.
    "Develop, manage and implement all Brand research projects requiring support and leadership.
    <br>Specifically manage research requirements arising from pre-launch and post-launch phase which will include qualitative and quantitative projects. <br> Working alongside the team and in collaboration with all Group Brand stockholders.
    I would like to break the text into several lines when below conditions match -
    1. when text length = 79
    2. when '<br>'  string is found.
    Any idea?
    Thanks a lot.

    closed.

  • [svn] 1366: BLZ-136 log an error and return no properties when IntrospectionException occurs when introspecting a value object

    Revision: 1366
    Author: [email protected]
    Date: 2008-04-23 14:45:47 -0700 (Wed, 23 Apr 2008)
    Log Message:
    BLZ-136 log an error and return no properties when IntrospectionException occurs when introspecting a value object
    Ticket Links:
    http://bugs.adobe.com/jira/browse/BLZ-136
    Modified Paths:
    blazeds/branches/3.0.x/modules/core/src/java/flex/messaging/io/BeanProxy.java

    Hi,
    Please apply the following correction manually.
    1. Go to transaction ST03N
    2. Change user from 'Administrator' to 'Expert Mode'.
    3. Go to Collector and performance analysis -> Performance database
       -> Monitoring database -> Contents
    4. Search where further info contains the string "h/2"
    like the following monikeys:
      - 'days  h/2'
      - 'weeks  h/2'
      - 'months  h/2'  
    5. Double click on each, so that they become red and show ** delete
    6. Finally SAVE
    This will remove the corresponding database related history up to the deletion date. It will accumulate anew afterwards.
    How can I identify the monikey that has to be deleted?
    When you load the text of the dump and then jump off to the break point of the debugger you may find the error break point look like:
    "IMPORT HIST2 FROM DATABASE MONI(DB) ID MONIKEY".
    To find the right monikey entry causing the dump you can search for the word 'MONIKEY' within the text of the dump. This can be 'days  h/3' or
    'tabgrowth  2'...
    You can then go back to the procedure above and search where further info contains the monikey that you found in the text of the dump.
    997535     DB02: Problems with History Data.
    Award points if helpful.
    Thanks,
    Tanuj

  • Get instantly the coordinate of end and start point of line, when moving it

    hello guys,
    i'm just wondering on how to get the coordinate of Start and End point of a line when I'm using PathWrangler wrangler = new PathWrangler(this); this latter allows the paint components to be dragged, so i want to get instantly the coordinate of the Start and End point of the line.
    MY AIM IS: i want whenver an intersection between 2 lines occur( the line is being dragged so intersection may occur between the two lines) i want to draw a circle having as center the intersection of the 2 lines.
    i managed to write a code that draws 2 lines and a circle having a center the intersection of both lines. here is the code:
    import java.awt.*; 
        import java.awt.event.*; 
        import java.awt.geom.*; 
        import java.util.*; 
        import java.util.List; 
        import javax.swing.*; 
        import javax.swing.event.MouseInputAdapter; 
        public class SDRx extends JPanel { 
           List<Path2D.Double> paths = new ArrayList<Path2D.Double>(); 
           PathWrangler wrangler = new PathWrangler(this);
           Point p1= new Point(120,150);
           Point p2= new Point(140,210);
           Point p3= new Point(120,150);
           Point p4= new Point(110,230);               
            Line2D.Double l1=new Line2D.Double(p1,p2);
           Line2D.Double l2=new Line2D.Double(p3,p4);
            Point2D.Double inter= intersection(l1.getX1(),l1.getY1(),l1.getX2(),l1.getY2(),l2.getX1(),l2.getY1(),l2.getX2(),l2.getY2());
           Ellipse2D.Double ell= new Ellipse2D.Double(inter.getX()-25,inter.getY()-25,50,50);
           public SDRx() { 
               paths.add(wrap(l1));
               paths.add(wrap(l2));
               paths.add(wrap(ell));             
           private Path2D.Double wrap(Shape s) { 
               return new Path2D.Double(s); 
           protected void paintComponent(Graphics g) { 
               super.paintComponent(g); 
               Graphics2D g2 = (Graphics2D)g; 
               g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, 
                                   RenderingHints.VALUE_ANTIALIAS_ON); 
               g2.setPaint(Color.blue); 
               for(int j = 0; j < paths.size(); j++) { 
                   g2.draw(paths.get(j)); 
           public void transformPath(Path2D.Double path, AffineTransform at) { 
               path.transform(at); 
               repaint(); 
            public Point2D.Double intersection(double x1,double y1,double x2,double y2, double x3, double y3, double x4,double y4) {
          double d = (x1-x2)*(y3-y4) - (y1-y2)*(x3-x4);
          if (d == 0) return null;
          double xi = ((x3-x4)*(x1*y2-y1*x2)-(x1-x2)*(x3*y4-y3*x4))/d;
          double yi = ((y3-y4)*(x1*y2-y1*x2)-(y1-y2)*(x3*y4-y3*x4))/d;
        return new Point2D.Double(xi,yi);
           public static void main(String[] args) { 
               JFrame f = new JFrame(); 
               f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 
               f.add(new SDRx()); 
               f.setSize(400,400); 
               f.setLocation(100,100); 
               f.setVisible(true); 
       }any help is appreciated.
    10x

    OK guys i'm sorry for before i said few wrong things about PathWrangler wrangler = new PathWrangler(this); i thought it was in the java library.
    anyway here is the full code( i got it few weeks ago(with few modidfication) from somwhere, u can google it)
        import java.awt.*; 
        import java.awt.event.*; 
        import java.awt.geom.*; 
        import java.util.*; 
        import java.util.List; 
        import javax.swing.*; 
        import javax.swing.event.MouseInputAdapter; 
        public class SDRx extends JPanel { 
           List<Path2D.Double> paths = new ArrayList<Path2D.Double>(); 
           PathWrangler wrangler = new PathWrangler(this);
           Point p1= new Point(120,150);
           Point p2= new Point(140,210);
           Point p3= new Point(120,150);
           Point p4= new Point(110,230);               
            Line2D.Double l1=new Line2D.Double(p1,p2);
           Line2D.Double l2=new Line2D.Double(p3,p4);
            Point2D.Double inter= intersection(l1.getX1(),l1.getY1(),l1.getX2(),l1.getY2(),l2.getX1(),l2.getY1(),l2.getX2(),l2.getY2());
           Ellipse2D.Double ell= new Ellipse2D.Double(inter.getX()-25,inter.getY()-25,50,50);
           public SDRx() { 
               paths.add(wrap(l1));
               paths.add(wrap(l2));
               paths.add(wrap(ell));             
           private Path2D.Double wrap(Shape s) { 
               return new Path2D.Double(s); 
           protected void paintComponent(Graphics g) { 
               super.paintComponent(g); 
               Graphics2D g2 = (Graphics2D)g; 
               g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, 
                                   RenderingHints.VALUE_ANTIALIAS_ON); 
               g2.setPaint(Color.blue); 
               for(int j = 0; j < paths.size(); j++) { 
                   g2.draw(paths.get(j)); 
           public void transformPath(Path2D.Double path, AffineTransform at) { 
               path.transform(at); 
               repaint(); 
            public Point2D.Double intersection(double x1,double y1,double x2,double y2, double x3, double y3, double x4,double y4) {
          double d = (x1-x2)*(y3-y4) - (y1-y2)*(x3-x4);
          if (d == 0) return null;
          double xi = ((x3-x4)*(x1*y2-y1*x2)-(x1-x2)*(x3*y4-y3*x4))/d;
          double yi = ((y3-y4)*(x1*y2-y1*x2)-(y1-y2)*(x3*y4-y3*x4))/d;
        return new Point2D.Double(xi,yi);
           public static void main(String[] args) { 
               JFrame f = new JFrame(); 
               f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 
               f.add(new SDRx()); 
               f.setSize(400,400); 
               f.setLocation(100,100); 
               f.setVisible(true); 
       class PathWrangler extends MouseInputAdapter { 
           SDRx component; 
           AffineTransform at = new AffineTransform(); 
           final int S = 6; 
           Rectangle net = new Rectangle(S, S); 
           Path2D.Double selectedPath; 
           Point offset = new Point(); 
           boolean dragging = false; 
           public PathWrangler(SDRx sdr) { 
               component = sdr; 
               component.addMouseListener(this); 
               component.addMouseMotionListener(this); 
           public void mousePressed(MouseEvent e) { 
               Point p = e.getPoint(); 
               net.setLocation(p.x-S/2, p.y-S/2); 
               List<Path2D.Double> list = component.paths; 
               for(int j = 0; j < list.size(); j++) { 
                   Path2D.Double path = list.get(j); 
                   // Use the contains method to detect RectangluarShapes 
                   // and the intersects method with net to detect lines. 
                  if(path.contains(p) || path.intersects(net)) { 
                       selectedPath = path; 
                       Rectangle r = selectedPath.getBounds(); 
                       offset.x = p.x - r.x; 
                       offset.y = p.y - r.y; 
                       dragging = true; 
                       break; 
           public void mouseReleased(MouseEvent e) { 
               dragging = false; 
           public void mouseDragged(MouseEvent e) { 
               if(dragging) { 
                   int x = e.getX() - offset.x; 
                   int y = e.getY() - offset.y; 
                   Rectangle r = selectedPath.getBounds(); 
                   at.setToTranslation(x-r.x, y-r.y); 
                   component.transformPath(selectedPath, at);
       }  10x

  • PL/SQL: ORA-04052: error occurred when looking up remote object.

    Hi All,
    I'm getting the following error message while executing a PL/SQL Block.
    PL/SQL: ORA-04052: error occurred when looking up remote object UPLDUSER.filestatushistory@FTS
    ORA-00604: error occurred at recursive SQL level 1
    ORA-03106: fatal two-task communication protocol error
    ORA-02063: preceding line from FTSStatement
    declare
    v_coun number;
    begin
    select count(*) into v_coun
    from updluser.filestatushistory@fts;
    end;Back ground of the situation as follows,
    My DataBase version 10.2.0.3 DB Name :DB1
    Table Owner : UPLDUSER
    Table Name : FILESTATUSHISTORY
    I have a report user on the same database and I have grant all on the above table to report user
    Report User : RPT_FTS
    SQL> GRANT ALL ON FILESTATUSHISTORY_V TO RPT_FTS;Now Please find the below database details where I'm getting subjected error.
    Database version : 9.2.0.8
    DB Name : DB2
    User Name : RPT_REPORTS
    I Have create a dblink from RPT_REPORTS to RPT_FTS on DB1 and the dblink works fine. But getting the above error while running it.
    but When I do the same other 10.2.0.3 db , the above PL/SQL block works fine without any problem.
    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    Now the strange about this is that I have Created a new table on DB1 db like below;
    SQL> CREATE TABLE UPLDUSER.ABC AS SELECT * FROM FILESTATUSHISTORY;and retry my code on DB2 (9.2.0.8) after changing the table to ABC and it worked. Now I don't know whats wrong with a original table(FILESTATUSHISTORY).
    To over come the problem and a work-a-round method I create a view on the DB1 (RPT_FTS) like the below
    SQL> CREATE VIEW FILESTATUSHISTORY AS SELECT * FROM UPLDUSER.FILESTATUSHISTORY;and was able to run the PL/SQL block Remotely.
    Just wants To know what whould have been the cause for this .
    Cheers
    Kanchana

    Hi Kanchana,
    Perhaps following link of google search has answer to your query
    ORA-04052. The search result contains some useful articles whose URLs I shan't post in the forums.
    HTH!
    *009*

  • Error when attempting to IMPORT object "TS_CHECK".

    When using in BI SAP NetWeaver 2004s (700 - SP 15) the transaction ST04old -> Detail analysis menu -> Summary report
    The following short dump occurs:
    Runtime Errors         CONNE_IMPORT_WRONG_COMP_TYPE
    Except.                CX_SY_IMPORT_MISMATCH_ERROR
    Date and Time          19.11.2008 15:14:08
    Short text
    Error when attempting to IMPORT object "TS_CHECK".
    What happened?
    Error in the ABAP Application Program
    The current ABAP program "SAPLSTD4" had to be terminated because it has
    come across a statement that unfortunately cannot be executed.
    Error analysis
    An exception occurred that is explained in detail below.
    The exception, which is assigned to class 'CX_SY_IMPORT_MISMATCH_ERROR', was
    not caught in
    procedure "DB02_ORA_FILL_TS_CHECK__CRITOB" "(FUNCTION)", nor was it propagated
    by a RAISING clause.
    Since the caller of the procedure could not have anticipated that the
    exception would occur, the current program is terminated.
    The reason for the exception is:
    When importing the object "TS_CHECK", the component no. 4 in the
    dataset has a different type from the corresponding component
    of the target object in the program "SAPLSTD4".
    The data type is "I" in the dataset, but "N" in the program.
    Missing RAISING Clause in Interface
    Program                                 SAPLSTD4
    Include                                 LSTD4U03
    Row                                     1
    Module type                             (FUNCTION)
    Module Name                             DB02_ORA_FILL_TS_CHECK__CRITOB
    Trigger Location of Exception
    Program                                 SAPLSTD4
    Include                                 LSTD4U03
    Row                                     51
    Module type                             (FUNCTION)
    Module Name                             DB02_ORA_FILL_TS_CHECK__CRITOB
    Source Code Extract
    Line
    SourceCde
    21
    DATA: BEGIN OF TD110.
    22
    INCLUDE STRUCTURE TD110_STRU.
    23
    DATA: END OF TD110.
    24
    25
    CURR_TIME = SY-UZEIT.
    26
    CURR_DATE = SY-DATUM.
    27
    28
    CALL FUNCTION 'GET_DB_ORA_RELEASE'
    29
    IMPORTING
    30
    ORACLE_RELEASE = ORA_REL.
    31
    32
    IF FLAG_REFRESH = 'y'.  FLAG_REFRESH = 'Y'. ENDIF.
    33
    flag_refresh = 'Y': Es soll in jedem Fall auf die DB zugegriffen werd.
    34
    35
    CLEAR TS_CHECK. REFRESH TS_CHECK.
    36
    CLEAR CRITOBJ. REFRESH CRITOBJ.
    37
    CLEAR NR_CRIT_OBJ.
    38
    39
    IF FLAG_REFRESH <> 'Y'.
    40
    41
    Suche zunächst im Arbeitsspeicher !
    42
    CLEAR TS_CHECK_CACHE. READ TABLE TS_CHECK_CACHE.
    43
    IF NOT ( TS_CHECK_CACHE IS INITIAL ) .
    44
    TS_CHECK[] = TS_CHECK_CACHE[].
    45
    CRITOBJ[] = CRITOBJ_CACHE[].
    46
    OK_1 = 'Y'.
    47
    48
    Suche danach in 'MONI' !
    49
    ELSE.
    50
    PERFORM PREPARE_MONIKEY USING 2.
    >>>>>
    IMPORT TS_CHECK CRITOBJ FROM DATABASE MONI(DB) ID MONIKEY.
    52
    53
    IF SY-SUBRC = 0.
    54
    OK_1 = 'Y'.
    55
    TS_CHECK_CACHE[] = TS_CHECK[].
    56
    CRITOBJ_CACHE[] = CRITOBJ[].
    57
    ENDIF.
    58
    ENDIF.
    59
    60
    'Same procedure' für datetime:
    61
    IF NOT ( TD110_CACHE IS INITIAL ).
    62
    DATETIME-MONI_DATE = TD110_CACHE-DATUM.
    63
    DATETIME-MONI_TIME = TD110_CACHE-UZEIT.
    64
    ELSE.
    65
    PERFORM PREPARE_MONIKEY USING 3.
    66
    IMPORT TD110 FROM DATABASE MONI(DB) ID MONIKEY.
    67
    IF SY-SUBRC = 0.
    68
    DATETIME-MONI_DATE = TD110-DATUM.
    69
    DATETIME-MONI_TIME = TD110-UZEIT.
    70
    TD110_CACHE = TD110.
    Only related SDN post is following, but solved by changing permissions for saposcol.
    Only related SAP Note is SAP Note Number 597743 "DB02: Poor entries for critical objects list", but not applicable for current SAP version.
    For me strange is that this issue occurs on the development system, but not on the acceptance and production system.
    Thanks in advance for any assistance.
    KR
    Gidion

    Received the solution from SAP Active Global Support:
    This error occurs due a corruption in the table MONI.
    For solving this issue you need to clean the records of this table via the following path :
    1. Call transaction ST03
    2. With GOTO -> Performance database -> Content of database
    3. Push button Delete data group
    4. Enter ID DB
    5. Continue
    6. Confirm the delete
    If you wish to backup the data before deleting the entry please follow the steps in the note 1000275 "DB02: history data backup procedure".
    Regards,
    Gidion

  • To run a report from command line, when using jdbc-odbc bridge

    Hi,
    How to run a report from command line, when using jdbc-odbc bridge?
    Usually with tns, we do by "rwrun module=<> userid=<user>/<passwd>@tns".
    with odbc, we do by "rwrun module=<> userid=<user>/<passwd>@odbc:DSN"
    Please specify, what is command line arguments for jdbc-odbc bridge driver?
    Environment : Oracle 9i Report Builder on WinNT
    Database : Sybase
    Regards,
    Ramanan

    Hello Ramanan,
    Report Builder : connect JDBC Query in Report Builder is to through Connection Dialog in JDBC Query Editor. User can use a Sign on parameter (can use, default : P_JDBCPDS or can create new) to connect to JDBC Data Source. Connection once made will be mentioned and will be reused through out Reports Builder.
    JDBC PDS allows user to connect one or more same or different kind of databases.
    While running report through runtime or Server, user can pass the sign on parameter(connection string) value, like any other user parameter.
    Syntax for connection string : <username>/<password>@databaseURL . The syntax of database part of connection string depend on the type of JDBC Driver used to connect to Data Source while designing the JDBC Query. databaseURL refer to the location of the database and its format depend on the JDBCPDS river selected in design time while creating the JDBC Query.
    rwrun eg :
    rwrun report=jdbc_odbc.rdf destype=file desname=output.html desformat=html P_JDBCPDS=scott/tiger@database
    Server eg :
    http://server.com:8888/servlet/RWServlet?server=MyReportServer+report=jdbc_odbc.rdf+destype=cache+desformat=html+P_JDBCPDS=scott/tiger@database
    http :
    Please see ORACLE_HOME/reports/conf/jdbcpds.conf for more information.
    With Regards
    Reports Team

  • Error when installing the supporting objects of OLL Packaged Application

    Hello,
    I am trying to install OLL Packaged Application|http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/apex/r41/inst_pkgapp/inst_pkgapp.htm#top
    but when installing the supporting objects, I got error when executing the code of "create_package_body"
    Error at line 274: PLS-00201: identifier 'UTL_TCP' must be declared
    create or replace package body eba_oll_log
    as
    g_start_time    number;
    procedure log_init
    is
    begin
        g_start_time := dbms_utility.get_time;
    end log_init;
    procedure log_page_view
    is
    begin
       insert into eba_oll_page_views
          ( APEX_USER,
            PAGE_ID,
            PAGE_NAME,
            VIEW_DATE,
            TS,
            ELAPSED_TIME,
            IP_ADDRESS,
            AGENT,
            APEX_SESSION_ID,
            CONTENT_ID,
            CONTENT_TITLE )
       values
          ( v('APP_USER'),
            v('APP_PAGE_ID'),
            wwv_flow.g_step_title,
            trunc(sysdate,'DD'),
            systimestamp,
            (dbms_utility.get_time-g_start_time)*(.01),
            owa_util.get_cgi_env('REMOTE_ADDR'),
            owa_util.get_cgi_env('HTTP_USER_AGENT'),
            v('APP_SESSION'),
            case when v('APP_PAGE_ID') = 24
                 then v('P24_CONTENT_ID')
                 else null
                 end,
            case when v('APP_PAGE_ID') = 24
                 then v('P24_CONTENT_TITLE')
                 else null
                 end );
       if v('APP_PAGE_ID') = 24 then
          insert into eba_oll_content_views
             ( APEX_USER,
               VIEW_DATE,
               TS,
               IP_ADDRESS,
               AGENT,
               APEX_SESSION_ID,
               CONTENT_ID,
               CONTENT_TITLE,
               NOTE )
          values
             ( v('APP_USER'),
               trunc(sysdate,'DD'),
               systimestamp,
               owa_util.get_cgi_env('REMOTE_ADDR'),
               owa_util.get_cgi_env('HTTP_USER_AGENT'),
               v('APP_SESSION'),
               v('P24_CONTENT_ID'),
               v('P24_CONTENT_TITLE'),
               'Viewed' );
       end if;
       commit;
    end log_page_view;
    procedure log_content_click
    is
    begin
       insert into eba_oll_content_views
          ( APEX_USER,
            VIEW_DATE,
            TS,
            IP_ADDRESS,
            AGENT,
            APEX_SESSION_ID,
            CONTENT_ID,
            CONTENT_TITLE,
            NOTE )
       values
          ( v('APP_USER'),
            trunc(sysdate,'DD'),
            systimestamp,
            owa_util.get_cgi_env('REMOTE_ADDR'),
            owa_util.get_cgi_env('HTTP_USER_AGENT'),
            v('APP_SESSION'),
            v('P24_CONTENT_ID'),
            v('P24_CONTENT_TITLE'),
            'Launched' );
       commit;
    end log_content_click;
    end eba_oll_log;
    create or replace package body eba_oll_api
    as
    function gen_id
       return number
    is
       l_id  number;
    begin
       select to_number(sys_guid(), 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
         into l_id
         from dual;
       return l_id;
    end gen_id;
    function eba_oll_tags_cleaner (
        p_tags  in varchar2,
        p_case  in varchar2 default 'U' ) return varchar2
    is
        type tags is table of varchar2(255) index by varchar2(255);
        l_tags_a        tags;
        l_tag           varchar2(255);
        l_tags          apex_application_global.vc_arr2;
        l_tags_string   varchar2(32767);
        i               integer;
    begin
        l_tags := apex_util.string_to_table(p_tags,',');
        for i in 1..l_tags.count loop
            --remove all whitespace, including tabs, spaces, line feeds and carraige returns with a single space
            l_tag := substr(trim(regexp_replace(l_tags(i),'[[:space:]]{1,}',' ')),1,255);
            if l_tag is not null and l_tag != ' ' then
                if p_case = 'U' then
                    l_tag := upper(l_tag);
                elsif p_case = 'L' then
                    l_tag := lower(l_tag);
                end if;
                --add it to the associative array, if it is a duplicate, it will just be replaced
                l_tags_a(l_tag) := l_tag;
            end if;
        end loop;
        l_tag := null;
        l_tag := l_tags_a.first;
        while l_tag is not null loop
            l_tags_string := l_tags_string||l_tag;
            if l_tag != l_tags_a.last then
                l_tags_string := l_tags_string||', ';
            end if;
            l_tag := l_tags_a.next(l_tag);
        end loop;
        return substr(l_tags_string,1,4000);
    end eba_oll_tags_cleaner;
    procedure eba_oll_tag_sync (
        p_new_tags          in varchar2,
        p_old_tags          in varchar2,
        p_content_type      in varchar2,
        p_content_id        in number )
    as
        type tags is table of varchar2(255) index by varchar2(255);
        l_new_tags_a    tags;
        l_old_tags_a    tags;
        l_new_tags      apex_application_global.vc_arr2;
        l_old_tags      apex_application_global.vc_arr2;
        l_merge_tags    apex_application_global.vc_arr2;
        l_dummy_tag     varchar2(255);
        i               integer;
    begin
        l_old_tags := apex_util.string_to_table(p_old_tags,', ');
        l_new_tags := apex_util.string_to_table(p_new_tags,', ');
        if l_old_tags.count > 0 then --do inserts and deletes
            --build the associative arrays
            for i in 1..l_old_tags.count loop
                l_old_tags_a(l_old_tags(i)) := l_old_tags(i);
            end loop;
            for i in 1..l_new_tags.count loop
                l_new_tags_a(l_new_tags(i)) := l_new_tags(i);
            end loop;
            --do the inserts
            for i in 1..l_new_tags.count loop
                begin
                    l_dummy_tag := l_old_tags_a(l_new_tags(i));
                exception when no_data_found then
                    insert into eba_oll_tags (tag, content_id, content_type )
                        values (l_new_tags(i), p_content_id, p_content_type );
                    l_merge_tags(l_merge_tags.count + 1) := l_new_tags(i);
                end;
            end loop;
            --do the deletes
            for i in 1..l_old_tags.count loop
                begin
                    l_dummy_tag := l_new_tags_a(l_old_tags(i));
                exception when no_data_found then
                    delete from eba_oll_tags where content_id = p_content_id and tag = l_old_tags(i);
                    l_merge_tags(l_merge_tags.count + 1) := l_old_tags(i);
                end;
            end loop;
        else --just do inserts
            for i in 1..l_new_tags.count loop
                insert into eba_oll_tags (tag, content_id, content_type )
                    values (l_new_tags(i), p_content_id, p_content_type );
                l_merge_tags(l_merge_tags.count + 1) := l_new_tags(i);
            end loop;
        end if;
        for i in 1..l_merge_tags.count loop
            merge into eba_oll_tags_type_sum s
            using (select count(*) tag_count
                     from eba_oll_tags
                    where tag = l_merge_tags(i) and content_type = p_content_type ) t
               on (s.tag = l_merge_tags(i) and s.content_type = p_content_type )
             when not matched then insert (tag, content_type, tag_count)
                                   values (l_merge_tags(i), p_content_type, t.tag_count)
             when matched then update set s.tag_count = t.tag_count;
            merge into eba_oll_tags_sum s
            using (select sum(tag_count) tag_count
                     from eba_oll_tags_type_sum
                    where tag = l_merge_tags(i) ) t
               on (s.tag = l_merge_tags(i) )
             when not matched then insert (tag, tag_count)
                                   values (l_merge_tags(i), t.tag_count)
             when matched then update set s.tag_count = t.tag_count;
        end loop;
    end eba_oll_tag_sync;
    procedure render_tag_cloud (
       p_selection          in varchar2 default null,
       p_app_id             in number,
       p_session_id         in number,
       p_min_nbr_tags       in number default 1,
       p_max                in number default 100,
       p_limit              in number default 10000,
       p_link_to_page       in varchar2 default '2',
       p_tag_item_filter    in varchar2 default 'P2_TAGS',
       p_clear_cache        in varchar2 default '2,CIR,RIR',
       p_more_page          in varchar2 default '62' )
    as
       l_printed_records    number := 0;
       l_available_records  number := 20;
       l_max                number;
       l_min                number;
       l_class_size         number;
       l_class              varchar2(30);
       type l_tagtype is table of varchar2(2000);
       l_tags l_tagtype;
       type l_numtype is table of number;
       l_cnts l_numtype;
       l_size number;
       l_total number :=0;
       l_buffer varchar2(32676);  
       CURSOR c_all_tags
       IS
           select tag, c from (
           select t.tag, count(*) c
             from eba_oll_content c,
                  eba_oll_tags t
            where c.content_id = t.content_id
              and c.display_yn = 'Y'
              and (p_selection is null or
                   (p_selection is not null and
                   (   (substr(p_selection,1,1) = 'R' and
                        substr(p_selection,2) in (select release_id
                                                    from eba_oll_content_products cp
                                                   where cp.content_id = c.content_id))
                    or (substr(p_selection,1,1) = 'C' and
                        substr(p_selection,2) in (select product_id
                                                    from eba_oll_content_products cp
                                                   where cp.content_id = c.content_id))
                    or (substr(p_selection,1,1) = 'P' and
                        (substr(p_selection,2) in (select product_id
                                                     from eba_oll_content_products cp
                                                    where cp.content_id = c.content_id) or
                         substr(p_selection,2) in (select p.parent_product_id
                                                     from eba_oll_content_products cp,
                                                          eba_oll_products p
                                                    where cp.content_id = c.content_id
                                                      and cp.product_id = p.product_id)))
                    or (substr(p_selection,1,1) = 'G' and
                        (substr(p_selection,2) in (select pg.group_id
                                                     from eba_oll_product_groupings pg,
                                                          eba_oll_content_products cp
                                                    where pg.product_id = cp.product_id
                                                      and cp.content_id = c.content_id) or
                         substr(p_selection,2) in (select pg.group_id
                                                     from eba_oll_product_groupings pg,
                                                          eba_oll_products p,
                                                          eba_oll_content_products cp
                                                    where pg.product_id = p.parent_product_id
                                                      and p.product_id = cp.product_id
                                                      and cp.content_id = c.content_id)))
            group by tag
           ) x where rownum < p_limit
                 and c >= p_min_nbr_tags
            order by upper(tag) ;
    begin
       -- Fetch tags into arrays
       open c_all_tags;
          loop
              fetch c_all_tags bulk collect into l_tags,l_cnts limit p_limit;
              exit;
          end loop;
       close c_all_tags;
       l_available_records := l_tags.count;
       -- Determine total count and maximum tag counts
       l_max := 0;
       l_min := 1000;
       FOR i in l_cnts.first..l_cnts.last loop
          l_total := l_total + l_cnts(i);
          if l_cnts(i) > l_max then
             l_max := l_cnts(i);
          end if;
          if l_cnts(i) < l_min then
             l_min := l_cnts(i);
          end if;
       end loop;
       if l_max = 0 then l_max := 1; end if;
       l_class_size := round((l_max-l_min)/6);
       -- Generate tag cloud --
       sys.htp.prn('<div class="tagCloud"><ul>');
       for i in l_tags.first..l_tags.last loop
           l_printed_records := l_printed_records + 1;
           if l_cnts(i) < l_min + l_class_size then
              l_class := 'size1';
           elsif l_cnts(i) < l_min + (l_class_size*2) then
              l_class := 'size2';
           elsif l_cnts(i) < l_min + (l_class_size*3) then
              l_class := 'size3';
           elsif l_cnts(i) < l_min + (l_class_size*4) then
              l_class := 'size4';
           elsif l_cnts(i) < l_min + (l_class_size*5) then
              l_class := 'size5';
           else l_class := 'size6';
           end if;     
           l_buffer := '<li><a class="'||l_class||'" href="'||
                  'f?p='||p_app_id||':'||p_link_to_page||':'||p_session_id||':::'||p_clear_cache||':'||
                  p_tag_item_filter||':'||htf.escape_sc(l_tags(i))||'">'||
                  htf.escape_sc(l_tags(i)) || '<span>' || l_cnts(i) || '</span></a></li>';
           sys.htp.prn(l_buffer);
           l_buffer := '';
           if  l_printed_records > p_max then
               exit;
           end if;
       end loop;
       sys.htp.prn('</ul></div>');
       -- print if there's more
       if l_tags.count - l_printed_records != 0 then
               htp.prn('<p><a href="f?p='||p_app_id||':'||htf.escape_sc(p_more_page)||
                     ':'||p_session_id||':::'||htf.escape_sc(p_more_page)||'">View all tags</a></p>');
       end if;
       exception when others then
          sys.htp.prn('<p>No tags found.</p>');
    end render_tag_cloud;
    procedure email_when_feedback (
       p_feedback_id  in  number,
       p_host_url     in  varchar2,
       p_app_id       in  number )
    is
       l_body       clob;
       l_body_html  clob;
    begin
    for c1 in (
       select f.feedback_comment, f.feedback_by,
              c.title, nvl(ct.feedback_contacts,'[email protected]') email
         from eba_oll_content_feedback f,
              eba_oll_content c,
              eba_oll_team ct
        where f.id = p_feedback_id
          and f.content_id = c.content_id
          and c.team_id = ct.team_id (+) )
    loop
       l_body := 'You have received feedback for a piece of content you own in the Oracle Learning Library (OLL) Application.
    Content: '|| c1.title || utl_tcp.crlf || '
    Feedback: '|| c1.feedback_comment || utl_tcp.crlf || '
    Left by: '|| lower(c1.feedback_by) ||'
    You can respond via the OLL Application, '||p_host_url||'f?p='||p_app_id||':47:::NO::P47_ID:' || p_feedback_id || '.';
       l_body_html := '<div style="border: 1px solid #DDD; background-color: #F8F8F8; width: 460px; margin: 0 auto; -moz-border-radius: 10px; -webkit-border-radius: 10px; padding: 20px;">
    <p style="font: bold 12px/16px Arial, sans-serif; margin: 0 0 10px 0; padding: 0;">
    You have received feedback for a piece of content you own in the Oracle Learning Library (OLL) Application.
    </p>
    <table style="width: 100%;" cellspacing="0" cellpadding="0" border="0">
    <tr>' || utl_tcp.crlf || '
    <td style="font: bold 12px/16px Arial, sans-serif; color: #666; padding: 0 10px 10px 0; vertical-align: top;">Content</td>
    <td style="font: normal 12px/16px Arial, sans-serif; padding: 0 10px 10px 0; vertical-align: top;"><a href="#" style="color: #000">'||c1.title||'</a></td>
    </tr>
    <tr>' || utl_tcp.crlf || '
    <td style="font: bold 12px/16px Arial, sans-serif; color: #666; padding: 0 10px 10px 0; vertical-align: top;">Feedback</td>
    <td style="font: normal 12px/16px Arial, sans-serif; padding: 0 10px 10px 0; vertical-align: top;">'||replace(c1.feedback_comment,CHR(10),'<br/>')||'</td>
    </tr>
    <tr>' || utl_tcp.crlf || '
    <td style="font: bold 12px/16px Arial, sans-serif; color: #666; padding: 0 10px 10px 0; vertical-align: top;">Left by</td>
    <td style="font: bold 12px/16px Arial, sans-serif; padding: 0 10px 10px 0; vertical-align: top;">'||lower(c1.feedback_by)||'</td>
    </tr>
    <tr>' || utl_tcp.crlf || '
    <td colspan="2" style="text-align: center; font: normal 12px/16px Arial, sans-serif; padding: 0 10px 10px 0; vertical-align: top;">
    <a href="'||p_host_url||'f?p='||p_app_id||':47:::NO::P47_ID:' || p_feedback_id ||'" style="display: block; padding: 10px; background-color: #EEE; font: bold 16px/16px Arial, sans-serif; color: #444">Respond to this Feedback</a>
    </td>
    </tr>
    </table>
    </div>';
       apex_mail.send (
          p_to        => c1.email,
          p_from      => '[email protected]',
          p_subj      => 'OLL - New Feedback for your team',
          p_body      => l_body,
          p_body_html => l_body_html );
    end loop;
    end email_when_feedback;
    procedure email_when_response (
       p_feedback_id  in  number,
       p_host_url     in  varchar2,
       p_app_id       in  number )
    is
       l_body       clob;
       l_body_html  clob;
    begin
    for c1 in (
       select f.feedback_comment, f.feedback_by, f.response, c.title
         from eba_oll_content_feedback f,
              eba_oll_content c
        where f.id = p_feedback_id
          and f.content_id = c.content_id )
    loop
       l_body := 'You have received a response to your feedback left in the Oracle Learning Library (OLL) Application.
    Content: '|| c1.title || '
    Feedback: '|| c1.feedback_comment || '
    Response: '|| c1.response || '
    You can also view this response via the OLL Application, '||p_host_url||'f?p='||p_app_id||':60:::NO::IR_ID:' || p_feedback_id || '.';
          l_body_html := '<div style="border: 1px solid #DDD; background-color: #F8F8F8; width: 460px; margin: 0 auto; -moz-border-radius: 10px; -webkit-border-radius: 10px; padding: 20px;">
    <p style="font: bold 12px/16px Arial, sans-serif; margin: 0 0 10px 0; padding: 0;">
    You have received a response to your feedback left in the Oracle Learning Library (OLL) Application.
    </p>
    <table style="width: 100%;" cellspacing="0" cellpadding="0" border="0">
    <tr>' || utl_tcp.crlf || '
    <td style="font: bold 12px/16px Arial, sans-serif; color: #666; padding: 0 10px 10px 0; vertical-align: top;">Content</td>
    <td style="font: normal 12px/16px Arial, sans-serif; padding: 0 10px 10px 0; vertical-align: top;"><a href="#" style="color: #000">'||c1.title||'</a></td>
    </tr>
    <tr>' || utl_tcp.crlf || '
    <td style="font: bold 12px/16px Arial, sans-serif; color: #666; padding: 0 10px 10px 0; vertical-align: top;">Feedback</td>
    <td style="font: normal 12px/16px Arial, sans-serif; padding: 0 10px 10px 0; vertical-align: top;">'||replace(c1.feedback_comment,CHR(10),'<br/>')||'</td>
    </tr>
    <tr>' || utl_tcp.crlf || '
    <td style="font: bold 12px/16px Arial, sans-serif; color: #666; padding: 0 10px 10px 0; vertical-align: top;">Response</td>
    <td style="font: bold 12px/16px Arial, sans-serif; padding: 0 10px 10px 0; vertical-align: top;">'||replace(c1.response,CHR(10),'<br/>')||'</td>
    </tr>
    <tr>' || utl_tcp.crlf || '
    <td colspan="2" style="text-align: center; font: normal 12px/16px Arial, sans-serif; padding: 0 10px 10px 0; vertical-align: top;">
    <a href="'||p_host_url||'f?p='||p_app_id||':60:::NO::IR_ID:' || p_feedback_id ||'" style="display: block; padding: 10px; background-color: #EEE; font: bold 16px/16px Arial, sans-serif; color: #444">View Response in OLL Application</a>
    </td>
    </tr>
    </table>
    </div>';
       apex_mail.send (
          p_to        => c1.feedback_by,
          p_from      => '[email protected]',
          p_subj      => 'Oracle Learning Library - Response to your Feedback',
          p_body      => l_body,
          p_body_html => l_body_html );
    end loop;
    end email_when_response;
    end eba_oll_api;
    /Error at line 274: PLS-00201: identifier 'UTL_TCP' must be declared
    Edited by: Fateh on Jan 13, 2012 7:32 AM

    Thanks & Sorry for not mentioning the full information about my environment.
    it was:
    Oracle 11g xe R2 on Windows 7 machine
    Apex listener deployed on Glass Fish server 3.1 on Windows 7 machine
    Apex 4.1
    Google Chrome
    So, to have OLL application worked locally . we need the following:
    grant execute on utl_tcp to [your_schema_name]And to
    Configure an Application Express Application as a Partner Application in Oracle AS Single Sign-On http://www.oracle.com/technetwork/testcontent/sso-partner-app-100552.html.
    I think I am going to install on my work space on apex.oracle.com.
    Regards,
    Fateh
    Edited by: Fateh on Jan 15, 2012 9:38 AM

Maybe you are looking for