Commented Code

I have thousand of commented code in my procedure suppose I delete all commented code and remove all dbms_output statment will it Improve performance?
Pls reply
Umesh

Not saying comments is a bad thing in itself. But comments in a SQL (depending on the Oracle version) can wind up in the Shared Pool. It is also can prevent a SQL from being sharable.
This is what happens in 9i when you use comments in the SQL. It winds up in the Shared Pool:
SQL> create or replace procedure fooProc is
2 i integer;
3 begin
4 select
5 /* this is comment line 1
6 line2
7 and yet another comment
8 */
9 count(*) into i
10 from user_objects;
11 end;
12 /
Procedure created.
SQL> show errors
No errors.
SQL>
SQL> exec fooProc
PL/SQL procedure successfully completed.
SQL>
SQL> select sql_text from v$sqlarea
2 where sql_text like '%user_objects';
SQL_TEXT
SELECT /* this is comment line 1 line2 and yet another comment
*/ count(*) from user_objects
SQL>
The 10g parser is more clever than this and will strip out non CBO comment hints from the SQL (and remove whitespaces and formatting) in order to "clean" the SQL and making it more uniform and thus more likely sharable with the same SQL that has been formatted differently. Here's a 10g example:
[pre]
SQL> create or replace procedure fooProc is
2 i integer;
3 begin
4 select
5 /* this is comment line 1
6 line2
7 and yet another comment
8 */
9 count(*) into i
10 from user_objects;
11 end;
12 /
Procedure created.
SQL> show errors
No errors.
SQL>
SQL> exec fooProc
PL/SQL procedure successfully completed.
SQL>
SQL> select sql_text from v$sqlarea
2 where sql_text like '%USER_OBJECTS';
SQL_TEXT
SELECT COUNT(*) FROM USER_OBJECTS
SQL>
Note - all uppercase and no comments.
It was just simply good practice to rather comment before or after a SQL in the past. Not so much relevant anymore, but lots of people still are using 9i and should note this.

