Syntax for href tag in out.println

Hi,
In the jsp, the table displays document number from the for loop in it.
I'm trying to put a hyperlink using href tag to the document number which is in the value "table.getString("VBELN")"
out.println(var + table.getString("VBELN"));
I do not know the correct syntax or any alternative to acheive the hyperlink for the document numbers displayed in the jsp. One that I tried is
out.println(var + "<a href="">" + table.getString("VBELN") + "</a>");
Appreciate your timely help.
Thanks.

Thanks Ashish.
I too had the same problem and so couldn't post my question properly and completely.
I've sent you an e-mail in reply.
I need to pass parameter and open the URL with the parameter and no toolbars.
Looking forward to your earliest possible reply. Thanks again.

Similar Messages

  • How to embed html tags in out.println

    Hi,
    i have the following code in a function in java which passes the JspWriter object
    out.println("<table>");
              out.println("<tr>");
              out.println("<td>User Id</td>");
              out.println("<td>Pack Purchased </td>");
              out.println("<td>Sms Used</td>");
              out.println("<td>Sms Left</td>");
              out.println("<td>New User</td>");
    out.println("</tr></table>");is what i'm doing rite? plz help.

    Hi,
    i' having a problem with the following code.
    the web page isnt displaying anything. its just a blank page. please help
    public void calculateUserDetails(JspWriter out) throws IOException
              out.println("<table border=1>");
              out.print("<tr><td>User Id</td>");
              out.print("<td>Pack Purchased </td><td>Sms Used</td>");
              out.print("<td>Sms Left</td><td>New User</td>");
              out.print("</tr>");
              Enumeration objEnumKeys = hashAllDetails.keys();
              while(objEnumKeys.hasMoreElements())
                 String strHashKey = (String)     objEnumKeys.nextElement();
                 UserDetails objUserDetails = (UserDetails) hashAllDetails.get(strHashKey);
                 intBasicPacksTotalCount += objUserDetails.CountBasicPacks;
                 intAdvancedPacksTotalCount += objUserDetails.CountAdvancedPacks;
                 int intCurrentUserSoldSmsCount = getSoldSmsCountToUser(objUserDetails);
                 intTotalSoldSmsCount = intTotalSoldSmsCount + intCurrentUserSoldSmsCount;
                 int intCurrentUserUtilizedSmsCount = intCurrentUserSoldSmsCount - objUserDetails.SmsBalance;
                 intTotalUtilizedSmsCount += intCurrentUserUtilizedSmsCount;
                 intActivePacksCount += getUserActiveSMSPacksCount(objUserDetails, intCurrentUserUtilizedSmsCount);           
                 int intTotalCountPackPurchased = packPurchased(objUserDetails);
                out.print("<tr><td>");
                out.print(objUserDetails.UserId);
                out.print("</td><td>Rs.");
                out.print(intTotalCountPackPurchased);
                out.print("</td><td>");
                out.print(intCurrentUserUtilizedSmsCount);
                out.print("</td><td>");
                out.print(objUserDetails.SmsBalance);
                out.print("</td>");
                boolean newFlag=NewUser(objUserDetails);
                if(newFlag==true)
                     out.print("<td>Yes</td></tr>");
                else
                     out.print("<td>No</td></tr>");
               }               //End while
               out.println("</table>");
         }     

  • OJ syntax for multi-table left outer join with MS Oracle Driver

    I have a multi-table left outer join that works fine in SQL Server ODBC Driver, Oracle ODBC driver 8.01.07.00, but not with Microsoft ODBC Driver for Oracle 2.573.7326.0
    SELECT * from { oj A LEFT OUTER JOIN B ON A.col1 = B.col1 LEFT OUTER JOIN C ON A.col1 = C.col1 }
    I noticed someone had a similar problem (the proposed solution doesn't work):
    http://www.justpbinfo.com/listarchive/msg02874.html
    Does anyone know how to get this working with the Microsoft ODBC Driver for Oracle? Or does it just not work?

    The Microsoft ODBC Driver for Oracle 2.573.7326.0 does perform the same 'fix up' with {oj} in Oracle 8i. The problem is that it doesn't work when joining more than two tables:
    This works:
    SELECT * from { oj A LEFT OUTER JOIN B ON A.col1 = B.col1}
    This doesn't work:
    SELECT * from { oj A LEFT OUTER JOIN B ON A.col1 = B.col1 LEFT OUTER JOIN C ON B.col1 = C.col1 }
    (The second query will work with the Oracle Oracle ODBC driver, with a bit of tweaking. But I haven't found a way to get it to work with the Microsoft ODBC Driver for Oracle 2.573.7326.0. My suspicion is that it just doesn't work.)
    Gavin

  • XML syntax for tags

    It has always been a habit of mine to use XML syntax for CF tags since I've been working with XHTML. For instance, I will do <cfset var myVar = "" /> However, I noticed when doing <cfdump var"#myvar#" />, the output is displayed twice. So now I am wondering if whenever I use a /> on something such as cfset, is the tag actually executing twice? How does this affect performance?
    I just happened to notice that in CFBuilder, when I do <cfargment name="myVar" required="true" type="string" default="" />, when I go to the next line and start typing <cfarg auto-suggest will select the cfargument tag, but this is only if I use a />. If I omit the ending forward-slash, auto-suggest does not work. That may be a setting specific to CFBuilder, but that wasn't the scope of this question.
    What syntax is correct and how does it affect performance?

    According to the document I've linked to below; using self-closing CF tags, such as <cfset myname="Bob" /> is permissible.  The document also notes exceptions to this such as CFIF and custom tags as examples where a self-closing tag shouldn't be used.
    http://livedocs.adobe.com/wtg/public/coding_standards/style.html
    Althoguh it doesn't look like it, that's an internal coding standard for one of Adobe's (well: it was Macromedia at the time) internal teams, and is not supposed to be a suggested standard for everyone.  I've had this same discussion with them, too.
    As Owainnorth (and many others) observe, it's completely doable.  My only challenge to it (and it's a challenge I state in an unduly heavy-handed fashion sometimes!) is the nonsensical rationales people use for doing it: making it more like XML, it's good if the CFML blends in better with the XHTML mark-up it's generating, it's tidier, etc.
    I hasten to add that Owainnorth's position that he finds it easier to read and assists with code navigation, whilst leaving me with a blank look on my face, is a completely reasonable basis for doing it.  I personally don't believe it, but there's no reason why that should bother him (and I'm sure it doesn't).
    I think it was reasonable of me to challenge his wording that it's easier to identify where CF code blocks are by looking at the closing slash rather than the tag name; but having explained himself better, I reckon it's not quite so much tosh as it originally sounded.  I mean: I still can't see it, but obviously he can, so fair enough.
    Adam

  • Can't run java apps with System.out.println on any builder.

    Hello,
    I'm currently using Vista RC2, which is the immediate problem.
    Classes with System.out.println won't launch the console window. As I'm a student and practicing on these steps, I do have quite a problem on my hands. I click on run, build succesfull, nothing happens.
    I have tried Netbeans and Jcreator, and gave up on trying different builds, as I reckon I'll have to find some other way to counter this; any way to get println messages working in vista?

    It is run as a desktop app, and other runs with commands such as JOptionPane do function, only the println windows don't appear at all. So I think JRE is installed and working.
    I did notice there was one command for input where I'd be able to enter it at the bottom of Netbeans.
    Like just now I clicked build and run for the following code
    import java.util.*;
    public class FirstProgram
        public static void main(String[] args)
            System.out.println("Hello out there.");
            System.out.println("I will add two numbers for you.");
            System.out.println("Enter two whole numbers on a line:");
            int n1, n2;
            Scanner keyboard = new Scanner(System.in);
            n1=keyboard.nextInt();
            n2=keyboard.nextInt();
            System.out.println("The sum of those two numbers is");
            System.out.println(n1+n2)
    }Resulting in a brief flash of "input" in the output window (which is below the coding window) and it dissapears. But this also occurs when I don't include system scanner code.
    Using commands in cmd
    java -jar "C:\Users\Alegis\Netb\MyApp\dist\MyApp.jar"
    Does not yield desired results either. Nothing happens.

  • Syntax to pass parameter value to jsp using href in out.println

    Hi,
    I have the URL in the form as mentioned below:
    <a href="b2c/marketing/showDocDetail.jsp"> <%=doc_no%></a>
    I've created the hyperlink using href tag to the document number in the jsp using the below syntax.
    <% String a1 = "Document ";
           String a2 = "<a href=\"";
           String a3 = "marketing/showDocDetail.jsp\">";
           String a4 = doc_no;
           String a5 = "</a>";
    out.println(a1a2a3a4a5);
    %>
    When clicked the doc_no is passed to backend RFC and export parameter is retrieved to result.jsp where values along with doc_no are displayed.
    the value after clicked is not being passed to action.java class that does the retreival.
    Needful, backend class, bom, entry in config.xml is all maintained.
    Please help me out with the syntax to pass the parameter value into java class

    Hi Bharathi,
    try below.
    <%
           String a1 = "Document ";
           String a2 = "<a href=\"";
           String a3 = "marketing/showDocDetail.do?docNo=";
           String a4 = doc_no;
           String a5 = " \">";
           String a6 = doc_no;
           String a7 = "</a>";
    out.println(a1+a2+a3+a4+a5+a6+a7);
    %>
    I assume doc_no is java variable contains value of document number
    Now create action entry in config.xml file. Suppose "actionDoc.java" class process it.
    <action path="/marketing/showDocDetail" type="com.xyz.actions.actionDoc">
                   <forward name="success" path="/marketing/showDocDetail.jsp"/>
                   <forward name="error" path="/marketing/showDocDetail.jsp"/>
    </action>
    We are passing parameter docNo=doc_no to action class actionDoc.java in this class you can retrieve request parameter docNo from request object and then process it as you want.
    Let me know if you face any problem or error.
    eCommerce Developer
    Edited by: Ecommerce Developer on Nov 9, 2009 8:35 AM

  • Oj syntax for outer join

    Is there a way to make Crystal Reports XI not generate the {oj .....   syntax for outer joins?
    In Crystal Reports 8, you could do a registry change to keep CR from using oj, but that doesn't seem to work on CR XI (or I don't know where to make the registry change)

