I work on two projects with a lot of PL/SQL code since few months.
However, I didn't find any really interesting tools to develop on this langage.
For the moment, my configuration includes the following tools:
Eclipse (the rest of the application is developed in Java), with PL/SQL Editor plugin
As I really don't like and trust the PL/SQL Editor plugin for Eclipse, I use mainly PsPad for editing my PL/SQL files.
SQL Developer (I have also TOAD, but I don't really know/like this tool).
So what is your "perfect" toolbox for developing PL/SQL applications?
I've also read that SQL Developer 2.1 introduces a PL/SQL unit testing feature. Does anybody has a feedback about this feature and this version of SQL Developer (I still use 1.5) ?
Being an old-fashioned sort of chap I still mainly get along with SQL*Plus and the TextPad IDE. TextPad is nagware, but the licence is cheap and the tool has some fantastic features. Also people have written PLSQL syntax libraries for it, which give you keyword highlighting. It is also possible to hook TextPad into other desktop tools such as Subversion.
SQL^Developer is written in java, which means it is a voracious consumer of memory. Still there is undoubted merit in having a data browser. Also the upcoming version 2.1 features built-in unit test, which could be very tasty.
Useful utilities:
pldoc :: generate Javadoc-style
documentation from the comments in
your package spec
utplplsql :: unit test harness;
old but it still works
QUTO :: another, more
sophisticated unit test harness
(which I don't use for the same
reason I'm still hacking with
SQL*Plus and TextPad)
QGCU :: PL/SQL code generator
(previously QNXO)
In defence of Luddism
The danger with tools like TOAD and SQL*Developer is that they allow us to execute DML and DDL directly against the database, including editing PL/SQL source. This is fine and dandy and awfully in the spirit of Getting Things Done. Until we need to revert our changes. Or the production DBA demands a script....
Of course it is possible to use TOAD or SQL Developer in a safe fashion - I know SQL Developer can hook into source control as well - if just requires more self-discipline.
I always liked the PL/SQL Developer by Allround Automations - an excellent, quick and easy to use, and totally affordable tool!
For an interactive query shell - much better than SQL*Plus - I used to use "Golden" - a nice and powerful shareware tool, highly recommended.
Much better than anything else I ever tried with Oracle.
Marc
Might be a slightly different answer than you were expecting but I feel the Oracle documentation and in particular this book should be essential for any PL/SQL toolbox.
My primary editor for PL/SQL packages is SlickEdit.
SlickEdit offers good support for PL/SQL development, though you might miss the direct connection to the database that tools like TOAD or SQLDeveloper offer.
On the other hand, working on PL/SQL files (instead of directly working on database objects, like many TOAD users do) is IMO a good practice for any non-trivial project.
In addition to SlickEdit, I use a few self-made helper programs, e.g. one that loads source code from the database and creates a source file, and another one that compiles the source and calculates the correct line numbers for errors in a file that contains multible objects, e.g. both package specification and body.
For direct database access, I prefer SQLDeveloper, mostly because it's free and works well on Linux.
I use:
Eclipse as the IDE
Toby's PLSQL Editor as the PLSQL Eclipse plugin
TOAD as the database tool
utplsql and OUnit as the unit test framework
Ant as the build tool
CVS as the source control tool
pldoc as the documentation tool
CruiseControl as the continuous integration tool
Toby's PLSQL Editor can do:
Syntax highlighting
Code completion
Load to database
Header generation
F3 jump to code
Related
When writing PL/SQL packages I am a using Allround Automations PL/SQL Developer, not only, but also because of its handy feature of Safe Compilation, which uses a temporary compilation object.
So it allows me to just compile my code and if I have any error in my syntax, nobody would be bothered.
Some colleagues are more comfortable working with Oracle SQL Developer (cur. 19.4.0), but it happens, that they invalidate a package and jobs or other overlying layers may get affected.
I was looking at the Preferences of Oracle SQL Developer, but did not found any useful settings, while searching for comp, temp or safe. May I overlooked something.
So my question is:
Is there a way to enable Safe Compilation of packages in Oracle SQL Developer?
No, you're working with an object in a database somewhere.
My best advice is create your own, local, private instance of Oracle to do your development work. Then when you're ready to share that code with your teammates, merge your changes to Git / Compile to the official Development instance.
VirtualBox, Docker, Oracle XE - there are many, easy ways to stand up a copy of Oracle on your machine for development purposes.
Other benefits include - you now get to be your own DBA/god. If you want to debug, step into an ASH report, there's no asking, you own the instance.
SQL Developer has a feature "Database Copy". I had initially thought that maybe it uses SQL*Plus COPY Command under the hood. However, this doesn't appear to be the case, as you can copy CLOB's through the SQL Developer option. Any ideas on what it uses, and how one could possibly script out a copy using the same methods? I find the feature to work really well when compared to some other database development IDEs for copying data.
We are planning on writing a load process that uses SSIS and loads a SQL 2008 database. Transformations may be done in the packages or in stored procedures that are called from a package or directly from our job scheduler.
What can we do now while in planning stage to minimize the impact should we have to migrate the app to Oracle in teh future?
I picture the SSIS packages could be changed to use a different provider.
What about the SQL that we use?
Q: Is there a way to put, for example, a stored procedure in "ANSI mode" for lack of a better term to ensure that only standard SQL is used within to increase our chances that the SQL will migrate to Oracle?
One thing you can do is SET FIPSFLAGGER FULL etc. More info here: http://msdn.microsoft.com/en-us/library/ms189781.aspx
I am not aware of any ANSI Standard for RDBMS programming languages. And the constructs between TSQL and PL/SQL are quite different.
But can you use the Common Runtime Environment (I think that's what its called) in SQL Server to run JAVA? If you can, and given that Oracle can run JA VA this might offer a pathway to what you want to acheive.
Is there PL/SQL package or engine available which would enable the creation of PDF reports from stored procedures?
If your looking for a freeware or open source package, their is this. I've not used it, but it has good reviews. lPL_FPDF If you have a budget, then this, which enterprise class product, meaning excellent documentation, is available. plpdf.
The commercial package is written in native Pl/SQL so will be very easy to use. The open source package I don't know.
If your running in an Oracle environment, with any of the reports servers, then all of then support PDF being emitted both to the printer and stored in the db as blobs.
Its a fairly tedious task to configure it, from what I remember.
Hope that gets you started.
B
PL_FPDF has many problems, such as 32k page limitations and many bugs. I've modified the code and renamed it to wpdf. You can get wpdf here: http://databaseknowledge.com/services.htm
You may want to look into Oracle Application Express to create PDF reports, but depending on how the output is coming out from your stored procedure, it may not be an easy tool to use.
You can find directions here:
http://www.oracle.com/technology/obe/apex/apex31nf/apex31rpt.htm#t1
Oracle Application Express - printing features not to be forgotten. You can use interactive reporting from browser and decide what you need to print. You can apply XSLT also and decide the printing format.
I was wondering if there are any good refactoring tools for Oracle databases and especially for PL/SQL. I'm working on a project where half the developers are working with c# and the other half on the db where there is a large and complex schema and a large code base in pl/sql. We also use sql server but the database team work exclusively with Oracle.
This code base is being worked on actively and is being refactored gradually but I was quite surprised to see how bad the refactoring tools for oracle seem to be (or at least in comparison to Eclipse and Resharper).
The developers are using Toad which only has basic refactoring support (probably as its seems to be targeted more towards db admin then development). I've used Toad myself before but always had assumed for pl/sql there were more features for working with code but had never looked into it. Now as far as I can see the only refactorings that it provides are extract method (procedure) and variable renaming. I read an article comparing sql developer and pl/sql developer and these do not appear to have any better support for refactoring. I had a quick look at the eclipse data tools project but couldn't see that they've added refactoring support since I last used it (a few years ago).
For Sql Server there exists Sql Refactor which when table structures are changed gets propagated through to the stored procedures. This for me is much cleaner and less error prone than having someone manually update all stored procedures. I used an older version of these tools on a project in the past and they seemed to be quite ok but a bit slow but that was a few years ago and it was still usable.
Something similar for Oracle would already be a big help for our developement team so I'd appreciate some pointers to good refactoring tools for Oracle if they do exist.
Thanks,
Crocked
As it happens the "D" in TOAD stands Developer not DBA. In fact many DBAs anathematise TOAD and other such tools.
You are out of luck. As far as I know there are no tools for refactoring PL/SQL. The root problem is that refactoring as a concept comes from the OOP paradigm, and PL/SQL is not object oriented. It does not support inheritance or polymorphism (*). This means that many of the techniques which underpin classical refactoring practice (say as defined by Fowler) - abstraction, interfaces, etc - have no analogue in PL/SQL.
The corollary of this is that people who are used to having refactoring as part of their conceptual toolbox tend to avoid programming with PL/SQL. I once got into a heated debate on the TDD list over this. The upshot being that even developers who need and appreciated the virtues of PL/SQL would rather develop in languages with better tool support, clause #1 of the Agile Manifesto notwithstanding.
The most important tool for refactoring is automated unit testing. Although TOAD does not (I think) have integrated unit testing, the next release of Oracle SQL Developer will. There are also standalone unit test tools. I recently mentioned a couple of them in another SO thread.
In terms of refactoring PL/SQL to match changes in the database, arguably most interaction with tables ought to be underaqtken by generated table APIs rather than being embedded in transactional PL/SQL. In this happy realm there is no need for refactoring tools, we just need to re-generate the relevant APIs. The post I linked to above also mentions QCGU, a tool which can do this. Of course, when we have a PL/SQL codebase which isn't organised in such a fashion then life is harder. You won't be surprised to learn that there isn't a lot of tool support for implementing Feathers's WELC in PL/SQL.
(*) Yes, I know Oracle has Types but they are (a) SQL not PL/SQL and (b) how many people out there are actually building APIs using them?