Similar Messages

  • ABAP Report : show commented code in output

    Hi,
    I have to display only commented code as the output.
    User will give the program (abap report) name and it should display only commented lines in that program.
    Is there any option or command or tcodes that can extract only selected text?
    Pls advise.

    Run the program below, i hope it suits ur requirement
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE lv_frttl.
      PARAMETERS: program LIKE sy-repid.
    SELECTION-SCREEN END OF BLOCK b1.
    DATA: gt_code(255)  TYPE c OCCURS 0,
          gv_code      LIKE LINE OF gt_code,
          gt_code2(255) TYPE c OCCURS 0,
          temp like gv_code.
    INITIALIZATION.
    sets the value for the title of the parameters block
      lv_frttl = 'Parameter'.
    START-OF-SELECTION.
      READ REPORT program INTO gt_code.
      LOOP AT gt_code INTO gv_code.
        if gv_code+0(1) eq '*'.
          write:/ gv_code.
        endif.
      endloop.
    Reward points if useful, get back in case of query...
    Cheers!!!

  • How to comment code?

    I know how to comment code but I was never really taught conventions for it. When should you comment something? What is the the standard way to comment a field? A method?
    Asking because this trig solver i was quarter way into got so out of hand I got lost in my own code and had to stop.
    As you can see no human being could possibly make anthing out of this without comments, as I was coding it I was fine. But when I woke up the next morning and started again I was lost.
    package trianglesolver;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.GroupLayout;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JMenu;
    import javax.swing.JMenuBar;
    import javax.swing.JMenuItem;
    import javax.swing.JPanel;
    import javax.swing.JTextField;
    public class Main {
        static boolean alreadyPressed = false;
        public static void main(String[] args) {
            JFrame mainFrame = new JFrame();
            mainFrame.setLocation(100, 100);
            mainFrame.setSize(480, 140);
            mainFrame.setTitle("Triangle Solver");
            mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            mainFrame.setResizable(false);
            JPanel mainPanel = new JPanel();
            mainFrame.add(mainPanel);
            GroupLayout grouplayout = new GroupLayout(mainPanel);
            grouplayout.setAutoCreateGaps(true);
            grouplayout.setAutoCreateContainerGaps(true);
            JMenuBar menuBar = new JMenuBar();
            JMenu file = new JMenu("File");
            menuBar.add(file);
            mainFrame.setJMenuBar(menuBar);
            JMenuItem exit = new JMenuItem("Exit");
            file.add(exit);
            mainFrame.setVisible(true);
            exit.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    System.exit(0);
            JLabel angleA_Label = new JLabel("Angle A");
            final JTextField angleA = new JTextField("0", 8);
            JLabel angleB_Label = new JLabel("Angle B");
            final JTextField angleB = new JTextField("0", 8);
            JLabel angleC_Label = new JLabel("Angle C");
            final JTextField angleC = new JTextField("0", 8);
            JLabel sideA_Label = new JLabel("Side A");
            final JTextField sideA = new JTextField("0", 8);
            JLabel sideB_Label = new JLabel("Side B");
            final JTextField sideB = new JTextField("0", 8);
            JLabel sideC_Label = new JLabel("Side C");
            final JTextField sideC = new JTextField("0", 8);
            JButton solve = new JButton("Solve");
            solve.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) throws NumberFormatException {
                    if (alreadyPressed == false) {
                        double A = Double.parseDouble(angleA.getText());
                        double B = Double.parseDouble(angleB.getText());
                        double C = Double.parseDouble(angleC.getText());
                        double a = Double.parseDouble(sideA.getText());
                        double b = Double.parseDouble(sideB.getText());
                        double c = Double.parseDouble(sideC.getText());
                        if (a != 0 & b != 0 & c != 0) {
                            A = Math.acos((Math.pow(a, 2) - Math.pow(b, 2) - Math.pow(c, 2)) / (-2 * b * c));
                            B = Math.asin((b * Math.sin(A)) / a);
                            angleA.setText(String.valueOf(Math.toDegrees(A)));
                            angleB.setText(String.valueOf(Math.toDegrees(B)));
                            angleC.setText(String.valueOf(180 - Math.toDegrees(A) - Math.toDegrees(B)));
                            angleA.setCaretPosition(0);
                            angleB.setCaretPosition(0);
                            angleC.setCaretPosition(0);
                        } else if (a != 0 & b != 0 & C != 0) {
                            c = Math.sqrt(Math.pow(a, 2) + Math.pow(b, 2) - 2 * a * b * Math.cos(Math.toRadians(C)));
                            B = Math.asin((b * Math.sin(Math.toRadians(C))) / c);
                            sideC.setText(String.valueOf(c));
                            angleB.setText(String.valueOf(String.valueOf(Math.toDegrees(B))));
                            angleA.setText(String.valueOf(180 - Double.valueOf(angleB.getText()) - Double.valueOf(angleC.getText())));
                            sideC.setCaretPosition(0);
                            angleB.setCaretPosition(0);
                            angleA.setCaretPosition(0);
                        } else if (b != 0 & c != 0 & A != 0) {
                            a = Math.sqrt(Math.pow(b, 2) + Math.pow(c, 2) - 2 * b * c * Math.cos(Math.toRadians(A)));
                            B = Math.asin((a * Math.sin(Math.toRadians(A))) / a);
                            sideA.setText(String.valueOf(a));
                            angleB.setText(String.valueOf(String.valueOf(Math.toDegrees(B))));
                            angleC.setText(String.valueOf(180 - Math.toDegrees(B) - Double.valueOf(angleA.getText())));
                            sideA.setCaretPosition(0);
                            angleB.setCaretPosition(0);
                            angleC.setCaretPosition(0);
                        } else if (a != 0 & c != 0 & B != 0) {
                            b = Math.sqrt(Math.pow(a, 2) + Math.pow(c, 2) - 2 * a * c * Math.cos(Math.toRadians(B)));
                            C = Math.asin((c * Math.sin(Math.toRadians(B))) / b);
                            sideB.setText(String.valueOf(b));
                            angleC.setText(String.valueOf(String.valueOf(Math.toDegrees(C))));
                            angleA.setText(String.valueOf(180 - Double.valueOf(angleB.getText()) - Math.toDegrees(C)));
                            sideB.setCaretPosition(0);
                            angleC.setCaretPosition(0);
                            angleA.setCaretPosition(0);
                        alreadyPressed = true;
            grouplayout.setHorizontalGroup(
                    grouplayout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(angleA_Label).addComponent(angleA).addComponent(angleB_Label).addComponent(angleB).addComponent(angleC_Label).addComponent(angleC).addComponent(sideA_Label).addComponent(sideA).addComponent(sideB_Label).addComponent(sideB).addComponent(sideC_Label).addComponent(sideC).addComponent(solve));
    }

    James wrote:
    I know how to comment code but I was never really taught conventions for it. When should you comment something? What is the the standard way to comment a field? A method? There really is no standard convention (if, by convention, you're referring to a set of rules used to determine when you should add a comment and when you should leave well enough alone). I try to document all public and protected methods, fields and constructors with JavaDoc documents. As for deciding when to add comments in other places my rule is this:
    If the code is not "self documenting", and there is some sort of ambiguity, then I'll write a very brief description of what is going on.
    If I am working on a large code base, and I make some sort of change, I will usually initial it, date it and provide a brief explanation of what I changed and why.
    Aside from that - I just kinda wing it. Commenting is really a personal preference - it has to do with your own comfort level and the comfort level of your coworkers. A lot of shops have a set of guidelines in place for when/how you should comment your code. And by that I mean they usually have a minimal, "these things must be documented" and leave the rest to your discretion.
    Asking because this trig solver i was quarter way into got so out of hand I got lost in my own code and had to stop.Looking at that tangled mess below, I'd say it's because you're code is a jumbled heap of grossness.
    >
    As you can see no human being could possibly make anthing out of this without comments,So rewrite it in a way that makes sense to someone. The pieces that can't be refactored for clarity will merit a brief comment or two.
    as I was coding it I was fine. But when I woke up the next morning and started again I was lost.A good sign that you should have written your code more neatly and clearly.
    grouplayout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(angleA_Label).addComponent(angleA).addComponent(angleB_Label).addComponent(angleB).addComponent(angleC_Label).addComponent(angleC).addComponent(sideA_Label).addComponent(sideA).addComponent(sideB_Label).addComponent(sideB).addComponent(sideC_Label).addComponent(sideC).addComponent(solve));
    Lines like that gem make me weep.

  • Exception number line pointing to commented code

    Hi
    Im facing a strange problem. In travel management project application, on click of one of the buttons, it throws a null pointer exception.
    In the exception details, it gives me a .java file with the name of the method and line number.
    when I go to that .java file in webdynpro and find the method and the line number, it is actually a commented code.
    Whats wrong? how can I find where exactly the problem is?
    thanks
    manoj

    Hi Sumit
    I have deployed it a couple of times, but the problem persists.
    Any thoughts, suggestions?
    Thanks
    Manoj

  • Auto-Removal of .lib reference comment code?

    [Pls keep in mind that English is not my native language - German is.]
    Hello there,
    from working with Golive we are used that .lib references are being removed from the source code automatically when the page is being uploaded via FTP.
    Now with DW it is no longer the case. We can only upload it with the .lib references in the code or have to go through the hassle as to export the whole site completely elsewhere with the markup removal AND THEN upload it in cleared code.
    As we have way to many web projects that extra step would practically kill our workflow and make it extremely fragile.
    And yes, we do want the code removal. Appearently for most it seems not to be so important - for us it was the reason to stay with an almost antique version of Golive for an extremly long time.
    This is discussion is not intended to discuss you may or may not find it neccessary to have that function, but whether it is possible to have the comment removal directly when uploading. Does CS5 do that? Why is it only possible with an extra export of the site in another local version?
    As for us - we are also working with a subversion server, which also ensures us to actually have the original coded version with all the references simultanuesly.

    DW does have the ability to strip comments out of the source code.
    e.g. http://forums.adobe.com/message/1032675
    That thread is pretty much unrelated to this question though.  You can create a Regular expression to strip all comments from the code, or to only strip the Library item comments from the code.  But this must be done manually on each page.  That's hardly a useful tool in this instance.
    DW has no ability to strip anything from the code at the moment that a page is uploaded.  You can certainly suggest this to the dev team as a potential feature for future versions, however -
    http://www.adobe.com/cfusion/mmform/index.cfm?name=wishform

  • JSF Rendering Commented code

    Am trying to debug an AssertionFailureException so I thought I'd reduce the components on my form - see section of JSP below
    When I deploy & test the items are still displayed -- surely this can't be correct
    When can we expect a fix
    <h:panel_data id="passportTblData" var="passport" valueRef="employee.passportList">
    <h:input_text id="passportId" valueRef="passport.passportNumber" readonly="true"/>
    <!-- <h:input_date id="passportIssueDate" valueRef="passport.passportIssueDate" readonly="true"/>     -->
    <!-- <h:input_text id="passportIssueLocation" valueRef="passport.issueLocation" readonly="true"/>     -->
    <!-- <h:input_date id="passportExpires" valueRef="passport.passportExpiryDate" readonly="true"/>     -->
    <!-- <h:input_text id="passportBirthPlace" valueRef="passport.birthPlace" readonly="true"/>     -->
              </h:panel_data>
    The more I learn about JSF - the less I'm impressed by it

    Hi Stefan,
    You're using HTML comment syntax where you need scriptlet comments. Try this:
    <%-- <h:input_date id="passportIssueDate" valueRef="passport.passportIssueDate" readonly="true"/> --%>
    ...HTML comments prevent the browser from rendering a portion of the page, but you're trying to prevent tag interpretation, which is done on the server side during JSP code generation.
    Jonathan

  • Weird boxes in code view from Dreamweaver 8 to Dreamweaver MX

    I have Dreamweaver 8 and my coworker has Dreamweaver MX. I
    have an XML document save from Dreamweaver 8. When the document is
    opened in Dreamweaver MX, there are alot of little boxes thrown in
    throughout the code. For example commented code has a box after
    each letter and each new line of code has a box at the start.
    Here's an example of what I mean. (I will use "O " instead of
    a box, because I don't know how to insert a box)
    Dreamweaver 8:
    <!-- Hello this is my code-->
    Dreamweaver MX:
    O<O!O-O-OHOeOlOloO OtOhOiOsO OiOsO OmOyO OcOoOdOeO
    O-O-O>
    As you can see this make the code virtually unreadable.
    Does anyone know a way around this issue?
    Thanks

    I figured it out myself. For anyone else that encounters this
    problem the solution is to. Open the document in WordPad and then
    save it as a "text document". Then reopen it in Dreamweaver MX and
    the little boxes are gone.

  • What is the proper way to code a "wrapper" class?

    Basically I want to replace an existing Action with a custom Action, but I want the custom Action to be able to invoke the existing Action.
    The following code works fine. I can create a custom Action using the existing action and the text on the button "paste-from-clipboard" is taken from the existing Action. So everything works great as long as the existing Action extends from AbstractAction.
    However the Action interface does not support the getKeys() method which I used to copy the key/value information from the existing action to the wrapped action. So if you try to create a button from some class that strictly implements the Action interface the key/value data in the wrapped Action will be empy and no text will appear on the button.
    So as the solution I thought I would need to override all the methods in the wrapped Action class to invoke the methods from the originalAction object. That is why all the commented code in the class is there. But then the protected methods cause a problem as the class won't compile.
    Do I just not worry about overriding those two methods? Is this a general rule when creating wrapper classes, you ignore the protected methods?
    import java.awt.*;
    import java.awt.event.*;
    import java.beans.*;
    import javax.swing.*;
    import javax.swing.text.*;
    public class WrappedAction extends AbstractAction
         private Action originalAction;
         public WrappedAction(JComponent component, KeyStroke keyStroke)
              Object key = getKeyForActionMap(component, keyStroke);
              if (key == null)
                   String message = "no input mapping for KeyStroke: " + keyStroke;
                   throw new IllegalArgumentException(message);
              originalAction = component.getActionMap().get(key);
              if (originalAction == null)
                   String message = "no Action for action key: " + key;
                   throw new IllegalArgumentException(message);
              //  Replace the existing Action with this class
              component.getActionMap().put(key, this);
              //  Copy key/value pairs to
              if (originalAction instanceof AbstractAction)
                   AbstractAction action = (AbstractAction)originalAction;
                   Object[] actionKeys = action.getKeys();
                   for (int i = 0; i < actionKeys.length; i++)
                        String actionKey = actionKeys.toString();
                        putValue(actionKey, action.getValue(actionKey));
         private Object getKeyForActionMap(JComponent component, KeyStroke keyStroke)
              for (int i = 0; i < 3; i++)
              InputMap inputMap = component.getInputMap(i);
              if (inputMap != null)
                        Object key = inputMap.get(keyStroke);
                        if (key != null)
                             return key;
              return null;
         public void invokeOriginalAction(ActionEvent e)
              originalAction.actionPerformed(e);
         public void actionPerformed(ActionEvent e)
              System.out.println("custom code here");
              invokeOriginalAction(e);
         public void addPropertyChangeListener(PropertyChangeListener listener)
              originalAction.addPropertyChangeListener(listener);
         protected Object clone()
              originalAction.clone();
         protected void firePropertyChange(String propertyName, Object oldValue, Object newValue)
              originalAction.firePropertyChange(propertyName, oldValue, newValue);
         public Object[] getKeys()
              return originalAction.getKeys();
         public PropertyChangeListener[] getPropertyChangeListeners()
              return originalAction.getPropertyChangeListeners();
         public Object getValue(String key)
              return originalAction.getValue(key);
         public boolean isEnabled()
              return originalAction.isEnabled();
         public void putValue(String key, Object newValue)
              originalAction.putValue(key, newValue);
         public void removePropertyChangeListener(PropertyChangeListener listener)
              originalAction.removePropertyChangeListener(listener);
         public void setEnabled(boolean newValue)
              originalAction.setEnabled(newValue);
         public static void main(String[] args)
              JTextArea textArea = new JTextArea(5, 30);
              JFrame frame = new JFrame("Wrapped Action");
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.add(new JScrollPane(textArea), BorderLayout.NORTH);
              frame.add(new JButton(new WrappedAction(textArea, KeyStroke.getKeyStroke("control V"))));
              frame.pack();
              frame.setLocationRelativeTo( null );
              frame.setVisible( true );

    I can't get the PropertyChangeListener to fire with any source. Here is my test code. Note I am able to add the PropertyChangeListener to the "Paste Action", but I get no output when I add it to the WrappedAction. I must be missing something basic.
    import java.awt.*;
    import java.awt.event.*;
    import java.beans.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.text.*;
    public class WrappedAction3 implements Action, PropertyChangeListener
         private Action originalAction;
         private SwingPropertyChangeSupport changeSupport;
          *  Replace the default Action for the given KeyStroke with a custom Action
         public WrappedAction3(JComponent component, KeyStroke keyStroke)
              Object actionKey = getKeyForActionMap(component, keyStroke);
              if (actionKey == null)
                   String message = "no input mapping for KeyStroke: " + keyStroke;
                   throw new IllegalArgumentException(message);
              originalAction = component.getActionMap().get(actionKey);
              if (originalAction == null)
                   String message = "no Action for action key: " + actionKey;
                   throw new IllegalArgumentException(message);
              //  Replace the existing Action with this class
              component.getActionMap().put(actionKey, this);
              changeSupport = new SwingPropertyChangeSupport(this);
            originalAction.addPropertyChangeListener(this);
            addPropertyChangeListener(this);
          *  Search the 3 InputMaps to find the KeyStroke binding
         private Object getKeyForActionMap(JComponent component, KeyStroke keyStroke)
              for (int i = 0; i < 3; i++)
                  InputMap inputMap = component.getInputMap(i);
                  if (inputMap != null)
                        Object key = inputMap.get(keyStroke);
                        if (key != null)
                             return key;
              return null;
         public void invokeOriginalAction(ActionEvent e)
              originalAction.actionPerformed(e);
         public void actionPerformed(ActionEvent e)
              System.out.println("actionPerformed");
    //  Delegate the Action interface methods to the original Action
         public Object getValue(String key)
              return originalAction.getValue(key);
         public boolean isEnabled()
              return originalAction.isEnabled();
         public void putValue(String key, Object newValue)
              originalAction.putValue(key, newValue);
         public void setEnabled(boolean newValue)
              originalAction.setEnabled(newValue);
         public void xxxaddPropertyChangeListener(PropertyChangeListener listener)
              originalAction.addPropertyChangeListener(listener);
         public void xxxremovePropertyChangeListener(PropertyChangeListener listener)
              originalAction.removePropertyChangeListener(listener);
         public void addPropertyChangeListener(PropertyChangeListener listener)
            changeSupport.addPropertyChangeListener(listener);
        public void removePropertyChangeListener(PropertyChangeListener listener)
            changeSupport.removePropertyChangeListener(listener);
         public void propertyChange(PropertyChangeEvent evt)
             changeSupport.firePropertyChange(evt.getPropertyName(), evt.getOldValue(), evt.getNewValue());
         public static void main(String[] args)
              JTable table = new JTable(15, 5);
              WrappedAction3 action = new WrappedAction3(table, KeyStroke.getKeyStroke("TAB"));
              action.addPropertyChangeListener( new PropertyChangeListener()
                   public void propertyChange(PropertyChangeEvent e)
                        System.out.println(e.getSource().getClass());
              action.putValue(Action.NAME, "name changed");
              Action paste = new DefaultEditorKit.PasteAction();
              paste.addPropertyChangeListener( new PropertyChangeListener()
                   public void propertyChange(PropertyChangeEvent e)
                        System.out.println(e.getSource().getClass());
              paste.putValue(Action.NAME, "name changed");
    }

  • Does CS5 enable the history panel in code view?

    I saw an old thread from last year (http://forums.adobe.com/message/1038491#1038491) where people confirmed that the history panel is only enabled in "design view", and is disabled in "code view". I'm wondering whether that feature has been changed in CS5. Does anybody know?
    The reason I'm wondering is I'm trying to create keyboard shortcuts to quickly comment code (either /* */, or //) and remove comments. I know there's a button available on the toolbar that will add a /* */ comment, so getting a keyboard shortcut for that isn't such a big deal, but I'd really like a way to remove comments that's faster than right-clicking on a text selection to bring up the context menu, go down to "Selection >", and click on "Remove Comment". From what I've read, it seems like the best way to make a keyboard shortcut for that would be to select some text and do "Remove Comment" through the context menu, then create a macro/command using the history panel, and finally assign a keyboard shortcut to that command. However, this doesn't seem possible since for me the history panel is disabled when I'm in code view (in Dreamweaver 8).
    If anyone has a better solution to my real question, of how to create a keyboard shortcut to remove comments from code, I'd be very grateful to hear it!

    Wow, I didn't even realize that button to remove coding was there. I was looking at the /* */ button on the PHP tab of the Insert toolbar, and trying to find another button there that would remove comments, and didn't realize there already was one on the coding toolbar. That's perfect, thanks a lot! And thank you also for the info on the CS5 history panel.

  • How to uncomment code in Standard SAP Programs

    Hi Experts,
    how to uncomment entire code  of standard SAP programs  which is commented .
    Standard SAP Program is fully commented,i have to uncomment it ,to work it as normal.
    i saw that some lines * / * like  this are there in the commented code .
    what is the way to un comment this ?
    Thanks in advance,
    Regards,
    Hitu

    Well, if it is commented by your company - This doesnt ask for access key but if it is commented by SAP and you want to uncomment, you need access key.
    You can ask basis guys to get access key for the object. you need to provide the program name and other information.
    Other information: - go to the GOTO on application tool bar and select object direct entry.... you need to provide the full object key.
    To uncomment the code - select the lines and right click - uncomment . This can only be done in editable mode.

  • BUG in Oracle SQL Developer 3.0.04 on the "generating DLL" with comments?

    I'm newbie on oracle, but I think that I found out a bug in Oracle SQL Developer version 3.0.04 on the "generating DLL" tool using "comments".
    I will describe the steps that I gave:
    I created a view, but after I test it I had to change my “where” condition, so I comment the old code and then I wrote the new “where” condition below. After I done that I tried to look at the sql code of my view using “generating DLL” tool, but oracle sql developer only shown me half of the code, a lot of code were missing. Then I began with some test trying to understand what happen and I notice that if I put an invalid sql code in my comment the generating DLL start working with no problems, for example(pseudo-code):
    (COMMENT WITH VALID SQL CODE the "Generating SQL" don't work:)
    CREATE OR REPLACE VIEW <user>.<view_name> ( <column1>,<column2> )
    AS
    SELECT column1, column2
    FROM table1
    INNER JOIN
    (SELECT
    FROM table2
    INNER JOIN .....
    INNER JOIN ....
    --where time_stamp = (select max(time_stamp) from .....)
    WHERE time_stamp >= TRUNC(sysdate)
    ) t1 ON t1.ID = ....
    AND ..... >= TRUNC(sysdate)
    ORDER BY ....
    Generating DLL returns this(when the error occurs):
    CREATE OR REPLACE VIEW <user>.<view_name> ( <column1>,<column2> )
    AS
    (COMMENT WITH VALID SQL CODE the "Generating SQL" work with no problems:)
    CREATE OR REPLACE VIEW <user>.<view_name> ( <column1>,<column2> )
    AS
    SELECT column1, column2
    FROM table1
    INNER JOIN
    (SELECT
    FROM table2
    INNER JOIN .....
    INNER JOIN ....
    --where
    WHERE time_stamp >= TRUNC(sysdate)
    ) t1 ON t1.ID = ....
    AND ..... >= TRUNC(sysdate)
    ORDER BY ....
    I believe that "Generating DLL" tool have some problem with the comments, I also used /*...*/ to comment but the problem is still active.
    I notice as well that if I started to add some more comments along the code, the conditions migth change, so I think the problem is related with "comments" code.
    Would you mind telling me if this is a real bug or if I'm doing anything wrong.
    Thank you in advance,
    Rodrigo Campos
    Edited by: 894886 on 3/Nov/2011 5:29

    Hi Rodrigo,
    Thank you for reporting this. The only bug I see currently logged on a comment affecting the generated View DDL involves ending the last line of the definition with a comment, which treats the ending semi-colon (even if on a different line) as part of the comment. That is actually related to a low-priority bug against an Oracle database API.
    Unfortunately, your pseudo-code is a bit complex. Trying a few quick, simpler tests against the standard HR schema did not reproduce the issue. I tried INNER JOIN, and nested SELECTs. It would help greatly if you could provide a test case compilable against one of the standard schema, like HR or SCOTT.
    Regards,
    Gary
    SQL Developer Team

  • RegEx Problem with flag COMMENTS

    Hello,
    I have the following Exception:
    java.util.regex.PatternSyntaxException: Unclosed group near index 9
    when my program is running with this flags:
    Pattern patt = Pattern.compile("^(@#@.+)$", Pattern.MULTILINE | Pattern.COMMENTS);but when I run this:
    Pattern patt = Pattern.compile("^(@#@.+)$", Pattern.MULTILINE);it works fine.
    Any COMMENTS ;-) for this problem? The entire RegEx is much bigger. I want to comment it.
    Thanks sacrofano

    Hi,
    thanks for your help, but it did not work.I did not suggest anything that would work! I was trying to point out that the Javadoc says that everything from # to the end of the pattern is treated as comment.
    I run this
    Pattern patt =
    Pattern.compile("^(?:(@#@.+))$",(Pattern.COMMENTS));[/
    code]So why, based on reading the Javadoc, would you expect this RE to compile? Everything after the # is treated as comment so your effective regular expression is "^(?:(@" which is obviously an invalid RE!
    with same exception as above.
    Is there a problem with the Flag Pattern.COMMENTSNo! RTFD.

  • How to remove comments in packages in oracle

    hi gurus,
    can any body help me to remove commented code in packages in oracle?
    thanks in advance...

    The obvious suggestion would be to edit the package (or package body) in whatever editor you prefer and recompile. I'm assuming you know that, however, since you managed to create the package in the first place. If that's not what you're looking for, can you explain a bit more what you're asking?
    Justin

  • JSP comments

    hi ,
              We have around 150 JSPs in our web application.
              Lot of commenting code has gone inside these JSPs.
              Though it is essential for maintenance purpose that we preserve the comments, it has been found that the comments appear on client side if client sees the HTML - View Source.
              It is not a good idea to show the client the comments which divulge un-necessary details.
              Can someone throw some light on how to prevent this?
              Also suggest some ideas to reduce the final HTML o/p page size for faster loading.

    hi ,
              I guess you are using the html comments in your JSPs, which obviously go to client side and are a part of page size.
              I will recommend use of JSP comments instead which can solve the issue of security and also the reduction of page size automatically.
              Well, other methods for size reduction may be removing formatting characters. I am not sure whether it helps.
              Can you try using zip streams? just a wild guess..

  • Surround With Try/Catch : comments issue

    hi
    Please consider this code:
         public static void main(String[] pArguments)
              FileInputStream vFileInputStream = new FileInputStream("someFile.txt");
              // some comments, e.g. several lines of commented code (that might be uncommented later)
         }It is possible to have JDeveloper "Surround With Try/Catch" this, but that results in this code:
         public static void main(String[] pArguments)
              FileInputStream vFileInputStream;
              // some comments, e.g. several lines of commented code (that might be uncommented later)
              try
                   vFileInputStream = new FileInputStream("someFile.txt");
              catch (FileNotFoundException e)
                   // TODO
         }Note that the declaration is before the comments and the try block starts after the comments.
    Is this intentional behaviour? I would prefer to leave the comments where they are, after the (modified) code.
    many thanks
    Jan Vervecken

    Thanks for your reply John.
    I tried the right-click "Surround With..." > "try-catch" approach you suggest, and I get this code:
         public static void main(String[] pArguments)
              try
                   FileInputStream vFileInputStream = new FileInputStream("someFile.txt");
              catch (FileNotFoundException e)
              // some comments, e.g. several lines of commented code (that might be uncommented later)
    }Indeed, the try-block starts before the comments.
    There is another difference with this approach, the declaration is not separated from the assignment.
    Next ... I'll try to remember which approach give which result. :)
    regards
    Jan

Maybe you are looking for

  • ITunes 5 (Quicktime 7.0.2) problem with Archicad

    Apparently Quicktime 7.0.2 is incompatible with Archicad (both R8.0 and R9.0). After installing iTunes 5, archicad starts to crash. When uninstall Quicktime 7.0.2 and install a previous version (6.5.2) Archicad works fine. Then iTunes5 can´t start. I

  • [SOLVED] KEYMAP - umlauts issue

    Hi there! I've just reinstalled Archlinux and the keyboard layout is giving me some troubles. I'd like to use the Swiss-German layout. My vconsole.conf KEYMAP=de_CH-latin1 FONT=Lat2-Terminus16 The main problem are the umlauts / special characters. Th

  • A general error has occurred. [nQSError: 27002] Near local : Syntax error

    Hi I am using oracle BI Dashboard. i had configured my physical , business and presentation layers. when i click on the answers in the dashboard it also show me my new create presentation layer. even i can directly query my database using OBI but whe

  • CMR JDEV9032 TABLE VIEW NOT FOUND

    Hello, I'm breaking my head on the following: I created two entity beans (A and B). Both are CMP EJB's. In EJB terms : A has the field (id, name), B also. In the deployment descriptor I set a CMR relationship from A to many B's. This is just like the

  • Drop Frame Timeline with 59.94 Editing Timebase

    I'm working with DVCPRO HD footage for broadcast television. My Editing Timebase is 59.94 and under the Timeline Options tab the checkbox to select a Drop Frame timeline is grayed out. I have a sequence that needs to be EXACTLY 22 minutes in running