A: oj syntax for outer join

Outer Join Escape Sequence builds the syntax for ODBC drivers using the outer join syntax in its SQL syntax.
Use Regedit on the problem client machine add following keys:
STEP 1........For Crystal Reports 9: HKEY_CURRENT_USER\Software\Crystal Decisions\9.0\Crystal Reports\Database\QueryBuilder\OuterJoinEscSeq
<<<OR>>>
...................For Crystal Reports 10:HKEY_CURRENT_USER\Software\Crystal Decisions\10.0\Crystal Reports\Database\QueryBuilder\OuterJoinEscSeq
STEP 2........"MSOuterJoinEscSeq"= "insert your ODBC driver name here": List of the drivers that support Microsoft ODBC {oj ..} join escape sequence.
"NoOuterJoinEscSeq"= "insert your ODBC driver name here": List of the drivers that do not support any join escape sequence.
For example...
MSOuterJoinEscSeq = "UVODBC"

Outer Join Escape Sequence builds the syntax for ODBC drivers using the outer join syntax in its SQL syntax.
Use Regedit on the problem client machine add following keys:
STEP 1........For Crystal Reports 9: HKEY_CURRENT_USER\Software\Crystal Decisions\9.0\Crystal Reports\Database\QueryBuilder\OuterJoinEscSeq
<<<OR>>>
...................For Crystal Reports 10:HKEY_CURRENT_USER\Software\Crystal Decisions\10.0\Crystal Reports\Database\QueryBuilder\OuterJoinEscSeq
STEP 2........"MSOuterJoinEscSeq"= "insert your ODBC driver name here": List of the drivers that support Microsoft ODBC {oj ..} join escape sequence.
"NoOuterJoinEscSeq"= "insert your ODBC driver name here": List of the drivers that do not support any join escape sequence.
For example...
MSOuterJoinEscSeq = "UVODBC"

  • Where does the logging happens for System.out.println

    Hello:
    I'm usingNetWeaver 2004sJava SP9 evaluation version. Added some System.out.println to the ejbs. Would like to know where to look for the logging details in this case.
    Thanks for your help,
    Ravi

    Hi,
      By default, if the setting has been done, then it appears in defaultTrace as mentioned. For configuration of it, refer to this link.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/db315878-0801-0010-928e-98c8283616d3
    Reward points if it helps.
    Regards,
    Vijai

  • System.out.println ....syntax error?

    Hi,
    I am workin on my first java program here...and althought my classes compile just fine I can't manage to get what I want to appear on the screen on Button action....
    Clicking on cost should trigger the appearance of the total cost...but nothing happens.
    Can you have a look and tell me where I went wrong please?
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    import java.util.*;
    public class Booking extends Applet implements ItemListener,ActionListener
    String[][] c = { {"French Language","250","130","70"}, {"Painting","270","140","70"}, {"Yoga","250","130","70"} };
    Courses courses_list = new Courses(c);
    Choice ChoiceCourse;
    Choice ChoicePeople;
    Checkbox cb1, cb2, cb3;
    boolean fulltime = false;
    boolean parttime = false;
    boolean concessions = false;
    Button b1;
    int c1;
    int p1;
    int price;
    public void init()
      add(new Label("Courses available for booking : "));
      ChoiceCourse = new Choice();
      add(ChoiceCourse);
    //the following populates the ChoiceCourse dropDown Menu with the Courses'Titles
      int i=0;
      while (i<c.length)
        ChoiceCourse.addItem(courses_list.getTitle(i));
        i++;
      ChoiceCourse.addItemListener(this);
      add(new Label("Number of participants for the course selected : "));
      ChoicePeople = new Choice();
      add(ChoicePeople);
    //the following populates the ChoicePeople dropDown Menu with "numbers" from 1 to 10
      int j=1;
      while (j<11)
        ChoicePeople.addItem(new Integer(j).toString());
        j++;
      ChoicePeople.addItemListener(this);
      cb1 = new Checkbox ("Full-Time");
      add(cb1);
      cb2 = new Checkbox ("Part-Time");
      add (cb2);
      cb3 = new Checkbox ("Concessions");
      add (cb3);
      b1 = new Button ("Cost");
      add (b1);
      b1.addActionListener(this);
      public void itemStateChanged(ItemEvent e)
       if (e.getSource() == ChoiceCourse)
         String c2 = (String) e.getItem();  // When ChoiceCourse is modified
         if (c2 == "French Language")
           int c1 = 0;
         if (c2 == "Painting")
           int c1 = 1;
         else
           int c1 = 2;
       if (e.getSource() == ChoicePeople)
         String p2 = (String) e.getItem();  // When ChoicePeople is modified
         int p1=Integer.parseInt(p2);       // converts the String into an integer
      public void actionPerformed(ActionEvent e)
        if ( e.getActionCommand() == "Cost" )
          fulltime = cb1.getState();
          parttime = cb2.getState();
          concessions = cb3.getState();
          if (fulltime == true)
            int price = 1;
          if (parttime == true)
            int price = 2;
          else
            int price = 3;
          int mode =  Integer.parseInt(c[c1][price]);  
          System.out.println("total cost of your selection is: �" + courses_list.getCost(p1,mode));
    }

    Thanks for the guidance and the explanations. I've improved my code according to your recommendations (1, 2 &3) and it compiles just fine.
    However, the println still doesn't work...but there is improvement:
    When I run my applet using the AppletViewer at the very end I get a log of what happened...and it's now showing:
    "D:\JBuilder8\jdk1.4\bin\appletviewer.exe Booking.html
    total cost of your selection is: �0"
    Which means that the println is being called but is not printing where it should be (on my screen)....the other problem is that it is obviously not properly calculating the total cost since it shouldn't be �0.
    Here is my new (improved) code, and below is the code for the Courses class (which does some of the calculation):
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    import java.util.*;
    public class Booking extends Applet implements ItemListener,ActionListener
    String[][] c = { {"French Language","250","130","70"}, {"Painting","270","140","70"}, {"Yoga","250","130","70"} };
    Courses courses_list = new Courses(c);
    Choice ChoiceCourse;
    Choice ChoicePeople;
    Checkbox cb1, cb2, cb3;
    boolean fulltime = false;
    boolean parttime = false;
    boolean concessions = false;
    Button b1;
    int c1;
    int p1;
    int price;
    public void init()
      add(new Label("Courses available for booking : "));
      ChoiceCourse = new Choice();
      add(ChoiceCourse);
    //the following populates the ChoiceCourse dropDown Menu with the Courses'Titles
      int i=0;
      while (i<c.length)
        ChoiceCourse.addItem(courses_list.getTitle(i));
        i++;
      ChoiceCourse.addItemListener(this);
      add(new Label("Number of participants for the course selected : "));
      ChoicePeople = new Choice();
      add(ChoicePeople);
    //the following populates the ChoicePeople dropDown Menu with "numbers" from 1 to 10
      int j=1;
      while (j<11)
        ChoicePeople.addItem(new Integer(j).toString());
        j++;
      ChoicePeople.addItemListener(this);
      cb1 = new Checkbox ("Full-Time");
      add(cb1);
      cb2 = new Checkbox ("Part-Time");
      add (cb2);
      cb3 = new Checkbox ("Concessions");
      add (cb3);
      b1 = new Button ("Cost");
      add (b1);
      b1.addActionListener(this);
      public void itemStateChanged(ItemEvent e)
       if (e.getSource().equals (ChoiceCourse)) //should this be == or .equals? it doesn't work either way but compiles
         String c2 = (String) e.getItem();  // When ChoiceCourse is modified
         if (c2.equals ("French Language"))
           c1 = 0;
         if (c2.equals ("Painting"))
           c1 = 1;
         else
           c1 = 2;
       if (e.getSource().equals (ChoicePeople)) //should this be == or .equals?it doesn't work either way but compiles
         String p2 = (String) e.getItem();  // When ChoicePeople is modified
         p1=Integer.parseInt(p2);       // converts the String into an integer
      public void actionPerformed(ActionEvent e)
        if ( e.getActionCommand().equals ("Cost") )
          fulltime = cb1.getState();
          parttime = cb2.getState();
          concessions = cb3.getState();
          if (fulltime)
            price = 1;
          if (parttime)
            price = 2;
          else
            price = 3;
          int mode =  Integer.parseInt(c[c1][price]);  
          System.out.println("total cost of your selection is: �" + courses_list.getCost(p1,mode));
    class Courses
    import java.util.*;
    public class Courses
    private String[][] Listing = new String[3][4]; //create array 3 rows * 4 columns
    Courses(String[][] c)
       this.Listing=c;
    int i;
    int j;
    int p;
    int price;
    int people;
    int cost;
    String t;
    String p1;
    String getTitle(int i)  //return Course Title
       t=Listing[0];
    return t;
    int getPrice(int i, int j) //return Price (Full-Time, Part-Time, Concessions)
    p1=Listing[i][j];
    p=Integer.parseInt(p1);
    return p;
    int getCost(int pe, int pp)
    pe=price;
    pp=people;
    cost=pe*pp;
    return cost;

  • [svn] 4184: Fix for @ see tag referencing a non-global package function generates an empty link@ href in DITA

    Revision: 4184
    Author: [email protected]
    Date: 2008-11-25 12:33:43 -0800 (Tue, 25 Nov 2008)
    Log Message:
    Fix for @see tag referencing a non-global package function generates an empty link@href in DITA
    Also now the deprecated should show up in the property and method summary table.
    and when @see results in an invalid href, an additional attribute called invalidHRef will be added to the dita file - this isn't picked up by xslt but will be consumed by FB.
    QE Notes: Some baselines may need to be updated due to new attribute for invalidHRef
    Doc Notes: None
    Bugs: SDK-18206
    tests: checkintests
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-18206
    Modified Paths:
    flex/sdk/trunk/asdoc/templates/asdoc-util.xslt
    flex/sdk/trunk/asdoc/templates/class-files.xslt
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/TopLevelClassesGenerator.ja va

    Update!
    v3.1 has a major bug! Even though it may appear to work properly, strange characters may leak onto the end of URLs, and you may even get segfaults. Sorry I didn't properly test it before releasing it!
    Technical details:
    I calloc()ed the memory for the link href improperly, per:
    link = calloc((noprepend ? 0 : urllen) + i - s, 1);
    Once I fixed it with "+ 1", per:
    link = calloc((noprepend ? 0 : urllen) + i - s + 1, 1);
    it worked great.
    I may use a method that doesn't use a calloc() in the future; this works for now, and I'm not gonna knock it...
    Last edited by dav7 (2009-01-23 12:38:51)

  • Why we use logger instead of System.out.println for debugging?

    Hi,
    why we use logger instead of System.out.println for debugging?
    Regard
    Sankar

    Ya Basha,
    good question....
    You can use the idoc method to transfer the data when you are having an interface between the sap system and the legacy system......
    All the times BDC is not preferable like take the case you developed on upload program with bdc after some days your company thought to go for upgrade the sap vesion from lower version to upper version... in that upgraded version the application may change like sequence of fields or screens at that time you previous bdc program will not work here so u have to develop a new program and and you have to take the things into consideration again...
    where as if you use bapi or idoc method it will support the upgradations...
    in the case of bdc you have to take the data into flat files.... and then upload it to sap system after all the validations done some times the data which is in the flat file is confidential so there is no security if u take such data in flat file any user can chang the data even though if u maintain the data in application server super user can change the data
    where is idoc is fully secured... you can easily establich the interface between the systems and once it is done you can transfer the data with full security because idoc r generated by a program... so there is no manual interaction.....
    I think i gave some useful answer to you
    ~~Guduri

  • Can't figure out the correct syntax for this select statement

    Hello,
    The following statement works great and gives the desired results:
    prompt
    prompt Using WITH t
    prompt
    with t as
       select a.proj_id,
              a.proj_start,
              a.proj_end,
              case when (
                         select min(a.proj_start)
                           from v b
                          where (a.proj_start  = b.proj_end)
                            and (a.proj_id    != b.proj_id)
                        is not null then 0 else 1
              end as flag
         from v a
        order by a.proj_start
    select proj_id,
           proj_start,
           proj_end,
           flag,
           -- the following select statement is what I am having a hard time
           -- "duplicating" without using the WITH clause
            select sum(t2.flag)
              from t t2
             where t2.proj_end <= t.proj_end
           ) s
      from t;As an academic exercise I wanted to rewrite the above statement without using the WITH clause, I tried this (among dozens of other tries - I've hit a mental block and can't figure it out):
    prompt
    prompt without with
    prompt
    select c.proj_id,
           c.proj_start,
           c.proj_end,
           c.flag,
           -- This is what I've tried as the equivalent statement but, it is
           -- syntactically incorrect.  What's the correct syntax for what this
           -- statement is intended ?
            select sum(t2.flag)
              from c t2
             where t2.proj_end <= c.proj_end
           ) as proj_grp
      from (
            select a.proj_id,
                   a.proj_start,
                   a.proj_end,
                   case when (
                              select min(a.proj_start)
                                from v b
                               where (a.proj_start  = b.proj_end)
                                 and (a.proj_id    != b.proj_id)
                             is not null then 0 else 1
                   end as flag
              from v a
             order by a.proj_start
           ) c;Thank you for helping, much appreciated.
    John.
    PS: The DDL for the table v used by the above statements is:
    drop table v;
    create table v (
    proj_id         number,
    proj_start      date,
    proj_end        date
    insert into v values
           ( 1, to_date('01-JAN-2005', 'dd-mon-yyyy'),
                to_date('02-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           ( 2, to_date('02-JAN-2005', 'dd-mon-yyyy'),
                to_date('03-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           ( 3, to_date('03-JAN-2005', 'dd-mon-yyyy'),
                to_date('04-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           ( 4, to_date('04-JAN-2005', 'dd-mon-yyyy'),
                to_date('05-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           ( 5, to_date('06-JAN-2005', 'dd-mon-yyyy'),
                to_date('07-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           ( 6, to_date('16-JAN-2005', 'dd-mon-yyyy'),
                to_date('17-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           ( 7, to_date('17-JAN-2005', 'dd-mon-yyyy'),
                to_date('18-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           ( 8, to_date('18-JAN-2005', 'dd-mon-yyyy'),
                to_date('19-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           ( 9, to_date('19-JAN-2005', 'dd-mon-yyyy'),
                to_date('20-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           (10, to_date('21-JAN-2005', 'dd-mon-yyyy'),
                to_date('22-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           (11, to_date('26-JAN-2005', 'dd-mon-yyyy'),
                to_date('27-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           (12, to_date('27-JAN-2005', 'dd-mon-yyyy'),
                to_date('28-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           (13, to_date('28-JAN-2005', 'dd-mon-yyyy'),
                to_date('29-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           (14, to_date('29-JAN-2005', 'dd-mon-yyyy'),
                to_date('30-JAN-2005', 'dd-mon-yyyy'));

    Hi, John,
    Not that you asked, but as you proabably know, analytic functions are much better at doing this kind of thing.
    You may be amazed (as I continually am) by how simple and efficient these queries can be.
    For example:
    WITH     got_grp          AS
         SELECT     proj_id, proj_start, proj_end
         ,     proj_end - SUM (proj_end - proj_start) OVER (ORDER BY  proj_start)     AS grp
         FROM     v
    SELECT       ROW_NUMBER () OVER (ORDER BY grp)     AS proj_grp
    ,       MIN (proj_start)                         AS proj_start
    ,       MAX (proj_end)               AS proj_end
    FROM       got_grp
    GROUP BY  grp
    ORDER BY  proj_start
    ;Produces the results you want:
      PROJ_GRP PROJ_START  PROJ_END
             1 01-Jan-2005 05-Jan-2005
             2 06-Jan-2005 07-Jan-2005
             3 16-Jan-2005 20-Jan-2005
             4 21-Jan-2005 22-Jan-2005
             5 26-Jan-2005 30-Jan-2005This is problem is an example of Neighbor-Defined Groups . You want to GROUP BY something that has 5 distinct values, to get the 5 rows above, but there's nothing in the table itself that tells you to which group each row belongs. The groups are not defined by any column in hte table, but by relationships between rows. In this case, a row is in the same group as its neighbor (the row immediatly before or after it when sorted by proj_start or proj_end) if proj_end of the earlier row is the same as proj_start of the later row. That is, there is nothing about 03-Jan-2005 that says the row with proj_id=2 is in the first group, or even that it is in the same group with its neighbor, the row with proj_id=3. Only the relation between those rows, the fact that the earlier row has end_date=03-Jan-2005 and the later row has start_date=03-Jan-2003, that says these neighbors belong to the same group.
    You're figuring out when a new group starts, and then counting how many groups have already started to see to which group each row belongs. That's a prefectly natural procedural way of approaching the problem. But SQL is not a procedural language, and sometimes another approach is much more efficient. In this case, as in many others, a Constant Difference defines the groups. The difference between proj_end (or proj_start, it doesn't matter in this case) and the total duratiojn of the rows up to that date determines a group. The actual value of that difference means nothing to you or anybody else, so I used ROW_NUMBER in the query above to map those distinct values into consecutive integers 1, 2, 3, ... which are a much simpler way to identify the groups.
    Note that the query above only requires one pass through the table, and only requires one sub-query. It does not need a WITH clause; you could easily make got_grp an in-line view.
    If you used analytic functions (LEAD or LAG) to compute flag, and then to compute proj_grp (COUNT or SUM), you would need two sub-queries, one for each analytic function, but you would still only need one pass through the table. Also, those sub-queries could be in-line views; yiou would not need to use a WITH clause.

  • Why doesn't System.out.println work for Palm?

    In my Java code,
    how come I don't see any output on my screen (Palm Vx) when I try this?
    System.out.println("Hello World");
    Where is the output really going to???

    Hi,
    On POSE (Palm OS emulator), the System.out.println() method output is a file called STDOUT.txt, filed in some directory of the emulator.
    On the eal device, I think theres no output for system.out.println().
    Ricardo

  • How to put tab for alignment using out.println?

    can anyone tell me how to put something like \t in out.println of JSP/

    out.println("<blockquote>your text</blockquote>");

  • How do I change Transfer Syntax for DICOM images using sample Java sources?

    Hi,
    I tested using Note:876534.1 Java API samples. It works fine when I put the "Implicit VR Little Endian" DICOM file.
    I could insert the DICOM file, also I could get the all DICOM tags correctly by SQL.
    But I could not get all DICOM tags when inserted "Explicit VR Little Endian" and "JPEG Lossy" DICOM file.
    Also I could not find how to change the Transfer Syntax to orddicom Java API.
    How do I change following simple java source for inserting different Transfer Syntax DICOM file?
    Connection conn = DriverManager.getConnection(args[0], args[1], args[2]);
    System.out.println("Got database connection");
    conn.setAutoCommit(false);
    Statement stmt = conn.createStatement();
    CallableStatement cs = null;
    cs = conn.prepareCall("begin ord_dicom.setDataModel(); end; ");
    cs.execute();
    cs.close();
    String rowInsertSQL = "insert into dicom_test (id, dcmobj) values (" + args[3] + ",ordsys.orddicom())";
    stmt.execute(rowInsertSQL);
    System.out.println("Inserted empty dicom object ...");
    String rowSelectSQL = "select dcmobj from dicom_test where id = " + args[3] + " for update";
    OracleResultSet rset = (OracleResultSet)stmt.executeQuery(rowSelectSQL);
    rset.next();
    OrdDicom dcmProxy = (OrdDicom)rset.getORAData("dcmobj", OrdDicom.getORADataFactory());
    rset.close();
    System.out.println("selected row for update...");
    File testFile = new File(args[4]);
    boolean success = dcmProxy.loadContent(testFile, true);
    dcmProxy.setProperties();
    if (success) {            
    String updateSQL = "update dicom_test set dcmobj=? where id=" + args[3];
    OraclePreparedStatement opstmt =
    (OraclePreparedStatement)conn.prepareStatement(updateSQL);
    opstmt.setORAData(1, dcmProxy);
    opstmt.execute();
    int contentLength = dcmProxy.getContentLength();
    String SOPInstanceUID = dcmProxy.getSOPInstanceUid();
    System.out.println("contentLength: " + contentLength);
    System.out.println("SOPInstanceUID: " + SOPInstanceUID);
    opstmt.close();
    Thanks,
    Tatsuya
    Edited by: user13490925 on 2011/01/31 1:48

    It would go like this
    1. TIFF + XML metadata => DICOM image file
    you can use the method ord_dicom.createDicomImage(src blob, metadata xmltype, dest blob) to create the DICOM image in a blob.
    2, then use the ORDDicom constructor ORDDIcom(data blob) to create an ORDDicom object
    3. then use the ORDDicom processCopy method to change the image properties.
    Alternatively you can change image properties on the input TIFF image (using ORDImage methods) then create the DICOM image. If you are happy with the image properties then you can skip step 3.
    Edited by: rabbott on Jun 22, 2009 12:41 PM

  • Maybe you are looking for

    • How to change default view in web plugin?

      Anyone know how to set a default view in the Reader plugin in Firefox and/or IE?  I'm getting sick of having to manually show the task bar and then un-toggle touch mode to get my scroll bar back every time I open a PDF. Thanks!

    • Electronic signature in about 100 documents at a single blow?

      In our company we are not using Acrobat yet (except the reader), but thinking of buying it as we need to implement electronic signature for future processes. Now I need to know if it is possible to sign a large amount of documents electronically in o

    • How to map the Categorization Reasons (SAP CRM) with Order Reason (SAP ECC)

      Hi Team . I have created a service order for a spare parts material  in CRM Web ui , order got saved successfully without errors and had  replicated  to ECC system. Issue : When the user is processing for billing, the system is asking for the order r

    • Is there a way to erase dates from photos?  Smart fill option?

      I had an old photo shop program that allowed me to circle the date or anything I wanted removed from the picture and it would smart fill with the background.  Does this Adobe Photoshop Elements 13 do the same?  If so, how?

    • Combining types in an object

      Hello all, I have a swing app that creates a text string. I want to combine a graphic (jpg used as a letterhead) with the generated text string into an object (?) that I can send to a printer for printing....I have been working on this for two days a