SQL Formatter

I see that sqldeveloper users sqlformatter to format queries. I'd like to use this source code for a java stored stored procedure. Has anyone done this? are there any gotchas?

Thanks, we have some serious issues with the SQL formatter we need to resolve before we take it production. Keep the comments comming; they help.
Mike

Similar Messages

  • EA1 - SQL Formatter issues (JOINs and GROUPs and ORDER BY oh my ;)

    Great job with improving the SQL Formatter, but it still has some bugs that need to be worked out.
    The key words JOIN and it's modifiers INNER, LEFT, RIGHT and FULL OUTER are not recognized as master key words. As such they end up flush against the left margin Also when GROUP BY and/or ORDER BY key words are present in an outer most select statement the other key words are not indented far enough to be right aligned with the end of the word BY and are indented too far to be right aligned with the word GROUP or ORDER. In sub queries, GROUP and ORDER BY are correctly right aligned with their respective SELECT statements.

    We're picking up and collating the Formatter issues. I'll add these.
    Specific bug for these #7013462
    Sue

  • SQL Formatter - Export for sharing to team coding

    Hi,
    I try to export my SQL Formatter preferences to share it with my team coding.
    I didn't find anything about that. Even if there is no method to export it, can anyone tell me where are store these preferences.
    Thanks a lot.

    You can get them from +(user profile)\sqldeveloper\system1.5.3.57.83\o.sqldeveloper.11.1.1.57.83\product-preferences.xml+, but there's the other preferences too...
    Have fun,
    K.

  • Two things: more shortcuts + configurable SQL formatter

    Hi folks,
    thanks for the great tool!
    As you can read from the subject, I have to small recommendations for you:
    First: make keyboard navigation possible through the use of shortcuts. Simple things such as switching from tab to tab, should be possible to do whithout the hands leaving the keyboard.
    Second: The SQL Formatter (Ctrl+B) is a great tool, I miss from many other commercial editors!!! In order for it to be as useful as possible: please try to make it configurable. There is not THE one way of formatting PL/SQL the right way. You probably have some kind of pl/sql template. However, let the format be configurable. There are all kinds of different formatting habbits in developer teams. Let this wonderful please every one of them.
    Thanks again for the good job.

    Does anybody know, if my request of a configurable SQL formatter is planned for anytime?

  • SQL Formatter Settings not saved

    Every time I try and change the tab size on the formatter settings, it reverts to 2, no matter what value I use.
    How do I set the Home directory? I have changed the start in directory in my windows shortcut, but when i go to open files, it always starts at c:\oracle\raptor\jdev, and cant find a way to change that.

    Can you post a link to the article you are referring to?
    I assume you have tried using a nother USB sync cable to help rule out the possibility of a faulty one?  What about plugging the iPod into a different USB port on your Mac?
    It might help to remove any other USB devices you have connected to the Mac. Then reboot the Mac as well as your iPod by pressing and holding both the Select/Center and Menu buttons together long enough for the Apple logo to appear. Then try to resync.
    Could you provide the full text from the error messages you are referring to?
    Make sure you are running the latest version of iTunes (10.6.3).
    B-rock

  • Tiny 2.1 EA1 SQL Formatter Bug?

    Not really a big deal and probably nobody cares about it, but once you use a query prefixed with a WITH clause, all subsequent queries are indented.
    Here's a quick formatted example. I was expecting query 3 to not be indented.
    -- QUERY 1
    SELECT * FROM dual;
    -- QUERY 2
    WITH src AS
          SELECT * FROM dual
      SELECT * FROM src;
      -- QUERY 3
      SELECT * FROM dual;

    On a similar note, how should i expect subprocedures/user defined types be indented inside a stored procedure? I would expect them to look something like this:
    CREATE OR REPLACE
    PROCEDURE p1
      TYPE my_type
      IS
        TABLE OF PLS_INTEGER;
      PROCEDURE subp1
      AS
        PROCEDURE subsubp1
        AS
        BEGIN
          NULL;
        END subsubp1;
      BEGIN
        NULL;
      END subp1;
    BEGIN
      NULL;
    END p1;But subprocedures and types don't seem to be indented.
    CREATE OR REPLACE
    PROCEDURE p1 TYPE my_type
    IS
      TABLE OF PLS_INTEGER;
    PROCEDURE subp1
    AS
    PROCEDURE subsubp1
    AS
    BEGIN
      NULL;
    END subsubp1;
    BEGIN
      NULL;
    END subp1;
    BEGIN
      NULL;
    END p1;

  • Need sql query formatter

    Hi friends i have the arduous task of 100s of queries for helping developers spot few problems in them.
    Can someone suggest some tool for pretty format all the sqls so that the identification of the problems becomes easier.
    I have seen some online tools like instant sql formatter, but they are not useful for formatting 100s of queries at once.
    as i have all queries in a separate file each and would like to keep it that way only.
    Please suggest.
    Regds,
    Kunwar
    Edited by: Kunwar on May 26, 2011 7:16 PM

    @Serverprocess
    Can you tell me how to do it in TOAD. I am not getting which option is there for that purpose.

  • SQL Developer Formatter Clobbering PLSQL Loop Lables

    When I use the formatter in SQL Developer and I have Loop Labels like '<<outer_loop>>'. It formats them to '< < outer_loop > >' with spaces between the << and >> symbols. The procedures will not compile now and I have to manually fix these.
    Is there any work around?
    Other than that I love the formatter.
    Edited by: user550307 on Jul 3, 2012 10:48 PM

    Hi user550307,
    Bug already logged: Bug 10217694 - << SHOULD NOT HAVE SPACE AND SHOULD NOT ALIGN WITH EQUALS.
    There might be an option workaround.
    try:
    tools->preferences->database->sql formatter->Oracle Formatting->edit->whitespace->spaces around operators, use keep unchanged (if there are no existing spaces between the two <) or no spaces
    -Turloch
    SQLDeveloper forum

  • SQL Developer 2.1.1.64 - code template does not work in Windows Vista

    I have been trying to import a code template in SQL Developer 2.1.1.64 / Windows Vista using the following steps:
    1. Import template (xml) file using "Preferences > Database > SQL Formatter > Import..." option. Pressed "OK" button.
    2. Clicked on "Preferences > Database > SQL Formatter > Oracle Formatting".
    I expected to see the new profile under "Profile" drop-down-list-box, but it does not appear there.
    I tried putting the template (xml) file under various locations, including:
    (a) C:\Users\<user_name>\
    (b) C:\Users\<user_name>\AppData\Roaming\SQL Developer\
    Please let me know any suggestions that you may have.
    Thanks in advance.

    I got it to work. In step 1 that I mentioned, "OK" button should not be pressed; go to step 2 without pressing "OK" button.

  • How does "format SQL' work?

    Congratulations to the team!! Thanls for offering such a useful tool!
    I like "Snippet" a lot.
    I put the following into the window beloe "Enter SQL statement"
    select trim(
    substr (txt,
    instr (txt, ',', 1, level ) + 1,
    instr (txt, ',', 1, level+1) - instr (txt, ',', 1,
    level) -1 ))
    from (select ','||l_string||',' txt from dual)
    connect by level <=
    length(l_string)-length(replace(l_string,',',''))+1
    Then I right clicked the mouth, chose "format SQL" (ctrl+B), but didn't do any formatting?
    How shall we this function?

    We do have some outstanding bugs with the SQL formatter, which we are addressing and will be improved in the next drop of Raptor we make.
    However, I have tried the examples given, just cut and pasted them into the Worksheet and I am not seeing any truncation.
    In the first example, there will be little formatting, as these are all simple function calls. You will find the most evidence of formating on a single SQL statement or PL/SQL procedure.
    In this first release, the SQL formatter is limited, but it will be enhanced over time.
    However we are testing currently, to make sure the formatter, doesn't impact on the correctness of the code.
    Donal

  • 0897: Formatter doesn't work in package editor

    Just downloaded latest version.
    The SQL Formatter does nothing in the package editor, but works in the SQL worksheet.

    Thanks for the feedback.
    This issue has now been resolved

  • How can I format pl-sql code with my own settings

    Are there any tools for formatting pl-sql in SD 1.1 excepting Ctrl-B?
    How can I adopt Ctrl-B for my own needs?

    There are a couple of options you can tweak in Tools - Preferences - SQL Formatter.
    It's very basic at this time, but will be enhanced in future releases. You can vote to add weight and add comments on the SQL Developer Exchange, there are 3 or 4 requests already for this.
    K.

  • SQL Developer 3.0.03 table sql tab errors

    In SQL Developer 3.0.03 EA3, when you visit the SQL tab for a table the result is not formatted to be readable or usable fashion.
    The generated statements do not have terminating semi-colons or separating slashes, nor is there a line terminator after the end of each statement.
    For tables with column comments, all the comment statements are generated in a single line. This is very difficult to read.
    In order to make a usable or even readable script from this display, every statement has to be edited to add a statement terminator or separator and to start the next statement on a new line.
    The same request, against the same database, using SQL Developer 2.1 displays the expected results.
    Edited by: djhenderson on Jan 26, 2011 7:55 PM

    You should be able to tweak this in Preferences - Database - Unload/View DDL Options.
    Be sure to have the Options checked, along with Pretty Print and Terminator.
    For the format, tweak Preferences - Database - SQL Formatter - Oracle.
    Hope that helps,
    K.

  • Set indention / tab size in Oracle SQL Developer

    I've been poking around for an hour. Can't figure this out.
    Where, either on the app's UI or in the "product-preferences.xml" file, can I change SQL Developer's indention (tab) size to 3? My organization uses PowerBuilder, and when I copy+paste our PB SQL (which uses leading tabs) into Oracle SQL Developer, it looks like crap. It would really help if I could change the code editor to a tab size equivalent to three spaces.
    And no, we can’t use spaces. :-)
    Thanks!
    (maybe SQL Developer 2 could have a tab size field in “Preferences”)

    In 1.5.x, it's under Preferences - Database - SQL Formatter - Alignment and Indentation .
    However, at least in the current 1.5.3, a bug ignores the tab preferences completely, so you're stuck with the 2 spaces. If you can't wait until this gets fixed (with luck in the upcoming 1.5.4 or else maybe by 2.0), revert to an earlier version.
    Regards,
    K.

  • Copying SQL Script from Oracle SQL Developer into Excel with formatting

    I need to copy a SQL Script into Excel in order to develop some VBA code. Is there any nice way that I can copy SQL Script from Oracle SQL Developer into Excel and retain its formatting? I am a stickler for having legible, readable SQL and like to have all my columns lined up and aliases lined up. When we used to use SQL Navigator, the tab formatting seemed to copy and paste just fine. Now that we have migrated to Oracle SQL Developer, the formatting seems to get all messed up.
    And suggestions are greatly appreciated and Thanks in advance for your review and am hopeful for an answer.
    Thanks.
    PSULionRP

    I suppose you want a real tabulator instead of spaces. You can configure this in the preferences (SQL Formatter - Oracle). You have to apply it then to your existing code (e.g. CTRL-F7), but new code should get it right from the start.
    Hope that helps,
    K.

Maybe you are looking for

  • Afraid to install iTunes 10.5

    The last time I did a iTunes UPGRADE my audible.com AudioBooks stopped working and I had to contact tech support and get support on resolving the issue. I completely forgot the solution that I did as it was not on their website, and it even baffled t

  • Numbers document - could not be opened

    I have my family budget spreadsheet that I use daily. I only have one copy. I went to open today and it has come up with The document "xxx.numbers" could not be opened.  I can preview the document. I can see it as an attachement on my iphone and view

  • Mandatory Segments / Fields for Incoming Vendor Invoice for PO

    Hello,            I have a Requirement to develop an Inbound Interface for Incoming Vendor Invoice with Reference to a PO. If I have to build an IDoc using WE19 tool, what are the Minimum Mandatory Segments / Fields that I need to populate in order t

  • Cheque details for non-invoiced payments

    Hi All, My requirement is to list out all the Cheque details for non-invoiced payments. Is there any transaction to get the details???? Is there any standard program which will list all the cheque details for non-invoice payments. Thanks in advance,

  • Primary and standby init file (switchove/failover)

    I have created standby database, its working fine, and logs are copying and being applied. I have successfully opened standby database in read only mode. Now I want to perform switchover and failover, please check parameters in init file that I have